Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
I am currently working on setting up paging and a heap. In the so doing, I decided to try to make my paging manager use all available physical memory, instead of just a small constant amount. I use the mem_upper member of the multiboot info struct that GRUB gives me. The assembly wrapper of my C kernel is just as that in the 'Bare bones' tutorial. Code:
When I run this, it panics with 'no available frames'. (Note that I am loosely following JamesM's tutorial.) When I run it in Qemu's GDB stub and print mbd->mem_upper, it gives me 0x1fbc0, which is obviously wrong. Does anyone know why this would be?
mem_upper is more of a guideline than anything. For all you know, in a system with 31MB of upper ram, 15MB may run from 1MB to 16MB, and then there will be a 16MB gap, then another 16MB of RAM. It's unlikely, but this kind of thing (Plus ACPI tables in that RAM) happens, and you really should be using GRUB's memory map instead