4Computer System Operation
4Computer System Operation
System Startup
• On power up
• everything in system is in random, unpredictable state
• special hardware circuit raises RESET pin of CPU
• sets the program counter to 0xfffffff0
• this address is mapped to ROM (Read-Only Memory)
• BIOS (Basic Input/Output Stream)
• set of programs stored in ROM
• some OS’s use only these programs
• MS DOS
• many modern systems use these programs to load other system programs
• Windows, Unix, Linux
BIOS
• General operations performed by BIOS
1) find and test hardware devices
- POST (Power-On Self-Test)
2) initialize hardware devices
- creates a table of installed devices
3) find boot sector
- may be on floppy, hard drive, or CD-ROM
4) load boot sector into memory location 0x00007c00
5) sets the program counter to 0x00007c00
- starts executing code at that address
Boot Loader
• Small program stored in boot sector
• Loaded by BIOS at location 0x00007c0
• Configure a basic file system to allow system to read from disk
• Loads kernel into memory
• Also loads another program that will begin kernel initialization
Initial Kernel Program
• Determines amount of RAM in system
• uses a BIOS function to do this
• Configures hardware devices
• video card, mouse, disks, etc.
• BIOS may have done this but usually redo it
• portability
• A System Call is the main way a user program interacts with the Operating System.
System Calls
Kernel Mode
Hardware
Linux Structure
Microsoft Windows Structure
Major Windows Components
• Hardware Abstraction Layer
• Hides hardware chipset differences from upper levels of OS
• Kernel Layer
• Thread Scheduling
• Low-Level Processors Synchronization
• Interrupt/Exception Handling
• Switching between User/Kernel Mode.
• Executive
• Set of services that all environmental subsystems need
• Object Manager
• Virtual Memory Manager
• Process Manager
• Advanced Local Procedure Call Facility
• I/O manager
• Cache Manager
• Security Reference Monitor
• Plug-and-Plan and Power Managers
• Registry
• Booting
• Programmer Interface: Win32 API
Types of System Calls
• Process control
• File manipulation
• Device manipulation
• Information maintenance
• Communications
• Protection
Types of System Calls
• Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step execution
• Locks for managing access to shared data between processes
Types of System Calls
• File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
• Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls
• Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
• Communications
• create, delete communication connection
• send, receive messages if message passing model to host name or process
name
• From client to server
• Shared-memory model create and gain access to memory regions
• transfer status information
• attach and detach remote devices
Types of System Calls
• Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Examples of Windows and Unix System Calls
Initial Hardware Model
The host machine is equipped with the physical hardware
e.g. a desktop with x-86 architecture running its installed Windows OS
All applications access hardware resources (i.e. memory, i/o) through system calls to operating
system (privileged instructions)
• Single OS image per machine
• Software and hardware tightly coupled
• Running multiple applications on same machine
• Underutilized resources
• Inflexible and costly infrastructure
• Advantages
• Design is decoupled (i.e. OS people can develop OS separate of Hardware
people developing hardware)
• Hardware and software can be upgraded without notifying the Application
programs
• Disadvantages
• Application compiled on one ISA will not run on another ISA..
• Applications compiled for Mac use different operating system calls then
application designed for windows.
• ISA’s must support old software
• Can often be inhibiting in terms of performance
• Since software is developed separately from hardware..
• Software is not necessarily optimized for hardware.
Architecture & Interfaces
Architecture: formal specification of a system’s interface and the logical behavior of its visible
resources.
Applications
API
Libraries
System Calls
ABI
Operating
System
ISA
System ISA User ISA
Hardware
Applications or OS
Virtualized
Disk
Virtualization
File File
Abstraction
Real Disk
• Virtualization, in computing, is the creation of a virtual (rather than actual)
version of something, such as a hardware platform, operating system, storage
device, or network resources.
• Virtualization is the process by which one computer hosts the appearance of
many computers.
• It is used to improve IT throughput and costs by using physical resources as a pool
from which virtual resources can be allocated.
VIRTUALIZATION BENEFITS
• Sharing of resources helps cost reduction
• Isolation: Virtual machines are isolated from each other as if they are physically
separated
• Encapsulation: Virtual machines encapsulate a complete computing environment
• Hardware Independence: Virtual machines run independently of underlying
hardware
• Portability: Virtual machines can be migrated between different hosts.
• Cross platform compatibility
• Increase Security
• Enhance Performance
• Simplify software migration
What is “Machine”?
• 2 perspectives
• From the perspective of a process
• ABI provides interface between process and machine