a memory layout question

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.
Post Reply
one

a memory layout question

Post by one »

I would liek to know how i can load my kernel above the 1mb mark from my bootloader. Is it possible to do so just after enabling the A20 line and before jumping to protected mode if not then when should it be done? also what happens when i set up the GDT with the code and data descriptors from 0 - 4Gb does this mean that this will affect my kernel code. also how else can i load the kernel to some memory address? Thanx in advance.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:a memory layout question

Post by Pype.Clicker »

basically, you have 3 options to achieve this goal (not mentionning the ugly option of using DMA memory-to-memory transfer):
  • switch to unreal mode (see Baby steps) so that you can movsb sectors you read with BIOS under 1MB to its definitive location
  • stay in real mode and use the BIOS high memory copy function (somewhere on INT 15h) which will perform memory copies by entering and leaving pmode transparently.
  • rewrite your own floppy driver that will be able to program the DMA so that it will store read bytes above 1MB (but always below 16MB)
Post Reply