Podcast
Questions and Answers
What is the primary role of the operating system when an application requires access to a hardware device?
What is the primary role of the operating system when an application requires access to a hardware device?
- To act as an intermediary, receiving system calls from the application and managing the hardware interaction. (correct)
- To allow the application to access the device controller's memory directly, improving performance.
- To directly connect the application to the device, bypassing system calls for efficiency.
- To instruct the CPU to ignore interrupts from the device, preventing conflicts.
After a device controller completes a task requested by the CPU, how does it notify the CPU of completion?
After a device controller completes a task requested by the CPU, how does it notify the CPU of completion?
- By directly updating the application's memory space.
- By sending a TCP/IP packet to the operating system.
- By signaling an interrupt. (correct)
- By writing a completion message to a shared file.
What is the purpose of the interrupt vector?
What is the purpose of the interrupt vector?
- To manage the priority of different interrupt requests.
- To point to the memory address of the interrupt handler. (correct)
- To store the data being transferred between the CPU and the device.
- To provide a direct communication channel between applications and hardware.
Which of the following is NOT a typical cause for a hardware interrupt?
Which of the following is NOT a typical cause for a hardware interrupt?
What is the key difference between a trap/exception and a hardware interrupt?
What is the key difference between a trap/exception and a hardware interrupt?
What is the purpose of privilege levels in an operating system?
What is the purpose of privilege levels in an operating system?
In the context of operating system privilege levels (protection rings), which ring typically has the most privileges and interacts directly with the physical hardware?
In the context of operating system privilege levels (protection rings), which ring typically has the most privileges and interacts directly with the physical hardware?
Which scenario exemplifies a 'trap' or exception in operating system context?
Which scenario exemplifies a 'trap' or exception in operating system context?
Which scenario best illustrates the concept of preemptive multitasking?
Which scenario best illustrates the concept of preemptive multitasking?
How does multiprocessing enhance computational speed?
How does multiprocessing enhance computational speed?
What is the primary purpose of interrupts in an operating system?
What is the primary purpose of interrupts in an operating system?
Which scenario exemplifies multiprogramming?
Which scenario exemplifies multiprogramming?
What is the role of a device controller?
What is the role of a device controller?
How does multithreading improve the performance of a program?
How does multithreading improve the performance of a program?
Which of the following actions can trigger a hardware interrupt?
Which of the following actions can trigger a hardware interrupt?
What is a 'time slice' in the context of multitasking?
What is a 'time slice' in the context of multitasking?
Which action triggers a transition from User Mode to Kernel Mode in an operating system?
Which action triggers a transition from User Mode to Kernel Mode in an operating system?
What is the primary role of an Application Programming Interface (API) in the context of operating systems?
What is the primary role of an Application Programming Interface (API) in the context of operating systems?
If a system has multiple programs loaded into memory but only one CPU, what mechanism allows these programs to seemingly run at the same time?
If a system has multiple programs loaded into memory but only one CPU, what mechanism allows these programs to seemingly run at the same time?
In the Windows operating system, where are Windows API functions typically located?
In the Windows operating system, where are Windows API functions typically located?
How do hardware interrupts typically communicate with the CPU?
How do hardware interrupts typically communicate with the CPU?
What benefit do APIs provide to programmers in terms of operating system interaction?
What benefit do APIs provide to programmers in terms of operating system interaction?
What is the role of libc
in Unix-like systems?
What is the role of libc
in Unix-like systems?
On Windows NT systems, which library functions as the Native API?
On Windows NT systems, which library functions as the Native API?
What happens when a function call from a program is completed?
What happens when a function call from a program is completed?
In an operating system employing protection rings, what is the primary distinction between Ring 0 and Ring 3?
In an operating system employing protection rings, what is the primary distinction between Ring 0 and Ring 3?
What is the primary purpose of the C standard library functions?
What is the primary purpose of the C standard library functions?
Why do modern operating systems, like Windows and Linux, implement User Mode (Ring 3)?
Why do modern operating systems, like Windows and Linux, implement User Mode (Ring 3)?
How do virtualization technologies like VMware utilize protection rings to manage guest operating systems?
How do virtualization technologies like VMware utilize protection rings to manage guest operating systems?
What is the significance of tying processes and file permissions to a User ID in an operating system?
What is the significance of tying processes and file permissions to a User ID in an operating system?
What is the purpose of privilege escalation in operating systems like Windows and Linux?
What is the purpose of privilege escalation in operating systems like Windows and Linux?
How do user applications typically access operating system services like file management or print services?
How do user applications typically access operating system services like file management or print services?
What role do system calls play in the transition between user mode and privileged mode?
What role do system calls play in the transition between user mode and privileged mode?
In what programming languages are system calls typically written?
In what programming languages are system calls typically written?
Which of the following scenarios best illustrates the role of the program counter?
Which of the following scenarios best illustrates the role of the program counter?
When a process transitions from the 'Waiting' state to the 'Ready' state, what event has most likely occurred?
When a process transitions from the 'Waiting' state to the 'Ready' state, what event has most likely occurred?
In the context of operating systems, what is the primary function of the Process Control Block (PCB)?
In the context of operating systems, what is the primary function of the Process Control Block (PCB)?
Why is it important for the contents of registers to be saved when a computer is multitasking?
Why is it important for the contents of registers to be saved when a computer is multitasking?
A program is run, and the operating system assigns it a Process ID (PID). When is the memory space assigned to this PID released?
A program is run, and the operating system assigns it a Process ID (PID). When is the memory space assigned to this PID released?
Which memory segment is used for variables without a default value?
Which memory segment is used for variables without a default value?
What is the purpose of the base and limit registers in memory management?
What is the purpose of the base and limit registers in memory management?
What is the primary reason that command-line interfaces (CLIs) are widely used for system administration?
What is the primary reason that command-line interfaces (CLIs) are widely used for system administration?
A user is running multiple applications simultaneously: a word processor, a web browser, and a music player. How does the operating system manage these concurrent activities?
A user is running multiple applications simultaneously: a word processor, a web browser, and a music player. How does the operating system manage these concurrent activities?
Why is the code segment (text) of a process typically marked as read-only?
Why is the code segment (text) of a process typically marked as read-only?
A system administrator wants to minimize resource usage on a Linux server. Which shell environment would be the MOST suitable choice?
A system administrator wants to minimize resource usage on a Linux server. Which shell environment would be the MOST suitable choice?
A software developer needs to write a script that interacts directly with the operating system kernel. Which type of command would be MOST efficient to use within the script?
A software developer needs to write a script that interacts directly with the operating system kernel. Which type of command would be MOST efficient to use within the script?
A user has several applications open on a desktop computer running a GUI-based operating system. What accurately describes the user's interaction capabilities?
A user has several applications open on a desktop computer running a GUI-based operating system. What accurately describes the user's interaction capabilities?
An IT technician needs to configure a Linux server for optimal performance and security. Which approach is MOST commonly used?
An IT technician needs to configure a Linux server for optimal performance and security. Which approach is MOST commonly used?
A system administrator is troubleshooting a problem on a remote Linux server that only has a command-line interface. Which skill would be MOST essential for the administrator?
A system administrator is troubleshooting a problem on a remote Linux server that only has a command-line interface. Which skill would be MOST essential for the administrator?
A user wants to execute a command on a Windows system. From the user's perspective, what is the primary difference between using an internal command versus an external command?
A user wants to execute a command on a Windows system. From the user's perspective, what is the primary difference between using an internal command versus an external command?
On a mobile operating system, how are input operations typically handled compared to a traditional desktop environment?
On a mobile operating system, how are input operations typically handled compared to a traditional desktop environment?
Which of the following is NOT a common desktop environment?
Which of the following is NOT a common desktop environment?
Flashcards
System Call
System Call
A request from an application to the OS for a service.
Device Controller
Device Controller
Hardware component that manages communication between the CPU and a device.
Hardware Interrupt
Hardware Interrupt
A signal from a device controller to the CPU indicating task completion.
Interrupt Vector
Interrupt Vector
Signup and view all the flashcards
Interrupt Handler
Interrupt Handler
Signup and view all the flashcards
Device Interrupt
Device Interrupt
Signup and view all the flashcards
Trap / Exception
Trap / Exception
Signup and view all the flashcards
Privilege Levels (Rings)
Privilege Levels (Rings)
Signup and view all the flashcards
Multitasking
Multitasking
Signup and view all the flashcards
Multiprogramming
Multiprogramming
Signup and view all the flashcards
Multiprocessing
Multiprocessing
Signup and view all the flashcards
Multithreading
Multithreading
Signup and view all the flashcards
Pre-emptive multitasking
Pre-emptive multitasking
Signup and view all the flashcards
Interrupt
Interrupt
Signup and view all the flashcards
Interrupt Handling
Interrupt Handling
Signup and view all the flashcards
Event-Driven O/S
Event-Driven O/S
Signup and view all the flashcards
Interrupt-Driven
Interrupt-Driven
Signup and view all the flashcards
Rings 1 & 2
Rings 1 & 2
Signup and view all the flashcards
Ring 3
Ring 3
Signup and view all the flashcards
User Mode
User Mode
Signup and view all the flashcards
Kernel Mode
Kernel Mode
Signup and view all the flashcards
Multi-user/Multi-process
Multi-user/Multi-process
Signup and view all the flashcards
Privilege Escalation
Privilege Escalation
Signup and view all the flashcards
System Call Interface
System Call Interface
Signup and view all the flashcards
Mode Bit
Mode Bit
Signup and view all the flashcards
System Call (Trap/Interrupt)
System Call (Trap/Interrupt)
Signup and view all the flashcards
Application Programming Interface (API)
Application Programming Interface (API)
Signup and view all the flashcards
API Libraries
API Libraries
Signup and view all the flashcards
Windows DLLs
Windows DLLs
Signup and view all the flashcards
API Abstraction
API Abstraction
Signup and view all the flashcards
libc API
libc API
Signup and view all the flashcards
Function Call
Function Call
Signup and view all the flashcards
Program
Program
Signup and view all the flashcards
Process
Process
Signup and view all the flashcards
Process ID (PID)
Process ID (PID)
Signup and view all the flashcards
Register (CPU)
Register (CPU)
Signup and view all the flashcards
Program Counter
Program Counter
Signup and view all the flashcards
Process Control Block (PCB)
Process Control Block (PCB)
Signup and view all the flashcards
Process State: Running
Process State: Running
Signup and view all the flashcards
Process State: Waiting
Process State: Waiting
Signup and view all the flashcards
Heap
Heap
Signup and view all the flashcards
Command Line Interface (CLI)
Command Line Interface (CLI)
Signup and view all the flashcards
Built-in Commands
Built-in Commands
Signup and view all the flashcards
External Commands
External Commands
Signup and view all the flashcards
Windows Shells
Windows Shells
Signup and view all the flashcards
Common Linux Shells
Common Linux Shells
Signup and view all the flashcards
Single Active Window
Single Active Window
Signup and view all the flashcards
Touch Screen
Touch Screen
Signup and view all the flashcards
GUI Environments
GUI Environments
Signup and view all the flashcards
Study Notes
CPU Operation
- The CPU executes one task at a time
- The CPU operates much faster than other computer components
- CPU speed runs at multiples speeds of the system bus
- Compared to CPU cycles, hard drive read and write operations are slow
- CPU utilization is increased by organizing jobs for processors when waiting for disk read/writes or other input/output operations
- Keyboard input or video output, and print jobs can increase CPU utilization
- Multiprogramming, Multitasking, Multiprocessing & Multithreading can increase CPU utilization
CPU Scheduling
- Multiprogramming increases CPU utilization by loading multiple programs into memory
- The operating system switches the processor between programs, so the processor is not idle
- One program runs until it relinquishes control, allowing another program to run
- Cooperative multitasking is a characteristic of multiprogramming
- Multitasking is used on modern operating systems and runs several programs simultaneously
- Multitasking runs other system tasks and assigns time slices to each running process
- Multitasking creates the appearance of several programs running at the same time
- Multiprocessing involves multiple CPUs on a motherboard
- Multiprocessing utilizes multiple processor cores within a single CPU package
- Program instructions are sent to different processors, so multiple instructions are completed simultaneously
- Multithreading requires multiple processors
- Several command strings are directed to different processors for parallel execution in multithreading, speeding up program execution
- Time sharing relies on the processor switching between multiple jobs
- Each process or job is scheduled based on a time slice allotment
- Preemptive multitasking is used
- Preemptive multitasking stops the current process execution and returns to a previous process
- User interaction is slow, so each process runs simultaneously
Operating System Interrupts
- Operating systems are interrupt-driven
- Commands for a process may be executed by the OS, and a packet arrives at the network interface card (NIC)
- An interrupt will be sent from the NIC to the CPU along the control bus
- Hardware interrupts originate from a device controller
- The OS suspends the execution of current process to service the arriving packets
- The OS will sit idle unless a process is running
- The OS waits for an event to initiate action
- An event may be a user opening an executable programs
- A hardware device may require action
- Most actions performed by the OS are triggered by a hardware or software interrupt
Device Controller
- A device controller manages a specific device
- Application programs execute code that interacts with a device
- Applications do not have direct access to devices, a system call is initiated from the application
- The OS issues the appropriate instructions to the CPU
- The CPU sends commands and data to the device controller by writing to local buffers (memory) in the controller
- The device controller has the instructions required to perform CPU-requested actions
- The device controller signals an interrupt to notify the CPU that the requested task is complete
- The CPU stops its current task to service the interrupt
- The interrupt's value is a pointer to a data structure called the interrupt vector
- The interrupt vector points to the memory address of the service routine with instructions to handle the device request
- The service routine with instructions is called an interrupt handler
- The table of interrupt vectors is stored in low memory locations
- The OS passes the results back to the application program
- A device also issues a hardware interrupt when something happens
- The interrupt is a request to the O/S to service the device
- A hardware interrupt may be triggered by pressing a key on a keyboard or when data arrives at the NIC
Software Interrupts
- A trap or exception is a software interrupt from applications or system programs
- Software Interrupts request for a specific service or action to be performed
- Saving data to disk and sending data to printer are functions of the software interrupts
- When a software error has occurred, division by zero, invalid memory access, and attempts by a program to modify another running program's data generate software interrupts
Privilege Levels
- The OS supports multiple privilege levels that protect the system hardware and the OS
- Privilege levels restrict CPU instructions used by programs at a specific level
- Ring 0 has the most privileges and interacts directly with the CPU and memory
- Rings 1 & 2 give privileges to hardware device drivers
- Ring 3 is for User applications
- Programs at ring 3 aren't allowed to access hardware at ring 0
- Operating systems often support two modes of operation
- Ring 0 & Ring 3 are the two rings common to all operating systems
- User mode prevents access to system instructions that could damage hardware, the kernel, or other processes; e.g. Ring 3
- Kernel modes are: Privilege Mode, Supervisor Mode or System Mode, e.g. Ring 0
- Hardware that supports virtualization often uses more levels
- VirtualBox and VMware place the guest kernel code in ring 1
- The guest OS has privileges that surpass user applications, but lack full kernel mode privileges
Protection and Security
- A computer may have multiple concurrent users and processes
- Data access must be controlled to ensure authorized users/processes have access
- Processes only execute in their assigned address space
- Processes and file permissions are tied to a User ID
- Privilege escalation allows a user to change to one with more rights
- Privilege escalation is "Run as administrator" on Windows
- Privilege escalation is "Sudo" on Linux
System Calls
- Operating systems provide many services, like file management and print services
- User applications and system programs access these services via system calls
- A system call is a request by a user program to perform a reserved task
- A system call is a programming interface to the operating system with a request to switch from user to privileged mode
- System calls are typically written in a high-level language like C or C++
- Calls directed to hardware devices could written in low level assembly language
- The CPU uses a mode bit to determine the level of privilege operation
- Kernel Mode = 0 and User Mode = 1
- When a user application is started the mode bit is set to 1
- A user application requires a privileged action to complete a system call
- The OS switches to Kernel Mode 0 to complete a system call
- System calls are programmed directly
- Programming languages compilers and interpreters include libraries to make using system calls easier
- The libraries are called Application Programming Interfaces (APIs)
- The API specifies a library of available function the application programmer can access
- Windows API functions are located in dynamic link libraries (dlls)
- Some Windows API example dlls are Kernel32dll, User32dll, shell32dll, and Gui32.dll
- The operating system interface details are hidden from the programmer by an API
- Systems provide a library or API between programs and the operating system
- On Unix-like systems, the API is part of an implementation of the C library (libc)
- On Windows NT, the API is part of the Native API, ntdll.dll library
- A function call is loading a piece of code into user space to perform a specific task
- When a task (or subroutine) is complete, control is passed back to the main program
- The C standard library provides built-in functions that a program can call
- Functions may complete system calls during execution
Process Management
- A program is a passive entity, a block of instruction code on disk
- A process is an active entity, an executing program
- Each process is given a process id (PID)
- The user may be running several programs at one time, each is a separate process
- Running a word processor, browsing the Internet, and listening to music are all separate processes
- When the process is terminated, assigned memory space is released back to the O/S for other processes
- A register is a small memory area built into a CPU
- Processes load instruction and related data from memory into registers for execution
- Each process has an identification number (PID)
- A program counter is a special register that points to the next instruction for execution
- When context-switching from one process to another, register and counter contents are saved
- Each process has a Process Control Block (PCB)
- The PCB contains information used monitor and manage processes
- A process runs continuously within multi-tasking systems
- When stored in a PCB, program counters and registers can store process values when not actively running
- New status represents the process is being created and assigned Process ID (PID) and memory addresses (stack & heap)
- Running status code indicates instructions are being executed by the Program counter
- Waiting status code means, the process is waiting for an event like an interrupt to occur
- Ready status code represents a processes waiting assignment to a processor for a time slice
- Terminated signifies the process has finished execution
Memory
- The operating system assigns each process id (PID) to a dedicated memory space
- Code segment (text) contains binary executable code (read only)
- The Initial Data segment contains assigned variables for the process
- Block Started by Symbol (BSS) contains variables without a default value
- Heap is memory allocated for use by the process
- Stack i temporary space for functions called by a process
- Based and Limits Registers define private memory addresses for the process
- Each process is allocated dynamic memory addresses called a heap, which stores data calculated by an instruction
- Dynamic memory called a stack (buffers) is assigned at the highest usable memory location and grows downwards
- The stack holds a temporary user's input variables into a program such as a the number entered into a calculator program
User Interface
- The Command Line Interface (CLI) uses a text mode interface
- The CLI allows users to interact with programs via a keyboard/screen with text characters
- Command line interfaces are called shells or command interpreters
- CLI commands operate at Ring level 3, the outer shell, with the kernel at the middle
- Widely uses CLI for system administration due to flexibility and efficiency
- Command line interfaces are available on Windows, Mac OSX and Linux
- Commands used at the CLI can be built into the shell or external commands
- Built-in commands exist always run with shell and cannot be separated
- External commands are separate programs that a shell loads and executes
- Internal and external commands are visibly indistinguishable
- Windows shells include: Command Prompt and PowerShell
- Many Linux servers feature CLI only (no GUI environment)
- CLI only is a common configuration for security and performance
- A Linux desktop with GUI also has CLI access via terminal application
- Bash (Bourne again shell) is the most widely used shell
- Bourne shell (sh) is one of the oldest Unix/Linux shells
- Korn shell (ksh) is a small, limited functionality shell for systems with limited resources
- Graphical User Interface (GUI) utilizes pointing device operations
- Images and icons are used as inputs to OS in GUI
- GUI employs Keyboards for text input
- Multiple windows display at once, but the user is limited to interacting with one at a time
- Mobile systems can combine keyboard, pointing device and basic screen functionality in a touch screen
- CDE is the Common Desktop Environment
- X-Windows include IBM AIX, SUN Solaris
- KDE is the K Desktop Environment
- GNOME is a common desktop environment
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.