Week 1 Flashcards

1
Q

OS Definition and Functions:

A

Purpose: The operating system (OS) manages hardware resources and simplifies complex hardware interactions by providing abstractions, making it easier for applications to work without needing to understand underlying hardware intricacies.

Two Main Functions: Resource management and abstraction of hardware complexity.

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

OS Role and Customers:

A

Hiding Hardware Complexities: The OS abstracts hardware, presenting simplified interfaces.

Primary Users: Application programs, not end users, are the OS’s main clients. The user interface (e.g., desktop, command prompt) caters to end users.

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

OS as Resource Manager:

A

Concurrent Program Management: Handles multiple programs, ensuring smooth output and efficient resource allocation.

Multi-User Environments: Prevents user interference, tracks resource usage, and mediates resource conflicts.

Multiplexing: Time multiplexing allows resources to be shared over time (e.g., CPU scheduling), while space multiplexing divides resources (e.g., memory) among programs.

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

Computer Hardware Overview:

A

CPU: Performs fetch, decode, and execute cycles. It uses registers like the Program Counter, Stack Pointer, and PSW (Program Status Word) for execution management.

Mode Operations: Supports kernel mode (full hardware access) and user mode (restricted).

Memory Hierarchy: Includes registers (fastest), cache, RAM (main memory), and SSD (nonvolatile).

I/O and Device Drivers: Consist of controllers and devices, with drivers running in kernel mode to manage each controller type.

Interrupts: Devices signal the CPU with interrupts, prompting the OS to execute handler code from the interrupt vector table.

Busses: Connect components, with specialized options like PCIe for high-speed point-to-point connections.

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

Multithreading and Multicore:

A

Multithreading: Allows the CPU to switch between threads for fast task-switching.

Multicore Chips: Processors with multiple independent cores that the OS treats as separate CPUs.

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

Operating System Key Concepts:

A

Processes: Independent execution units.

Address Space: Memory assigned to processes.

Files and I/O: Managed by the OS for efficient access and device control.

Protection and Shell: Safeguard resources, and the shell provides a command-line interface to interact with the OS.

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

Protections

A
  • User, Group, Other
    rwx - Read, Write, Execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

System Calls:

A

Mechanics: System calls run under a single-CPU constraint, using a trap instruction to switch from user to kernel mode, allowing access to privileged operations.

Execution Steps: Involve preparing parameters, library calls, trap execution, system-call handling, and returning control to the user with results or errors.

Process Management Calls: fork() duplicates processes, and waitpid() allows parent processes to await specific child termination. The shell utilizes execve() for command execution.

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

Process Model:

A

Sequential Processes: Each process, a standalone program instance, maintains its own execution state. Virtual CPUs are created by rapid context switching, supporting pseudo-parallelism.

Process Table: Stores critical process information such as program counters, memory usage, and file status in structured entries.
a

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

Threads

A

Basic Concept: Threads enable concurrent execution within a shared address space, offering faster creation/destruction than processes.

Multithreaded Web Server: Threads boost performance by enabling simultaneous I/O and computation.

Data Processing Model: Tasks like input, processing, and output are organized into separate threads, improving resource utilization.

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

Thread Model:

A

Processes as Resource Groups: Processes group resources, while threads are execution entities within a process.

Shared Address Space: Threads share memory and resources but lack strict protection, requiring careful coordination.

Thread Stacks: Each thread has an independent stack for local variables and history, with complexities around synchronization.

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

POSIX Threads:

A

Functions for thread creation (thread_create), termination (thread_exit), and joining (thread_join) facilitate multithreaded programming.

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

Process and Thread Tables:

A

User-Level Threads: Managed in user space, offering efficient switching but may block entire processes during page faults.

Kernel Threads: Tracked globally by the kernel, handling page faults effectively but at a higher creation cost.

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