is there a list of os independent functions in libc
i know that most of string.h is and the i86 or whatever include files for interrupts(16bit) but besides that i have no idea
the one im wondering about most though is string to int and int to string conversions like itoa if they are not then does anyone have a replacement function that is os independent
Is there a list of os independent functions
Re:Is there a list of os independent functions
I'm using a this, and can be easily modified to atoi.
Sorry for the bump...
Code: Select all
void putint(unsigned int val,unsigned int base){
int div;
div=val/base;
if(div>0){
putint(div,base);
}
console_putch("0123456789ABCDEF"[val%base]);
}
Re:Is there a list of os independent functions
IIRC it's in the C standard (ISO 9989:1999) under the header of a "freestanding" implementation. Freestanding here stands for "without OS layer above it".
Re:Is there a list of os independent functions
The "freestanding" part of the library is stddef.h, limits.h, float.h, iso646.h and two or three others - headers that are all typedef and #define, i.e. which do not introduce any code.
Actually, most functions in the C standard library are OS-independent. You need kernel support for only a handful of functions, all of them in stdio.h and stdlib.h:
1) Anything that has to do with interrupts is not part of the standard C library.
2) Anything that has to do with interrupts is most certainly OS-dependent.
Actually, most functions in the C standard library are OS-independent. You need kernel support for only a handful of functions, all of them in stdio.h and stdlib.h:
- opening a file,
- closing a file,
- writing to a file,
- reading from a file,
- positioning within a file,
- getting environment variables,
- terminating the process,
- getting heap memory,
- raising and catching a signal,
- calling an external process (system()).
Uh?I know that most of string.h is and the i86 or whatever include files for interrupts(16bit) but besides that i have no idea
1) Anything that has to do with interrupts is not part of the standard C library.
2) Anything that has to do with interrupts is most certainly OS-dependent.
Every good solution is obvious once you've found it.
Re:Is there a list of os independent functions
It's difficult to transplant the exsit code from a kernel to yours as my thought for most of the code..Emm at least for me.