Page 1 of 1
Run Time Libraries (RTL) - design & usage
Posted: Wed Dec 17, 2003 10:12 am
by neuRopac
what are the steps to make my own RTL in C and how to use them.
Re:Run Time Libraries (RTL) - design & usage
Posted: Wed Dec 17, 2003 12:19 pm
by Tim
1. Write some C
2. See an error about a missing function, e.g. malloc
3. Write the function you need
4. Repeat
How hard it is to write a C runtime function depends on the what the function does. Some are easy and the same on every OS, such as strlen; some are harder and require some OS dependencies, like malloc; others require kernel support and are completely OS-dependent, like fopen.
Re:Run Time Libraries (RTL) - design & usage
Posted: Wed Dec 17, 2003 3:07 pm
by Pype.Clicker
actually, you do not need a full C library like what ANSI C provides ... Most of the kernel may be written without a "atoi" function, for instance.
The very basic things Clicker uses are described
here
Maybe you can get inspired, maybe not. You're most likely to need
- a few string manipulation functions
- a dynamic memory allocator (? la malloc())
- a few printing functions (not as complete as printf, but something like this)
The closer you'll be from ANSI C in the way provided functions work, the easier third-party code or contributors code can be included ...