Introduction to OS Flashcards
- a program that acts as an intermediary between a user of a computer and the computer hardware
- controls and coordinates use of hardware among various applications and users.
- is a resource allocator and control program making efficient use of HW and managing executing of user programs.
operating system
- execute user programs and make solving user problems easier.
- make the computer system convenient to use.
- use the computer hardware in an efficient manner.
OG goals
(computer system structure)
- provides basic computing resources
- CPU, memory, I/O devices
hardware
(computer system structure)
- define the ways in which the system resource are used to solve the computing problems of the users.
- word processors, compilers, web browsers, database systems, video games
- all programs not associated with the operating system.
application programs
(computer system structure)
- people, machines, other computers.
- want convenience, ease of use and good performance.
users
-mainframe or minicoputer must keep all users happy.
shared computer
the one program running at all times on the computer-part of the operating system.
kernel
-ships with the operating system, but not part of the kernel
system program
- today’s OS for general purpose and mobile computing also includes this.
- a set of software frameworks that provide addition services to application developers such as databases, multimedia, graphics.
middleware
- one or more CPUs, device controllers connect through common bus providing access to shared memory.
- concurrent execution of CPUs and devices competing for memory cycles.
computer-system operation
- is in charge of a particular device type
- has a local buffer.
- each type has an operating system device driver to manage it.
- informs CPU that it has finished its operation by causing an interrupt.
device controller
each device controller type has an operating system this to manage it
device driver
(common functions of interrupts)
-control to the interrupt service routine.
interrupt transfers
(common functions of interrupts)
-contains the addresses of all the service routines.
interrupt vector
(common functions of interrupts)
-must save the address of the interrupted instruction
interrupt architecture
(common functions of interrupts)
-is a software-generated caused either by an error or a user request.
trap/exception
(common functions of interrupts)
-an operating system is.
interrupt driven
- the operating system preserves that state of the CPU by storing the registers and the program counter.
- determienes which type of interrupt has occurred.
interrupt handling
types of interrupt
polling/vectored interrupt system
-determine what action should be taken for each type of interrupt.
separate segments of code
- after I/O starts, control returns to user program only upon I/O completion
- after I/O starts, control returns to user program without waiting for I.O completion.
two methods (for handling I/O)
-request the OS to allow user to wait for I/O completion
system call
- contains entry for each device I/O device indicating its type, address, and state
- OS indexes into I.O device table to determine device status and to modify table entry to include interrupt.
device-status update
- the computer cannot handle too many processes occurring simultaneously.
- all memory is being used up.
- too many threads.
hanging computer
- if the process is waiting for too long
- once the process has acquired the resources, it will not release it unless it is done with the execution.
starvation
-you are requesting for process that are waiting for you
>deadlock
>no release of resource and no acquiring of resource
>hanging
cyclical waiting
- copying information into faster storage system; main memory can be viewed as a cache for secondary storage
- important principle, performed at many levels in a computer (in hardware, operating system, software).
- information is use copied from slower to faster storage temporarily.
- faster storage (cache) checked first to determine if information is there.
- -its is, information used directly from the cache (fast).
- -if not, data copied to cache and used there.
caching
(I/O Structure)
-it will not proceed with the execution of the remaining code for the user programs without compleing the interrupt.
synchronous
- (I/O Structure)
- it will resume the operating of the CPU for the execution of user program without for I/O completion.
asynchronous
- CPU is running the user program and it processes I/O interrupts.
- If the I/O device is idle, the CPU is kept busy on the user program execution.
- every device in a computer system has an interrupt address or interrupt request.
interrupt timeline
(storage structure)
- only large storage media that the CPU can access directly.
- random access
- typically volatile-temporary storage, it requires power.
- typically random-access memory in the form of Dynamic Random-access memory (DRAM)
main memory
(storage structure)
-extension of main memory that provides large nonvolatile storage capacity.
secondary storage
(storage structure|secondary storage)
-rigid metal or glass platters overed with magnetic recording material
hard disk drives (HDD)
(storage structure|secondary storage|HDD)
-is logically divided into tracks, which are subdivided into sectors.
disk surface
(storage structure|secondary storage|HDD)
-determines the logical interaction between the device and the computer.
disk controller
(storage structure)
- faster than hard disks, nonvolatile
- various technologies
- becoming more popular as capacity and performace increases, price drops.
non-volatile memory (NVM)
(operating-system operations)
-simple code to initialize system, load the kernel
boostrap program
(operating-system operations)
-services provided outside of the kernel
system daemons
(operating-system operations)
- software error
- request for operating system service-system call
- other process problems include infinite loop, processes modifying each other or the operating system.
software interrupt
- Bootstrap Program
- Kernel Loads
- Starts system daemons
- Kernel interrupt driven
- -Hardware interrupt
- -Software interrupt
Operating-system operations
(multiprogramming)
- single user cannot always keep CPU and I/O devices busy
- 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 is selected and run via job scheduling
- when job has to wait (for I/O for example), OS switches to another job.
batch system
- I/O routine supplied by the system
- Memory management- they system must allocate memory to several jobs (also known as process for the program in execution)
- CPU scheduling (job scheduling)-the system must choose among the several jobs read to run.
- allocation of devices.
OS features needed for multiprogramming
(multitasking)
-a logical extension of Batch systems-the 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, swappingmoves them in and out to run
> Virtual memory allows execution of processes not completely in memory.
timesharing
-allows OS to protect itself and other system components.
>user mode and kernel mode
-Mode bit provided by hardware
-some instructions designated as provelaged, only executable in kernel mode.
dual-mode operation
- provides ability to distinguish when system is running user code or kernel mode.
- when a user is running -> is user
- when kernel code is execuitng -> is kernel
mode bit
(dual-mode operation)
- execution done on behalf of user
- the system is in this mode when the OS is running a user application (text editor).
user mode
(dual-mode operation)
- execution done on behalf of operating system
- the system starts with this mode when it boots and after the OS is loaded
- it executes the application in user mode
- there are some privilege instructions that can only be executed in kernel mode- these are interrupt instructions (I/O management, etc.)
- if privilege instruction is executed in user mode, it is illegal, and a trap is generated
kernel mode
-when the application requests the help of OS or an interrupt or a system call
transition from user mode to kernel mode
- is to prevent infinite loop (or porcess hogging resources)
- is set to interrupt the coputer after some time period.
- keep a counter that is decremented by the physical clock.
- operating system set the counter (priveleged instruction)
- when counter zero generate an interrupt.
- set up before scheduling process to regain control or terminate program that exceeds allotted time.
timer
(process management)
-program is not running
passive entity
(process managment)
- process
- program when it runs
active entity
(process management)
- has one program counter specifying location of next instructin to execute.
- -process executes instructions sequantially, one at a time, until completion.
single-threaded process
(process management)
-has one program counter per thread
multi-threaded process
- includes process creation and deletion
- there is provision of mechanism for process synchronization and process communication.
Activities:
>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.
process management
- to execute a program all (or pasrt) of the instructions must be in memory.
- all (or part) of the data that is needed by the program must be in memory.
- determines what is in memory and when
- -optimizing CPU utilization and computer response to users.
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.
memory management
- is a large array of words or bytes, each with its own address.
- it is a repository of quickly accessible data shared by the CPU and I/O devices.
memory
- OS provides uniform, logical view of information storage
- each medium is controlled by device (disk drive, tape drive)
- -varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)
- files usually organized intro directories.
- access control on most systems to determine who can access what.
Activites:
>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
file-system management
- abstract physical properties to logical storage unit
- is a collection of related information defined by its creator
- represent programs both source and object forms and data.
file
- 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 in disk subsystem and its algorithms
activities: >mounting and unmounting >free-space management >storage allocation >disk scheduling >partitioning >protection
mass-storage management
-multiprocessor environmentmust provide this in hardware such that all CPUs have the mmost recent value in their cache.
cache coherency
-one purpose of OS is to hide peculiarities of hardware devices from the user.
>memory management of I/O including buffering (storing data temporarily while it is being transferred), cahing (soring 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.
I/O subsystem
-anny mechanisms for controlling access of processes or users to resources defined by the OS.
protection
- defense of the system against internal and external attacks.
- -huge range, including denial-of-service, worms, viruses, identity theft, theft of service.
security
(protection & security)
- include name and associated number, one per user.
- then associated with all files, processes of that user to determine access control.
user ID
(protection and security)
-allows set of users to be defined and controls managed, then also asscoiated with each process, file.
group ID
(protection and security)
-allows user to change to effective ID with more rights
privilege escalation
- allows OS to run applications within other OSes
- OS natively compiled for CPU, running guest OSes also natively compiled.
- -consider VMware running WinXP guests, ech running application, all on native WinXp host OS.
- VMM= provides virtualization services.
virtualization
- use when source CPU type different from target types
- -generally slowest methos
- -when computer language not compiled to native code– Interpretation
emulation
- collection of separate, possibly heterogeneous, systems networked together.
- is a collection of processors that do not share memory or a clock.
- provides user access to various system resources, access to shared rsources allows computation speed up, data availability, and enhanced reliability.
distributed systems
-is a communications path, TCP/IP most common >LAN >WAN >MAN >PAN
network
- provides features between systems across netwwork
- communication scheme allows systems to exchange messages
- illusion of a single system
network operating system
-systems growing in use and importance
>also known as parallel systems, tightly-coupled systems
>advantages:
-increased throughput–faster execution but not 100% linear speed up
-economy of scale –peripherals, disks, memory shared among processors.
-increased reliability–graceful degradation or fault tolerance
multiprocessors
(multiprocessors)
-each processor is assigned a specie task.
asymmetric multiprocessing
(multiprocessors)
-each processor performs all tasks
symmetric multiprocessing
- multi-chip and multicore
- systems containing all chips
- -chassis containing multiple separate systems
- each core has their own register and cache
- both share l2 cache leading to the same memory
dual-core design
- one core could switch from one CPU to the next.
- CPU is accessing memory in non-uniform fashion.
non-uniform memory access system
- multiple systems working together
- usually sharing storage via a storage-area networ (SAN)
- provides a high-availability service which survives failures.
- some clusters are for high-performance computing (HPC)
- applications must be written to use parallelization
- some have distributed lock manager (DLM) to avoid conflicting operations
clustered systems
(clustered systems)
-has one machine in hot-standby mode
asymmetric clustering
(clustered systems)
-has multiple nodes running application, mobitoring each other.
symmetric clustering
-this board is fully-functioning computer, once its slots are populated. It consistsof a processor socket containing a CPU, DRAM sockets, PCle bus slots, and I/O connectors of various types. Even the lowest-cost general-purpose CPU conatins multiple cores. Some contains multiple processor sockets. More advanced computers allow more than one system bpard, creating NUMA systems.
PC Motherboard
(computing environments)
- stand-alone general-purpose machines
- but blurred as most systems interconnect with others (the internet)
- portals provde web access to internal systems
- network computers (thin clients) are like Web terminals
- mobile computers interconnect via wireless
- netowkring becoming ubiquitous-even home systems use firewalls to protect home computers from Internet attacks
Traditional
(computing environments)
- handheld smartphones, tablets, etc.
- what is the functional difference between them and a “traditional” laptop
- extra feature-more OS eatures (GPS, gyroscope)
- allows new types of appls like augmented reality
- use IEEE 802.11 wireless, or cellular data networs for connectivity
- leaders are Apple iOS and Google Android.
mobile
(computing environments)
- dumb terminals supplanted by smart PCs
- many systems now servers, responding requests generated by clients
- you have a server that caters the demands of the clients
client server
(computing envronments | client server)
-provides an interface to client to request services (i.e. database)
computer-server system
(computing envrionments | client server)
-provides interface for clients to store ad retreive files
file-server system
(computing envrionments)
- another model of distributed system
- P2P does not distinguish clients and servers
- instead all nodes are considered peers
- may each act as client, server or both
- node must join P2P network
- broadcast request for service and respond to requests for service via discovery protocol.
- examples: Napster and Gnutella, Voice over IP (VoIP) such as Skype
peer-to-peer
(computing envrionments)
- another model of distributed system
- P2P does not distinguish clients and servers
- instead all nodes are considered peers
- may each act as client, server or both
- node must join P2P network
- broadcast request for service and respond to requests for service via discovery protocol.
- examples: Napster and Gnutella, Voice over IP (VoIP) such as Skype
peer-to-peer
(computing envrionments)
- 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, petabyte of storage available across the internet, pay based on usage
cloud computing
(computing envrionments | cloud computing)
-available via internet to anyone willing to pay
public cloud
(computing envrionments | cloud computing)
-run by a company for the company’s own use
private cloud
(computing envrionments | cloud computing)
-includes both public and private cloud components
hybrid cloud
(computing envrionments | cloud computing)
-one or more applications available via the internet (i.e., word processor)
software as a service (SaaS)
(computing envrionments | cloud computing)
-software stack ready for application use via the Internet (i.e., a database server)
platform as a service (PaaS)
(computing envrionments | cloud computing)
-servers or storage available over Internet (i.e., storage avaiable for backup use)
infrastructure as a service (IaaS)