Unclear in what mode I work and how to use uint64_t
Posted: Thu Dec 19, 2019 10:40 am
I'm using GRUB to boot and expect it to boot me into protected mode, but it looks like it's booting me into long mode.
I ran my operating system on a virtual machine with 5120 megabytes of RAM and got this output:
THIS INT32 OUTPUT SECTION
ram_available = 1073282048 bytes
ram_available = 1023 MB
THIS UINT32 OUTPUT SECTION
ram_available = 1073282048 bytes
ram_available = 1023 MB
It is obvious that I get such numbers because of variable overflow, but I expected to see 4 GB because in protected mode it is no longer available. In the end, you can see that all 5 GB are indexed but they are not impossible to remove.
I tried using uint64_t to implement the char* itoaUINT64(uint64_t value, char* result, int base); function, but got a compilation error: Undefined reference to '__divdi3'.
-static-libgcc -lgcc not help.
Source code here
gcc args here in string №73
itoaUINT64() here
How do I solve this problem?
I ran my operating system on a virtual machine with 5120 megabytes of RAM and got this output:
THIS INT32 OUTPUT SECTION
ram_available = 1073282048 bytes
ram_available = 1023 MB
THIS UINT32 OUTPUT SECTION
ram_available = 1073282048 bytes
ram_available = 1023 MB
It is obvious that I get such numbers because of variable overflow, but I expected to see 4 GB because in protected mode it is no longer available. In the end, you can see that all 5 GB are indexed but they are not impossible to remove.
I tried using uint64_t to implement the char* itoaUINT64(uint64_t value, char* result, int base); function, but got a compilation error: Undefined reference to '__divdi3'.
-static-libgcc -lgcc not help.
Source code here
gcc args here in string №73
itoaUINT64() here
How do I solve this problem?