viruss33 wrote:
Thanks, checking for addresses <4gb and casting address to uint32_t fixes the problem. Paging is not yet enabled, that's what im working now. I'm wondering how the compiler knows that the code I'm writing is 32-bit. Is it the target architecture that we pass to it?
With gcc, the executable is different for each... what to call it? major architecture version, and for some other details about the target. For instance, the full name of gcc on my old Knoppix disk is "i686-linux-gnu-gcc-8". (It's the only gcc install I have handy.) There's a bunch of symlinks in /usr/bin:
gcc -> gcc-8
gcc-8 -> i686-linux-gnu-gcc-8
i586-linux-gnu-gcc -> gcc-8
i686-linux-gnu-gcc -> gcc-8
i686-linux-gnu-gcc-8