Run Time Libraries (RTL) - design & usage

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
neuRopac

Run Time Libraries (RTL) - design & usage

Post by neuRopac »

what are the steps to make my own RTL in C and how to use them.
Tim

Re:Run Time Libraries (RTL) - design & usage

Post 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.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Run Time Libraries (RTL) - design & usage

Post 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 ...
Post Reply