Page 1 of 1

64bit loading

Posted: Tue Jun 08, 2010 7:03 am
by itisiuk
hi, im having trouble loading my 64bit kernel. this is the first time i have attempted one as i wanted to make sure a normal 32bit one would work first.

i compiled grub2 and followed the wikis e.t.c but none the less i can not get it to work.

anyway, i wondered if i could just make a normal 32bit kernel and a modual which would be a flat binary for the 64bit kernel both loaded by grub.
then have the 32bit kernel do all the setup and jump into the 64bit modual.

ive read over the documentation material but so meny different ways todo things im getting a little confused now.

also woud this affect the loading of other moduals as i am using a microkernel design as i find it easyer to write basic drivers for.

Re: 64bit loading

Posted: Tue Jun 08, 2010 8:01 am
by gerryg400
anyway, i wondered if i could just make a normal 32bit kernel and a modual which would be a flat binary for the 64bit kernel both loaded by grub.
then have the 32bit kernel do all the setup and jump into the 64bit modual.
Yes, that's a good idea. I converted my old 32bit kernel into a loader. And made a new 64bit kernel. Grub looks like this.

Code: Select all

title		Artix
kernel		/boot/loader
module		/boot/kernel
quiet
I recommend that you make the kernel an ELF file though. My loader can load binary, elf or tar files.

Re: 64bit loading

Posted: Tue Jun 08, 2010 6:14 pm
by itisiuk
Thanks :D

this has been driving me nuts for a while lol.

think ill just keep the 64bit kernel as a flat binary tho, much easyer to start with, unless theres a major reason why i shouldnt.

Re: 64bit loading

Posted: Tue Jun 08, 2010 6:52 pm
by gerryg400
ELF is better when things go wrong. Because it contains symbols it disassembles to something you can read. Loading ELF files is barely more difficult than loading a binary.

Re: 64bit loading

Posted: Wed Jun 09, 2010 6:48 am
by Neolander
I agree. The ELF parser was, by far, the most easy part of my soon-to-be-completed bootstrap code. It's really as simple as reading a file header from a known address... :)

Re: 64bit loading

Posted: Wed Jun 09, 2010 6:35 pm
by itisiuk
Cool. ill get a something up and running first then mod it :)

Thanks