64bit loading

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
itisiuk
Member
Member
Posts: 98
Joined: Mon Mar 24, 2008 1:46 pm

64bit loading

Post 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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: 64bit loading

Post 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.
If a trainstation is where trains stop, what is a workstation ?
itisiuk
Member
Member
Posts: 98
Joined: Mon Mar 24, 2008 1:46 pm

Re: 64bit loading

Post 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.
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: 64bit loading

Post 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.
If a trainstation is where trains stop, what is a workstation ?
User avatar
Neolander
Member
Member
Posts: 228
Joined: Tue Mar 23, 2010 3:01 pm
Location: Uppsala, Sweden
Contact:

Re: 64bit loading

Post 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... :)
itisiuk
Member
Member
Posts: 98
Joined: Mon Mar 24, 2008 1:46 pm

Re: 64bit loading

Post by itisiuk »

Cool. ill get a something up and running first then mod it :)

Thanks
Post Reply