Lecture 1 Flashcards

1
Q

What is an Operating System?

A

A program that acts as an intermediary between a user of a computer and
the computer hardware.

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

What is operating systems goals?

A

• Execute user programs and make solving user problems easier
• Make the computer system convenient to use
• Use the computer hardware in an efficient manner

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

Explain the four components of the computer system?

A

->Computer system can be divided into four components:
• Hardware – provides basic computing resources
• CPU, memory, I/O devices
• Operating system
• Controls and coordinates use of hardware among various applications and users
• Application programs – define the ways in which the system resources are used to
solve the computing problems of the users
• Word processors, compilers, web browsers, database systems, video games
• Users
• People, machines, other computers

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

Explain the definitions of the operating system:

• OS is a resource allocator

• OS is a control program

A

-> OS is a resource allocator:
• Manages all resources
• Decides between conflicting requests for efficient and fair
resource use

-> OS is a control program:
• Controls execution of programs to prevent errors and improper
use of the computer

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

What is Kernel?

A

-> “The one program running at all times on the computer” is the kernel.
• Everything else is either
• a system program (ships with the operating system) , or
• an application program.

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

What is bootstrap program and Where is it stored?

A

-> bootstrap program is loaded at power-up or reboot
• Typically stored in ROM or EPROM, generally known as firmware
• Initializes all aspects of system
• Loads operating system kernel and starts execution

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

How CPU access the shared memory?

A

• One or more CPUs, device controllers connect through common bus providing
access to shared memory

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

Can I/O devices and the CPU can execute concurrently?

A

I/O devices and the CPU can execute concurrently

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

How the device controller informs the CPU that it has finished its operation?

A

Device controller informs CPU that it has finished its operation by causing
an interrupt

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

Interrupt transfers control to the interrupt service routine generally,
through the ………. ………., which contains the addresses of all the
………. ……….. .

A

Interrupt transfers control to the interrupt service routine generally,
through the interrupt vector, which contains the addresses of all the
service routines

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

What is a Trap or Exeption?

A

A trap or exception is a software-generated interrupt caused either by an
error or a user request.

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

How the operating system preserves the state of the CPU?

A

• The operating system preserves the state of the CPU by storing registers
and the program counter

Determines which type of interrupt has occurred:
• polling
• vectored interrupt system

• Separate segments of code determine what action should be taken for each
type of interrupt

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

• Main memory?

A

Main memory – only large storage media that the CPU can access directly
• Random access
• Typically volatile

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

Secondary storage?

A

Secondary storage – extension of main memory that provides large
nonvolatile storage capacity

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

Hard disks?

A

Hard disks – rigid metal or glass platters covered with magnetic recording
material
• Disk surface is logically divided into tracks, which are subdivided into sectors
• The disk controller determines the logical interaction between the device and the computer

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

Solid-state disks?

A

• Solid-state disks – faster than hard disks, nonvolatile
• Various technologies
• Becoming more popular

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

Storage systems organized in hierarchy write down what are they?

A

Storage systems organized in hierarchy
• Speed
• Cost
• Volatility

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

Caching?

A

Caching – copying information into faster storage system; main memory can
be viewed as a cache for secondary storage

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

Device Driver?

A

Device Driver for each device controller to manage I/O
• Provides uniform interface between controller and kernel

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

Faster storage (………) checked first to determine if information is there

• If it is, information used directly from the …….. (fast)
• If not, data copied to …….. and used there

A

Cache

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

What is multi programming (Batch system)?

A

Multiprogramming : Multiprogramming operating system allows to execute multiple processes by monitoring their process states and switching in between processes. It executes multiple programs to avoid CPU and memory underutilization. It is also called as Multiprogram Task System.

• Single user cannot keep CPU and I/O devices busy at all times
• Multiprogramming organizes jobs (code and data) so CPU always has one to execute
• A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When it has to wait (for I/O for example), OS switches to another job

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

What is Timesharing (multitasking)?

A

Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can
interact with each job while it is running, creating interactive computing.

• Response time should be < 1 second

• Each user has at least one program executing in memory ->process

• If several jobs ready to run at the same time -> CPU scheduling

• If processes don’t fit in memory, swapping moves them in and out to run

• Virtual memory allows execution of processes not completely in memory

23
Q

What is mean interrupt driven(Hardware and software)?

A

->If the CPU works on other tasks while awaiting an interrupt from the device’s control register, this is called interrupt-driven I/O.

-Interrupt driven (hardware and software)
- Hardware interrupt by one of the devices
• Software interrupt (exception or trap):
• Software error (e.g., division by zero)
• Request for operating system service
• Other process problems include infinite loop, processes modifying each other or the operating system

24
Q

What is dual mode?

A

->Dual-mode operation allows OS to protect itself and other system components
-User mode and kernel mode
- Mode bit provided by hardware
• Provides ability to distinguish when system is running user code or kernel code
• Some instructions designated as privileged, only executable in kernel mode
• System call changes mode to kernel, return from call resets it to user

I… Dual Mode in OS is the switching of modes between the two modes and switching of mode by the OS for computation of process by system. Dual Mode is responsible for the management of processes and avoiding any system crashes.

25
What is user mode?
The OS mode in which all the user applications and programs will run. Here, the user instructions are worked on and softwares like playing music is run.
26
What is Kernel mode?
The OS mode in which the hardware loads and its computations are performed. Only privileged instructions are allowed to run in kernel mode. Some common privileged instructions are − -Input-Output Management -Switching modes between user mode and kernel mode. -Interrupt management
27
How the transition from user mode to kernel mode happens?
• Timer to prevent infinite loop / process hogging resources • Timer is set to interrupt the computer after some time period • Keep a counter that is decremented by the physical clock. • Operating system set the counter (privileged instruction) • When counter zero generate an interrupt • Set up before scheduling process to regain control or terminate program that exceeds allotted time
28
What is a process?
A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. -> Process needs resources to accomplish its task • CPU, memory, I/O, files • Initialization data • Process termination requires reclaim of any reusable resources • Single-threaded process has one program counter specifying location of next instruction to execute • Process executes instructions sequentially, one at a time, until completion • Multi-threaded process has one program counter per thread • Typically system has many processes, some user, some operating system running concurrently on one or more CPUs • Concurrency by multiplexing the CPUs among the processes / threads
29
Which activities that OS is responsible for process management?
• Creating and deleting both user and system processes • Suspending and resuming processes • Providing mechanisms for process synchronization • Providing mechanisms for process communication • Providing mechanisms for deadlock handling
30
Memory management?
• To execute a program all (or part) of the instructions must be in memory • All (or part) of the data that is needed by the program must be in memory. • Memory management determines what is in memory and when • Optimizing CPU utilization and computer response to users • Memory management activities • Keeping track of which parts of memory are currently being used and by whom • Deciding which processes (or parts thereof) and data to move into and out of memory • Allocating and deallocating memory space as needed
31
Explain the Storage management in detail.
• OS provides uniform, logical view of information storage • Abstracts physical properties to logical storage unit - file • Each medium is controlled by device (i.e., disk drive, tape drive) • Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random).
32
Explain the File-System management in detail?
• Files usually organized into directories • Access control on most systems to determine who can access what • OS activities include • Creating and deleting files and directories • Primitives to manipulate files and directories • Mapping files onto secondary storage • Backup files onto stable (non-volatile) storage media
33
How mass storage management works?
• Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time • Proper management is of central importance • Entire speed of computer operation hinges on disk subsystem and its algorithms • OS activities • Free-space management • Storage allocation • Disk scheduling • Some storage need not be fast • Tertiary storage includes optical storage, magnetic tape • Still must be managed – by OS or applications • Varies between WORM (write-once, read-many-times) and RW (read-write)
34
Explain the I/O Subsystem?
• One purpose of OS is to hide peculiarities of hardware devices from the user • I/O subsystem responsible for • Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs) • General device-driver interface • Drivers for specific hardware devices
35
Protection and Security Explain what is protection?
Protection – any mechanism for controlling access of processes or users to resources defined by the OS.
36
Protection and Security Explain the security?
• Security – defense of the system against internal and external attacks • Huge range, including denial-of-service, worms, viruses, identity theft, theft of service. • Systems generally first distinguish among users, to determine who can do what • User identities (user IDs, security IDs) include name and associated number, one per user • User ID then associated with all files, processes of that user to determine access control • Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file • Privilege escalation allows user to change to effective ID with more rights
37
Explain the Computing environments Virtualization.
• Allows operating systems to run applications within other OSes • Vast and growing industry • Emulation - used when source CPU type different from target type (i.e. PowerPC to Intel x86) • Generally slowest method • When computer language not compiled to native code – Interpretation • Virtualization – OS natively compiled for CPU, running guest OSes also natively compiled • Consider VMware running WinXP guests, each running applications, all on native WinXP host OS • VMM (virtual machine Manager) provides virtualization services
38
What is emulation is used for?
• Emulation used when source CPU type different from target type (i.e. PowerPC to Intel x86) • Generally slowest method • When computer language not compiled to native code – Interpretation
39
What is Virtualization?
Virtualization – OS natively compiled for CPU, running guest OSes also natively compiled • Consider VMware running WinXP guests, each running applications, all on native WinXP host OS • VMM (virtual machine Manager) provides virtualization services
40
Explain the cloud computing?
-> Delivers computing, storage, even apps as a service across a network -> Logical extension of virtualization because it uses virtualization as the base for it functionality. • Amazon EC2 has thousands of servers, millions of virtual machines, petabytes of storage available across the Internet, pay based on usage • Many types • Public cloud – available via Internet to anyone willing to pay • Private cloud – run by a company for the company’s own use • Hybrid cloud – includes both public and private cloud components • Software as a Service (SaaS) – one or more applications available via the Internet (i.e., word processor) • Platform as a Service (PaaS) – software stack ready for application use via the Internet (i.e., a database server) • Infrastructure as a Service (IaaS) – servers or storage available over Internet (i.e., storage available for backup use)
41
Explain the Real-Time Embedded Systems?
• Real-time embedded systems most prevalent form of computers • Vary considerable, special purpose, limited purpose OS, real-time OS • Use expanding • Many other special computing environments as well • Some have OSes, some perform tasks without an OS • Real-time OS has well-defined fixed time constraints • Processing must be done within constraint • Correct operation only if constraints met
42
Operating systems provide an environment for execution of programs and services to programs and users. Explain the user interface?
• One set of operating-system services provides functions that are helpful to the user: • User interface - Almost all operating systems have a user interface (UI). • Varies between Command-Line (CLI), Graphics User Interface (GUI), Batch
43
One set of operating-system services provides functions that are helpful to the user (Cont.): Explain the File-system manipulation?
• File-system manipulation - The file system is of particular interest. Programs need to read and write files and directories, create and delete them, search them, list file Information, permission management.
44
One set of operating-system services provides functions that are helpful to the user (Cont.): Explain communications?
• Communications – Processes may exchange information, on the same computer or between computers over a network • Communications may be via shared memory or through message passing (packets moved by the OS
45
One set of operating-system services provides functions that are helpful to the user (Cont.): Explain the error detection?
-> Error detection – OS needs to be constantly aware of possible errors • May occur in the CPU and memory hardware, in I/O devices, in user program • For each type of error, OS should take the appropriate action to ensure correct and consistent computing • Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system
46
• Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing Explain the resource allocation?
• Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them • Many types of resources - CPU cycles, main memory, file storage, I/O devices.
47
• Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing Explain the Accounting?
Accounting - To keep track of which users use how much and what kinds of computer resources
48
• Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing Explain the Protection and Security?
• Protection and security - The owners of information stored in a multiuser or networked computer system may want to control use of that information, concurrent processes should not interfere with each other • Protection involves ensuring that all access to system resources is controlled • Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts
49
Operating systems provide an environment for execution of programs and services to programs and users. Explain the program execution?
• Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error)
50
Operating systems provide an environment for execution of programs and services to programs and users. Explain the I/O operations?
I/O operations - A running program may require I/O, which may involve a file or an I/O device
51
User Operating System Interface - CLI Explain the CLI or command interpreter?
CLI or command interpreter allows direct command entry • Sometimes implemented in kernel, sometimes by systems program • Sometimes multiple flavors implemented – shells • Primarily fetches a command from user and executes it • Sometimes commands built-in, sometimes just names of programs • If the latter, adding new features doesn’t require shell modification
52
User Operating System Interface - GUI Explain the GUI?
• User-friendly desktop metaphor interface • Usually mouse, keyboard, and monitor • Icons represent files, programs, actions, etc • Various mouse buttons over objects in the interface cause various actions (provide information, options, execute function, open directory (known as a folder) • Invented at Xerox PARC • Many systems now include both CLI and GUI interfaces • Microsoft Windows is GUI with CLI “command” shell • Apple Mac OS X is “Aqua” GUI interface with UNIX kernel underneath and shells available • Unix and Linux have CLI with optional GUI interfaces (CDE, KDE, GNOME)
53
Explain the System Calls?
• Programming interface to the services provided by the OS • Typically written in a high-level language (C or C++) • Mostly accessed by programs via a high-level Application Programming Interface (API) rather than direct system call use • Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) Note that the system-call names used throughout this text are generic