Operating Systems: Kernels, Processes, and Threads

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Which component is NOT a typical characteristic of an operating system's kernel?

  • Operating as a software layer above the hardware.
  • Solving file management problems.
  • Providing an abstract interface to the hardware.
  • Direct management of user applications. (correct)

What is the purpose of multiprogramming?

  • To utilize processor time during process blocking. (correct)
  • To allow processes to run indefinitely without blocking.
  • To execute multiple processes within the same program.
  • To allocate memory equally among all running processes.

Which of the following is NOT a typical state in the lifecycle of a process?

  • Prepared
  • Active
  • Blocked
  • Suspended (correct)

What is the primary benefit of using threads within a process?

<p>Threads allow for parallelization of activities within a process. (D)</p> Signup and view all the answers

What is a key characteristic of NUMA (Non-Uniform Memory Access) architecture?

<p>Each processor has its own local memory, leading to varying access times. (C)</p> Signup and view all the answers

Which of the following scenarios would trigger a 'Software Interrupt'?

<p>A deliberate system call by a program. (D)</p> Signup and view all the answers

In the context of operating systems, what is the purpose of the 'supervisor mode'?

<p>To enable privileged instructions and kernel operations. (C)</p> Signup and view all the answers

What is the role of a page table in memory management?

<p>To map logical addresses to physical addresses. (B)</p> Signup and view all the answers

What is the primary purpose of memory virtualization?

<p>To allow processes to access pages not currently in physical memory. (B)</p> Signup and view all the answers

Which of the following describes the function of a device 'adapter'?

<p>Provides a standardized interface for connecting devices. (B)</p> Signup and view all the answers

What is the key difference between 'polling' and 'interrupts' in device I/O?

<p>Polling requires the CPU to constantly check device status. (D)</p> Signup and view all the answers

What is the role of a 'device driver' in the context of operating systems?

<p>To provide the interface between the OS kernel and specific hardware devices. (D)</p> Signup and view all the answers

What information is used for sector addressing in CHS (Cylinder, Head, Sector) addressing?

<p>Array of sectors on the disk (A)</p> Signup and view all the answers

What is the purpose of Wear Leveling in SSDs?

<p>To distribute write operations evenly across memory cells. (D)</p> Signup and view all the answers

Which of the following is a characteristic of a monolithic kernel?

<p>Everything is accessible from any component (C)</p> Signup and view all the answers

Flashcards

Operating System Kernel Definition

The core software layer above the hardware providing an abstract interface.

What is a Process?

A program in execution, with its own memory space.

Multiprogramming Definition

Allows utilizing processors effectively during blocking periods.

Process Scheduler

Part of the kernel scheduling processor time across processes.

Signup and view all the flashcards

What are Threads?

A sequence of execution within a process, sharing resources.

Signup and view all the flashcards

Organization (Hardware)

External devices connect to processors via buses.

Signup and view all the flashcards

Hardware Interrupt

A hardware-triggered event altering the execution sequence.

Signup and view all the flashcards

Software Interrupt

A software-initiated interrupt for specific system calls.

Signup and view all the flashcards

Supervisor Mode

A privileged state allowing execution of restricted instructions.

Signup and view all the flashcards

Paging Definition

Each process has its own logical memory space.

Signup and view all the flashcards

Virtual Memory

Processes run without fully transferring pages to memory.

Signup and view all the flashcards

Device Adapter

The component implementing operations for a device.

Signup and view all the flashcards

What is a Controller?

The interface connecting to a device.

Signup and view all the flashcards

Magnetic Storage Units

Memory with magnetic plates that store data.

Signup and view all the flashcards

SSD (Solid State Drive)

A solid-state storage using flash memory.

Signup and view all the flashcards

Study Notes

Operating System

  • The operating system consists of the kernel plus system tools, and it provides software to facilitate the use of the computer system
  • The kernel is the software layer above the hardware which provides an abstract interface
  • It is independent of the hardware, and it solves file reading problems

Processes

  • A process is a program in execution
  • It has isolated memory space, also referred to as a logical address space
  • Processes are synchronized and communicate via the kernel
  • Distinct processes allow running the same program multiple times
  • A process can create other processes (parent, child) and can make system calls
  • Multiprogramming allows using processors during blocking times
  • The process scheduler is part of the kernel that distributes the processors' time among processes
  • Process states include prepared (lacking a processor), active (executing instructions), and blocked (awaiting an operation's completion)

Threads

  • Threads are execution sequences within a process that share resources
  • Threading enables parallelization of activities, potentially utilizing multiple processors. If there is blocking time, the thread can be utilized by one processor
  • Activities' dependency occurs when variables and common structures must communicate to maintain integrity
  • Threading implements creation, destruction, and synchronization of threads
  • Inter-thread communication lacks protection within the same process
  • A process can be defined as a system object complete with threads, memory allocation, and resources
  • Thread scheduling is an important factor to its operation

Basic Hardware Concepts: Organization

  • External devices connect to processors via buses, using local and shared memories
  • NUMA architecture involves distinct memories
  • Multi-core processors replicate the Control Unit
  • Multi-threaded processors replicate some of the processor's components

Interruptions

  • Interruptions alter the execution sequence upon an event
  • Hardware interruptions are triggered by changes in the input state of the processor
  • Exceptions are caused by a failed instruction, such as page faults or privilege violations
  • Software interruptions are deliberate

To handle interruptions:

  1. Interruption is triggered
  2. The processor switches to supervisor mode
  3. The return address to the previous instruction prior to the interruption is saved
  4. The address of the subroutine is determined; interruption vectors
  5. The corresponding subroutine is executed

Execution Modes

  • User mode restricts the execution of privileged instructions which access hardware resources (IN/PUT) or external software (HALT)
  • Supervisor mode allows executing all instructions, providing for a robust kernel

Memory - Pagination

  • Every process has its own logical address space of consecutive directions (with non-consecutive frames)
  • Address translation occurs between logical and physical spaces

For each process there is a page table. It always starts with index 0 and associates:

  • A frame, which is the physical page corresponding to the logic one
  • If it is present (1 if the page is present physically) access and modification rights

Processes also have:

  • A table with all process directions that are the location of a given process' page table

Virtual Memory

  • Processes run without having all their pages in memory; instead:
  1. Pages not in use are created
  2. At physical access, an error occurs during the process
  3. The kernel control transfers to the memory administrator
  4. A free frame is localized and that page is copied there
  5. Now page is displayed on the page table, and is actually present
  6. The control returns to the kernel administrator

Device Access

  • A device includes an adapter, controller, and electromechanical components
  • It implements operations like receiving orders, informing status, and information
  • The adapter provides a standardized mechanical (shape, dimension), electrical (voltage, intensity), and logical (protocols, error detection, error correction) interface for device connection

Other facts related to Device Access:

  • The controller is the connection interface of the device - SATA, SCSI, SAS, Bluetooth
  • Control register: software interface with processing directions in input-output
  • Order registries: includes order, codes and configs
  • State registries: indicates the code end order
  • Reading-writing registries: used to read and write information

Input-Output

  • Guidance is fundamental
  • Sondeo is used to completely check its state
  • Interruptions are only received when the state changes
  • PCI: interrupts to the processor
  • MSI, places interruptions as messages in the memory without accessing the PCI
  • Plug and play: give it a interruption number

Storage Units | Magnetic Units

  • These consist of plates with 2 faces each, tracks and sectors
  • Cylinder: tracks set with the same number that have lecture-escritura heads that move in unity
  • Tracks are circular crowns divided in sectors
  • Sector are the minimum transfer units
  • Buffer, RAM: temporary memory to read and write
  • Permanent memory: are magnetic plates where electromagnetic information is wrotten with lecture heads

Addressing + Transfer + Transfer isolated sector

  • CHS is a disc such as sector arrays

  • LBA is a disc such as vector sectors

  • Sector isolated transfer: bad performance. The transfer term is: TTransferencia = (Tmotor) + Tpistas consecutivas + Tinercia + Trotación + Tsector

  1. Time to start the motor to remove standby mode if activated
  2. Time to find the correct track
  3. Delay in rotation to locate the correct sector
  4. Time to transfer sector by putting it under the lecture heads
  • Efficient sector transference*: perform multiple order request. Minimize the searching time because it is extremely low for the following sectors: only use rotation delay, and then reserve blocks

Solid State Units (SSD)

Problems:

  • Increase of writings: it writes in empty sectors, erases in blocks
  • Finite number of erases for the sectors

Solutions:

  • Dynamic Wear Leveling: instead of erasing to re-write, it changes the modification in different cell marking the previous one as obsolete
  • Trim command: an administrator informs to the SSD unit which sectors are invalid to not lose time reading or rewriting them
  • Static Wear Leveling: moves the sectors with more number of erases to maintain the mean "life"

User Interface

  • Internal terminals - consul the screen adapter controls the screen display managing events
  • Video memory: shared unit between the adapter and the main system
  • Keypad adapter: sends events and scan codes to pulsate and release
  • Mouse adapter: sends events and movement vectors

External Terminals

  • External terminals are independent clients connected to a system
  • Cliente terminals exist as the way text mode can be sent by encrypted characters, screen borraton, mouse position, colors, etc
  • The graphic mode sends events to the processing machine

Startup

  • System startup is the sequence of operations from power on to system readiness
  1. Internal processor initialization
  2. The first instruction is executed; it is on the reset vector. If OS in ROM: the hardware charger initialices minimum then the control is transferred to the kernel
  3. If OS isn’t on ROM, cargador software is needed to search for the OS, see if it works and upload the key, the control then goes to the kernel
  4. Initialice the kernel, in modo supervisor with configuration system devices and also in user mode, gestor session, command line, etc

Basic Concepts about Operating Systems

  • System calls involve requesting a service from the kernel via the kernel API
  • Routines are an inefficient implementation way of performing the calls. They involve using entry points on fixed directions in variables to be uploaded later
  • Software interruptions are called using a call to the interruption vector

How the software interruptions perform;

  1. Modo supervisor
  2. Hardware looks for the entry code and its parameters
  3. The operative System code is called
  4. Return, way previously called
  • Advantages of software interuption : independence of points directions because of how the supervisor mutates

  • Special instructions: efficient implementation of calls. The entry point is given to the STAR direction

  • Instructions are executed on the reader of directions

  • Usuarios are authorized individuals to use a determinate id of sistema, sharing the same group and rights.

Files

These are memory information/devices that are identified by:

  • the system
  • a hierarchical organization

Command Interpreter

  • Command interpreters are interfaces in text mode that translate commands into system calls
  • Graphical User Interfaces use graphical commands and offer APIs to programs

Design Models

  • A monolithic model offers quick execution and low memory usage while being difficult to maintain and debug
  • A layered design improves debugging and maintenance at the cost of slower execution and higher memory usage
  • Microkernels offer better robustness, flexibility and facilitate distributed adaptation, but can be slower, and still have the higher memory usage

Model Types

  • In a monolithic kernel, memory accesses are instantaneous, the structure involves auxiliary dispatch routines. Also kernel switches call for interruption
  • Linux builds upon a monolithic kernel, externalizing components to enable loadable modules that improve OS maintainability
  • Processes upload and eliminate modules, it also contains system and user libraries

Windows

  • Windows uses, as such, a monolithic kernel but distinguishes between User and Superviser modes. Memory has HAL + drivers + executive hilos

  • HAL abstracts to make the kernel viable

  • Windows can also work in Layer models, where hardware and management is done by the process

  • In microkernel models, the kernel is minimum such as only working with multirprocessing

    • the code is hardware, is a micro Kernel, external processes send communications through the micro kernel
    • However, this model needs extra execution time and the memory has increased occupation

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser