Hi.
To display text on the screen, I use Scalable Screen Font, it needs a memory manager.
I wrote code that outputs text, in qemu it works as it should and outputs everything. But when trying to run the kernel in Virtual Box, the library reported errors in my memory Manager. Later, I noticed that in virtual box the test machine has 5120 MB of RAM, so I lowered this number to 1024 and everything worked fine.
I thought I found an error, I thought that when working with more than 4 GB of RAM in the memory Manager there is a problem.
Then I put 4100 MB to test my guess, but everything worked.
Experimentally, I found out that if I put 4132 MB or higher I get a problem. At 4131 MB, everything works well.
I did not apply the source code of the memory Manager because the comments are not written in English(I will translate them later). But if someone wants to look at them, you can find them all here.
What could be the reason for this problem?
Thanks.
Magic problems in the memory manager.
Re: Magic problems in the memory manager.
Are you asking why your 32-bit os doesn't work with more than 4GB of RAM?
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Magic problems in the memory manager.
Your problem is here. You are casting memory_map->addr and memory_map->len to uint32_t, but they do not fit in 32 bits.
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Magic problems in the memory manager.
With PAE, a 32-bit OS may access the entire physical address space (up to 52 bits on current processors).iansjack wrote:Are you asking why your 32-bit os doesn't work with more than 4GB of RAM?
Of course, if you're using anywhere near that many physical address bits, you'd probably be better off in long mode.
Re: Magic problems in the memory manager.
Thanks for the help. I was surprised why when installing for example 4131 MB everything works, and if a little more, everything breaks. Now I understand.Octocontrabass wrote:Your problem is here. You are casting memory_map->addr and memory_map->len to uint32_t, but they do not fit in 32 bits.
Love you.
Re: Magic problems in the memory manager.
Well, yes. But that rather supposes that you are using PAE.Octocontrabass wrote:With PAE, a 32-bit OS may access the entire physical address space (up to 52 bits on current processors).iansjack wrote:Are you asking why your 32-bit os doesn't work with more than 4GB of RAM?
-
- Member
- Posts: 81
- Joined: Sun Apr 21, 2019 7:39 am
Re: Magic problems in the memory manager.
Isn't that supposed to be 4096? I mean 4096 MiBytes (p.c.) = 4194304 KiBytes = 4294967296 (1 over the max value for a uint32_t)