1/18
Flashcards covering operating system fundamentals including dual-mode operation, system calls, system boot, process and thread architecture, multicore parallelism, and FCFS scheduling.
What is the primary purpose of dual-mode operation in an operating system?
It ensures proper execution by distinguishing between operating-system code (kernel mode) and user-defined code (user mode), protecting the operating system and users from errant or malicious programs.
What numerical values does the hardware mode bit use to distinguish between kernel mode and user mode?
Kernel mode is indicated by 0, and user mode is indicated by 1.
In what mode does computer hardware start at system boot time, and when does it switch to user mode?
The hardware starts in kernel mode at boot time; the operating system is loaded and sets the mode bit to 1 (user mode) before passing control to a user application.
What happens if an application attempts to execute a privileged instruction while in user mode?
The hardware does not execute the instruction, treats it as illegal, and traps it to the operating system.

Based on this dual-mode execution diagram, what mode bit transitions occur when a user process issues a system call and then receives the return?
Executing a system call triggers a trap that switches the mode bit from 1 to 0 (kernel mode). Upon completing the system call, a return switches the mode bit from 0 back to 1 (user mode).
What are the Unix system call equivalents to the Windows process control system calls CreateProcess(), ExitProcess(), and WaitForSingleObject()?
The Unix equivalents are fork(), exit(), and wait().
What are the Unix system call equivalents to the Windows file manipulation system calls CreateFile(), ReadFile(), WriteFile(), and CloseHandle()?
The Unix equivalents are open(), read(), write(), and close().
Which Windows system calls correspond to the Unix communication system calls pipe(), shmget(), and mmap()?
The corresponding Windows calls are CreatePipe(), CreateFileMapping(), and MapViewOfFile().
In the layered approach to operating system design, what do layer 0 and layer N represent?
Layer 0 is the hardware, and layer N is the user interface.
What is a bootstrap loader, and where is it stored?
It is a small piece of code stored in ROM or EEPROM that locates the kernel, loads it into memory, and starts it.
What capabilities does the common bootstrap loader GRUB provide during system boot?
GRUB allows the selection of a kernel from multiple disks, versions, and kernel options.
Beyond program code (the text section), what two elements represent the current activity of a process?
The value of the program counter and the contents of the processor's registers.
What types of data are stored in a process's stack, data section, and heap?
The stack contains temporary data (function parameters, return addresses, local variables); the data section contains global variables; and the heap contains memory dynamically allocated during run time.
What components compose an individual thread?
A thread composes a program counter, a set of registers, a stack, and its own thread ID.
What resources does a thread share with other threads belonging to the same process?
It shares the code section, data section, and other operating system resources.
What is the difference between data parallelism and task parallelism in multicore programming?
Data parallelism distributes subsets of the same data across multiple cores performing the same operation on each, whereas task parallelism distributes threads across cores with each thread performing a unique operation.
How many cores and hardware threads per core are present in an Oracle SPARC T4 CPU?
It has 8 cores and 8 hardware threads per core.
What is the convoy effect in CPU scheduling?
A situation where short processes have to wait behind a long process (such as one CPU-bound process and many I/O-bound processes).

According to this FCFS Gantt chart, what are the individual waiting times for processes P1, P2, and P3, and what is their average waiting time?
The waiting times are P1=6, P2=0, and P3=3. The average waiting time is 36+0+3=3.