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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OS Dev...static compilation with in built libs

Status
Not open for further replies.

ekanth

Programmer
Jul 28, 2001
28
0
0
US
Hello
When you write code for OS why do you rewrite everything like print function again in C. Cant we use the existing C functions and link the exe statically and convert them into binary file. Why do we do it the other way.
Regards
Ekanth
 
If you use ANSI C/C++ standard function you don't have to rewrite them. I don't understand what you mean by this:
>Cant we use the existing C functions and link the exe
>statically and convert them into binary file.

If you are porting code to other OS you have to compile source code on each platform and link object files with static or dynamic libraries. And actually linking will produce executable (or libraries).
Of cause only source code is portable (if it is in ANSI standard) and compiled objects are not.
Sometime you have to rewrite some code for specific platform. Such as directory listing or GUI. Also there are some good packages that can do this job for you, for example Qt. Qt is portable GUI that also provide some useful utilities for writing portable application (but this is C++)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top