System Calls Flashcards

1
Q

What is a system call?

A

Interface for user programs to request OS services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens when a system call occurs?

A

Causes a trap into the OS. Dedicated ISR for handling system call interrupts.

The sys call identifier is wrote into a particular register.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How are parameters passed to sys calls?

A

Can pass parameters in registers, by pushing them onto the stack. or as a table.

Stacks and tables do not limit the number of parameters that can be passed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does pushing parameters to the stack work?

A

System call implementation knows to pop date from the stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do parameter tables works?

A

Address of table passed to OS. Within the table are the passed parameters.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

On Linux, what happens after the system call?

A

Integer representing the success/failure of syscall stored in EAX.

Return value written to some specified address.

CPU state is restored.

User mode is restored before returning.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can Syscalls be invoked?

A

High-level functions and other system library functions (printf, open etc..)

syscall() C function

Invoking interrupt 128

How well did you know this?
1
Not at all
2
3
4
5
Perfectly