3.2.1 System Call Format
T-Kernel adopts C as the standard high-level language, and standardizes interfaces for system call execution from C language routines.
The method for interfacing at the assembly language level is implementation-dependent and not standardized here. Calling by means of a C language interface is recommended even when an assembly language program is created. In this way portability is assured for programs written in assembly language even if the OS changes, so long as the CPU is the same.
The following common rules are established for system call interfaces.
- All system calls are defined as C functions.
- A function return code of 0 or a positive value indicates normal completion, while negative values are used for error codes.
All system call interfaces are provided as libraries. C language macros, in-line functions and in-line assembly code are not used. The reason is that C macros and in-line functions can be used only from a C program. Moreover, since in-line functions and in-line assembly are not standard C features, their functioning is in many cases compiler-dependent, diminishing portability.

Comments