From: kaushal <kaushal@rocsys.com>
To: linux-c-programming@vger.kernel.org
Subject: Boot code in C
Date: 05 Jul 2004 19:19:29 +0530 [thread overview]
Message-ID: <1089035369.7299.48.camel@kaushal> (raw)
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).
next reply other threads:[~2004-07-05 13:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-05 13:49 kaushal [this message]
2004-07-05 17:36 ` Boot code in C John T. Williams
2004-07-06 5:26 ` Progga
2004-12-11 7:15 ` itmncm
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1089035369.7299.48.camel@kaushal \
--to=kaushal@rocsys.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).