
Ultimately i want a 64bit kernel running in the higher half of its VAS. To achieve this goal my plan is to use GRUB Legacy as my initial boot loader(since im already familiar with it), GRUB will load my own 32bit loader as a kernel and load my 64bit kernel as a module(along with other modules for drivers and the init process) . My 32 bit loader will do the initial prep work for long mode (Make a GDT,IDT and the initial long mode page table structures), process the boot modules by unpacking them into physical memory and mapping them appropriatly into the 64bit vas, Enable long mode by enabeling pageing and then activating long mode by doing a far jump to the 64bit code segment with the entry point of my 64 bit kernel (passing it the addresses of some systems information datastrucuters in registers).
I have almost got the above process working with two 32bit kernels and a 4GB address space and im now planning on making the necesary changes to maek it load the 64 bit kernel. The first thing i dont understand however is once ive doneall the long mode enabling stuff with the page tabels how i actually jump into my 64bit kernel? I know that to actually activate long mode i must do a far jump to a 64bit code segment but since the jump is being executed in protected mode i only have a 32bit offset and so cannot use the offset of my kernel in the higher half. Also since segment based addressing is ignored i cant do any tricks with the base address to overcome this problem. So is the only way to do this to include a tiny 64bit code stub in my 32bit loader that repeats the jump with a 64bit address or am i missing a trick?
Thanks for your time and apologies since this may be the first in a series of questions while i get my head round this

Pinky