Grub and a kernel

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.
Omegaice

Re:Grub and a kernel

Post by Omegaice »

ok, here is a link to my code, i had to do i this way cuz it was too big for the attachments.

http://www.terraquad.com/OmegaOS.zip
K.J.

Re:Grub and a kernel

Post by K.J. »

grub requires ELF
Not true. GRUB can boot virtually any kernel in any file format as long as it has a correct multiboot header. I've used GRUB to succesfully boot kernels in binary, coff, pe, elf, and aout formats. As long as the multiboot header is correct, it'll work.

K.J.
Chris Giese

Re:Grub and a kernel

Post by Chris Giese »

K.J. wrote:
grub requires ELF
Not true. GRUB can boot virtually any kernel in any file format as long as it has a correct multiboot header. I've used GRUB to succesfully boot kernels in binary, coff, pe, elf, and aout formats. As long as the multiboot header is correct, it'll work.
I second this. I've used GRUB to boot ELF, DJGPP COFF, and Win32 PE COFF kernels.

It's certainly a lot simpler than trying to re-compile DJGPP or MinGW to make them support ELF.
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:Grub and a kernel

Post by Pype.Clicker »

well, things seems to have evolved ... i apologize for my lack of knowledge ...
Omegaice

Re:Grub and a kernel

Post by Omegaice »

ok, on a turtorial on http://osdev.neopages.net about grub there is a multibootheader for aout kludge, i tryed to compile that thing but it came up with errors saying that it cant use an oporand and there is a prob with the folowing 3 lines:

dd code ; start of kernel .text (code) section
dd edata ; end of kernel .data section
dd end ; end of kernel BSS
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:Grub and a kernel

Post by Pype.Clicker »

@omegaice (pretty silly question, but who knows ...) did you define code, edata and end symbols properly ? the best way to do this is probably through the linker script (and declare them extern in the assembly file ... not tested though ...)

@KJ ...
From the tutorial i've read at osdev.neopages.net, it appears to me that GRUB has only builtin support for ELF files. If you want to load anything else, you have to give an "AOUT" header extension which will tell GRUB explicitely where code, data, etc. are located... correct ?
Post Reply