Hello all,
Sorry if this question is old, I searched around for a solution but could find one.
I'm attempting to write all of my boot sector code using the gnu assembler. The problem is that when I assemble and link, it creates a Linux executable. I just want it to create a raw executable that can be run on system start up.
Can some one tell me the assembler and linker directives that I need to pass to get this output?
Thanks,
creating raw executables with gas
-
- Posts: 2
- Joined: Sat Jan 12, 2008 5:59 pm
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
The linker would have told you among others:jimmyhilldrix wrote:Yes, I did look at the linker, although I've been under the impression that the assembler is what's going to be adding the ELF stuff. Either way nothing there popped out at me.
Is it the Linker that I need to be looking at?
Which should get you where you want to beld --help wrote: --oformat TARGET Specify target of output file
(...)
i386-elf-ld: supported targets: elf32-i386 coff-i386 elf32-little elf32-big srec symbolsrec tekhex binary ihex
I just posted a script for this on this thread: http://www.osdev.org/phpBB2/viewtopic.php?t=15902
ld has bugs related to binary file creation when working with some object file types so my script does not use ld to create the binary. It uses objcopy which appears to have a bug too, but it's non-fatal, and easy to accommodate.
- Rich
ld has bugs related to binary file creation when working with some object file types so my script does not use ld to create the binary. It uses objcopy which appears to have a bug too, but it's non-fatal, and easy to accommodate.
- Rich