Operating System Concepts: Dual-Mode Operation, System Calls, Processes, Threads, and Scheduling

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/18

flashcard set

Earn XP

Description and Tags

Flashcards covering operating system fundamentals including dual-mode operation, system calls, system boot, process and thread architecture, multicore parallelism, and FCFS scheduling.

19 Terms

1
New cards

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.

2
New cards

What numerical values does the hardware mode bit use to distinguish between kernel mode and user mode?

Kernel mode is indicated by 00, and user mode is indicated by 11.

3
New cards

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 11 (user mode) before passing control to a user application.

4
New cards

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.

5
New cards
<p>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?</p>

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 11 to 00 (kernel mode). Upon completing the system call, a return switches the mode bit from 00 back to 11 (user mode).

6
New cards

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().

7
New cards

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().

8
New cards

Which Windows system calls correspond to the Unix communication system calls pipe(), shmget(), and mmap()?

The corresponding Windows calls are CreatePipe(), CreateFileMapping(), and MapViewOfFile().

9
New cards

In the layered approach to operating system design, what do layer 0 and layer N represent?

Layer 00 is the hardware, and layer NN is the user interface.

10
New cards

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.

11
New cards

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.

12
New cards

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.

13
New cards

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.

14
New cards

What components compose an individual thread?

A thread composes a program counter, a set of registers, a stack, and its own thread ID.

15
New cards

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.

16
New cards

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.

17
New cards

How many cores and hardware threads per core are present in an Oracle SPARC T4 CPU?

It has 88 cores and 88 hardware threads per core.

18
New cards

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).

19
New cards
<p>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?</p>

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=6P_1 = 6, P2=0P_2 = 0, and P3=3P_3 = 3. The average waiting time is 6+0+33=3\frac{6 + 0 + 3}{3} = 3.