Re: Creating a pure binary image using binutils ?



ksashtekar@xxxxxxxxx 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

.



Relevant Pages

  • Re: Creating a pure binary image using binutils ?
    ... I compiled this program using gcc. ... I am going to write it to the boot sector of the floppy image. ... I guess i have to use objcopy. ...
    (comp.arch.embedded)
  • Creating a pure binary image using binutils ?
    ... I have made a small program in assembly where i use the bios video ... I compiled this program using gcc. ... I am going to write it to the boot sector of the floppy image. ...
    (comp.arch.embedded)
  • Re: 2.6.17-rc5-mm1-lockdep: a rather strange oops
    ... with Debian sarge gcc 3.3.5-13. ... gcc 3.3.5 compiled a kernel that is too large to boot off a floppy. ... and see if that still oopses. ...
    (Linux-Kernel)
  • [PATCH] i386/gcc bug with do_test_wp_bit
    ... Playing around with gcc 3.3.3, I compiled a 2.6 series kernel for i386 ... not boot, since do_test_wp_bitmust not exist in the __init section. ... When compiling a Linux 2.6 kernel using gcc 3.3.3, gcc was able to inline the function do_test_wp_bit. ...
    (Linux-Kernel)
  • Re: Cannot boot from Win Xp SP2 CD
    ... to do with BIOS settings and/or hardware. ... Insert a win98 or ME floppy, warm boot, and verify that you get a DOS ... Also, if you get a floppy image with generic CD support, you can use it to ...
    (microsoft.public.windowsxp.perform_maintain)