Hello,
What is the utility to give to the kernel a different virtual address of the physical one ?
For instance, why to map the kernel at 3GB rather than to the real physical address where is running ?
I've also seen some kernels which keep the first 4MB unmapped. Why ?
Do you know good tutorials about OS design (which explains the avantages of using such technical solutions) ?
Thanks for helping me...
Why to remap the kernel ?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Why to remap the kernel ?
As you can find in Great Teacher Tim's tutorial "for V86 mode, (...) if your kernel is mapped in half bottom, you're stuck". I hope this is not that deseperate as my own kernel *is* in the bottom half, but definitely it means i must trust V86 code i'll run while Tim need not (his kernel code&data are completely unreachable from V86 programs), thus Tim can run DOS programs (if he wants to) while all i can dream of is Bios function calls by kernel modules (and that's all i want, so i'm pleased with my actual choice...)Silverhawk wrote: Hello,
What is the utility to give to the kernel a different virtual address of the physical one ?
For instance, why to map the kernel at 3GB rather than to the real physical address where is running ?
Hehe ... that's because you need some mapping to remain constant while you're setting up paging. If the paging is enable by your bootloader, no worry about this, but otherwise, it's way simpler to keep a common mapping. The alternative is to play with both paging and segments to keep an uniform (while changing) memory environment. Code Slasher recently succeeded in doing this, but that wasn't piece of cake :pI've also seen some kernels which keep the first 4MB unmapped. Why ?
Also, because my kernel is 1:1 mapped in the lowest 4Mb, i know that kernel-type memory is good for DMA buffers, and that a continuous range of kernel-class virtual address is easy to translate in a continuous range of physical addresses.
Re:Why to remap the kernel ?
*adds his daemonish sermon ];->*
well ... as for vm86: I have my kernel mapped at 3 gb in virtual memory space. My vm86 Process is mapped in the first mb of virtual memory space + some additional pages. this first mb is nothing else but a remapping of preserved space otherwise unreachable for processes. Only kernel or vm86 may access the data and functions located there. so, simply spoken, the vm86 process can't access kernel space (it doesnt know about it), but an int or an exception suddeny reveals that there is more to it than one might believe *lol*
Great Teacher Tim's texts about vm86 helped me very much in achieving my goal.
well ... as for vm86: I have my kernel mapped at 3 gb in virtual memory space. My vm86 Process is mapped in the first mb of virtual memory space + some additional pages. this first mb is nothing else but a remapping of preserved space otherwise unreachable for processes. Only kernel or vm86 may access the data and functions located there. so, simply spoken, the vm86 process can't access kernel space (it doesnt know about it), but an int or an exception suddeny reveals that there is more to it than one might believe *lol*
Great Teacher Tim's texts about vm86 helped me very much in achieving my goal.
Re:Why to remap the kernel ?
thanks for these explanations !
I'm not sure to understand very well, but I'll read Tim's tutorial...
I'll be back after )
I'm not sure to understand very well, but I'll read Tim's tutorial...
I'll be back after )