1/221
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What are the objectives of the lecture on the history of operating systems?
Describe the generations of operating systems and their influences.\n2. Analyze effects of multiprogramming vs. uniprogramming.\n3. Identify components and central abstractions of OS.
What is an Algorithm?
A set of instructions with finite initial store and state, a starting point, and unambiguous ordering until the endpoint (halt point).
What is a Program?
The sequence of instructions that embody an algorithm. It can be the Source code or Machine Code.
What is a Process?
A program in execution plus its Process State. These are represented by the current instruction, state of memory, and resources.
What is a Job?
A task to be completed. Often a program or a collection of programs awaiting execution.
Difference between 'Process' and 'Job'?
The words 'process' and 'job' are often used interchangeably in practice, but they are slightly different. A 'Job' is often a program or a collection of programs awaiting execution, while a 'Process' is a program in execution.
Why do we need an Operating System?
To help with repetitive or complex tasks such as loading a program, which can involve a series of precise but repetitive tasks.
What is the Altair 8800?
An example of an old computer that did not have an Operating System. Programs had to be loaded manually before execution.
How does the OS help in accessing I/O devices?
The OS provides a uniform interface to access input and output devices and often standardizes input and output routines.
What safety features does the OS provide?
The OS restricts access to read/write routines to users and processes, preventing unauthorized access to resources.
What are the primary jobs of an OS?
Resource Manager\n2. To provide an extended machine to the user.
What does the OS do as a Process Manager?
It switches between multiple programs and processes, giving the illusion that they are executing at the same time.
What does the OS do as a Memory Manager?
It decides which programs to load to main memory, which to keep on fixed storage, and which to load into cache memory.
What are the three large groups of OSs?
Interactive OSs\n2. Batch OSs\n3. Real-time OSs
What characterized the first generation of computers (1945-1955)?
Users were also operators.\n2. Programs were represented by wiring instructions into physical boards.\n3. Ran a single program at a time.
What characterized the second generation of computers (1955-1965)?
Built with transistors.\n2. Introduced batch systems.\n3. Users/programmers were not operators.
What is the difference between Uniprogrammed and Multiprogrammed systems?
Uniprogrammed systems run a single program at any given time. Multiprogrammed systems aim to keep the CPU busy by utilizing a pipeline approach.
What characterized the third generation of computers (1965-1980)?
Built with Integrated Circuits.\n2. Introduced Timesharing systems.\n3. Users developed software directly using terminals.
What are the limitations and constraints in the history of OSs?
Old computers had very limited memory and storage. As computers evolved, these limitations were overcome, but they became relevant again with the advent of wearables and embedded computers.
What is not part of an OS?
The user interface is not part of the OS.\n2. System Tools are not part of the OS.\n3. Libraries utilized by the OS are not part of the OS.
How did the role of 'programmer' and 'operator' evolve over generations?
In the first generation, users were also operators. In the second generation, the roles separated. By the third generation, users developed software directly using terminals, effectively becoming operators again.
What is the role of OS in multitasking?
The OS manages resources, protects private information, and facilitates interactions between multiple users, processes, and programs, enabling multitasking.
How does the OS fit in the organization of a typical personal computer system?
The OS is the layer of software that exists between the hardware and the user-interface program.
What are the additional OS concepts covered in the video?
Named Calls, including Procedure and System calls.
What resources does the OS manage?
CPU time allocated to each process.\n2. Working memory (or main memory).\n3. Storage (fixed/removable disks or SSDs).\n4. Device Input and Output.
What are Files in the context of OSs?
Files are logically named persistent storage. They can be text, video, or audio files. They also serve as a paradigm for I/O devices and data communication.
What is a Process in the context of OSs?
A process is a program in execution. It occupies some address space and is associated with specific resources like data, stack, pointers, and files.
How do File Systems work in OSs?
File Systems define how data is stored, have mounting schemes, implement strategies to name files and store them in folder or directory trees, and may provide advanced features like data redundancy and networking capabilities.
How are disks identified in Windows and Unix OSs?
In Windows, disks are identified by letters (e.g., C:). In Unix systems, they appear as directories, usually inside the mnt (mount) directory.
How does a process read from a disk?
A process issues a system call to the OS, which then executes the disk access and returns the requested information to the application program.
What is a Process in terms of its components?
A process is a program in execution that occupies some address space and is associated with specific resources like data, stack, pointers, and files.
How are Processes organized?
Processes are organized in trees, where each process has a parent and may have one or multiple children.
What are Threads in the context of Processes?
Threads are a way to save memory when you need multiple processes executing the same set of instructions.
What are Named Calls?
Named calls are divided into Procedures and System Calls.
What are Procedures?
Procedures are named code with local variables and parameters. They execute completely in User Space in the OS.
What are the segments of a process in memory?
Text: Code the process is executing.\n2. Data: Static and dynamic variables.\n3. Stack: Activation frames of the calls made.
How is memory allocated for a process?
Memory for the process is allocated so that there is empty (Gap) memory for the data and stack to grow.
What happens when a procedure call is made?
A new stack frame is added to the call stack, which contains all the information needed for the procedure to execute and return.
What is a System Call?
A named call that involves a context switch into kernel mode for execution. Needed to execute protected instructions like reading or writing from a disk.
How is a System Call initiated?
The user program calls a System Library procedure, which then stores parameters and a System call number in predetermined memory areas, and issues a kernel trap.
What is the role of the OS Dispatcher in System Calls?
The Dispatcher reads the system call number from memory and uses it to look up a vector table that has pointers to code that can carry out each possible system call.
What is POSIX?
A set of formal descriptions that provide a standard for the design of operating systems, especially ones compatible with Unix.
Examples of POSIX standard System Calls for process management?
Fork, to create child processes, and Exit, to terminate a process.
Examples of POSIX standard System Calls related to file operations?
Open, Close, Read, Write, and Lseek.
What is a Hardware Interrupt?
A Hardware Interrupt is a signal sent by a hardware device to the CPU to interrupt the current flow of execution.
How does a hardware device signal an Interrupt Request (IRQ)?
The device 'raises a line,' meaning a wire from the device connected to the main board goes from zero volts to typically +3 volts. The interrupt controller senses this raised voltage and interprets it as an Interrupt Request.
What is the role of the Interrupt Controller?
The Interrupt Controller manages interrupt requests from various hardware devices. Upon receiving a request, it sends a signal to the CPU to interrupt the current sequence of instructions.
How does the CPU acknowledge an interrupt?
"The CPU sends a signal back to the Interrupt Controller acknowledging the interrupt. The Interrupt Controller then responds back with an interrupt number (IRQ#)."
"What is the purpose of the IRQ#?"
"The IRQ# is used to let the OS know how to treat the interrupt. For example, it may indicate what to do when a reading operation from a disk is complete."
How are interrupts managed in multicore systems?
On multicore systems, the interrupt controller can be programmed to send different interrupts to different processor cores.
What are the steps to treat an Interrupt Request?
"1. The I/O device issues a hardware interrupt.\n2. The current instruction is interrupted, and the OS switches to kernel mode.\n3. The Dispatcher uses the IRQ# to find the correct handler via the Interrupt Service Routine (ISR).\n4. The handler is executed, informing the process that the requested operation is complete.\n5. Control is returned to the scheduler for new process scheduling."
What is an Interrupt Mask?
An Interrupt Mask is a binary value stored on a register in the interrupt controller. It determines which signals the controller listens to.
How are multiple interrupts managed?
If another interrupt arrives during an ongoing interrupt routine, the interrupt controller mask will block the new request until the previous one is treated.
What does 'restoring interrupts' mean?
Restoring interrupts involves remembering old mask values and restoring them, allowing the interrupt controller to listen to new interrupts.
When does the OS check for interrupts?
The OS checks for interrupts typically before each FETCH, DECODE, and EXECUTE cycle.
What are Precise Interrupts?
Precise Interrupts are treated after an instruction is completed and before another is started. They have a known program counter state, and all preceding instructions are fully executed.
What are Imprecise Interrupts?
Imprecise Interrupts are treated even if instructions are left incomplete or partially executed. They may have close to zero wait time but add complexity in stopping and restarting instructions.
What is the difference between how system calls and interrupts trap the OS into Kernel space?
During a system call, the OS is trapped into Kernel space by a system library call. During an interrupt, it is triggered by raising the interrupt line between the interrupt controller and the CPU.
What are the two main types of OS architectures?
Microkernel and Monolithic Kernel.
How do Microkernel and Monolithic Kernel architectures differ?
Microkernel has only core functionalities in kernel space and most modules in user space. Monolithic Kernel has all modules in kernel space.
What are the advantages of Microkernel architecture?
Modules communicate via message passing, most operations don't require system calls, and changes to modules don't require the OS to be re-compiled. Commonly used in OS research.
What are the characteristics of Monolithic Kernel architecture?
All modules like file system, device drivers, and task management are in kernel space. Any change requires recompilation of the entire OS. File system operations require system calls.
What is a process?
A program in execution. It is loaded into main memory and has its own pointers, counters, and variables.
How is an executable program represented in memory?
An executable has a Header, Text, Data, and Symbols. The Header contains metadata, Text contains instructions, Data contains constants and variables, and Symbols are metadata about addresses.
How is a process represented in memory?
The process has Text and Data loaded from the executable. It also has a Heap for dynamic allocations and a Stack for procedure calls and local variables. Some free, empty memory is also allocated.
How does the memory space of a process grow?
The Stack grows down and the Heap grows up inside the process memory space.
What is the 'process model'?
A model that dictates how processes are created, executed, and terminated. Processes have at least one thread of execution, program counter, allocated memory space, stack, and program pointers. They also have independence of execution.
What is PSEUDOPARALLELISM?
It imitates parallel execution even with just a single processor. Processes take turns using the CPU for a small amount of time, known as a QUANTUM.
What happens when a process is 'preempted'?
The process is removed from the CPU so that another process can be scheduled and executed.
How is pseudoparallelism achieved?
After each quantum, the OS swaps processes by saving the state of the running process and loading the state of the next process to execute.
Where are the contents of CPU registers stored during a process swap?
In main memory or on fixed storage like a hard disk or SSD.
How are processes created and terminated in Unix systems?
The first process is created by the 'init' call during system initialization. Other processes are created by the 'fork' system call. Processes can be terminated voluntarily or involuntarily.
What is the Process Control Block (PCB)?
A data structure in main memory that contains information needed to manage processes, such as register values, states, text, data, heap, and stack pointers, and file descriptors.
What is the role of the OS Scheduler?
The Scheduler handles process scheduling, chooses which process to run next, responds after interrupts, and balances the needs of all processes to prevent starvation.
How is the Scheduler scheduled to run?
The OS enters kernel mode, removes the old process from the CPU, loads a new process into the CPU registers, sets an alarm for a quantum of time, and switches back to User mode. When the alarm goes off, the Scheduler is executed.
What are the different states a process can be in?
Running, Ready, Blocked, Swapped Out & Blocked, Swapped Out & Ready, Initializing, and Exiting.
What does 'Swapped Out' mean for a process?
The process is not in main memory but has been saved in fixed storage like a hard drive.
What is a 'context switch'?
It occurs when the CPU switches between two processes. The context of the CPU (content of its registers) is replaced with new information for the new process.
What causes a context switch?
I/O operations, wait or sleep operations, pseudoparallelism, asynchronous events like hardware interrupts, Signals, and Exceptions.
What steps are involved in a context switch?
Store register values in main memory, keep track of allocated memory addresses, and update the process state in the PCB.
What are Signals in the context of OS?
Signals are generated by system calls and are used to pass messages to a process. They can be issued by the Kernel or other processes.
How are Signals treated?
If a handler is registered in the PCB, the signal is stored and the handler is queued to execute. If no handler is registered, the target process is terminated.
What is a Segmentation Fault?
A signal issued by the Kernel when a process tries to allocate a memory area not allowed by the OS. The process may catch the signal or be terminated.
What is the Sigkill signal?
A signal that cannot be treated. If a process receives this signal, it will be terminated.
What is a single-threaded process?
A single-threaded process is a program in execution with allocated memory areas for code, data, and files. It has a single program counter, or thread of execution.
What is a multithreaded process?
A multithreaded process has multiple threads of execution, each with its own register information and stack. However, all threads share the code, data, and file descriptors.
What are Lightweight processes?
Threads are often referred to as 'Lightweight processes' because they share code, data, and files but have individual register and stack information.
What is shared between threads in a multithreaded process?
Code, data, and file descriptors are shared between threads.
What is unique to each thread in a multithreaded process?
Each thread has its own program counter, register information, stack entries, and state.
Why are threads used?
Threads are used to avoid wasting memory with repeated information and to break up complicated tasks into simpler ones for improving efficiency.
What are User-space threads?
User-space threads are OS-independent and run in user-space. The OS and its scheduler are not aware of them. They are managed by thread libraries specific to programming languages.
What are Kernel-space threads?
Kernel-space threads are part of the OS and run in kernel mode. The OS scheduler is aware of them and can schedule each thread individually.
What are Hybrid threads?
Hybrid threads combine user-space and kernel-space threads. They can get complex and are better suited for specific optimizations.
What are the two main strategies for inter-process communication?
Shared Memory and Message Passing.
What is Shared Memory in inter-process communication?
Processes or threads read and write directly to a shared memory space. This strategy requires explicit synchronization.
What is Message Passing in inter-process communication?
Data parcels are accepted and delivered between processes. Two common approaches are pipes (local only) and network sockets (between hosts).
What is a race condition?
A race condition occurs when a process or thread attempts to perform two or more operations at the same time, but the operations must be done in the proper sequence to be done correctly.
What are Critical Regions?
Critical regions are areas of code that must be protected from interruptions to avoid race conditions. Operations inside critical regions must be atomic.
What properties must be maintained to avoid race conditions?
Concurrency, Safety, and Liveness. Concurrency means no assumptions about speed or number of CPUs. Safety means no two processes may be simultaneously within their CRs. Liveness means no process outside of the CR may block other processes inside it, and no process should wait forever to enter its CR.
What are the two primary synchronization criteria?
Safety and Liveness.