Results 11 to 12 of 12
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-11-2013 #11
- Join Date
- May 2011
Virtual kernel memory layout:
[ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB)
[ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
[ 0.000000] vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
[ 0.000000] lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
[ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB)
[ 0.000000] .text : 0xc0008000 - 0xc06bd000 (6868 kB)
[ 0.000000] .init : 0xc06bd000 - 0xc06fc000 ( 252 kB)
[ 0.000000] .data : 0xc06fc000 - 0xc0745520 ( 294 kB)
[ 0.000000] .bss : 0xc0745544 - 0xc0786e9c ( 263 kB)
- 01-23-2013 #12
All the kernel has to do, at boot time, is map its data to some virtual place, switch to virtual memory, jump up to its new virtual location, and clean up the mess in the range where its physical addresses were mapped to the virtual ones linearly, in order to make the jump possible.
From that moment on, whenever the kernel needs a physical address for say, page tables or a driver HAS to use some range of memory (don't say this doesn't happen), these locations are just mapped into virtual memory, from virtual memory, and referenced from there.
As for the original question of "will the allocation fail?" the answer is depends on the system and its kernel build.
In general on x86 it will fail, because the kernel only has 1 GB of virtual memory to play with. On EM32T however, I think the kernel has 2 gigs of virtual memory to play with, so it won't fail there ...
Anyways, on higher half stuff and virtual memory is some pretty fun (though maybe overly complex) stuff out there.
Operating Systems Development Series
What is virtual memory? | Orion
Higher Half Kernel - OSDev Wiki
Paging - OSDev Wiki