Hello...In case I deside to add v86 mode to my kernel, how would I move my kernel above one meg?
My kernel is loaded at 0x9000.
Thank you,
Moving Kernel's Code
Re:Moving Kernel's Code
If you know the size of your kernel just load ecx with the size in bytes, es:edi (place to put it) and ds:esi (place to get it from) and then do a rep movsb (you should probably clear the DF flag (cld) aswell just to be sure), better still from c just call memcpy() and your done. Dont forget to jump into the new location. I would do this before enabling paging or anything like that. You should probably do this straight away before you do anything else (once you want to di that is ).
hope this helps.
hope this helps.
Re:Moving Kernel's Code
It isn't a question of moving the kernel in memory, but of where it is located in virtual address space.
Before you start adding V86 mode, I'd recommend that you start using paging (heck, I'd recommend that you write a fully working kernel first). Then you can say that the kernel is at whatever address you want, regardless of where it is in physical memory.
Before you start adding V86 mode, I'd recommend that you start using paging (heck, I'd recommend that you write a fully working kernel first). Then you can say that the kernel is at whatever address you want, regardless of where it is in physical memory.