Re: How to create a standalone C program?
- From: "Malcolm McLean" <regniztar@xxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 20:46:17 +0100
"dspfun" <dspfun@xxxxxxxxxxx> wrote in message news:1185908920.759023.148720@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
How do you create a standalone C program? With standalone C program IDon't include any libraries.
mean it should run "freestanding" on a CPU without an OS or other
supporting software/libraries linked to the C program. After the bios/
setup has done its initializations and "stuff" I would like to be able
to continue execution with my own C program. The C program will be
really simple to start with, for example just write an integer value
to a memory address.
The snag is that you've then go no IO. You need to write to hardcoded memory address, possible in C, or generate interrupts, for which you need a spot of assembly.
Then somehow you've got to get a compiler that can be persuaded not to include normal start-up code before main(). This is probably possible with most comercial compilers, but it will need a certain amount of delving into unexplored depths of documentation to understand how to do it. On non-hosted implementations, which is effectively what you are using the PC as, normally entry is vai a special function called "boot" or similar.
.
- References:
- How to create a standalone C program?
- From: dspfun
- How to create a standalone C program?
- Prev by Date: Re: Bounds checking and safety in C
- Next by Date: Re: How to create a standalone C program?
- Previous by thread: Re: How to create a standalone C program?
- Index(es):