Introduction to operating system structure and computer systems
What is an Operating System?
operating system (OS) is the software that acts as an intermediary between user applications and computer hardware
computer system components
hardware: provides basic computing resources (CPU, memory, I/O devices)
operatingsystem: controls and coordinates use of hardware among application programs and I/O for devices
applicationprograms: solve computing problems of users
“ABSTRACT VIEW OF SYSTEM”
users: people, machines and other computers
operating system roles
referee: resource allocation, isolation of different users and applications, communication between users and applications
illusionist: each application appears to have entire machine to itself
glue: reduces cost of developing software with libraries and user interface widgets
example: file systems
referee: prevent users from accessing each other’s files without permission
illusionist: files can grow arbitrarily large
glue: named directories
operating system challenges: reliability, availability, security, privacy, performance, portability
key idea: device files as the boundary
I/O sharing implemented in operating system kernel
Operating Systems History
early operating systems: bare machine (1950s), expensive hardware and cheap human
structure: large machines run from console, single user system with programmer/user as operator and punched cards
secure execution and inefficient use of expensive resources (low CPU utilization and high setup time)
simple batch systems (1960s)
reduce setup time by batching jobs with similar requirements and hire an operator (user is NOT the operator)
automatic job sequencing with rudimentary OS
solutions to speed up I/O: offline processing
spooling (simultaneous peripheral operation on-line)
introduces job pool allowing OS to choose next job to run as to increase CPU utilization
direct memory access (DMA)
data moved directly between I/O devices and memory thus CPU can work on other tasks
used for high speed I/O devices to transmit information at close to memory speeds
I/O completion by polling: device sets a flag when it is busy and program tests the flag in a loop waiting for completion of I/O
interrupts: on completion of I/O, device forces CPU to jump to specific instruction address with ISR
after interrupt processed, CPU returns to code it was executing prior to servicing interrupt
multi-programmed batch systems
use interrupt to run multiple programs simultaneously
when program performs I/O, instead of polling, execute another program till interrupt is received
requires secure memory and I/O for each program, intervention if program indefinite loops and CPU scheduling to choose
next job to run
time-sharing systems ( cheaper hardware and more expensive human )
programs queued for execution in FIFO order and timer device interrupts after quantum (timeslice)
interrupted program returned to end of FIFO and next program taken from head of FIFO
control card interpreter replaced by command language interpreter
interactive (action/response), file systems required for users to access data and code, and virtual memory
personal and mobile computer systems ( cheap hardware and expensive human )
portable, single user systems with I/O devices and NO need for advanced CPU utilization or protection features
advantages of user convenience, responsiveness and ubiquitous
Computer System and Operating System Structure
computer system organization
execution sequence: fetch instruction at PC, decode, execute, write results to registers/memory, increase PC and repeat
I/O devices and CPU execute concurrently
each device controller is in charge of a particular device type with local buffer
CPU moves data from/to main memory to/from local buffers and device controller interrupts CPU on completion of I/O
interrupt: transfers control to interrupt service routine (segments of code that determine action to be taken for interrupt)
polling: same interrupt handler called for all interrupts thus polls all devices to figure out reason for interrupt
interrupt vector table: different interrupt handlers will be executed for different interrupts
OS preserves state of CPU by storing registers and program counter
incoming interrupts disabled while another interrupt being processed to prevent a lost interrupt
types of I/O processing
synchronous I/O: after I/O requested, wait until I/O is done thus program will be idle
asynchronous I/O: after I/O requested, control returns to user program without waiting for I/O completion
limit process rights by hardware protection
dual mode operation: provide hardware support to differentiate between at least two modes of operation
user mode (execution done on behalf of user) and kernel mode (execution done on behalf of OS)
“privileged” instructions only executable in kernel mode, otherwise in user mode would trap into kernel mode (interrupt)
trap (exception): software generated interrupt caused by error or user request (system call)
mode bit added to hardware to indicate current mode, kernel = 0 and user = 1
(when interrupt OR trap occurs, switch to kernel mode)
memory protection: provided for interrupt vector and interrupt service routines
when process is running, only memory in that process address space must be accessible BUT kernel has unrestricted access
to ALL memory when executing in kernel mode
to provide memory protection, add two registers that determine range of legal addresses a program may address
base register holds smallest legal physical memory address and limit register contains size of the range
virtually addressed base and bounds
(memory outside defined range is protected)
CPU protection: prevent a process from executing indefinitely
timer: interrupts computer after specified period to ensure that OS maintains control, decremented every clock tick
when timer reaches value of 0, an interrupt occurs
commonly used to implement time sharing and to compute current time (load timer is privileged instruction)
I/O protection (ALL I/O instructions are privileged instructions)
must ensure that user program could never gain control of computer in kernel mode
user perform I/O via system calls, method used by process to request action by OS
process: an instance of a program, running with limited rights
thread: a sequence of instructions within a process, potentially many threads per process
address space: set of rights of a process and memory that the process can access with permissions process has
kernel: computer program that is core of computer’s OS, with complete control over everything in the system
handles I/O requests from software and translate them into data-processing instructions for central-processing unit (CPU)
connects application software to hardware of computer and performs tasks in protected memory
isolation of memory access
address space = set of accessible addresses + state associated with them (for 32-bit processor, 232 = 4 billion addresses )
system call
user code can issue a system call which causes a trap to be handled by kernel (ex: read(), write(), open() …)
interface between running program and OS: assembly language instruction and direct system calls by high level language
passing parameters between running program and OS via register, memory tables or stack
system services/programs: convenient environment for program development and execution and defines user view of OS
ex: command interpreter (parses/execute other system programs), file manipulation (copy/print), file modification (edit) …
command interpreter system: commands that are given to OS via executable command statements
ex: process creation and deletion, I/O handling, file system access …
programs that read and interpret control statements and obtains next command and executes it
ex: control card interpreter, command-line interpreter and shell
system design and implementation
establish design goals (user/system) and software engineering (separate mechanism from policy, what vs. how)
choose high-level implementation language (faster implementation, compact and easier to debug)
system generation
OS written for class of machines thus must be configured for each specific site
process to customize OS for exact hardware: customizable source code, pre-compiled modules and table to choose execution
system boot
bootstrap program: stored in ROM, loader program loads kernel which loads rest of OS
storage architecture
main memory: only large storage media that the CPU can access directly
secondary storage: extension of main memory that has large nonvolatile storage capacity
magnetic disk: rigid metal-glass platters covered with magnetic recording material
disk surface logically divided into tracks/sectors & disk controller determines logical interaction betw. device & computer
storage systems organized in hierarchy based on speed, cost and volatility
caching: process of copying information into faster storage system (main memory = fast cache for secondary storage)
operating systems organization
simple (1-2 levels of code) and layered (lower levels independent of upper levels)
modular (core kernel with dynamically loadable modules) and microkernel (OS built from many user-level processes)
MS-DOS: provides a lot of functionality in little space, NOT divided into modules,
interfaces and levels of functionality NOT well separated
original unix system structure: limited structuring with two separable parts
systems programs and kernel (below system call interface and above physical hardware)
layered os structure: OS divided into number of layers (bottom is hardware and highest is user interface)
each layer uses functions and services of only lower-level layers
modules-based structure: most modern os implement modules where each core component is separte, each talks to other over known interfaces and each is loadable as needed within the kernel
similar to layers BUT more flexibility
monolithic vs. microkernel os
mono have large kernels with lots of components (Linux, Windows, Mac)
whereas micro moves as much from kernel into “user” space with small core OS running at kernel level
communication between modules with message passing
benefits: easier to extend a microkernel and to port OS to new architecture, more reliable (less code running in kernel mode)
fault isolation (parts of kernel protected from other parts) and more secure
detriments: performance overhead severe from naïve implementation
OS tasks managements
process: fundamental concept in OS as instance of a program in execution and needs resources (CPU time, memory, files…)
OS responsible for following process management activities
process creation and deletion, suspension and resumption, synchronization and interprocess communication & interaction
main memory: volatile array of addressable words OR bytes that is quickly accessible
OS responsible for following memory management activities
allocation/deallocation, managing multiple processes within memory and determineing which processes to load when memory becomes available
secondary storage: required for backup as primary form of disk
OS responsible for storage allocation, free-space management and disk scheduling
I/O system consists of buffer caching and management, device driver interface that abstracts device details and drivers for
specific hardware devices
file system management: file = collection of related information defined by creator, represents programs and data
OS responsible for file creation and deletion, directory creation and deleted, mapping files to disks and …
protection and security: protection mechanisms control access of programs and processes to user and system resources
THUS protects user from himself, user from other users and system from users
protection mechanism: distinguish between authorized and unauthorized use
specify access control to be imposed on use
provide mechanism for enforcement of access control
security mechanisms provide trust in system and privacy (authentication, certification…)
networking: connecting processor in distributed system which is collection of processors that do NOT share memory or clock
processor connected via communication network
advantages: allows use and system to exchange information
provide computational speedup
increase reliability and availability of information
virtual machines
use cases: resource configuration, running multiple OS (either same or different OS) and run existing OS binaries
I/O devices
port: connection point with a device bus: set of wires and common protocol for communication with devices
controller: digital interface to physical device
system communications
I/O devices and CPU can execute concurrently BUT CPU must be aware of when devices should be interacted with
CPU queries device using polling OR device controller informs CPU that it is ready by causing an interrupt
polling: CPU is used by device drive to continually check device (registers) to see whether device is ready for input or output
( frequent polling = wasted CPU cycles, whereas infrequent polling = buffer overrun and data loss )
interrupts: device controller sets interrupt request line (different lines for different device types)
interrupt handling: when interrupt triggered, control is transferred to interrupt service routine (ISR) through
interrupt vector which contains address of all service routines
( ISR must save address of interrupt instruction and program state )
for fast synchronous devices (display driver) use polling and for slow asynchronous devices (network driver) use interrupts
direct memory access (DMA)
devices requiring big amounts of data to be copied from/to device memory to/from main memory
if CPU handles copy, slow and waste cycles
device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention
( interrupt is generated when transfer is done )
Buy Introduction to operating system structure and computer systems Assignment Answers Online
Talk to our expert to get the help with Introduction to operating system structure and computer systems Assignment to complete your assessment on time and boost your grades now
The main aim/motive of the management assignment help services is to get connect with a greater number of students, and effectively help, and support them in getting completing their assignments the students also get find this a wonderful opportunity where they could effectively learn more about their topics, as the experts also have the best team members with them in which all the members effectively support each other to get complete their diploma assignments. They complete the assessments of the students in an appropriate manner and deliver them back to the students before the due date of the assignment so that the students could timely submit this, and can score higher marks. The experts of the assignment help services at urgenthomework.com are so much skilled, capable, talented, and experienced in their field of programming homework help writing assignments, so, for this, they can effectively write the best economics assignment help services.
Get Online Support for Introduction to operating system structure and computer systems Assignment Help Online
Resources
- 24 x 7 Availability.
- Trained and Certified Experts.
- Deadline Guaranteed.
- Plagiarism Free.
- Privacy Guaranteed.
- Free download.
- Online help for all project.
- Homework Help Services
Testimonials
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak: Sheryl. Read More