Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What all I have to do to run C applications in 8086 system without OS

Status
Not open for further replies.

Jenda

Programmer
Feb 27, 2001
14
CZ
I have system based on 8086 without OS and BIOS (just empty memory). I want to do applications in C language for this system. I want to know wether I can write all the application in C language or I need to write some routines in assemler (memory managing, interrupt services,boot sequence,... but no video services managing, because there is no display) and what all I need to do for succesfull run of C application. Please write to me if you know some good about this problem.
Thanks
 
You definitely need SOME assembly code. C is by itself only a grammar, without a vocabulary of commands. The commands you use in C are in fact library routines which are written in C and assembly. Most library routines expect SOME sort of OS in the form of DOS>

Incidentally you will still be "writing" an "OS" for your system, particularly in the form of the boot sector. This is the only part you may need to write in assembly (am not sure though, you might still be able to use C).
"Information has a tendency to be free. Which means someone will always tell you something you don't want to know."
 
Hey,
Just compile "C" code (statically along
with library ). Link it using LD as a "BINARY'
and relocate the code address( say 0x1000 ) appropriartely..

Now load ur C code into the empty 8086 machine at
address 0x1000.
Note: u need to initialize segment registers
as appropriate of where u r loading..
do a CLI .

Ur program shall not use any INTs.. in case if it uses,
u need to write handlers in ur "C" code and initialize
IVT appropriately..

hope it helped

sarnath


Do not rejoice that ur code works.
it might be a special case of an error :-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top