L8 Network & Operating Systems Flashcards

1
Q

What are the 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.

A

• Shared memory or message passing
• Inter-process or inter-system communication
• Handled 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
• Examples: 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

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

What are the different states of a process?

A

• New
• Running
• Waiting
• Ready
• Terminated

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

What is the Process Control Block (PCB)?

A

• Data structure storing information about a process:
- Process state, program counter, CPU registers
- Scheduling info, memory info, I/O status

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

When is the PCB updated?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

What is depicted in Diagram 1?

A
  • Hierarchical structure showing user programs accessing system and application programs, which interface with the OS and hardware
25
Where does the operating system sit in the architecture?
* Between system/application programs and computer hardware
26
What are some system/application programs in the diagram?
* Compiler, assembler, text editor, database system
27
What is the role of the system call interface in this diagram?
* Bridges user mode and kernel mode for system calls
28
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
29
What does this diagram show?
* Flow of a high-level function (`printf`) through standard C library to a system call (`write()`)
30
Why is the C library involved before a system call?
* It abstracts direct system call use and manages parameters
31
What layers are shown in this OS services model?
* User programs, user interfaces, system calls, services, OS, hardware
32
Which layer handles file systems and communication?
* Services layer under system calls
33
What regions are shown in the process memory layout?
* Text, Data, Heap, Stack
34
How do stack and heap grow?
* Stack grows downward, heap grows upward
35
What is the purpose of this comparison table?
* Shows equivalent system calls in Windows and Unix for common operations
36
Give a file manipulation example from both OSes.
* Windows: `CreateFile()`, Unix: `open()`
37
What components make up a PCB?
* State, process number, PC, registers, memory limits, open files
38
Why is the PCB essential for scheduling?
* Stores process-specific data needed to resume execution
39
What state changes are shown in the diagram?
* New → Ready → Running → Waiting → Terminated
40
When does a process enter the waiting state?
* During I/O wait or event wait
41
What does the diagram show?
* How processes move between ready and device queues
42
What queues are color-coded?
* Ready queue (blue), Device queue (yellow)
43
What is shown in the queue layout?
* Linked-list style ready/device queues with pointers to PCBs
44
How are PCBs connected in queues?
* Each has a pointer to the next in the linked list
45
What does the green star represent?
* New process entering the ready queue
46
What event causes a context switch?
* Interrupt or system call
47
What does the OS do during context switching?
* Saves current state to PCB, loads new process state
48
Why is context switching necessary?
* To allow multitasking by switching between processes