Midterm 1 Flashcards

1
Q

Explain the Von Neumann Architecture

A

Computer that fetches instructions from RAM to execute
Those instructions can further modify other RAM locations which can contain data or even code
Known as “stored program” concept

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

What is an Operating System

A

Piece of software that manages resources, abstracts details

The “adult” in the room

Event-driven

Program that runs first on the computer –> allows the code to set up the initial addresses of the interrupt handlers in the interrupt vector

When OS is terminated, computer is done

Overhead: any resources taken by the OS cannot be used what we really want system to run

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

Explain the Abstraction of Details in the Operating System

A

We want to give the illusion that each program (process) has exclusive access to the CPU’s time
Also includes exclusive access to I/O devices and transparent security
However, we are worried about sharing the resources of the system

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

Exclusive Access

A

Abstraction technique called virtualization

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

What is partitioning?

A

Dividing the memory region into pieces and giving a piece to each program

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

Describe the drawbacks of remembering the extents of each partition

A

It’s very expensive as we would check the limit and base frequently and does not give the illusion of exclusive access

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

Explain virtual addressing

A

It solves protection problems as an address is already yours, and you can’t write to another address of a different program

It also solves relocation problem since address is already yours and to your program the address doesn’t move

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

What are system calls used for? Explain what a syscall is

A

They are used for asking the Operating System for something

They are software interrupts (stops what we are doing with the intention to go back)

This makes the OS event-driven, as it isn’t constantly running. It responds to events

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

Explain privileged/Kernel and Protected/User mode instructions

A

They are different instruction sets.

In kernel mode, it has full unrestricted access to the system’s resources. Due to this, only well trusted code can run in this mode.

In user mode, the executing code has restricted access, as in it can’t handle privileged instructions. If applications in user mode try to execute privileged instructions, the OS kills the program (SIGILL)

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

Explain what happens in the OS when a syscall is called

A

The CPU goes into kernel mode. It looks the type of software interrupt in the interrupt vector.

The interrupt vector should contain the address to set the PC( Program Counter) to

Then, we look at v0 to determine the index and determine which syscall it is and what behaviors to perform

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

Go more in depth about the interrupt vector

A

It is stored in the CPU
It is essentially a data structure that provides the address of the routine to be executed when a specific interrupt occurs

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

Explain Context Switching

A

The instructions of the OS share the same resources as the instructions of the user program that is being interrupted

We have to put things back the way they were when we return from the OS

These values are stored in memory, which means context switching is very costly
We want to do it the least possible

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

Monolithic Kernel

A

Everything that is OS lives in kernel mode
All kernel-level code and data structures share an address space. This means functions are shared and can be called anywhere
More efficient as there is less context switching.

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

Microkernel

A

Smaller in order to make OS do less
Needs a scheduling algorithm
Scheduling doesn’t need to access to kernel instructions. We move it out into user mode called process server. Once that decision is made, we enter kernel mode.

Slower as there is more context switching

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

What is a process?

A

A running program and its associated data. The program is the code and (static) data stored in an executable file on disk. The von Neumann architecture prevents us from running it until it has been copied into RAM

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

Explain Multiprogramming

A

It is the ability to run multiple processes at the same time, or in other words, concurrency.