Hello,
I'm doing the Bare Bones tutorial but the kernel doesn't boot with grub. When i type "kernel 200+15" it returns error 13 : invalid or unsupported executable format.
I'm using cygwin in which i have built a gcc cross compiler (with the tutorial).
When I do objdump -h, i get "file format pei-i386". does this mean the executable is not ELF but PE ? shouldn't it be ELF because i compiled with the cross compiler ?
In the Questions part, it says "you should specify the AOUT kludge in the multiboot header". Could you give me more info on this ? what is it for and more importantly how to do this?
Also, is it possible to set up the cross compiler output format at ELF even with cygwin on windows ?
Thank you very much for your help !!
Booting kernel with grub
- JackScott
- Member
- Posts: 1035
- Joined: Thu Dec 21, 2006 3:03 am
- Location: Hobart, Australia
- Mastodon: https://aus.social/@jackscottau
- Matrix: @JackScottAU:matrix.org
- GitHub: https://github.com/JackScottAU
- Contact:
Re: Booting kernel with grub
It is indeed PE (or at least something that isn't ELF!)
Assuming you've built the cross-compiler correctly, make sure you are actually using it. Specify the full path in your Makefile or add /usr/cross/bin to your $PATH. Details on how to do that are in the cross-compiler tutorial.
You shouldn't need to use the a.out kludge if you have (and are using) a working i586-elf cross-compiler.
Assuming you've built the cross-compiler correctly, make sure you are actually using it. Specify the full path in your Makefile or add /usr/cross/bin to your $PATH. Details on how to do that are in the cross-compiler tutorial.
You shouldn't need to use the a.out kludge if you have (and are using) a working i586-elf cross-compiler.
Re: Booting kernel with grub
Thank you for your reply !
I think I built the cross compiler correctly. I followed the exact tutorial step by step.
I have the i586-elf-gcc (and a i586-elf-gcc-3.4.4) in /usr/cross/bin. I'm not sure why there is those 2 executables.. Please see the attached picture, it's what i do on cygwin and apparently the kernel.bin isn't an elf file. What could i have done wrong during building the cross compiler?
Edit : if i try with i586-elf-gcc-3.4.4 its the same.
I think I built the cross compiler correctly. I followed the exact tutorial step by step.
I have the i586-elf-gcc (and a i586-elf-gcc-3.4.4) in /usr/cross/bin. I'm not sure why there is those 2 executables.. Please see the attached picture, it's what i do on cygwin and apparently the kernel.bin isn't an elf file. What could i have done wrong during building the cross compiler?
Edit : if i try with i586-elf-gcc-3.4.4 its the same.
Last edited by stanko51 on Mon Mar 30, 2009 7:40 am, edited 2 times in total.
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: Booting kernel with grub
You need to use your i586-elf-ld rather than Cygwin's ld. You'll also need to use i585-elf-objdump to view the ELF file when it gets created.
I'd also suggest doing
So you can run just i586-elf-gcc instead of typing the path to it every time.
I'd also suggest doing
Code: Select all
export PATH=/usr/cross/bin:$PATH
Re: Booting kernel with grub
ok, this totally makes sense.... sorry for the newbie's question.
Thank you!
Thank you!