[fpc-pascal] syscalls and fpc

Florian Klaempfl florian at freepascal.org
Sat Feb 16 21:03:38 CET 2008


ik schrieb:
> 1. There is a support only for up to 6 parameters (plus the instruction itself).

Which syscall has more parameters?

> 2. It support only integer base parameters, while you can not pass
> pointers, chars, array, record or floating point types.

Did you just calculate how much functions it would take to support all
these combinations besides the fact that no kernel function takes e.g.
floats.

> 3. Each OS changes/add/remove functions frequently, so assuming one of
> the above making the functions unusable for anything that is not an
> integer and up to 6 parameters.

Example? Did you realize that the linux supports _only_ one calling
convention: taking the syscall number in a register and the other
parameters in the remaining six registers?

> 
> 1. Is there a way to implement the above with array of const ?

Just add typecasts and a wrapper. Array of const is slow and not
suitable for such low level stuff.

> 2. Is there a way to implement the above without using assembly, 

Just add type casts.



More information about the fpc-pascal mailing list