Podcast
Questions and Answers
A processor instruction cycle only involves fetching, decoding, and executing instructions.
A processor instruction cycle only involves fetching, decoding, and executing instructions.
True (A)
In processor user mode, the processor can execute any instruction in its complete instruction set and reference any memory address.
In processor user mode, the processor can execute any instruction in its complete instruction set and reference any memory address.
False (B)
The system bus connects the processor, main memory, and I/O devices, linking all components of a computer.
The system bus connects the processor, main memory, and I/O devices, linking all components of a computer.
True (A)
An operating system primarily functions to complicate the management and use of the computer, ensuring inefficiency.
An operating system primarily functions to complicate the management and use of the computer, ensuring inefficiency.
When a computer is turned on, the CPU starts by loading the operating system directly without any preliminary steps.
When a computer is turned on, the CPU starts by loading the operating system directly without any preliminary steps.
Hardware interrupts do not cause the CPU to execute operating system code.
Hardware interrupts do not cause the CPU to execute operating system code.
Interrupt Descriptor Tables are used to set the PC to return to user mode after an interrupt is handled.
Interrupt Descriptor Tables are used to set the PC to return to user mode after an interrupt is handled.
A single-tasking operating system can manage multiple processes simultaneously.
A single-tasking operating system can manage multiple processes simultaneously.
Type 1 hypervisors run on top of an existing operating system, while Type 2 hypervisors run directly on the hardware.
Type 1 hypervisors run on top of an existing operating system, while Type 2 hypervisors run directly on the hardware.
The POSIX standard is a Microsoft implementation for API development.
The POSIX standard is a Microsoft implementation for API development.
Monolithic operating systems are easy to modify due to their modular design.
Monolithic operating systems are easy to modify due to their modular design.
In the 1970s, Unix became successful partly because it was written in C, facilitating portability across different computers.
In the 1970s, Unix became successful partly because it was written in C, facilitating portability across different computers.
In a monolithic OS, there is generally better performance due to the more complicated design.
In a monolithic OS, there is generally better performance due to the more complicated design.
A process is a static set of instructions, while a program is a dynamic entity in execution.
A process is a static set of instructions, while a program is a dynamic entity in execution.
The Process Control Block (PCB) does not save the state of a process.
The Process Control Block (PCB) does not save the state of a process.
A process in the 'Blocked' state is running in the CPU, executing instructions.
A process in the 'Blocked' state is running in the CPU, executing instructions.
In process state transitions, the system chooses one of the processes in the ready state to carry out execution.
In process state transitions, the system chooses one of the processes in the ready state to carry out execution.
Context switching involves saving the PC and PSW, but not necessarily the rest of the CPU registers.
Context switching involves saving the PC and PSW, but not necessarily the rest of the CPU registers.
Interrupts can only cause a process switch if the current process needs to wait for a operation.
Interrupts can only cause a process switch if the current process needs to wait for a operation.
Threads do not each have their own stack.
Threads do not each have their own stack.
With User Level Threads (ULTs), the OS kernel is aware of the individual threads.
With User Level Threads (ULTs), the OS kernel is aware of the individual threads.
Short-term scheduling is responsible for suspending processes and moving them to secondary memory.
Short-term scheduling is responsible for suspending processes and moving them to secondary memory.
In a FIFO scheduling algorithm, processes are organized for execution in a first-in, first-out queue.
In a FIFO scheduling algorithm, processes are organized for execution in a first-in, first-out queue.
Static priority scheduling can automatically adapt to changes in the system environment, avoiding starvation.
Static priority scheduling can automatically adapt to changes in the system environment, avoiding starvation.
Symmetric multiprocessing involves dedicating one processor solely to running the operating system.
Symmetric multiprocessing involves dedicating one processor solely to running the operating system.
When an interrupt occurs, the hardware automatically raises the processor level from user mode to kernel mode.
When an interrupt occurs, the hardware automatically raises the processor level from user mode to kernel mode.
In order to achieve concurrency, multiple processors or cores are required.
In order to achieve concurrency, multiple processors or cores are required.
Independent concurrent processes require assistance or cooperation of other processes.
Independent concurrent processes require assistance or cooperation of other processes.
Deadlock can be resolved with dynamic avoidance through careful resource allocation.
Deadlock can be resolved with dynamic avoidance through careful resource allocation.
A mutex is a mechanism that limits the number of threads concurrently accessing a resource to one.
A mutex is a mechanism that limits the number of threads concurrently accessing a resource to one.
Flashcards
Program
Program
Instructions to be executed by a computer to solve a problem.
Process
Process
Result of the execution of a program.
Processor Instruction Cycle
Processor Instruction Cycle
Fetch, Decode, Execute operations that a processor can perform.
Hardware Interrupt
Hardware Interrupt
Signup and view all the flashcards
TRAP Instruction
TRAP Instruction
Signup and view all the flashcards
Processor user mode
Processor user mode
Signup and view all the flashcards
Processor kernel mode
Processor kernel mode
Signup and view all the flashcards
Processor
Processor
Signup and view all the flashcards
Main memory
Main memory
Signup and view all the flashcards
I/O devices
I/O devices
Signup and view all the flashcards
System Bus
System Bus
Signup and view all the flashcards
Operating System
Operating System
Signup and view all the flashcards
OS Booting and Activation
OS Booting and Activation
Signup and view all the flashcards
Interrupt management
Interrupt management
Signup and view all the flashcards
Types of OS
Types of OS
Signup and view all the flashcards
VM Operating system
VM Operating system
Signup and view all the flashcards
Hypervisor
Hypervisor
Signup and view all the flashcards
Type 1 hypervisor
Type 1 hypervisor
Signup and view all the flashcards
Type 2 hypervisor
Type 2 hypervisor
Signup and view all the flashcards
Components of the OS
Components of the OS
Signup and view all the flashcards
Interfaces provided by OS
Interfaces provided by OS
Signup and view all the flashcards
Monolithic Operating Systems
Monolithic Operating Systems
Signup and view all the flashcards
Structured Operating Systems
Structured Operating Systems
Signup and view all the flashcards
Distributed Operating Systems
Distributed Operating Systems
Signup and view all the flashcards
Computer
Computer
Signup and view all the flashcards
Process
Process
Signup and view all the flashcards
Scheduling
Scheduling
Signup and view all the flashcards
Fragmentation
Fragmentation
Signup and view all the flashcards
Virtual memory
Virtual memory
Signup and view all the flashcards
Paging
Paging
Signup and view all the flashcards
Study Notes
Unit 1: Introduction
- A program consists of instructions executed by a computer to solve a problem.
- A process represents the result of a program's execution.
- The processor instruction cycle involves fetching, decoding, and executing instructions.
- Hardware interrupts signal the processor to deviate from its normal instruction cycle and jump to another instruction.
- A TRAP instruction is a processor instruction that triggers an interrupt upon execution.
- Processor user mode restricts certain actions, such as accessing the complete instruction set or all memory space.
- Processor kernel mode allows unrestricted execution and memory access.
Parts of a Computer
- The processor performs computations, executes instructions, and stores information in registers.
- Main memory stores data and programs.
- I/O devices connect the computer to the external world.
- The system bus connects all hardware components.
Operating System Concepts
- An operating system (OS) simplifies computer management, enhances safety and efficiency as well as coordinates hardware components.
- The OS acts as an interface between user applications and hardware.
- The OS manages hardware resources, coordinates operations, optimizes results, and handles user requests.
OS Booting and Activation
- When a computer starts, the CPU jumps to a specific memory address containing a program.
- Initial tasks during boot include checking the hardware configuration and its state.
- An important part is the loading of the operating system.
- The OS launches a user interface enabling program execution.
- The OS retakes control when an application ends, attempts illegal operations, requires special OS functions, or when a device needs attention.
- Interrupts handle all situations requiring OS intervention.
Interrupt Management
- The CPU jumps to specific OS code when an interrupt occurs.
- The process involves saving the Program Counter (PC) and Status register, using the Interrupt Vector Table to find the new PC value, switching to kernel mode, and executing the interrupt handling routine.
- The original process may be resumed by restoring stored PC and Status register values and returning to user mode.
Types of OS
- OS types include single-tasking/multitasking, single-process/multiprocessing, single-user/multiuser, interactive/batch, uniprocessor/multiprocessor, embedded, real-time, and mobile.
- VM Operating systems create virtual machines, emulating a computer to run multiple systems, even with different OSs, to optimize CPU use.
- A hypervisor creates and manages virtual machines and there are 2 types:
- Type 1 hypervisors run directly on hardware, and “Bare metal” includes VMware ESX/ESXi, Microsoft Hyper-V, Citrix XENServer, and Oracle VM.
- Type 2 hypervisors run on an OS, such as VMware Server/Player/Workstation, Microsoft Virtual PC, Citrix Xendesktop, and Oracle Virtual Box.
Components of the OS
- Components of the OS include process, device, memory, and file management systems, along with security and protection mechanisms.
Interfaces Provided by the OS
- OS provides interfaces through APIs (Application programming interface) for application developers, such as the POSIX standard for Unix-like systems.
- Command-line interfaces (CLIs), and command files or shell scripts (e.g., Bourne in Unix, Cmd-line, Jscript, Windows PowerShell).
- Graphical user interfaces (GUIs).
Design of the OS
- Different OS such as Monolithic Operating Systems have functionality integrated into a single program running in kernel mode while, Structured Operating Systems are organized in layers (e.g., Microkernel, Hybrid).
- Distributed Operating Systems are pure or include middleware.
Evolution of OS:
- Early systems progressed from serial processing to simple batch, then to multiprogrammed batch, time-sharing, and personal computers.
Operating System Evolution by Period
- 1940s Prehistory: Serial processing on Von Neumann architecture using vacuum tubes such as ENIAC (1943).
- 1950s 1st Generation: Resident monitors, loading/executing programs, processing batch jobs, I/O routines, error recovery and control language on Transistors such as IBSYS (IBM) with Assembler, FORTRAN, and COBOL languages.
- 1960s 2nd Generation: Performance improvements, multiprogramming, interactive multiuser timesharing and real time processing on Integrated Circuits such as CTSS (IBM 7090) with BASIC and ALGOL languages.
- 1970s: General-purpose OS: Dissemination of multiuser timesharing such as Unix from ATT Bell Laboratories on PDP-7,11 with C language implementation.
- 1980s: Simplification of the OS: Importance of the user such as UNIX, MS-DOS Windows, Amiga.
- 1990s: Free Operating Systems: Real-time Operating Systems such as Linux (91) FreeBSD.
- Present and future Operating systems: Embedded operating systems sucha as Linux (RedHat) Windows Longhorn
QUIZ OS Definitions
- An OS cannot be defined as a Naked Machine, rather its purpose is to "dress" the bare machine and convert it into an extended virtual machine.
- An OS resource manager controls resources of the system (hardware and software).
- An OS is a service provider, managing resources and offering services.
- An OS acts as an intermediary between hardware and user, executing user commands.
- The OS runs in kernel mode when activated.
- Syscalls are initiated by programs through API functions, while hardware devices trigger interrupts.
- Hardware exceptions are internal interrupts and activate the OS in privilege mode.
- API functions are callable system services invoked by programs, while shell commands are user programs utilizing API functions.
- Dual mode operation prevents unauthorized access to resources, enhancing security at the cost of computational overhead.
- Type 1 hypervisors do not require an underlying OS to create virtual machines, unlike Type 2.
- Single tasking is determined by the number of simultaneous processes, while single processors are determined by the number of managed processors.
- General-purpose operating systems are used on PCs, in contrast to embedded systems with a specific purpose.
- The user interface layer of the OS receives and executes user requests.
- Different operating systems offer different APIs and user interfaces.
- Batching in first-generation OSs involved sequential execution without intervention.
- Unix in the 70s, implemented in C, was successful due to its portability, and GUIs/networking were introduced in the 80s and the performance of pure microkernel systems bad performace
Process and Execution Modes
- A computer executes programs, consisting of a set of instructions that solve problems.
- Steps in the processor execution cycle include initialization, fetch, decode, read, and execute.
- Trap Instruction generates an interrupt when executed: The CPU can operate in user or kernel mode, with kernel mode having unrestricted access.
- An operating system facilitates computer use and manages components.
- Data stored in the Instruction Register and general purpose registers and it is loaded into main memory as a program from ROM.
Interrupts and System Activation
- The CPU's execution mode changes when interrupts occur: kernel to user via IRET, and vice versa.
- The OS is activated during privilege requests, program termination, or illegal operation attempts.
- When interrupts arrive, the CPU jumps to memory addresses based on the interrupt vector.
System Calls and Multitasking
- Operating systems are called extended due to execute more instructions
- System calls serve as OS API functions within the OS, transitioning the processor to user mode upon completion.
- As processing multiple processes simultaneously is called multiprocessing.
User Interface
- Application programs communicate directly with the OS API, while users interact through the OS User Interface with application programs.
Operating System Structure
- Layered OSs can only request operations from adjacent layers, while client-based OSs allow servers to ask for services from each other.
- The structure of monolithic systems is benefit performance with a simpler debug and a high number of CPUs
- Batch processing optimizes CPU use by minimizing time between jobs.
Time Sharing and Concurrency
- Time-sharing supports interactive use of computers that modern OS are modular
Virtual Machines and Hypervisors
- The hypervisor creates and manages virtual machines.
Unit 2: Process Management
- A process is a running program that needs resources like CPU time, memory, files, and I/O Devices.
- Resources are allocated to a process when created and during execution and A process is a living entity. An instant in the process's life is given by the • Its code • Data that has at that moment • The value of the execution stack
OS as a Process Manager
- The OS provides services to create and manage processes, schedule process execution, facilitate process synchronization and communication, handle deadlocks, and minimize overhead.
Elements of a Process
- A process comprises text (code), data, stack (temporary data), and a Process Control Block (PCB).
- The PCB contains execution details, enabling interruption and later resumption.
Process States
- The states of a process include new, running, blocked, ready, and finished.
- Transition from New to Ready, process must resources for it.
Process Transitions
- Transitions include creating (None to New), system acceptance with resources (New to Ready), scheduling for execution (Ready to Running), OS-initiated termination (Running to Finished).
- Transitions caused by time slice expiration or voluntary yield (Running to Ready), request for slow operation (Running to Blocked), and blocked operation completion (Blocked to Ready).
- Parent-initiated termination of child processes (Ready/Blocked to Finished).
Interrupt Handling and Context Switching
- A process reschedule after new process is chosen from the Ready to Run queue.
- A context switch involves saving the state of one process and restoring another.
- Operations performed by the OS to make a process leave the CPU for another process is called a process switch
- State saving involves copying register values to the PCB and operations performed by the OS to the state of the processor in the PCB
Interrupt-Driven Process Switching
- Some interrupts cause a process switch if the current process ends, blocks, or exceeds its time limit.
- The current process does not need to wait for anything and system can continue to execute the same amount of time
Threads Concept
- Each thread has its own Program Counter, register values, and stack.
- Threads enhance execution speed and performance, creation and destruction of threads is much lower cost.
- Threads share memory space, leading to risks of concurrent resource access.
User Level Threads (ULT) and Kernel Level Threads (KLT)
Advantages of ULT:
- Flexible as implement policies and management operations are more efficient.
- Thread operations available without kernel involvement. Disadvantages of ULT:
- All threads are blocked too.
- Real parallelism is not possible in multi process as multiple threads are blocked.
Advantages KLT:
- Thead can be blocked.
- Real parallelism is possible.
Disadvantages KLT:
- Mangement operations are slower.
- Processor mode switch is needed to change the executing thread.
Process and Thread Scheduling
- Scheduling involves sharing processor time, with short-term scheduling assigning processors to ready processes through Scheduler and Dispatcher.
- Metrics for algorithm performance include processor use and throughput for the system, and turnaround, waiting, and response times for processes.
Scheduling Policies
Policies such as
- FCFS where process leaves the CPU if blocked or voluntarily yields.
- Shortest processes time is favores and improved average process with a bad variance.
- Priorities in ready queue is given according the scheduler and assigned.
Scheduling policy is
- Expulsive, preemptive (ex: SRTF), and non-expulsive policies (Round robin)
Scheduling and Scheduling Policies
- Provides a fair sharing of time and assign some time.
- Scheduling policy the processes have to be executed on a process and fixed time
Real Time Systems
- It must provide in time or its deadline
Processes and Threads Policies
- Applies to processes and threads with priority level based on lower value
Short Term scheduling for algorithms
- FIFO algorithm (if another process arrives increases the priority and queue and is the head).
- Other algorithms with all system simultaneously.
Multiprocessor scheduling schemes
-
Asymmetric multiprocessing involves a dedicated processor for the OS.
-
Symmetric Multiprocessing ensures all processors are running for concurrency issues.
-
Load Sharing is the criteria on the processor and to assign the processor to process.
- When using Single queue, it produces Load Balancing
- When using one queue for each processor scheduling, the load becomes more balanced
Advtantages of a bottleneck on process
Thread Scheduling Policies
- Shared Time:Each is assign to application and is being applied on one proccessor
- Shared space: is a set of threads that can apply to groups
QUIZ Process Concurrency
- A multitasking OS supports the real concurrency between the I/O and the processor
Process
- When you run a process, the OS will be executed before, during, and after the execution of the process
- The stack is used with local variables
- An info is being printed in PCV that involves data of process
- A single OS supports multiple programming to allow a users
State Model and Transitions
-
'time slices' was introduced to change a state to another when the proces it' being processed
-
When an Interrupt rises, is raised from OS to kernel and the image of proccess will be created
-
Some reasons like the creation of process the process does execute on preveleage OS level
-
Threads share memory and each can has it own state
The medium depends of process change to is stored and aimed for proccesses
-
When there are many processes OS may schedule in fact
-
Process: program when executing. The resources that it needs are: processor, memory, I/O devices and resources created by the OS, as files. This resources are received by the process when the process is created by the OS or when the process asks for them.
-
Interrupts makes a process to leave
Unit 3: Concurrency
- Parallelism achieves concurrency through execution on different processor cores.
- Apparent concurrency simulates this on a single processor.
Types of Processes
- Independent processes run without assistance/cooperation.
- Cooperating processes work together through communication and interaction.
Interaction Types
- Interaction requires synchronization to achieve common gools
Concurrency Problems
- Race Conditions: Several processes final result of the execution depend on order. Solution: Executing critical section in mutual exclusion.
- Deadlock: Happens when one cant happen. Prevention, detection and recovery
Parallelism and Atomicity
- While the OS is executing, an interrupt can occur and leave in bad statement implement like a current several system with different processes (atomic way)
Synchronization and mechanisms
- Support with language and system
Synchronization Mechanisms
- Semaphores: solve the problem
- Mutex solve exclusitivity
- Conditional and variables
Communication Mechanisms
- Send process
- Message that it uses direct communication
Synchronization Problems
- Solved between process
- Ports is used in different machines
- Memory on all current processess
Processes with Multiple
- Processes must is able to had information
- We use Pipes to can comunicate
Unit 4: Memory Management
- Program references logical addresses between 0 and N translated to main memory physical addresses. In multiprogramming,
Memory Management
memory is shared by all programs when its loading
-
Base address can translate
-
In cases that something is wrong. exception can occur
-
If Address can not translate, the process must stop working.
-
Real Memory: processes share data between other processess
-
To save more process, you have to take out one memory
-
virtual Memory: uses the memory
Physical memory Schemes
- fixed size, the partitions must have same parameters and limits
- The remaining part has to be resolves
Static Memory
- The implementation is simple
- The memory has more limitations and space than if its virtual
Address Translation.
- MMU
- Paging is used
- Protection is used
- Create is
- Load processes
Problems Page table has
-
To storage must go faster and reduce time
-
Segmentation is used
-
Division the data
Virtual Segmentation
- Hw and dependency
- Read and save memory
- When there is a fault
Replacement
- To find the correct value
- Dynamic policies
- Dynamic policies
System has list and frames
- Is need small to implement algorithm
- Current reference
QUIZ Memory Management
- Current system needs the addreesses to be transalated
- The protection prevent all processess to can access
If address translation is not performed
-
The memory the process is can not use address on running time
-
The OS has the power
-
A static partitions the schema has
-
External fragmentation has a different size
-
Is lower to high
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.