732 questions
1
vote
0
answers
79
views
cuda & cpp - compilation and linking using cmake
I want to create a skeleton for a project in which there are multiple cuda and cpp files. They will be compiled individually and then linked together to form a single executable.
Currently I have the ...
1
vote
0
answers
145
views
Dallas DS18B20 - problem with address decoding
I am implementing my own SW for getting data from DS18B20, but I've been stuck on decoding address for a while - "receiving" only zeros as a result. Here is my code:
#include <avr/io.h>...
2
votes
1
answer
101
views
how does the cpu find static/global objects on x86?
I know the stack pointer can be used to find stack allocated objects, but how does the cpu find global/static objects? From what I could tell from the disassembly, it uses absolute/immediate ...
1
vote
1
answer
125
views
Python asyncio - How do awaitables interact with system-level I/O events (e.g., serial ports)?
I’m learning asynchronous programming in Python using asyncio and want to understand how low-level awaitables work, particularly for system events like serial port communication. For example, ...
2
votes
0
answers
77
views
How do I resolve the recursive dependency in my page frame allocator (custom OS)?
I’m developing a custom OS and facing a chicken-and-egg problem with my page frame allocator. I need to map a specific page, but if the corresponding PML4 entry is NULL, I must allocate a PDPT. ...
1
vote
0
answers
125
views
How to build an assembler for my custom virtual machine?
I am building a virtual machine in C and now I want to create an assembler to make it easier to write programs instead of using macros or manually writing the bytecode.
#define ADD(dest, src1, src2) ((...
0
votes
0
answers
63
views
Unwanted Instructions Showing Up on xdbg [duplicate]
I'm using x64dbg and am writing some instructions in a region of the executable that I 'hollowed out' previously (just set to NOPs). After entering a simple xor instruction, shown below, some random ...
1
vote
1
answer
69
views
Optimizing low-level structure for CPU memory performance in my game simulator [closed]
I am writing a world simulator for a turn-based game. The key feature is that there will be many NPCs with detailed psychology modelling, perhaps 20,000 - 30,000 of them. I want all NPCs to make their ...
-1
votes
1
answer
75
views
How would having an #include file.h inside a function work?
I am working on an embedded systems project, so i am dealing with limited memory.
I have this huge array of strings in C, it is basically an array of 31 bitmaps. I have it in a separate file called ...
1
vote
2
answers
111
views
MIPS Assembly--> BEQ
I'm using MARS 4.5 like editor to coding in Assembly Mips.
Today I'm learning BEQ, however I have a problem with this code:
.data
Message_1: .asciiz "I numeri sono uguali"
Stampa:
li $...
-2
votes
1
answer
423
views
How to draw to screen in x86 Assembly? [duplicate]
I am trying to code a game in x86 Assembly. I don't know how to draw to screen using x86 assembly.
Based on my previous experience with assembly I assume I have to code a bootloader which jumps to a ...
1
vote
1
answer
103
views
Why a string disappear from the stack when exiting from a function
I'm experimenting with the stack in C to test some things and learn more in the language.
I know that a function has a stack frame created by moving the rsp/rbp pointer.
What I don't understand is ...
0
votes
0
answers
150
views
signal SIGSEGV: address access protected in __run_exit_handlers
I'm trying to do a packer project for my school, it is made in C and ASM, and for the moment it is supposed to target only ELF files.
I have managed to do my section injection, correctly align my new ...
1
vote
2
answers
121
views
How does the ms_abi pass between c and assembely
I am working on an OS using EFI using the ms_abi and was wondering how does it pass arguments because I am moving some systemtable info into a register but when I try to call a function using the ...
1
vote
2
answers
548
views
How do you draw graphics in C/C++ without external libraries?
I’m trying to find out how to draw graphics in C/C++ without any external libraries. I know it is possible because I’m pretty sure the libraries are programmed in either C or C++ and I want to know ...
0
votes
0
answers
70
views
freertos linking problems to a z80 device
I'm using the Z88DK C compiler to control my Z80 CPU. While trying to link the FreeRTOS library to my project, I've run into some issues. I'm configuring the Z80 with EEPROM from 0 to FFF and RAM from ...
0
votes
0
answers
38
views
Could anyone help me figure out where the flow of my MIPS program is going wrong?
I'm writing a MIPS program (simulated on qtSpim) for a class that's supposed to do the following: read two integers from user input, determine whether each one is even or odd, compare them, and then ...
-1
votes
2
answers
1k
views
Compiler for Z80 CPU
I'm a student at an engineering college, and I have encountered a problem while working on a project. In this project, I am designing a microcontroller. I opted to use the Z80 CPU due to its ...
1
vote
0
answers
203
views
how to write a large value > 32 bits with a format string exploit %n
I'm working on a challenge that requires me to overwrite a memory address with a libc address, which is usually around 48 bits.
I can write a 32-bit number into an address but with anything larger ...
0
votes
0
answers
101
views
Parsing SQLite file columns without sqlite3.h header file
I'm currently working on parsing a SQLite file for my C program, and I need to extract three columns, url, username, and password. I want to parse it without using the sqlite3.h header file. I could ...
1
vote
0
answers
33
views
How is asynchronous programming implemented under the hood without continuous cheching?
I'm currently exploring asynchronous programming.
While I understand the basics of how this works conceptually, I'm interested in a deeper understanding of its implementation.
How is asynchronous ...
1
vote
1
answer
99
views
How to set buttons and leds using addresses in mips assembly?
The system has 4 push buttons, named A to D. The push buttons are memory mapped to address 0xffffe440. The status of the buttons are given at bit indices 7 through 4, where button A is given at index ...
1
vote
1
answer
240
views
Bochs Panicing After Not Finding Speaker In WSL
I am making my own basic operating system and I obviously face some bugs, until now I have been just using the build logs but as the OS gets more complex it becomes very hard to debug. That's why I ...
7
votes
0
answers
363
views
Sanitizing static freestanding nolibc programs?
I'm developing a static freestanding nolibc/nostdlib program for Linux and would like to use the C compiler's memory, address and undefined behavior sanitizers to improve my code.
I couldn't get it to ...
0
votes
0
answers
261
views
How to extract a double from a vector of doubles (SIMD)?
sorry if this is a nooby question or a possible duplicate, but I am reading into vector intrinsics and thinking that is there a clean way to extract the first double out 256-bit vector of 4 doubles ...