Subject: | |
From: | |
Reply To: | |
Date: | Tue, 12 Sep 2000 00:46:10 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 10 Sep 00, at 23:15, swann1 wrote:
> Does any know whether it would be possible to run a PC from a C
> program (i.e. with no operating system).
I've seen the necessary stuff in two places over the years. One
was the "IBM PC Assembly Programmer's Problem Solver", which stepped
through the whole process of creating a bootable floppy.
The other, rather more modern source, is the MURTLE book "Build
Your Own 32-bit Operating System"....
> Would I need to convert the program into object code so the
> computer can understand it.
This is mainly what the C compiler does -- convert the source text
into object code.
> How would get the computer to recognise the program at start up, It
> would be a very simple program.
Normally, the OS provides the "loader" which copies the object code
from disk into memory, initializes it, and passes control to the
startup code supplied by the compiler (which *eventually* passes
control in turn to the converted code *you* wrote). Various library
functions your program might want to use turn out to call back into
internals of the operating system for things like disk I/O.
Better compilers (not necessarily more expensive) provide source
code for their start-up routines and run-time libraries, and you
could customize this for your needs. Note that most of this is
likely to be in assembly rather than C, so you should probably learn
everything you can about that level of PC programming before
attempting this feat.
David G
PCBUILD's List Owner's:
Bob Wright<[log in to unmask]>
Drew Dunn<[log in to unmask]>
|
|
|