Computer Architecture - System Software
System Software
Objectives
Become familiar with the functions provided by operating systems, programming tools, database software, and transaction managers.
Understand the role played by each software component in maintaining the integrity of a computer system and its data.
Introduction to System Software
System software resides at the third level, interacting with software at the fourth and fifth levels, operating just above the instruction set architecture level.
This software facilitates interaction with hardware resources for application programs.
System software includes compilers, utilities, and middleware.
Middleware bridges the semantic gap between physical components and high-level languages.
Operating systems are fundamental to all system software interactions.
The effectiveness of a computer relies on its ability to provide services efficiently to users.
Users interact with the computer through application programs that are executed by hardware components.
System software, like operating systems and middleware, serves as the essential link between these components.
Operating Systems
The evolution of operating systems has mirrored hardware advancements, enabling easier management of machine power.
Early operating systems were simple resident monitor programs capable of loading, executing, and terminating programs.
Multiprogramming:
In the 1960s, hardware enabled multiprogramming, allowing concurrent execution of multiple tasks by allocating CPU time slices to each process.
Interactive multiprogramming systems were also known as timesharing systems.
A context switch occurs when the CPU switches from one process to another.
Multiprocessor Systems:
Multiprocessor systems present challenges in synchronization and interference prevention.
Tightly coupled systems: Share a common memory and I/O devices.
Symmetric multiprocessor systems: Tightly coupled and load balanced.
Loosely coupled systems: Feature physically separate memory, often referred to as distributed systems.
Networked systems: Collections of interconnected, collaborating workstations.
Real-Time Operating Systems:
Control computers that respond to their environment.
Hard real-time systems: Have strict timing constraints.
Soft real-time systems: Do not have tight timing constraints.
Personal Computer Operating Systems:
Designed for ease of use.
BIOS (Basic Input-Output System):
Allowed a single operating system to function across different small systems by handling peripheral device variations.
Graphical User Interfaces (GUIs):
Introduced in the 1980s, initially for desktop publishing and games, now essential for users with limited computer education.
Linux:
Evolved from a server OS to a desktop system, bringing Unix to ordinary users.
Key Operating System Components:
Kernel:
The core of the OS, responsible for scheduling, synchronization, memory management, interrupt handling, security, and protection.
System programs
Microkernel Systems:
Provide minimal functionality, with most services performed by external programs.
Examples: MINIX, Mach, and QNX.
Ideal for symmetric multiprocessor computers.
Offer better security, easier maintenance, and portability but may sacrifice execution speed.
Monolithic Systems:
Provide most services within a single OS program.
Examples: Linux, MacOS, and DOS.
Offer faster execution speed but are harder to port across different architectures.
Process Management:
The OS creates, schedules access to resources for, deletes, and deallocates resources from processes.
The OS monitors process activities to prevent synchronization issues when shared resources are used.
The OS provides services for inter-process communication.
Process Execution Scheduling:
Long-term scheduling: Determines which processes gain access to the CPU.
Short-term scheduling: Determines which process has CPU access at any given moment.
Context switches: Occur when a process is removed from the CPU and another takes its place, preserving process state information.
Types of Short-Term Scheduling:
Non-preemptive: A process retains the CPU until termination or when waiting for unavailable resources.
Preemptive: Each process receives a time slice; a context switch occurs at the end of the slice or when a higher-priority process requires the CPU.
CPU Scheduling Approaches:
First-come, first-served: Jobs are serviced in arrival order and run to completion if they have necessary resources.
Shortest job first: Schedules the smallest jobs first.
Round robin: Each job is allocated a fixed amount of CPU time, and a context switch occurs when the time expires.
Priority scheduling: Preempts lower-priority jobs when a higher-priority job needs the CPU.
Protected Environments
Offer resource management and protection by isolating processes or groups of processes.
Approaches include virtual machines, subsystems, and partitions.
Simplify system management, control, and can emulate machines to run programs the system couldn't otherwise.
Virtual Machines:
Present an image – either of themselves or of a different architecture – to processes within the environment.
Managed by the kernel, which handles all resource requests from processes in the virtual environment.
Subsystems:
Provide logically distinct environments that are individually controlled and managed.
Can be stopped and started independently.
Serve special purposes like controlling I/O or virtual machines, and can partition large systems to improve manageability.
Resources must be made visible to the subsystem before processes within it can access them.
Logical Partitions (LPARs):
Establish high barriers in large computers, preventing processes in one partition from accessing processes in another without an explicit connection.
Enable consolidation of numerous small servers into a single large system.
Programming Tools
Facilitate software creation within the operating system and hardware.
Assemblers:
Translate mnemonic instructions to machine code.
Use two passes:
First pass: partially assembles code and builds the symbol table.
Second pass: completes instructions using values from the symbol table.
Output is relocatable binary code, where operand addresses are relative to the program's load address.
Absolute code is suitable for device and OS control programming.
Special registers provide base addressing when relocatable code is loaded for execution, with addresses interpreted as offsets from the base.
Binding:
The process of assigning physical addresses to program variables.
Can occur at compile time (absolute code), load time (program cannot be moved), or run time (requires a base register).
Link Editors (Linkers):
Create executable modules by incorporating binary routines based on a program's external symbols.
Perform two passes: The first pass creates a symbol table and the second resolves references to the values in the symbol table.
Dynamic Linking:
Delays link editing until load time or run time.
External modules are loaded from Dynamic Link Libraries (DLLs).
Load time dynamic linking slows program loading, but DLL calls are faster.
Run time dynamic linking results in slower execution time.
Dynamic linking reduces program module sizes but risks loss of control over the DLL.
Programming Languages Generations:
Assembly language (2GL).
Compiled languages (C, C++, Pascal, COBOL) are third-generation languages (3GLs).
Each generation brings problem-solving tools closer to human thought and farther from machine implementation.
Compilers
Must translate all languages above the machine level into machine code, bridging the semantic gap between the higher-level language and the machine's binary instructions.
Use a six-phase process:
Analysis phases:
Lexical analysis extracts tokens.
Syntax analysis (parsing) checks statement construction.
Semantic analysis checks data types and operator validity.
Synthesis phases:
Intermediate code generation creates three-address code.
Optimization creates assembly code, leveraging architectural features.
Code generation creates binary code.
Compilers can be adapted for various platforms by modifying the last two phases.
Interpreters:
Produce executable code from source code in real time, line by line.
Slower than compiled languages and offer fewer error-checking opportunities.
Useful for teaching programming concepts due to instantaneous feedback.
Java: All the Above
Java programs (classes) run within the Java Virtual Machine (JVM), allowing cross-platform execution.
Java is both compiled and interpreted; compilation produces bytecode, which is interpreted by the JVM.
The JVM is a miniature operating system that loads, links, executes threads, manages, and deallocates program resources.
The JVM's extensive run-time tasks mean its performance cannot match traditional compiled languages.
Execution Phases:
A JVM must be running on the host system.
The JVM loads and executes the bytecode class file.
The JVM verifies the integrity of the bytecode while loading.
The loader performs run-time checks as it places the bytecode in memory.
The loader calls the bytecode interpreter.
Bytecode Interpreter Actions:
Link edits bytecode instructions by asking the loader to supply referenced classes and system binaries.
Creates and initializes the main stack frame and local variables.
Creates and starts execution threads.
Manages heap storage by deallocating unused storage during thread execution.
Deallocates resources of terminated threads.
Upon program termination, kills remaining threads and terminates the JVM.
Java's portability is a trade-off for performance, but it is ideal for middleware platforms (write-once, run-anywhere).
Conclusion
A computer system's performance depends on both its software and hardware.
The operating system is foundational for all other software.
Operating systems manage process execution, resources, protection, and security.
Subsystems and partitions aid compatibility and management.
Programming languages are grouped into generations, with assembly language as the first.
Languages above machine level must be translated into machine code.
Given its portability and relative ease of use, the Java language and its virtual machine environment are the ideal middleware platform.
Compilers bridge the semantic gap through six steps.
Link editors resolve system calls and external routines, creating executable modules.
Java uses a virtual machine, compiler, and interpreter.