linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Boot code in C
@ 2004-07-05 13:49 kaushal
  2004-07-05 17:36 ` John T. Williams
  2004-07-06  5:26 ` Progga
  0 siblings, 2 replies; 4+ messages in thread
From: kaushal @ 2004-07-05 13:49 UTC (permalink / raw)
  To: linux-c-programming


Hello  all,
          I want to know if there is a way to  generate a binary file,
from  a C program(Not from an assembly code)(can use any Linux
tools)that can be burned on to a floppy and which ,say--  just prints a
string on to the screen.
I tried out to the following:


1.[kaushal@linuxbox]#cc Hello.c -static -o Hello
  [kaushal@linuxbox]#strip Hello
  [kaushal@linuxbox]#objcopy -O binary Hello Hello.bin
  [kaushal@linuxbox]#dd if=Hello.bin of=/dev/floppy


2.[kaushal@linuxbox]#cc Hello.c -S 
  [kaushal@linuxbox]#as Hello.s -o Hello
  [kaushal@linuxbox]#strip Hello
  [kaushal@linuxbox]#objcopy -O binary Hello Hello.bin
  [kaushal@linuxbox]#dd if=Hello.bin of=/dev/floppy

In the second case (2.)(Even if I don't give a "-static" switch for the
first one(1.)) the Hello size is MUCH less than its counterpart of case
(1.)
Either way it did not work.I think the problem occurs because of absence
of OS at boot time.So is there any way of atleast generating the
required assembly code from the C code(The optimised one).



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-12-11  7:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-05 13:49 Boot code in C kaushal
2004-07-05 17:36 ` John T. Williams
2004-07-06  5:26 ` Progga
2004-12-11  7:15   ` itmncm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).