cs4310 midterm 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/75

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:23 AM on 3/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

76 Terms

1
New cards

Where is the operating system?

Runs in the kernel and has complete access to all the hardware and can execute any instruction the machine is capable of executing

2
New cards

What two functions does the OS perform?

Provide application programmers a clean abstract set of resources and manages these hardware resources

3
New cards

The OS can be defined as what two things?

Extended machine or resource manager

4
New cards

Viewing the OS as an extended machine is considered what type of view?

Top-down view

5
New cards

Viewing the OS as a resource manager is what type of view?

Bottom-up view

6
New cards

What is the processor?

The brain of the computer. Fetches instructions from memory and executes them

7
New cards

What is the basic cycle of every cpu?

Fetch instruction from memory, decode to determine its type and operands, execute it, and then fetch, decode, and execute subsequent instructions

8
New cards

What is multithreading?

Allows the CPU to hold the state of two different threads and then switch back and forth on a nanosecond time scale

9
New cards

What is main memory divided into?

Cache line that are 64 bytes

10
New cards

Where are the most heavily used cache lines located?

High-speed cache located inside or very close to the CPU

11
New cards

What is a cache hit?

When a program needs to read a memory word, the cache hardware checks to see if the line needed is in the cache if it is its a hit. The request is satisfied from the cache and no memory request is sent over the bus to main memory

12
New cards

How long do cache hits and misses take?

Cache hits take two clock cycles while misses have to go to memory with a substantial time penalty

13
New cards

Why should you traverse caches by row?

Take advantage of spatial locality since consecutive elements in a row are stored contiguously in memory and load more efficiently into the CPU

14
New cards

Difference between HDD and SDD

SSD have no moving parts, do not contain platters, and store data in flash memory

15
New cards

What is virtual memory?

Makes it possible to run programs larger than physical memory by placing them on the disk and using main memory as a kind of cache for the most heavily executed parts

16
New cards

What does virtual memory require?

Requires remapping memory addresses on the fly to convert the address the program generated by the physical address in RAM where the word is located.

17
New cards

Who does the mapping for virtual memory?

The memory management unit which is a part of the CPU

18
New cards

IO devices consist of what two parts?

The controller and the device itself

19
New cards

What is a controller for I/O

A chip or set of chips that physically controls the device. It accepts commands from the OS and carries them out

20
New cards

What is a device driver?

The software that talks to a controller, gives it commands and accepts responses. Each controller manufacturer has to supply a driver for each OS it supports

21
New cards

What are the three ways to accomplish I/O?

  1. A user programs a syscall, which the kernel translates into a procedure call to the appropriate driver (simplest)

  2. The driver starts the device and asks it to give an interrupt when it is fine. At that point, the driver returns. The OS then blocks the caller if need be and looks for other work to do.

  3. Use of special Hardware. Direct Memory Access Chip that can control the flow of bits between memory and some controller without constant CPU intervention

22
New cards

What is the Basic Input Output System/Unified Extensible Firmware Interface (BIOS/UEFI)

Contains low level IO software, including procedures to read the keyboard, write to the screen etc

23
New cards

Where is the BIOS/UEFI located?

Flash ram which is nonvolatile but can be updated by the OS itself when patches need to be applied to it

24
New cards

What happens when the computer is booted for BIOS/UEFI?

BIOS/UEFI is started and checks to see how much ram is installed along with other basic checks. It determines the boot device and loads the OS into memory and starts it. The OS then queries the BIOS/UEFI to get configuration information and proceeds to startup

25
New cards

What is a monolithic system?

Most common structure. Entire OS runs as a single program in kernel mode

26
New cards

What is a basic structure of a monolithic system?

Main program that invokes the requested service procedure. A set of service procedures that carry out the system calls. A set of utility procedures that help the service procedures.

27
New cards

What are microkernels?

A layered approach to kernels, designer have a choice to where to draw the kernel-user boundary.

28
New cards

Downside of microkernels?

Takes longer because of message passing between kernel and user

29
New cards

Upside for microkernels?

By having less in the kernel, bugs wouldn’t bring down the system instantly

30
New cards

What are layered systems?

A generalization of the approach of Monolithic kernels to organize the OS as a hierarchy of layers, with each one constructed upon the one below it

31
New cards

What is a client server model?

A variation of microkernel that distinguishes two classes of processes. Servers which provide a service and clients that use the provided services

32
New cards

Communication between Client-Server model is done how?

Message passing

33
New cards

What is a process?

An abstraction of a running program. An instance of an executing program, including the current values of the program counter, registers, and variables

34
New cards

Processes allow a single CPU to have what?

Pseudo concurrent operation.

35
New cards

In the process model what does each process think and what is reality?

Each process believes it has its own virtual CPU, in reality each CPU switches back and forth from process to process

36
New cards

What is multiprogramming?

When a CPU switches back and forth from process to process

37
New cards

What four principal events cause a process to be created?

  1. System Initialization

  2. Execution of a process creation system call by a running process

  3. A user request to create a new process

  4. Initiation of a batch job

38
New cards

What causes a process to terminate?

  1. Normal Exit (Voluntary)

  2. Error Exit (Voluntary)

  3. Fatal Error (Involuntary)

  4. Killed by another process (Involuntary)

39
New cards

What is a process group?

A process and all of its children and further descendants

40
New cards

When a user sends a signal from the keyboard to a process group what happens?

The signal is delivered to all members of the process group currently associated with the keyboard. But individually, each process can catch the signal, ignore the signal, or take the default action

41
New cards

Is there a concept of process hierachy?

No, all processes are equal.

42
New cards

What are tokens in a process?

The parent is given a special token called a handle that allow parents to control the child. But the parent is free to pass this token to some other processes.

43
New cards

Can processes in UNIX disinherit their children?

No, they cannot disinherit

44
New cards

When does a process block?

When it cannot continue because it is waiting for an input that is not yet available. Also possible for a process that is conceptually ready and able to run to be stopped because the OS has decided to allocate the CPU to another process for a while

45
New cards

What states can a program be in?

Started/New, Ready, Running, Blocked/Waiting, Terminated/Exit

46
New cards

What is the scheduler?

The lowest level of the OS with a variety of processes on top of it. All the interrupt handling, process state management and more are hidden here. Makes the choice of which processes get CPU cycles

47
New cards

What is a sequential process?

All the runnable software on the computer, including the OS

48
New cards

In process creation, system initialization is what?

Part of the kernel

49
New cards

What are the 3 main process states we care about?

Ready, Running, Blocked

50
New cards

What is a process table/process control blocks?

OS maintains a table (array of structures) with one entry per process

51
New cards

What is an interrupt vector?

Contains the address of the interrupt service routine (ISR)

52
New cards

What are the three main topics in the process table?

Process management, Memory management, File Management

53
New cards

Actions such as saving registers and setting the stack pointer are unable to be what?

Expressed in high level languages even C, so must be done in assembly

54
New cards

Whats the key idea of a process interupt?

After each interrupt, the interrupted process returns to precisely the same state it was in before the interrupt occurred

55
New cards

What is a main thread?

In traditional OS, each process has an address space and a single thread of control called a main thread

56
New cards

Why use multiple threads within a process?

Multiple activities at once, lighter weight than processes, allows activities to overlap improving performance, and useful in true hardware parallelism environments

57
New cards

How are threads useful in process modeling?

Allow multiple executions to take place in the same process environment and address space

58
New cards

What are the two main ways to implement threads?

User Space and Kernel Space

59
New cards

What is user space for threads?

OS does not know the existence of threads, it thinks its only working on single-threaded processes. Works on OSes that don’t support threading

<p>OS does not know the existence of threads, it thinks its only working on single-threaded processes. Works on OSes that don’t support threading</p>
60
New cards

What is kernel space for threads?

Thread creation/destruction handled by kernel calls. No need for a runtime system

<p>Thread creation/destruction handled by kernel calls. No need for a runtime system</p>
61
New cards

Whats the biggest advantage for user space threads?

Can be implemented on an OS that doesn’t support threads

62
New cards

What is a thread table?

Keeps track of threads in that process, contains stack pointer, program counter, registers, state, etc

63
New cards

Disadvantage of user space threads?

Invisible to kernel and lack of coordination

64
New cards

Advantages of kernel threads?

Directly supported by OS, kernel performs thread creation, scheduling, and management

65
New cards

Disadvantage of kernel threads

Slower to create and manage because you have to switch between the OS and the Kernel

66
New cards

What is the scheduling algorithm?

What the scheduler uses to make decisions of which processes get CPU cycles

67
New cards

What is a long-term schedueler?

Selects a process from the pool of jobs and loads into memory from execution

68
New cards

What is a short-term scheduler?

Selects a process from the ready queue and allocates it to the CPU

69
New cards

What is the memory scheduler?

Decides which processes should be kept in memory and which ones kept on disk when the number of processes is too large

70
New cards

Why is scheduler important?

Process switching is very expensive

71
New cards

What happens when switching from user to kernel mode?

All information for the blocked process must be saved, memory map must be saved, new process selected by scheduler, information from new process must be loaded, and start running a new process

72
New cards

What happens when you context switch?

Flush out the entire cache, very inefficient long term

73
New cards

When to schedule?

Process creation, process switching from running to blocked, process switching from running to ready, terminating a process, process switching from blocked to ready

74
New cards

What is non-preemptive algorithm?

Picks a process to run and then lets it run until it blocks or voluntarily releases the CPU

75
New cards

Drawbacks for non-preemptive algorithm?

Even if it runs for many hours, it won’t be forcibly suspended and no scheduling decisions are made during clock interrupts

76
New cards

What is preemptive algorithm?

Picks a process and lets it run for a maximum amount of some fixed time. If still running at end of time interval, process is suspended and scheduler picks another process to run. Requires clock interrupt to give control of CPU back to scheduler