OS and Architecture Overview

0.0(0)
studied byStudied by 0 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/27

flashcard set

Earn XP

Description and Tags

Flashcards covering the role of the OS, hardware virtualization, system calls, process creation, memory protection, I/O, interrupts, caching, and related hardware concepts.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

28 Terms

1
New cards

What is the primary role of the OS with respect to applications and hardware?

To serve as a layer that separates applications from hardware and virtualizes hardware resources, providing a safe, consistent interface for program execution.

2
New cards

Why would running programs directly on hardware be problematic (no OS) according to the notes?

Applications would be less portable and harder to adapt to different hardware; they would need to know how to talk to specific hardware, creating complexity and potential security vulnerabilities.

3
New cards

How does virtualization of hardware benefit applications, as described in the notes?

The OS turns hardware into virtualized resources that are easier to use, shareable by many programs, and provide a consistent interface across different hardware, enabling abstractions like a file system.

4
New cards

What does the OS interface to applications primarily consist of?

A collection of system calls (e.g., read, write) that request services from the OS.

5
New cards

How do C programs typically interact with the OS for I/O, according to the notes?

Through the C standard library, which may eventually invoke OS system calls.

6
New cards

What is a system call?

A low-level interface that allows a program to request services from the OS by transferring control to the kernel.

7
New cards

What is a file descriptor in Unix/POSIX?

An integer handle returned by open() used by read(), write(), and close() to access a file.

8
New cards

Name the three Unix/POSIX system calls commonly used to read a file and their roles.

open() to obtain a file descriptor, read() to read bytes into a buffer, close() to release the descriptor.

9
New cards

What command-line tool can show all system calls made by a program?

strace, e.g., strace ./readFile.

10
New cards

What does fork() do in Unix/POSIX?

Creates a new child process that is a copy of the parent; both can run concurrently.

11
New cards

What does exec*() accomplish in the Unix/POSIX process model?

Replaces the currently running program with a different program, usually after a fork.

12
New cards

What is the purpose of wait() in Unix/POSIX?

Makes the parent wait for one of its child processes to terminate.

13
New cards

Can the parent and child processes run concurrently, and how?

Yes, they can run concurrently on a single CPU by taking turns, or in parallel on multiple CPUs.

14
New cards

List some typical system calls for running programs mentioned in the notes.

Reading and writing files, starting other programs, allocating/configuring memory, inter-process communication, monitoring the system state.

15
New cards

What is dual-mode operation in CPUs?

The CPU can run in kernel mode (privileged) or user mode (restricted); kernel mode has access to privileged instructions.

16
New cards

What are base and limit registers used for in memory protection?

They define a contiguous memory region that a user process can access; hardware checks every memory access against this region.

17
New cards

What is a timer interrupt and why is it important?

An interrupt generated by a countdown timer that ensures the CPU returns to the kernel, enabling multitasking and responsiveness.

18
New cards

How do interrupts work in general?

When an interrupt occurs, the CPU suspends the current instruction sequence and jumps to an interrupt handler via an interrupt vector.

19
New cards

What is Direct Memory Access (DMA) and its benefit?

DMA allows device controllers to transfer bulk data directly to memory, reducing CPU involvement; requires bus arbitration.

20
New cards

What are Port-Mapped I/O and Memory-Mapped I/O?

Port-Mapped I/O uses special I/O instructions to access device registers; Memory-Mapped I/O uses regular memory instructions to access device registers in a reserved memory region.

21
New cards

Why is I/O protection important and how is it achieved for memory-mapped I/O?

The OS must ensure I/O requests come through system calls; memory protection is needed to prevent devices or memory regions from being misused.

22
New cards

What is the purpose of memory protection in the OS?

To control which memory a program can access, prevent programs from interfering with the kernel or other processes, and protect kernel memory.

23
New cards

Describe the base/limit memory-protection mechanism in brief.

Base holds the starting address and limit holds the size; hardware checks each access to ensure it lies within the allowed region, with privileged instructions to modify them.

24
New cards

What is the role of the interrupt vector?

A table of pointers to interrupt handlers, enabling dispatch to the correct handler for each interrupt type.

25
New cards

What is the Von Neumann architecture as described in the notes?

Code and data reside in main memory; the CPU fetches and executes instructions from memory.

26
New cards

Why is caching important in memory hierarchies?

Caches exploit temporal and spatial locality to speed up memory access by storing a subset of data closer to the CPU, reducing latency.

27
New cards

How does the OS interact with device controllers for I/O?

The CPU communicates with device controllers via device registers on the controllers and the system bus; the OS can manage I/O using interrupts or DMA.

28
New cards

What is the overall takeaway of the lecture notes?

Understanding the role of the OS, basic computer organization (memory hierarchy, caching, I/O, interrupts), and hardware protection mechanisms.