CS2005 - Lecture 9 - Operating Systems Structures and Processes Flashcards

(36 cards)

1
Q

What are the 9 key services an operating system provides?

A

User Interface (CLI, GUI, Batch)
Program execution
I/O operations
File-system manipulation
Communication
Error detection
Resource allocation
Accounting
Protection and Security

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

What types of user interfaces do operating systems typically offer?

A

Command-Line Interface (CLI)
Batch interface
Graphical User Interface (GUI)

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

What is program execution in the context of OS services?

A

The ability to load and run programs in memory; Handle normal and abnormal termination; Manage resources for execution

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

What does the operating system do in terms of I/O operations?

A

Provides an interface to I/O devices; Facilitates data exchange with files and peripherals; Prevents direct device manipulation by users

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

How does an OS facilitate file-system manipulation?

A

Allows creation, deletion, reading, and writing of files; Manages directories and permissions; Provides search and metadata access

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

Describe how OS handles communication between processes (inter-process communication).

A

Shared memory or message passing, via OS for data integrity and synchronization

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

What is error detection in operating systems?

A

Identifying and handling hardware/software errors; Includes power failure, memory issues, invalid instructions; OS may terminate or recover processes

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

What is resource allocation in OS?

A

Distribution of CPU time, memory, and I/O devices; Done for concurrent users/processes; May involve specific or general allocation algorithms

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

What is the role of the command interpreter or shell?

A

Accepts user commands and executes them; May be part of the kernel or user-level system program; Examples include BASH, cmd.exe

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

How do batch files relate to OS?

A

Scripts containing CLI commands; Automate tasks; Used in system diagnostics, automation, etc.

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

Describe the three major APIs for system calls.

A

Win32 API (Windows)
POSIX API (UNIX-based)
Java API (Java VM)

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

How are system calls typically invoked?

A

Programs use API functions
System call number passed to OS kernel
Kernel executes the call and returns status/result

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

What are some common types of system calls?

A

Process control; File manipulation; Device management; Information maintenance; Communication

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

What are system programs?

A

Utilities that provide a programming environment (e.g.File managers, compilers, loaders, device drivers)

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

What is a process in operating systems?

A

A program in execution; Needs resources like memory, CPU, files; Can be user or system process

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

What is a process composed of?

A

Text: Program code
Stack: Temporary data
Data: Global variables
Heap: Dynamically allocated memory

17
Q

What are the different states of a process?

A

New
Running
Waiting
Ready
Terminated

18
Q

What is the Process Control Block (PCB)?

A

Data structure storing information about a process

19
Q

When is the PCB updated?

A

Whenever a process changes state
During interrupts, scheduling, or completion of tasks

20
Q

What are the three major process scheduling queues?

A

Job queue: All processes in system
Ready queue: Processes in memory ready to execute
Device queue: Processes waiting for I/O devices

21
Q

What does the short-term scheduler do?

A

Chooses next process to run
Runs frequently (e.g., every few ms)
Allocates CPU to processes

22
Q

What is the role of the long-term scheduler?

A

Decides which processes to bring into ready queue
Runs less frequently
Controls multiprogramming level

23
Q

Differentiate between I/O-bound and CPU-bound processes.

A

I/O-bound: More time in I/O, short CPU bursts
CPU-bound: Long CPU usage, few I/O operations

24
Q

Where does the operating system sit in the architecture?

A

Between system/application programs and computer hardware

25
What happens when an application makes an open() system call?
The request goes through the system call interface, kernel looks up implementation, executes it, and returns the result
26
Why is the C library involved before a system call?
It abstracts direct system call use and manages parameters
27
Which layer handles file systems and communication?
Services layer under system calls
28
What regions are shown in the process memory layout?
Text, Data, Heap, Stack
29
How do stack and heap grow?
Stack grows downward, heap grows upward
30
Give a file manipulation example from both OSes.
Windows: CreateFile(), Unix: open()
31
What components make up a PCB?
Process state Program counter CPU registers Scheduling info memory info I/O status
32
What does the PCB store to resume execution and why is the PCB essential for scheduling?
Stores process-specific data needed to resume execution
33
When does a process enter the waiting state?
During I/O wait or event wait
34
What event causes a context switch?
Interrupt or system call
35
What does the OS do during context switching?
Saves current state to PCB, loads new process state
36
Why is context switching necessary?
To allow multitasking by switching between processes