Run Time Libraries (RTL) - design & usage
Run Time Libraries (RTL) - design & usage
what are the steps to make my own RTL in C and how to use them.
Re:Run Time Libraries (RTL) - design & usage
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.
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.
- Pype.Clicker
- 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
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 ...
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 ...