TEST 1 - Unit 1 & 2 Flashcards
What is Operating System?
A program that acts as an intermediary between a user of a computer and the computer hardware
Definition of OS
(Functions/Characteristics/Roles)
- OS is a resource allocator
- it manages all resources
- decides between conflicting requests for efficient and fair resource use - OS is a control program
- control program executions to prevent errors and improper use of the computer
What are the GOALS of OS?
- make computer system convenient to use
- execute programs & make solving user problems easier
What are the computer system components?
- hardware
- operating system
- application programs
- users
Explain each computer system components and provide examples.
- HARDWARE provides basic computing resources.
- CPU, memory, I/O devices - OS controls and coordinates use of hardware among various applications and users
- Linux, macOS, Microsoft Windows - APPLICATION PROGRAMS are software applications that perform specific tasks or functions for users.
- compilers, video games, database systems - USERS are Users are individuals or entities who interact with the computer system to perform tasks and utilize software.
- people, machines, other computers
What is “kernel”?
A computer program that runs at all times
What are the two types of boot processes?
- Hard (cold) boot
- powering on the computer when it’s completely turned off - Soft (warm) boot
- restart while the computer is still powered but unresponsive
What are the 4 steps in Boot Process?
- Startup BIOS runs POST and assigns resources
- ROM BIOS startup program searches and loads an OS
- OS configures the system and completes its own loading
- Application software is loaded and executed
Explain Computer System Operations.
- in a comp system, one or more CPUs and device controllers are interconnected through a common bus
- this architecture allows them to
-> access shared memory
-> enabling the concurrent
execution of CPUs and devices
What are the 4 basic components of computer system?
- Processor
- Main Memory
- I/O Modules
- System Bus
What are INTERRUPTS?
Events that pause the normal sequence sequence of proessor
Why do Interrupts exist?
- I/O devices are slower than the processor.
- they allow the processor to continue other tasks while waiting for I/O operations to finish
What are the 4 classes of interrupts?
- Program
- generated when something goes wrong during instruction execution or accessing memory you’re not supposed to - Timer
- generated by a timer within processor
- allows OS to perform certain functions on a regular basis - I/O
- generated by an I/O controller
- signaling they have completed or require attention - Hardware Failure
- generated by a failure such as power failure or memory parity failure
Common Fucntions of Interrupts
- Transfer Control
- interrupts transfer control to specific interrupt service routines through an interrupt vector - Address Preservation
- interrupt architecture must save the address of the interrupted instruction - Interrupt Management
- new interrupts are disabled while another interrupt is being processed to prevent lost interrupt - Traps
- a software-generated interrupt caused either by and error or a user request - OS is interrupt driven
What is Interrupt Handling?
the process of managing interruptions in a computer’s normal operation
Explain about Interrupt Handling.
- CPU stops its current tasks when interrupted and immediately transfers execution to a fixed location
- OS saves the CPU’s state
- It identifies the type of interrupt occurred
- Separate segments of code are used to respond appropriately to each type of interrupt
Explain Interrupt Cycle
Processor checks for interrupt;
- If no interrupts fetch, next instruction of the program is executed
- If an interrupt is pending, suspend execution of the current program and execute interrupt handling
What are the 2 types of I/O Structure and their difference(s)?
Synchronous and Asynchronous
In synchronous I/O, control returns to user program only upon I/O completion while in Asynchronous IO, control returns to user program without waiting for I/O completion
What is Uniprogramming?
processor must wait for I/O instruction to complete before preceding
(1 program at a time)
What is Multiprogramming?
when one job needs to wait for I/O, the processor can switch to the other job
(allows multiple programs to be loaded into the computer’s memory at the same time)
What’s the importance of Multiprogramming?
it’s needed for efficiency
- single user cant keep CPU and I/O devices busy all the time
- MP organizes jobs 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, OS switches to another job
What is Job Scheduling?
to choose which job is the priority/more important
What is Time Sharing?
a logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing
What is the concept of Time Sharing?
- use Multiprogramming to handle multiple interactive jobs
- allows multiple users to share a single computer’s resources simultaneously by dividing CPU time into small slices.
Features of Time Sharing.
- Response Time - should be <1 sec
- Process - each user has at least one program executing in memory
- CPU Scheduling - if several jobs ready to run at the same time
- Virtual Memory - allows execution of processes not completely in memory
What are the issues in Time Sharing?
- User Behavior and Hacking
users attempt to manipulate the system to get more CPU time - Resources Utilization
users often spent time in an idle state than actively using computer resources - Complex Memory Hierarchy
What is an example of Time-Sharing?
Compatible Time Sharing System (CTSS)
PLACEHOLDAHHH
NEXT IS CHAPTER 2
Definition of Process
- a program in execution
- an instance of a program running on a computer
What are the elements of Process?
- Identifier - unique to the process
- State - running or not running
- Priority - relative to other processes
- Program counter - address of next instruction in the process
- Memory pointers - to program code
- Context Data - data in the registers while process is executing
- I/O status information - outstanding I/O requests
- Accounting information - amount of processor time used
What are the the process state models used in OS?
- Two-State Process Model
- Five-State Process Model
What is Two-State Process Model?
Process can be in one of 2 states;
- running
- not running
Explain the 2 states.
Running
- process is actively executing and utilizing the PU
Not Running
- ready to execute but is waiting for I/O
What is Five-State Process Model?
- a more detailed representation of process state
- is commonly used in modern multitasking OS
Explain the 5 states.
- Run - currently executing
– not running –
2. Ready - prepared to execute
- Blocked - cant execute until some event occurs
- New - just created, not loaded into MM
- Exit - process has completed its executed and is being terminated
What are the Five-State Model transitions? There are 9.
- NULL - NEW
a new process is created for various reasons - NEW – READY
OS prepared to accept an additional process - READY – RUNNING
scheduled for execution - RUNNING - EXIT
the currently running process is terminated if it has signaled its completion - RUNNING – READY
its time quantum for execution has expired - RUNNING – BLOCKED
it requests some data that is not immediately available - BLOCKED – READY
the event was waiting for has occured - READY – EXIT
- BLOCKED – EXIT
What is Suspended Process?
Process that has been temporarily halted from execution.
- processor is faster than I/O so all processors could be waiting for I/O
- swap these processors to disk to free up more memory
- blocked state becomes suspend state when swapped to disk
2 new states in Suspended Processes
- Blocked/Suspend
- Ready/Suspend
What are the reasons for Process Suspension?
- Swapping
OS needs to release sufficient MM to bring in process that is ready to execute - Other OS reasons
OS may suspend a process that is suspected of causing problems - Interactive User Request
for purposes of debugging
What is Multithreading?
distribution of instructions of a single process into multiple, concurrent execution paths
eg, Windows, Linux, Solaris
2 Primary types of Multithreading
- User-Level Threads (ULTs)
- Kernel-Level Threads (KLTs)
User-Level Threads (ULTs)
- all thread management is done by the application
- kernel is not aware of the existence of threads
What does threads library contains of in ULTs?
contains codes to
- create and destroy threads
- pass messages and data between threads
- schedule thread execution
- save and restore thread context
Kernel-Level Threads (KLTs)
- kernel maintains context info for the process and the threads
- scheduling is done on a thread basis
eg, Windows
INCLUDE ADVAN DISADVAN OF ALL APPROACH ANDDD THREADS IN WORDS LATERRR
INCLUDE DIAGRAMS TOO
Combined Approach
- combine the approaches of ULTs and KLTs
- thread creation done in the user space
- bulk of scheduling and synchronization of threads within application