Chapter 2: Operating System Stuctures Flashcards

1
Q

what useful sevices do operating systems provide?

A

user interface
program execution
I/O operations
File-system manipulation
communication
error detection

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

communication is one of the useful services provided by OS, explain what is meant by communication?

A

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)

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

error detection is one of the useful services provided by OS, what do we mean by Error detection?

A

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

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

what is the OS services that ensure the efficient operation of the system itself?

A

resource allocation:

Accounting:

Protection and security:

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

explain resource allocation as a way of OS service for the operation of system:

A
  1. resources need to be allocated to users for jobs running concurrently
  2. 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

explain Accounting as a way of OS service for the operation of system itself:

A

to keep track of which user use how much and what kind of computer resources

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

Explain protection and security as a service for the operation of OS:

A

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

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

we know that almost all OS have user interface, what two ways are there?

A

interactive UI
non interactive UI

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

give examples of interactive UI:

A

command line interface
graphical user interface

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

give examples of non interactive UI:

A

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

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

give a quick explanation of CLI (Command Line Interface)

A

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)

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

Give a quick explanation of GUI (Graphical User Interface)

A

examples: mouse, keyboard, monitor, icons for files and programs

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

many systems these days have which user interface?

A

both,
Microsoft Windows is GUI with CLI shell
Apple is aqua GUI and UNIX kernel

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

what is the main job of a system call?

A

enable processes to request device access, perform read or write operations on these devices, and release them afterward

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

What are software interrupts, and how do they relate to OS services?

A

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

How are software interrupts invoked in assembly language programming?

A

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.

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

What is an Application Binary Interface (ABI), and why is it important?

A

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.

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

Give examples of OS services that programs commonly request.

A

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

How does the CPU switch between user mode and kernel mode during software interrupts?

A

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.

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

What role do assembly-language trap instructions play in program-OS interaction?

A

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

How does the ABI ensure compatibility between programs and the operating system?

A

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.

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

What are some benefits of using a standardized ABI?

A

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

How do programs utilize the program interface to OS services to enhance their functionality?

A

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.

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

What ares some common OS specific API?

A

Windows API
POSIX API

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

many programming languages come with operating system independent APIs for accessing common OS services, give examples:

A

standard C library
Java API fir java Virtual Machine

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

how is each system call called?

A

with an associated number

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

what is the number that is associated with system call mean?

A

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

How does the system call API invoke a system call in the OS kernel?

A

By using a trap assembly instruction with a syscall number and parameters.

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

What mechanism does the system call API use to communicate with the OS kernel?

A

Trap assembly instruction.

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

How does the OS kernel process a system call requested by the system call API?

A

By executing the requested operation based on the syscall number and parameters.

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

How is the result of a system call retrieved by the system call API?

A

It retrieves the result from the OS kernel.

32
Q

What role does the trap assembly instruction play in the system call process?

A

It triggers a switch to kernel mode for accessing OS services

33
Q

What information is passed to the OS kernel when a system call is invoked?

A

Syscall number and parameters.

34
Q

How does the system call API return the result of a system call to the caller?

A

By passing return values or relevant data.

35
Q

Why is the use of trap assembly instructions necessary for system calls?

A

It enables user programs to access privileged OS services securely.

36
Q

What is the purpose of passing a syscall number to the OS kernel during a system call?

A

To identify the requested operation.

37
Q

How does the system call mechanism facilitate interaction between user programs and the operating system?

A

It provides a standardized interface for requesting OS services.

38
Q

can programmers see the details of the OS interface?

A

hah no

39
Q

what are the three possible approaches passing parameters to the OS?

A
  1. pass the parameters in CPU registers
  2. parameters stored in a block, or table, in memory and address of block passed as a parameters in a register (Linux and Solaris)
  3. parameters placed or pushed onto the stack (pointed to by the stack pointer in the CPU register by the program and be popped off the stack by the operating system)
40
Q

what are differences between API and ABI?

A

API is an interface used by a high level programming language program (if API changes then the whole application has to be fixed to recompiled)

ABI is the interface used on assembly/ machine code level (if ABI changes different numbers used for an existing system call or order or format of parameters so all compiled programs will fail)

41
Q

what problems does change in ABI can cause?

A

both problems in OS level and java, C++

42
Q

what should we do to prevent the changes in API and ABI?

A

add more calls instead of changing

43
Q

what are the types of system calls?

A
  1. process control
  2. file management
  3. device management
  4. information management
  5. communications
  6. protection
44
Q

what are some process control system calls?

A

end, abort process
load execute process
create process, terminate process
get/set process attribute
wait for a certain amount of time
signal event, wait for event
allocate memory, free memory

45
Q

how are system programs delivered?

A

they are delivered together with an OS and provide a convenient environment for program development and execution

46
Q

nowadays how are system programs provided as system service?

A

by GUI

47
Q

system programs can be divided into what categories?

A

file management
status information
file modification
programming language support
program loading and execution
communication
application programs
background programs

48
Q

what does the file management part of system programs mean?

A

Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories.

49
Q

what does the Status information of system programs mean?

A

some ask system for information like date, time, mount of available memory, disk space and number of users,

usually these programs format and print the output to the terminal

some systems implement a registry which is used to store and retrieve configuration information

50
Q

what does the file modification of system programs mean?

A

text editors to create and modify files
special commands to search contents of files or perform transformations of the text

51
Q

what does the Programming-language support of system programs mean?

A

compilers, assemblers , debuggers and interpreters

52
Q

what does the Program loading and execution of system programs mean?

A

command interpreter (shell)
linker and tracing of the system calls

53
Q

what does the Communication of system programs mean?

A

Provides the mechanism for creating virtual connections among processes, users and computer systems

allows users to send messages to one another’s screen browse web pages, send electronic mail messages , log in remotely, transfer files from one machine to another

54
Q

what does the Application programs of system programs mean?

A

additional programs for solving application specific problems(word processor, graphic editor, games)

55
Q

what does the Background programs of system programs mean?

A

known as daemons
prints spooler for buffering print jobs while printer is busy. syslog for logging events, execution of command at scheduled time

56
Q

is there a standard design for operating systems?

A

no

57
Q

how to decide on an Operating system design?

A
  1. define goals and specifications
  2. choose the hardware, type of OS
  3. identify user goals: should be easy to learn, fast, reliable and safe
  4. identify system goals: should be easy to design, implement, maintained, flexible, reliable, error-free and efficient
58
Q

explain mechanism and policies in operating system design and implementation:

A

we have to separate policy from mechanism

Mechanism refers to the fixed component responsible for executing various functions, while policy determines how those functions are executed based on specific criteria or rules.

fx. in CPU scheduling, the mechanism is responsible for allocating CPU time to processes, while the policy dictates the criteria used for scheduling, such as switching processes every 20 milliseconds for multitasking

separation of policy from mechanism allows for flexibility since policies can change

59
Q

how did the operating system used to be implemented and how are they implemented now?

A

by assembly
now by C: easier to port to other CPU, slower tho

60
Q

what is operating system structures?

A

different designs of operations systems

61
Q

different structures of operating systems?

A
  1. simple structure (Monolithic system)
  2. layered system
  3. Microkernel system
  4. module based system
62
Q

explain monolithic system:

A

it is the operating system that i not divided into separated modules or layers
layers can exist but an applications can circumvent the layers and directly access the hardware, making the system vulnerable

63
Q

describe the layerd approach of the structure of operating system:

A

operating system is divided into number of levels
each level is built on top of another
bottom layer is 0
highest layer is the user
only higher levels can access the services by lower levels not vice versa

64
Q

explain the advantages and disadvantages of the layered approach:

A

advantages: development is easier since the concept of layers is easier, layers are easy to exchange

disadvantages: good seperation of the layers may be hard
low speed since each layer involves an additional funciton call

65
Q

give an example of layered approach:

A

UNIX has two layers

66
Q

describe microkerel systems

A
67
Q

describe the advantages and disadvantages of the microkernel system :

A

Advantages: easy to extend a microkernel system (by just adding user space module)
easy to port the operating system to new architectures (just port kernel)
more secure and reliable (less code is running in the kernel mode)

disadvantages: huge performance overhead due to user space to kernel space and back communications

68
Q

what is the structure of the most modern operating systems such as linux, solaris, mac OS and windows implement?

A

kernel modules

69
Q

whats is meant by kernel modules?

A

kernel consists of only of core functionality

functionality can be added by loading kernel modules at run time
(similar to Object Oriented approach)

mixture of microkernel and layers but faster than microkernel and more flexible than layered approach

70
Q

what are the characteristics of each class of kernel module?

A

the have a well defined interface
each kernel module implements this interface

71
Q

we say that module based operating system is faster tan microkernel, explain:

A

there will be no message passing required for communication since kernel and kernel modules run in kernel space and may use ordinary function calls to call eachother therefor it will be faster

72
Q

we say that module based operating system is faster than layered approach, explain:

A

each class of kernel module module may call functions from another class of kernel module with not strict hierarchical layers and additional modules may be added at run time.

73
Q

what are the 7 different classes of kernel modules in Solaris?

A
  1. scheduling class
  2. device and bus drivers
  3. miscellaneous modules
  4. STREAM modules
  5. executable formats
  6. loadable system calls
  7. file systems
74
Q

give an example of hybrid structure (microkernel and layered):

A

apple Mac OS X: based on Mach microkernel, some common services run as user space processes.

Android: module based Linux kernel with higher layers of libraries and frameworks + Android RunTIme virtual machine that interpret CPU-dependent bytecode

75
Q

what are virtual machines

A
76
Q
A