Computer Systems: Architecture and Operating System Fundamentals
Computer Organization Principles
Design Levels and Hierarchical Organization
Design Levels: Each level provides higher-level features and functions, which are then utilized by the levels below. These levels can be described either top-down or bottom-up.
Hierarchical Organization: Each level within a computer system is a set of interrelated systems, each possessing its own hierarchical structure. The organizational structure often references models such as Tanenbaum’s.
Understanding Operating Systems
What is an Operating System (OS)?
An Operating System (OS) serves as a resource manager and an interface between programs, users, and hardware. The OS is a fascinating field, combining aspects from various computer-related areas such as languages, hardware, data structures, and algorithms.
The basic purpose of an OS is to create a virtual machine that is easy to work with and use.
Core Functions of an OS
Its primary functions include:
- Sharing hardware resources among users.
- Facilitating input/output operations.
- Scheduling and allocating resources among users.
- Defining and managing the user interface.
- Allowing users to share data.
- Recovering from system errors.
Key Resources Managed by an OS
The key resources an OS manages include:
- Processors
- Input/Output (I/O) devices
- Storage
- Data
Roles of an Operating System
The OS plays crucial roles as a:
- Coordinator and Resource Arbiter:
- Manages all system resources.
- Resolves conflicts in resource requests.
- Prevents errors and inappropriate uses of the computer.
- Facilitator:
- Provides all necessary facilities, such as standard libraries and windowing systems.
- Makes application programming easier, quicker, and more error-free.
Visions of an Operating System
Different perspectives define the scope and focus of an OS:
- Broad Vision:
- Provides an environment for creating and maintaining programs.
- Offers a sophisticated interface for program operations.
- Provides an interface to implement programs simply.
- Manages system resources comprehensively.
- Restricted Vision: Focuses on the core system functions and data structures necessary to manage fundamental resources:
- CPU
- Memory
- Input/Output (I/O) Devices
- Processes
Types of Operating Systems
Batch Operating Systems
- The OS was always resident in memory.
- To speed up processing, operators grouped similar jobs into batches and ran them as a group on the computer.
- Often, the CPU was idle during I/O operations.
- This approach replaced direct card reader drives and led to the development of job scheduling and multiprogramming.
Interactive Operating Systems
- Provides direct communication between the user and the system.
- The user instructs the operating system or a program directly using a keyboard or mouse and expects immediate results.
Timesharing Operating Systems
- Allows multiple users to share the computer simultaneously.
- The CPU switches rapidly from one user to another, giving the illusion of simultaneous access.
Real-time Operating Systems (RTOS)
- Used when there are rigid requirements on the operation time of a processor.
- Often used in dedicated applications.
- The system must respond within a fixed amount of time to ensure proper operation and avoid failure.
Network Operating Systems
- Provides an environment where users with multiple machines can access remote resources.
Distributed Operating Systems
- Distributes the computing system among several physical processors.
- Processors do not share memory or a common clock.
- Instead, each processor has its own local memory.
- They communicate through various communication lines, such as network connections.
Program Execution on a Dedicated Machine
Four Steps for Program Execution
Here are four dedicated steps to run a program on a dedicated machine:
- System Preparation/Setup: Ensure the machine is ready for operation.
- Manual Program Loading: Manually load the program into memory.
- Execution Initiation: Load the starting address and begin program execution.
- Monitoring and Control: Monitor and control the program’s execution from the console.
Multiprogramming Advantages
The main advantage of multiprogramming is that it makes efficient use of the CPU by overlapping the demands for the CPU and Input/Output (I/O) operations from various users. It aims to increase CPU utilization by always having a task ready for the CPU to run.
When a Shared System is Optimal
A shared system is particularly effective when:
- There are few users.
- The computational tasks are significant.
- The underlying hardware is fast.
Challenges of Real-time Systems
A real-time system has fixed and well-defined time constraints. Therefore, the main difficulty a programmer faces when writing an operating system for a real-time environment is ensuring that processing occurs within these defined limits; otherwise, the system will fail.