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.
Ok, I now (finally!) have a working setup of GRUB. New problem: when I try to build the BareBones example (DJGPP), LD says about the NASM-assembled loader:
loader.o: file not recognized: File format not recognized
I'm assembling the NASM version of loader.s (with the '-f elf' option).
Even just using NASM and assembling into a pure binary ('-f bin') to load with GRUB does not work. Nor does a pure elf file ('-f elf'). I switched to GRUB so I could make a C kernel (and also because it seemed so much easier). Why won't this work?
Last edited by pcmattman on Thu Feb 08, 2007 3:48 pm, edited 1 time in total.
to get a list of supported targets. Otherwise, nasm is able to produce its object files in lots of different formats, dunno what your ld uses, but I would suggest to use elf.
Do you use 32 bit code for your kernel ? You should ... Maybe you could give some code, but I think the following should work (for example)
Dunno whether it's possible to use a.out, but it should be possible to use the binary format, even if it is more complicated than using elf. GRUB needs to know where to load the file so you need to adjust the multiboot header. I don't remember exactly what to do but you could look for it in the multiboot specification, it should be easy to understand.
It doesn't matter anymore, I did a search on Google for 'GRUB binary kernel" and the first result that came up was exactly what I needed. Thankyou for your help.