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
Q

How does the device driver respond after the completion of an I/O operation?

A

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

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

What mechanism is used by the device controller to inform the device driver about the completion of its operation?

A

The device controller informs the device driver about the completion of its operation through an interrupt.

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

What purpose does an interrupt serve in the context of I/O operations?

A

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.

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

How are interrupts triggered in a computer system?

A

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.

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

What happens when the CPU is interrupted?

A

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.

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

Illustrate the transition from user mode to kernel mode

A

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.

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

How are interrupt service routines managed efficiently?

A

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.

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

What is the significance of saving and restoring the processor state during interrupt handling?

A

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.

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

Describe the basic mechanism of interrupts in a computer system.

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

What are the three features needed for interrupt handling in modern operating systems?

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

I/O devices and the CPU can execute ——

A

concurrently (at the same time)

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

Each device controller is in charge of a particular —–

A

device type

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

What storage component does each device controller possess for the data currently undergoing input or output?

A

Each device controller has a local buffer for the data that is currently subject to input or output.

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

How does the CPU transfer data between the local buffers of a device controller and main memory during input and output operations?

A

he CPU copies data via the bus between the local buffers of a device controller and main memory for inputting and outputting data.

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

Where does the actual input/output operation take place in a computer system?

A

The actual input/output operation occurs between the local buffer of the controller and the physical input/output device.

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

What action does an interrupt perform on the CPU’s execution flow?

A

An interrupt transfers control from any instruction currently executed by the CPU to the interrupt service routine.

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

What does an interrupt vector contain, and what purpose does it serve?

A

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.

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

Describe the process of handling interrupts

A

when interruption happen, the CPU executes the interrupt service routine. After completion of the routine, the CPU resumes the interrupted computation.

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

What does the interrupt architecture need to save when an interrupt occurs, and why?

A

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
Q

Why are interrupts of lower priority often disabled or masked when a higher-priority interrupt is being processed?

A

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
Q

What are the two main categories of interrupts, and what distinguishes them?

A

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
Q

an OS is —– driven

A

Interrupt

47
Q

what is a SW trap?

A

is a software generated interrupt cause by an error or a user/application program request

48
Q

what is one step that must happen before next interrupt?

A

the previous interrupt service routine must have finished

49
Q

what happens when interrupt is called before next one starts?

A

the previous I/O would not get completely processed and get lost

50
Q

what does I/O controller needs when an interrupt is raised?

A

it needs the data quickly or else data will get lost

51
Q

the role of interrupt handling in operating system:

A
  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
Q

how does the interrupt service routine preserves the state of the CPU?

A

by saving registers and the program counter and restores it afterwards

(typically already
saved by the CPU hardware when an interrupt is detected)

53
Q

what is multi programming?

A
  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
Q

What is time-sharing or multitasking?

A

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
Q

what are some criteria for multitasking?

A
  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
Q

we say the OS is interrupt driven, what do we mean by this?

A

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
Q

what does Dual-mode operation allows the OS to do?

A

it allows OS to protect itself and other system components

58
Q

what are the two modes of the dual mode?

A
  1. user mode
  2. kernel mode
59
Q

we can say that some CPU instructions are privileged, what do we mean by this?

A

it means that it will only be executed in kernel mode

usually, certain memory region, may only be accessed in kernel mode

60
Q

what do we mean by user mode?

A

user space, where user has access to

61
Q

what do we mean by kernel mode?

A

it is what we call a supervisor mode and is a kernel space

62
Q

what mode does each interrupt change to automatically?

A

kernel mode

63
Q

what is the only way to switch to a kernel mode?

A

interrupts

64
Q

how are system calls executed and what mode is the CPU automatically?

A

called by issuing a software interrupt
it goes back to kernel mode

65
Q

what is restricted in the user mode and by what?

A

Memory hardware restricts memory access in user mode.

66
Q

we call it memory protection, what does it mean?

A

user process can only access its own memory, wild processes that cannot be overwritten any instructions and data of other processes and kernel

67
Q

sometimes CPU have more than just two modes, what do we call them?

A

rings
ring 0 has the kernel and is most privileged,
ring 1 to ring x have increasingly less privileges

68
Q

we know that the system call made by an application switches to kernel modem but what else?

A

each interrupt

69
Q

an interrupt is raised by a I/O device controller, what does that mean?

A

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
Q

explain the timer used by the multitasking:

A

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
Q

what is a process?

A

A process is a program in execution. It is a unit of work within the system

72
Q

what is a program?

A

A program is a passive entity (program file stored on mass storage device)

73
Q

what entity is a process?

A

active entity

74
Q

what does a process needs to accomplish its tasks?

A

resources: CPU, memory, I/O, files, initial data

75
Q

what does process termination do?

A

it requires operating system to reclaim any reusable resources

76
Q

what is a single threaded process?

A

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
Q

what is a multi-threaded process?

A

has one counter per thread

78
Q

what does a typical system usually has?

A

many processes, few users, one operating system running concurrently on one or more CPUs (by multi tasking)

79
Q

Describe the components in a modern multiprocessor computer system

A

CPU, memory, bus, I/O controllers and Operating systems

80
Q

Discuss how operating systems are used in various computing environment.

A

client server computing and web based computing

81
Q

where do the instructions of a process have to be in order to execute processes?

A

main memory

82
Q

where does the data of a process have to be during processing?

A

main memory

83
Q

what is memory management?

A

it is deciding what is in the main memory when optimizing CPU and resource utilization and computer response to users

84
Q

what are the roles of memory management?

A
  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
Q

what is the speed of computer operations depend on?

A

disk subsystem and the operating systems algorithms and how they are managed

86
Q

what are the low level mass storage management activities?

A

free space managements
storage allocation
disk scheduling

87
Q

what is caching?

A

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
Q

explain what caches are at different levels:

A

CPU is a cache for main memory
Main memory is a cache for secondary storage
Web browser is a cache for network transmission

89
Q

what is protection within OS

A

any mechanism for controlling access of processes or users to resources defined by the OS

90
Q

what is security?

A

defense of the system against internal and external attacks

examples: viruses, identity theft, theft of
service

91
Q

how are operating systems protected?

A

by user identities, user id, group identifier and privilege escalation which allows users to change effective id with more rights

92
Q

what are embedded systems?

A

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
Q

how OS do embedded systems often run?

A

real time OS

94
Q

real time operating systems must do something to not fail what is that?

A

being done within a defined time constraint

95
Q

what are some examples of real time OS?

A
  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
Q

what are some special purpose systems?

A
  1. embedded systems
  2. real time operating systems
  3. mobile computing
97
Q

explain mobile computing:

A

restricted hardware
like computers
support for power saving
special user interface
wireless
limited storage capacity

98
Q

what is another name for client server computing

A

distributed systems

99
Q

what is meant by client server computing?

A

computers as servers and responding to requests generated by clients

100
Q

what do compute-servers provide?

A

interface for the client to request services like database

101
Q

what do file-servers provide?

A

interface for clients to store and retrieve files

102
Q

what is web based computing?

A

Web-based computing delivers applications and services over the internet, enabling users to access software and data remotely via a web browser.

103
Q

free and open source operating systems is?

A

operating systems whos source codes are accessible and modified and redistributed for free
linux as an example

104
Q

closed source operating system are?

A

only compiled binary available and only vendors can fix the bugs
Microsoft Windows as an example

105
Q

what is hybrid operating system?

A

Darwin OS kernel is open sourced, system programs and middle-ware are not

106
Q

START
Describe the general organization of a computer system and the role of interrupts

A
107
Q

explain the process management activities of operating system:

A
  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