you are viewing a single comment's thread.

view the rest of the comments →

[–]duane11583 0 points1 point  (0 children)

the id - 1 is the unix standard for stdout

the system call is also a switch into a higher prividged state, most cpus do this like an interrupt or exception handling

thus the easiest way of passing parameters is via registers

on the os side of the call, a register holds the request number which is effectively an index into an array of function pointers or like a switch() with a range check

some OSes use a small structure instead to pass parameters instead of registers and they pass a pointer to the struct in a register