Portable C++ standard library
Posted: Sat Jul 14, 2007 4:13 am
What implementations exists? Which would be the easiest to port to my OS?
The Place to Start for Operating System Developers
http://forum.osdev.org./
What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
A compiler for his own OS, perhaps?bregma wrote:What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
When I said:Combuster wrote:A compiler for his own OS, perhaps?bregma wrote:What C++ compiler are you using that does not come with a standard library?MessiahAndrw wrote:What implementations exists? Which would be the easiest to port to my OS?
I meant the my OS, since this is an osdev forum. I use GCC if you'd like to know.MessiahAndrw wrote:easiest to port to my OS?
You could just port Newlib or another standard C library... Why reinvent the wheel?MessiahAndrw wrote:Right now when I have time (I have too many college projects) I'm porting across the C standard library and writing wrappers for my own functions. I'll worry about C++ later.
You could just use Windows or another operating system... Why reinvent the wheel?pcmattman wrote:You could just port Newlib or another standard C library... Why reinvent the wheel?MessiahAndrw wrote:Right now when I have time (I have too many college projects) I'm porting across the C standard library and writing wrappers for my own functions. I'll worry about C++ later.
The way the most implementations of the standard C library handles some minor things like printing to the screen (printf()) is incompatible with the way my OS manages console output (a console output will eventually be a pointer to a type of window structure (the 3 window types planned for my window manager are: control-based (OS routines for optimized drawing of buttons/images/components), console-based, and direct-based (for 2d/3d/movie-drawing apps which require direct access to the window buffer and ignores the default window-manager drawing functions))).pcmattman wrote:You could just port Newlib or another standard C library... Why reinvent the wheel?
<offtopic>Candy wrote:You could just use Windows or another operating system... Why reinvent the wheel?
I sounds more like your planned implementation of the C library is incompatible with the design of the C library. The standard C file streams abstract such details away.MessiahAndrw wrote: The way the most implementations of the standard C library handles some minor things like printing to the screen (printf()) is incompatible with the way my OS manages console output (a console output will eventually be a pointer to a type of window structure (the 3 window types planned for my window manager are: control-based (OS routines for optimized drawing of buttons/images/components), console-based, and direct-based (for 2d/3d/movie-drawing apps which require direct access to the window buffer and ignores the default window-manager drawing functions))).
That's like forcing my OS to be designed a certain way - to treat the console as a file stream. The reason I'm inspired to write my OS is because I have some abstract ideas of how to do things. I don't want to be told "this is how a console works" - I don't want to turn it into Yet-Another-POSIX-Clone.bregma wrote:There's nothing to stop you from providing a complete custom binding library for your own OS. But if you want to use the standard stuff, you'll have to do things in a standard way.
--smw