Lecture 2 Flashcards

1
Q

Steps in the transition from user to kernel mode

A
  • User code issues a system call
  • Mode is changed to kernel mode
  • OS checks that everything is in order and legal
  • OS executes system call
  • Mode is set back to user mode
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or false: a single system call may contain multiple privileged instructions

A

True

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

System calls enable users to…

A

…Access OS services

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

System calls are typically written…

A

…in a high-level programming language (like C/C++)

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

Each system call has a…

A

…System call number

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

System calls are accessed via…

A

…an API (Application Program Interface)

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

What does an API do

A
  • Hides the details of implementation of system calls

- Offers portability across the OS

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

Common APIs

A
  • POSIX (UNIX, Linux, Mac OS X)
  • Java API (Java Virtual Machine)
  • Win32 (Windows)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Programming languages can be seen as APIs when they have…

A

…file I/O operations

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

What does the command $ strace -c [command] do?

A

Displays summary info on system calls invoked during

the execution of the command

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

Numerous system calls are typically invoked for…

A

…even simple tasks

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

Types of system calls

A
  • Process Control
  • File Manipulation
  • Device Manipulation
  • Information Maintenance
  • Communication
  • Protection
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Steps in using a timer for protection

A
  • Before giving user control of a program, OS sets a
    timer (usually in the millisecond range)
  • After period expires, timer chip issues a system
    interrupt, giving the OS control again
  • OS decides whether to kill the process or let it
    continue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is a user holding resources to long a problem?

A

Malicious user might be exploiting something, or the program may have just bugged out

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

Types of OS structure

A
  • Monolithic (everything the OS does goes in the
    kernel)
  • Layered (Hardware is bottom layer, user interface is
    top layer, with multiple layers in between)
  • Microkernel (Kernel only does what it absolutely has to)
  • Modular
  • Hybrid
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Pros and Cons of Monolithic OS

A
  • Pro: efficient in terms of space and speed
  • Con: Difficult to implement + maintain (too much in
    one layer)
17
Q

Pros and Cons of Layered OS

A
  • Pro: Easier to develop, debug, and update
  • Con: Less efficient, and it’s hard to decide what goes
    on which layer
18
Q

In a microkernel structure, modules communicate using…

A

…Message passing through kernel

19
Q

Pros and Cons of Microkernel OS

A
  • Pro: Easier to extend microkernel/port to new devices,
    more reliable and secure
  • Con: More performance overhead
20
Q

In a modular structure, core components go in the…

A

…Kernel module

21
Q

In a modular OS, how are new modules loaded?

A

They are linked to the kernel as needed

22
Q

Modules talk to each other using…

A

…well-defined interfaces

23
Q

Modular Structure Advantages

A
  • Easy to maintain, update, and debug
  • Similar to layers but more flexible
  • Similar to microkernel but more efficient
24
Q

OS must be available to ____ to start it

25
On powering up, the instruction register is loaded with...
...a predefined memory location (usually the location of the Bootstrap loader in ROM)
26
Bootstrap loader routine:
- Performs diagnostic tests - Move boot block from fixed location to memory - Boot block loads the rest of the loader from the disk - Boostrap loader loads kernel