Protection and Syscalls Flashcards

1
Q

describe Dual Mode Operation

A
  • can distinguish between tasks executed by OS and user
  • user mode (ring 3) or kernel mode (ring 0)
  • allows privileged instructions
  • ISR code executes in kernel mode
  • user code must appeal to OS to run privileged instructions using system calls
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is a System Call and how is it called

A
  • user programs request system calls
  • a syscall traps to OS
  • dedicated ISR for syscall interupts
  • write the syscall id into a particular register
  • execute the instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain user mode to kernel mode transition

A
  • user process calls system call
  • mode bit = 0
  • parameters pass to registers
  • system call is executed
  • mode bit = 1
  • return from system call
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a system library?

A

A library of wrapper functions for the system calls to simplify their use. e.g. printf uses the write

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

What happens when a user mode application tries to exe a privileged instruction?

A

The CPU generates a protection fault (a type of interupt) and traps to the OS to be handled

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

what are the 3 protection mechanism?

A

dual mode
hardware timers - os regularly interupts user programs to ensure it maintains control of the cpu
memory protection

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