Flashcards
SCC 211 Operating Systems

Cards in this deck (108)
- 1—


- 2What does an Operating System do?Manages hardware and system resources
Shares out and accounts for resources
Offers secure environment for applications
Provides common device or I/O system - 3What does operating system abstraction help with?An environment that applications can operate on.
- 4What does hardware abstraction help with?Hide hardware differences from the operating system so OS can run on different machines.
- 5What to operating systems empahise on?- Long term reliability
- Small footprint (no unneeded code, Shez)
- Certification process for safety-critical systems - 6What do Server Operating Systems emphasize on?- Fair share of resources
- Reliability - 7What do Desktop Operating Systems emphasize on?- Interactivity
- GUI and graphics/media - 8What are the Types of Operating Systems?Monolithic
Microkernel
Modular
Exo-kernel - 9Basics of Monolithic Operating System?All OS Code runs with Full privileges
Difficult to impose security or protection
Efficient call structure
Difficult to maintain
(Layered approach) - 10Positives and Negatives of a layered OS approach?+ Impose tighter security as move from -
hardware (Performance penalty per layer moved)
- Hard to manage complex inter-layer calls
(call down not up layers) - 11Basics of Micro-Kernel Operating System?- Minimal amount of code has 'system' privileges
- Components communicate by message passing
- Extensible and have minimal system dependencies (Clean APIs) - 12What does Linux and Windows NT base their operating systems off?Linux = Layered Microkernel
Windows = Layered Monolithic - 13Basics of a Modular Operating System?- Kernel loads modules as needed
- Kernel modules run with elevated privileges
- Naturally restricted to module API - 14Basics of a Exo-kernel operating system?Kernel configures security at lowest level
Libraries provide - addition security, os structure, and personallity
- Applications more aware of hardware. - 15What are 3 modes of an operating system?Real
Protected
Virtual - 16Brief overview of "Real Mode"Initial state for x86 processors
Ensures backward compatibility with early PC code - 17Brief overview of "Protected Mode"Full access to x86 features: memory protection...
No Access to bios functions - 18Brief overview of "Virtual Mode"Emulates real mode while in virtual mode
Traps anything not compatible with protected mode config. - 19Where is the Operating System stored?ROM
(Read Only Memoy) - 20What is the first program to run on startup?BIOS
(Basic Input/Output System) - 21Who creates a BIOS and what does it offer?- Developed by Hardware supplier
- Offers limited access to basic functions
(Basic disk access, keyboard, and mouse, parallel and serial ports) - 22What does the BIOS contain?Basic Drivers for hardware on motherboard.
- Provides lowest level of hardware abstraction
- For common devices and OS specific. - 23Steps of BIOS startup- Performs Power on Self Test (POST)
- Finds populated memoy areas
- Checks basic devices
- initial device discovery (ISA and PCI)
- Detemines list of boot drives - 24What is the MBR on a disk?Master Boot Record
- 25What happens on a BIOS based boot?- Reads first sector of boot disk (MBR)
- Copies boot code to clear memory area
- Initial OS code machine dependent (Initialises stack, calls kernel main function) - 26What are Multi-stage/chain boot loaders?Commonly agreed way of passing basic host configuration data to OS
(Conforms to multiboot spec) - 27Name 2 Multi-Stage/Chain Boot loadersGNU GRUB
BootMgr/WinLoad - 28Stages of Multi-Stage/Chain boot loaders?1 - Degined to fit within free space in disk boot block
2 - Detemines main host config, loads and starts OS
(Abstracts boot process) - 294 Sections of address space?Stack
Heap
Data
Code - 30What are two types of I/O?Memory Mapped
Isolated I/O - 31What is Memory Mapped I/O?Devices visible as noemal memory locations
(Easily accessed using C Pointers) - 32What is Isolated I/O?Seperate bus for I/O devices
- easier interfacing, distinct from high-speed memory bus
- accessed via special instructions - 33What is Synchronous I/O?Act of Polling or Busy Waiting
Spins waiting for change
(wasteful) - 34What is Asynchronous I/O?Interrupt Driven
No waiting for I/O input
(Interrupts are prioritied) - 35What does ISR Stand for?Interrupt Service Routine
- 36Steps in a basic ISRPush all registers (save state)
call c_handler
popall (handle interrupt)
iret (restart main program) - 37What happens when using 1 interrupt line?No idea what generated an interrupt
Must poll each device to ask what made the interrupt. along with data ready/state change - 38What does using Multiple interrupt lines solve?Narrows search when subsequently polling
Groups similar devices
More support on processor - 39What does the Pushall instruction do?Push all general registers to the stack
- 40What generates interrupts?The device attatched to the wire/line
(Message based)
Software (bu executing special interrupts)
Exceptions (generated in response to internal processor problem) - 41Types of x86 ExceptionsFault (significant event)
Trap (Minor event requring, no remedial)
Abort (Unrecoverable)
(some store error codes) - 42What can Programmable Interrupt Controllers do?Processor can't have seperate wire to every device
Give priority to most important devices
(orders interrupts) - 43What are Precise and Imprecise Exceptions?Precise - Current instructions complete execution, ISR Called
Imprecise - ISR called
Deeply pipelined function not fully complete.
Hard to recover from unknown state. - 44What does a PIT do?Creates periodic event at set/configurable interval
Used to invoke periodic kernel tasks - 45What could happen if a Programmable Interrupt Timers frequency is too low or too high?Low: kernel can seem unresponsive
High: OS Spends too much time servicing timer - 46What does a typical I/O device contain?Circular buffer for input and output
Status register, Control Register
(Device ready, data available flags) - 47What is an alternative to programmed I/O?Direct Memory Access
- 48What are device drivers?Defined interface to an I/O system
Loadable modules allow run-time changes
Must be re-entrant
(can be called again before previous request serviced) - 49What are device driver tasks?- I/O Scheduling
- Buffering, Spooling and caching
- Error Handling
- I/O Protection - 50Example of Single and Multi instance devices?Single: Printers
(Devices that can only be used by one procss)
Multi:
Handle requests from multiple sources - 51What happens at PCI initialisation and Addressing?Scan PCI bus hierarchy
(Establish device type,
Whether multi-function device,
Resource requirements, Allocate and set I/O address and interrupt used) - 52What is base and Limit?A way to enforce memory protection
- Base bottom, limit top - 53What does the Relocation Register allow?To find the physical address from a logical address
- 54Segments of MemoryStack
Code
Data
Heap
Shared libraries
Shared Data - 55Three types of Dynamic Storage AllocationFirst fit
Best fit
Worst fit - 56What type of fragmentation occurs when using Variable/Dynamic allocation?External Fragmentation
(space left outside/between allocated memoy) - 57What type of fragementation occurs when using Fixed size schemes?Internal Fragmentation
(Processes typically get more memory than requested) - 58What is paging?Memory management technique, divided into fixed sized pages. When a program needs a page, it is avaliable in MM, as the OS copies a number of pages from SM to MM.
- 59What does paging allow?Physical address space of a process to be noncontiguous
- 60What does paging assure?Operating system will never run out of memory.
(By storing pages of memory to a hard-disk) - 61What does a page table map?Page numbers to frames
- 62Page tables in registers vs MemoryRegisters: Fast but limited capacity
Memory: Capacity limited by memory, slow access time
(Hybrid, maintain a cache of page to frame translation) - 63How can we solve problems with page table sizes?Hierarchical / Multi-level paging
(Top level becomes a Directory pointint to other page tables)
[page1][page2][offset] - 64What do inverted page tables allow?One table used for all processes
page table has one entry for each frame - 65What happens if a process tries to access a memory location not mapped in its page tables?PAGE FAULT exception
(kernel page fault handler called) - 66What is demand paging?Pages are un-allocated until data is requested on startup. Once a page fault occurs memory is loaded as needed.
- 67What happens if a page table entry isn't present in RAM?Present flag determines if frame is valid.
- 68Steps of Frame Replacement- Take page fault
- if free/empty space available in memoy (select) else (identify victim frame)
- Write/swap out frame
- read requested page into frame
- restart process - 69What does the Dirt Flag determine?if not dirty, no need to write to disk.
Disk copy will have same content. - 70Two ways to speed-up replacing framesKeep at least one free page
keep write queue of likely victim pages - 71Algorithms to replace frames?First-In First-Out (FIFO)
Least Recently Used (LRU) - 72Why is FIFO bad?First pages likely to hold key parts of process
(libraries, globals...) - 73How can we determine a pages access frequency?Accessed flag
- 74What is thrashing in the context of paging?Process is allocated too few frames
- high number of page faults
- CPU util spends time swapping pages - 75How can we limit thrashing?Using Local replacement algorithm
(Process cannot take frames from another)
Thrashing can't extend to other processes - 76Why would we need Non Page Based Allocation?- Can't allocated whole page for every request.
- Sometimes need memory area larger than one page (maybe contiguous)
(allocated pages as group then allocate group) - 77Idea of buddy allocation?A memoy block can be split into two
(Two buddies)
They can be recombined reforming original larger block - 783 Types of SystemsBatch
Real-time
Interactive - 79Characteristics of Batch SystemsNon preemptive (no interrupts)
Scheduling Policies:
First come first served
Shortest job first - 80Types of Characterising processesCPU Bound
(Process spends most time with data)
I/O Bound
(Process spend most time waiting for data) - 81Types of real time processesSoft Real-Time
Hard Real-Time - 82How is Real-Time scheduling driven?Periodic events - predictable
Aperiodic events - unpredictable - 83Characteristics of Real-Time SchedulingRate Monotonic
- Static scheduling policy
- Schedule for worst case
Earliest Deadline First
- Dynamic - 84Characteristics of Interactive SystemsMulti-tasking
(Cooperative, pre-emptive) - 85What is pre-emptive scheduling?Scheduler forces context switch at defined interval
Quantum defines how long processes run - 86What is round robin scheduling?P0 -> P1 -> P2 -> P3
<-------------------------
P0 -> P1 -> P2 -> P3 - 87What does a dispatcher do?Given a scheduled task, performs a context switch to this task
- 88What types of access are there in file systems?Read, write, execute, append, delete, list
- 89How can we share files in a file system?Multiple directories can point to the same files
- 90What does the virtual file system hide?Multiple file-systems
File-system differences
Networked file systems - 91Ways to allocate space for filesContiguously
Linked-lists
Indexed - 92Benefits of contiguous allocation?- Each file fills set of adjacent blocks in file system
- Fast access - 93Disadvantages of contiguous allocation?- Need to know file size before finding gap for file
- Suffers from external fragmentation - 94Advantages and disadvantages of linked-list allocation?+ Avoids external fragmentation problem
- Suffers with long access times (only sequential) - 95Advantages of Indexed allocationDedicated index blocks
(Quick access to any position)
Can support holes - 96What is Combined Allocation?First entries in index blocks are data blocks
last entry is a 2nd level pointer to an index - 97What is a hard link?A way for the system to think that a file actually exists in that location using a junction point. (Modifying junction also modifies the original)
(can't point to directories (avoids loops)) - 98What is a symbolic link?A file containing the path to a linked file.
Ability to place a folder which is actually a link to another location on the system.
(Similar to a shortcut)
(Can refer to delete files) - 99How do kernel tables speed up access?Maintains a cache of recently used inodes
(active inode question) - 100What does buffering allow?Decoupled byte and block reads
Caching of blocks to reduce disk activity
read-ahead to speedup access - 101Why do we need to perform Flush/Synchronize in a file system?- Protect against lost data in event of failure
- speed up reuse of LRU buffers
(Uses dirty flag track updates) - 102What is POSIX File locking?a way to coordinate unrelated applications
- Shared lock
- Exclusive lock - 103How can large files be suited with block fragmentation?Larger files can be allocated fragments of blocks, 4x 1k fragments = a single 4K disk block
(blocks must be a multiple of disk sector size) - 104What are problems with Variable size regions?Suffers external fragmentation
- 105Three ways to allocate dynamicallyFirst fit,
Best fit,
Worst fit. - 1065 Scheduling CriteriaCPU Utilisation
Throughput
Turnaround time
Waiting time
Response time - 107How is the average wait time for processes worked out?Dispatch - Arrival time
- 108How is the average turnaround time for processes worked out?Completion - Arrival time
Information
- Description
- Flashcards on SCC 211 Operating Systems, created by Alex Stout on 13/05/2017.
- Created by
- Alex Stout
- Views
- 6
- Rating