Reply by September 15, 20082008-09-15
On Sep 15, 11:35 am, Tauno Voipio <tauno.voi...@INVALIDiki.fi> wrote:
> > I am trying to boot a floppy image on Bochs (x86 emulator). > > I have made a small program in assembly where i use the bios video > > services (0x10) to write a character to the screen. > > I compiled this program using gcc. > It seems obvious that the file you produced with > gcc is 32 bit code. A PC boots in 16 bit mode and > it does not understand 32 bit code, when initially > booted.
> On the other hand, the 32 bit code cannot use > common BIOS routines which run in 16 bit mode.
These are some very good points. Maybe it's worth mentioning that MS-DOS "debug" gave you the capability to non-symbolically assemble 8086 mnemonics, write binary .com executables to disk, or even to disk sectors. Does freedos have something comparable? I think there were 16 bit dos ports of GCC at some point in the past that might be useful too?
Reply by Tauno Voipio September 15, 20082008-09-15
ksashtekar@gmail.com wrote:
> Hello Friends, > > I am trying to boot a floppy image on Bochs (x86 emulator). > I have made a small program in assembly where i use the bios video > services (0x10) to write a character to the screen. > I compiled this program using gcc. > > I am going to write it to the boot sector of the floppy image. > > Can anybody tell me how to get a pure binary image from the elf file > gcc has produced. > I guess i have to use objcopy. But I am not sure. Can anybody help?
It seems obvious that the file you produced with gcc is 32 bit code. A PC boots in 16 bit mode and it does not understand 32 bit code, when initially booted. The code read from the boot diskette (image) has to transfer the computer into 32 bit mode before the binary produced by gcc is runnable. On the other hand, the 32 bit code cannot use common BIOS routines which run in 16 bit mode. -- Tauno Voipio tauno voipio (at) iki fi
Reply by September 15, 20082008-09-15
On Sep 11, 1:40=A0am, "ksashte...@gmail.com" <ksashte...@gmail.com>
wrote:
> Hello Friends, > > I am trying to boot a floppy image on Bochs (x86 emulator). > I have made a small program in assembly where i use the bios video > services (0x10) to write a character to the screen. > I compiled this program using gcc. > > I am going to write it to the boot sector of the floppy image. > > Can anybody tell me how to get a pure binary image from the elf file > gcc has produced. > I guess i have to use objcopy. But I am not sure. Can anybody help? > > Kaustubh
Yes, you use objcopy: objcopy --output-target=3Dbinary ... Jim
Reply by ksas...@gmail.com September 11, 20082008-09-11
Hello Friends,

I am trying to boot a floppy image on Bochs (x86 emulator).
I have made a small program in assembly where i use the bios video
services (0x10) to write a character to the screen.
I compiled this program using gcc.

I am going to write it to the boot sector of the floppy image.

Can anybody tell me how to get a pure binary image from the elf file
gcc has produced.
I guess i have to use objcopy. But I am not sure. Can anybody help?

Kaustubh