Chapter 1: Introduction Flashcards

Operating Systems

1
Q

what are operating systems?

A
  1. software that manages a computer’s hardware
  2. provides a basis for application programs
  3. acts as an intermediary
    between the computer user and the computer hardware.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the four components of computer systems?

A
  1. hardware
  2. operating system
  3. application programs
  4. user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what are the basic computing resources for the systems provided by the HARDWARE?

A
  1. central processing unit
  2. memory
  3. input/output devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what are the application programs?

A
  1. word processors,
  2. spreadsheets,
  3. compilers,
  4. web browsers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what do the application programs do?

A

they defines the ways in which these resources are used to solve users’ computing problems.

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

why doe we need operating systems?

A

The operating system controls the hardware and coordinates its use among the various application programs for
the various users.

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

there are two ways to look at the operating systems, what are they?

A
  1. User view - Top down view
  2. System view - bottom up view
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are the some of the keys of user view?

A

the operating system is made for ease of use
and not for resource utilization
usually are phones and tablets
using the touch screen or the audio search

OS abstracts away hardware detail in order to ease the use of the
involved hard- and software. Maximize the work the user performs.

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

Draw a user view diagram:

A

user <–> application programs (compilers, web browsers) <–> operating systems <–>computer hardware (CPU, memory, I/O)

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

key takeaways from system view:

A

operating system is the program most intimately involved with the hardware.

OS is a resource allocator and manages all of the resources, it will also decide between conflicting requests for efficient and fair use

OS is a control program and controls the execution of programs to prevent errors and improper use of the computers

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

in system view we can view an operating system as a?

A

resource allocattor

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

What is a resource allocator?

A

any resource that may be required to solve a problem

  1. cpu time
  2. memory space
  3. storage space
  4. I/O devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what does a control program do?

A

manages the execution of user programs to prevent errors and improper use of the computer.

It is especially concerned with the operation and control of I/O devices.

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

Goals of the operating system are?

A
  1. make computer system convenient to use
  2. use the computer hardware and software resources in an efficient manner
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is a common way to explain what OS is?

A

OS is the one program that is running at all time called Kernel

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

How can we conclude what operating systems consists of?

A

the operating system includes the always running kernel,

The middleware frameworks that ease application development and provide features,

and system programs that aid in managing the system while it is running

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

what is system programs?

A

deals with resources managed by the OS

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

What is an application program?

A

its extra stuff that are installed seperately

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

What are the main components of a modern general-purpose computer system?

A

One or more CPUs (Central Processing Units) and a number of device controllers connected through a common bus

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

What is the role of a device controller in a computer system?

A

A device controller is responsible for managing specific types of devices

(e.g., disk drives, audio devices, graphics displays)

Maintaining local buffer storage

Using special-purpose registers to move data between peripheral devices and its local buffer storage.

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

How do operating systems interact with device controllers?

A

Operating systems typically have a device driver for each device controller, which provides a uniform interface to the device for the rest of the operating system.

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

What ensures orderly access to shared memory in a computer system?

A

A memory controller synchronizes access to the shared memory, allowing the CPU and device controllers to compete for memory cycles in an orderly manner.

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

What initiates an I/O operation in a computer system?

A

The device driver initiates an I/O operation by loading the appropriate registers in the device controller.

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

What role does the device controller play in an I/O operation?

A

The device controller examines the contents of the loaded registers to determine the action to take (e.g., reading a character from the keyboard),

starts the data transfer from the device to its local buffer, and informs the device driver upon completion of the operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
How does the device driver respond after the completion of an I/O operation?
the device controller informs the device driver that it has finished its operation The device driver then gives control to other parts of the operating system, returning the data or a pointer to the data if the operation was a read
26
What mechanism is used by the device controller to inform the device driver about the completion of its operation?
The device controller informs the device driver about the completion of its operation through an interrupt.
27
What purpose does an interrupt serve in the context of I/O operations?
An interrupt is used to notify the device driver that the device controller has finished its operation, allowing the CPU to respond promptly to events such as completed I/O operations.
28
How are interrupts triggered in a computer system?
Hardware can trigger an interrupt at any time by sending a signal to the CPU, usually through the system bus, which serves as the main communication path between major components.
29
What happens when the CPU is interrupted?
When the CPU is interrupted, it halts its current task and immediately transfers execution to a fixed location, typically containing the starting address of the service routine for the interrupt.
30
Illustrate the transition from user mode to kernel mode
The transition from user mode to kernel mode, also known as a mode switch, occurs when a user process requests a privileged operation, such as accessing hardware or executing system-level instructions. This transition is typically facilitated by software interrupts, system calls, or exceptions. When triggered, the CPU switches from executing user-mode instructions to executing privileged kernel-mode instructions, granting access to protected resources and functionalities. After completing the privileged operation, the CPU returns to user mode to resume executing user-level code.
31
How are interrupt service routines managed efficiently?
A table of pointers to interrupt routines, known as an interrupt vector, is used for efficient handling. This table allows direct access to the appropriate service routine without the need for intermediate routines, ensuring quick handling of interrupts.
32
What is the significance of saving and restoring the processor state during interrupt handling?
The interrupt architecture must save the state information of the interrupted process to ensure proper restoration once the interrupt is serviced. If the interrupt routine modifies the processor state, it must explicitly save and restore the state to ensure the interrupted computation resumes seamlessly.
33
Describe the basic mechanism of interrupts in a computer system.
1. The CPU senses the interrupt-request line after executing each instruction. 2. Upon detecting an interrupt signal from a device controller, the CPU reads the interrupt number and jumps to the corresponding interrupt-handler routine using the interrupt vector. 3. The handler saves any state it will be changing, processes the interrupt, restores the saved state, and returns the CPU to its previous execution state.
34
What are the three features needed for interrupt handling in modern operating systems?
1. Ability to defer interrupt handling during critical processing. 2. Efficient dispatching to the proper interrupt handler for a device. 3. Support for multilevel interrupts to distinguish between high- and low-priority interrupts and respond accordingly.
35
I/O devices and the CPU can execute ------
concurrently (at the same time)
36
Each device controller is in charge of a particular -----
device type
37
What storage component does each device controller possess for the data currently undergoing input or output?
Each device controller has a local buffer for the data that is currently subject to input or output.
38
How does the CPU transfer data between the local buffers of a device controller and main memory during input and output operations?
he CPU copies data via the bus between the local buffers of a device controller and main memory for inputting and outputting data.
39
Where does the actual input/output operation take place in a computer system?
The actual input/output operation occurs between the local buffer of the controller and the physical input/output device.
40
What action does an interrupt perform on the CPU's execution flow?
An interrupt transfers control from any instruction currently executed by the CPU to the interrupt service routine.
41
What does an interrupt vector contain, and what purpose does it serve?
An interrupt vector, which is an array or table in main memory, holds the addresses of all the service routines for each type or priority of interrupt. It helps direct the CPU to the appropriate service routine when an interrupt occurs.
42
Describe the process of handling interrupts
when interruption happen, the CPU executes the interrupt service routine. After completion of the routine, the CPU resumes the interrupted computation.
43
What does the interrupt architecture need to save when an interrupt occurs, and why?
The interrupt architecture must save the address of the interrupted instruction. This saved address allows the CPU to resume execution at the appropriate point once the interrupt service routine completes.
44
Why are interrupts of lower priority often disabled or masked when a higher-priority interrupt is being processed?
Lower-priority interrupts are usually disabled or masked while a higher-priority interrupt is being processed to prevent them from interrupting and potentially delaying the completion of the higher-priority interrupt service routine.
45
What are the two main categories of interrupts, and what distinguishes them?
Hardware interrupts originate from the I/O system, while software traps or exceptions are software-generated interrupts caused by errors (e.g., division by zero) or requests from user or application programs. Additionally, system calls, typically made by invoking OS functions, are also software-generated interrupts.
46
an OS is ----- driven
Interrupt
47
what is a SW trap?
is a software generated interrupt cause by an error or a user/application program request
48
what is one step that must happen before next interrupt?
the previous interrupt service routine must have finished
49
what happens when interrupt is called before next one starts?
the previous I/O would not get completely processed and get lost
50
what does I/O controller needs when an interrupt is raised?
it needs the data quickly or else data will get lost
51
the role of interrupt handling in operating system:
1. provides interrupt service routine 2. initializes interrupt vector accordingly 3. Configures on multicore systems an APIC (Advanced Programmable Interrupt Controller) to which core(s) which interrupts are routed.
52
how does the interrupt service routine preserves the state of the CPU?
by saving registers and the program counter and restores it afterwards (typically already saved by the CPU hardware when an interrupt is detected)
53
what is multi programming?
1. Multiprogramming organizes jobs (code and data) so CPU always has one to execute. 2. A subset of total jobs in system is kept in memory. 3. One job selected and run via job scheduling 4. When job has to wait (for I/O for example), OS switches to another job. 5. WE DONT USE IT ANYMORE
54
What is time-sharing or multitasking?
allows multiple tasks or processes to run concurrently on a single CPU. This is achieved by rapidly switching between tasks, giving the illusion of simultaneous execution.
55
what are some criteria for multitasking?
1. response time should be less than 1 second 2. each user have at least one program running in the memory 3. CPU scheduling if multiple jobs are ready at the same time 4. if processes dont fit, swam them in and out 5. virtual memory allows execution of processes not completely in memory 6. time-sharing is used in PC operation systems
56
we say the OS is interrupt driven, what do we mean by this?
Hardware Interrupts: These are signals from hardware devices requesting immediate CPU attention. They handle tasks like servicing I/O device controllers and enforcing periodic timer interrupts for multitasking. Software Interrupts: These are initiated by software for tasks like error handling or requesting OS services. Examples include system calls for accessing OS functions and exceptions/traps for handling errors during program execution.
57
what does Dual-mode operation allows the OS to do?
it allows OS to protect itself and other system components
58
what are the two modes of the dual mode?
1. user mode 2. kernel mode
59
we can say that some CPU instructions are privileged, what do we mean by this?
it means that it will only be executed in kernel mode usually, certain memory region, may only be accessed in kernel mode
60
what do we mean by user mode?
user space, where user has access to
61
what do we mean by kernel mode?
it is what we call a supervisor mode and is a kernel space
62
what mode does each interrupt change to automatically?
kernel mode
63
what is the only way to switch to a kernel mode?
interrupts
64
how are system calls executed and what mode is the CPU automatically?
called by issuing a software interrupt it goes back to kernel mode
65
what is restricted in the user mode and by what?
Memory hardware restricts memory access in user mode.
66
we call it memory protection, what does it mean?
user process can only access its own memory, wild processes that cannot be overwritten any instructions and data of other processes and kernel
67
sometimes CPU have more than just two modes, what do we call them?
rings ring 0 has the kernel and is most privileged, ring 1 to ring x have increasingly less privileges
68
we know that the system call made by an application switches to kernel modem but what else?
each interrupt
69
an interrupt is raised by a I/O device controller, what does that mean?
the kernel needs to serve that I/O device controller computer hardware is designed to allow I/O controller can only be accessed in kernel mode but tehe that interrupts switches to kernel mode when its needed by kernel
70
explain the timer used by the multitasking:
we set the timer interrupt after a specific period Timer interrupt transfers control to operating system: OS gains control even if process is stuck in an infinite loop. CPU scheduling may take place and select next process to be executed.
71
what is a process?
A process is a program in execution. It is a unit of work within the system
72
what is a program?
A program is a passive entity (program file stored on mass storage device)
73
what entity is a process?
active entity
74
what does a process needs to accomplish its tasks?
resources: CPU, memory, I/O, files, initial data
75
what does process termination do?
it requires operating system to reclaim any reusable resources
76
what is a single threaded process?
a process that has one program counter specifying the location of next instructions to execute, processes execute instructions in a row one at the time until completion
77
what is a multi-threaded process?
has one counter per thread
78
what does a typical system usually has?
many processes, few users, one operating system running concurrently on one or more CPUs (by multi tasking)
79
Describe the components in a modern multiprocessor computer system
CPU, memory, bus, I/O controllers and Operating systems
80
Discuss how operating systems are used in various computing environment.
client server computing and web based computing
81
where do the instructions of a process have to be in order to execute processes?
main memory
82
where does the data of a process have to be during processing?
main memory
83
what is memory management?
it is deciding what is in the main memory when optimizing CPU and resource utilization and computer response to users
84
what are the roles of memory management?
1. Keeping track of which parts of main memory are currently being used and by whom 2. Deciding which processes (or parts thereof) and data to move into and out of main memory. 3. allocating and deallocating main memory space as needed
85
what is the speed of computer operations depend on?
disk subsystem and the operating systems algorithms and how they are managed
86
what are the low level mass storage management activities?
free space managements storage allocation disk scheduling
87
what is caching?
information in used that are copied from slower to faster level temporarily to be used over and over. when we need an information we check cache first if not we copy the data to cache and use
88
explain what caches are at different levels:
CPU is a cache for main memory Main memory is a cache for secondary storage Web browser is a cache for network transmission
89
what is protection within OS
any mechanism for controlling access of processes or users to resources defined by the OS
90
what is security?
defense of the system against internal and external attacks examples: viruses, identity theft, theft of service
91
how are operating systems protected?
by user identities, user id, group identifier and privilege escalation which allows users to change effective id with more rights
92
what are embedded systems?
Embedded systems are specialized computing systems built into devices or machinery to perform specific functions. They are characterized by their dedicated purpose, limited resources, and integration with hardware components example: cars, DVD. since they are not general purpose systems they have restricted hardware and no mass storage device, maybe lights and some buttons
93
how OS do embedded systems often run?
real time OS
94
real time operating systems must do something to not fail what is that?
being done within a defined time constraint
95
what are some examples of real time OS?
1. dustrial control system, 2. Traffic control system, 3. Medical systems, 4. Multi-media system (audio/video must be delivered in time to avoid stuttering)
96
what are some special purpose systems?
1. embedded systems 2. real time operating systems 3. mobile computing
97
explain mobile computing:
restricted hardware like computers support for power saving special user interface wireless limited storage capacity
98
what is another name for client server computing
distributed systems
99
what is meant by client server computing?
computers as servers and responding to requests generated by clients
100
what do compute-servers provide?
interface for the client to request services like database
101
what do file-servers provide?
interface for clients to store and retrieve files
102
what is web based computing?
Web-based computing delivers applications and services over the internet, enabling users to access software and data remotely via a web browser.
103
free and open source operating systems is?
operating systems whos source codes are accessible and modified and redistributed for free linux as an example
104
closed source operating system are?
only compiled binary available and only vendors can fix the bugs Microsoft Windows as an example
105
what is hybrid operating system?
Darwin OS kernel is open sourced, system programs and middle-ware are not
106
START Describe the general organization of a computer system and the role of interrupts
107
explain the process management activities of operating system:
1. Creating and deleting both user and system processes 2. Scheduling processes (and threads) on the CPUs 3. Suspending and resuming processes 4. Providing mechanisms for process synchronization 5. Providing mechanisms for process communication