CS2005 - Lecture 9 - Operating Systems Structures and Processes Flashcards
(48 cards)
What are the key services an operating system provides?
User Interface (CLI, GUI, Batch); Program execution; I/O operations; File-system manipulation; Communication; Error detection; Resource allocation; Accounting; Protection and Security
What types of user interfaces do operating systems typically offer?
Command-Line Interface (CLI); Batch interface; Graphical User Interface (GUI)
What is program execution in the context of OS services?
The ability to load and run programs in memory; Handle normal and abnormal termination; Manage resources for execution
What does the operating system do in terms of I/O operations?
Provides an interface to I/O devices; Facilitates data exchange with files and peripherals; Prevents direct device manipulation by users
How does an OS facilitate file-system manipulation?
Allows creation, deletion, reading, and writing of files; Manages directories and permissions; Provides search and metadata access
Describe how OS handles communication between processes.
Shared memory or message passing; Inter-process or inter-system communication; Handled via OS for data integrity and synchronization
What is error detection in operating systems?
Identifying and handling hardware/software errors; Includes power failure, memory issues, invalid instructions; OS may terminate or recover processes
What is resource allocation in OS?
Distribution of CPU time, memory, and I/O devices; Done for concurrent users/processes; May involve specific or general allocation algorithms
What is the role of the command interpreter or shell?
Accepts user commands and executes them; May be part of the kernel or user-level system program; Examples include BASH, cmd.exe
How do batch files relate to OS?
Scripts containing CLI commands; Automate tasks; Used in system diagnostics, automation, etc.
Describe the three major APIs for system calls.
Win32 API (Windows); POSIX API (UNIX-based); Java API (Java VM)
How are system calls typically invoked?
Programs use API functions; System call number passed to OS kernel; Kernel executes the call and returns status/result
What are some common types of system calls?
Process control; File manipulation; Device management; Information maintenance; Communication
What are system programs?
Utilities that provide a programming environment; Examples: File managers, compilers, loaders, device drivers
What is a process in operating systems?
A program in execution; Needs resources like memory, CPU, files; Can be user or system process
What is a process composed of?
Text: Program code; Stack: Temporary data; Data: Global variables; Heap: Dynamically allocated memory
What are the different states of a process?
New; Running; Waiting; Ready; Terminated
What is the Process Control Block (PCB)?
Data structure storing information about a process: Process state, program counter, CPU registers; Scheduling info, memory info, I/O status
When is the PCB updated?
Whenever a process changes state; During interrupts, scheduling, or completion of tasks
What are the three major process scheduling queues?
Job queue: All processes in system; Ready queue: Processes in memory ready to execute; Device queue: Processes waiting for I/O devices
What does the short-term scheduler do?
Chooses next process to run; Runs frequently (e.g., every few ms); Allocates CPU to processes
What is the role of the long-term scheduler?
Decides which processes to bring into ready queue; Runs less frequently; Controls multiprogramming level
Differentiate between I/O-bound and CPU-bound processes.
I/O-bound: More time in I/O, short CPU bursts; CPU-bound: Long CPU usage, few I/O operations
What is depicted in Diagram 1?
Hierarchical structure showing user programs accessing system and application programs, which interface with the OS and hardware