Chapter 2: Operating System Stuctures Flashcards
what useful sevices do operating systems provide?
user interface
program execution
I/O operations
File-system manipulation
communication
error detection
communication is one of the useful services provided by OS, explain what is meant by communication?
Processes exchange information, this may happen between computers over a network
and it may be exchanged via shared memory or through message passing (packets moved by the OS)
error detection is one of the useful services provided by OS, what do we mean by Error detection?
since OS has to always be aware of possible errors:
in the CPU and memory hardware, I/O devices or user program
each type of error OS will take an appropriate actions to ensure correct and consistent computing
there are also debugging facilities that can greatly enhance the user’s and programmer’s abilities to efficiently use the system
what is the OS services that ensure the efficient operation of the system itself?
resource allocation:
Accounting:
Protection and security:
explain resource allocation as a way of OS service for the operation of system:
- resources need to be allocated to users for jobs running concurrently
- allocation strategies depend on types of resources
for example it can be specific to resource like a CPU scheduler, memory management or file storage
and generic allocation strategies for other resources like all I/O devices that may be allocated and released in the same way
explain Accounting as a way of OS service for the operation of system itself:
to keep track of which user use how much and what kind of computer resources
Explain protection and security as a service for the operation of OS:
access of information stored in a multi-user or networked computer system must be controlled
concurrent processes should not interfere with each other
Protection: it involves insuring that all access to system resources from system users is controlled
Security: preventing access from outsiders, requiring user authentication, extending external I/O devices from invalid access attempt
we know that almost all OS have user interface, what two ways are there?
interactive UI
non interactive UI
give examples of interactive UI:
command line interface
graphical user interface
give examples of non interactive UI:
batch interface:
0. user specifies all details of a batch job in advance to the actual batch processing
0. no prompt for further input after processing has started
0. user receives the output when all the processing is done
give a quick explanation of CLI (Command Line Interface)
CLI allows direct command entry via keyboard
sometimes CLI is implemented in the kernel, or even by a separate system program like a shell
CLI primary fetches a user textual command and executes it sometimes:
1. commands built in into the shell
2. commands are just names of eternal programs that will be executing in a new process like a system library (adding new features doesn’t require shell modification)
Give a quick explanation of GUI (Graphical User Interface)
examples: mouse, keyboard, monitor, icons for files and programs
many systems these days have which user interface?
both,
Microsoft Windows is GUI with CLI shell
Apple is aqua GUI and UNIX kernel
what is the main job of a system call?
enable processes to request device access, perform read or write operations on these devices, and release them afterward
What are software interrupts, and how do they relate to OS services?
Software interrupts, also known as traps, are mechanisms used by programs to request services from the operating system. When a program needs to invoke an OS service, it triggers a software interrupt, causing the CPU to transfer control to the OS
How are software interrupts invoked in assembly language programming?
In assembly language programming, software interrupts are invoked using special instructions, such as INT on x86 architecture. These instructions trigger a switch to kernel mode and execute the corresponding OS service.
What is an Application Binary Interface (ABI), and why is it important?
An Application Binary Interface is a set of conventions and rules that govern how functions in a program interface with the operating system and other system libraries. It ensures compatibility between different parts of a program and between different programs and the operating system.
Give examples of OS services that programs commonly request.
Examples of OS services include file I/O operations (e.g., reading and writing files), memory management (e.g., allocating and deallocating memory), process management (e.g., creating and terminating processes), and system resource access (e.g., networking and device access).
How does the CPU switch between user mode and kernel mode during software interrupts?
During software interrupts, the CPU switches from user mode (where applications run) to kernel mode (where the operating system operates) to execute the requested OS service. This switch provides the necessary privileges for the OS to perform system-level tasks on behalf of the program.
What role do assembly-language trap instructions play in program-OS interaction?
Assembly-language trap instructions, such as INT on x86 architecture, are used to generate software interrupts that trigger the invocation of OS services. These instructions act as signals to the CPU to switch to kernel mode and execute the requested service
How does the ABI ensure compatibility between programs and the operating system?
The ABI defines conventions for function calling, parameter passing, and other aspects of program-OS interaction. By adhering to these conventions, programs can effectively communicate with the operating system and other system libraries, ensuring compatibility across different software components.
What are some benefits of using a standardized ABI?
Standardized ABIs facilitate interoperability between different software components, enable portability across different platforms, simplify development by providing consistent interfaces, and enhance system security by enforcing access controls and privilege levels.
How do programs utilize the program interface to OS services to enhance their functionality?
Programs utilize the program interface to OS services to access a wide range of functionalities provided by the operating system, enabling them to perform tasks such as file operations, memory management, process control, and system resource access. This enhances the functionality and capabilities of programs, allowing them to interact with the underlying system effectively.
What ares some common OS specific API?
Windows API
POSIX API
many programming languages come with operating system independent APIs for accessing common OS services, give examples:
standard C library
Java API fir java Virtual Machine
how is each system call called?
with an associated number
what is the number that is associated with system call mean?
the number identifies the associated routine in OS kernel
number is used as an index of a table that contains addresses of functions that implement the corresponding system calls
How does the system call API invoke a system call in the OS kernel?
By using a trap assembly instruction with a syscall number and parameters.
What mechanism does the system call API use to communicate with the OS kernel?
Trap assembly instruction.
How does the OS kernel process a system call requested by the system call API?
By executing the requested operation based on the syscall number and parameters.