Operating Systems
1. What is OS? What are its important functions?
- An Operating System (OS) is software that manages computer hardware and software resources
- Functions:
- Process management: Allocates CPU time (e.g., when you run Chrome and Word simultaneously)
- Memory management: Allocates and tracks RAM (e.g., closing unused apps frees memory)
- File system management: Organizes data storage (e.g., saving files to specific folders)
- Device management: Controls hardware (e.g., printing documents)
- Security: Manages user permissions (e.g., admin vs. standard user rights)
- User interface: Provides ways to interact (e.g., Windows GUI or command line)
2. What is system call? How it is executed?
- System calls are interfaces between user programs and OS kernel services
- Execution process:
- Application makes system call request (e.g., open() to access a file)
- Parameters placed in registers/stack
- Control transfers to kernel mode via interrupt
- Kernel validates and executes request
- Results returned to application
- Example: When you open a file in an app, the open() system call requests file access from kernel
3. Explain terms: Multi-programming, Multi-tasking, Multi-threading, Multi-processing and Multi-user?
- Multi-programming: Multiple programs loaded in memory, CPU switches between them
- Example: Having Word, Excel, browser in memory simultaneously
- Multi-tasking: Multiple tasks execute concurrently by time-sharing
- Example: Playing music while writing a document
- Multi-threading: Single process contains multiple execution flows
- Example: Web browser rendering page while downloading files
- Multi-processing: Multiple CPUs/cores work simultaneously
- Example: Video rendering using all CPU cores
- Multi-user: Multiple users access system resources simultaneously
- Example: University computer lab where many students log in to the same system
4. Explain process life cycle.
- Creation: Process is created (e.g., clicking an app icon)
- Ready: Process waiting for CPU time
- Running: Process executing on CPU (e.g., app responding to input)
- Waiting/Blocked: Process waiting for resource/event (e.g., waiting for file download)
- Terminated: Process execution complete (e.g., closing an application)
- Real-life example: When opening Microsoft Word, it's created, moves to ready, runs when given CPU time, waits when saving files, terminates when closed