Os Chapter One
Os Chapter One
• CTSS – the first timesharing system developed for IBM 709 and later to IBM
7094
• Ensure correct computing by detecting errors in the CPU and memory hardware,
in I/O devices, or in user programs.
• It should take the appropriate action to ensure correct and consistent computing.
Resource Allocation:
• If there are more than one user or jobs running at the same time, then resources
must be allocated to each of them.
• Operating system manages different types of resources require special allocation
code, i.e. main memory, CPU cycles and file storage.
• There are some resources which require only general request and release code
• For allocating CPU, CPU scheduling algorithms are used for better utilization of
CPU.
• CPU scheduling algorithms are used for better utilization of CPU.
• CPU scheduling routines consider the speed of the CPU, number of available
registers and other required factors.
Accounting
• Collects usage statistics for various resources
• Monitor performance parameters such as response time
• Accounting information is useful For future enhancement
• In tuning the system to improve performance
• For billing purposes (in multi-user environment)
• Logs of each user must be kept.
• It is also necessary to keep record of which user how much and what kinds
of computer resources.
• This log is used for accounting purposes.
• The accounting data may be used for statistics or for the billing.
• It also used to improve system efficiency.
Shell( program execution )
• Command interpreter that acts as a primary interface between a user sitting at its
terminal and the operating system
• It is a process (running program) that reads commands
• It is not part of the operating system but it makes heavy use of many operating
system features
• How the shell works?
• When any user logs in, a shell is started up
• The shell displays a prompt which tells the user that it is ready to accept a
command
• When the user enters a command, the shell creates a child process that runs the
program for the corresponding command
• When the child process is running, the shell waits for it to terminate
• When the child process finishes, the shell displays the prompt and tries to read
the next command
1.7 operating system structure
• Size and complexity of operating systems has been growing over the years
• More and more features have been added
• Hardware has become more capable and versatile
• The size and complexity has created some major problems
• Late delivery
• Latent bugs
• Performance
• The essence of operating system structure is to manage the complexity of the
software
• Operating system structure refers to the internal organization of the software
• Four types of OS structures:
• Monolithic system
• Layered system
• Virtual machines
• Client server system
Monolithic Systems
• Has no structure
• Collection of procedures
• Each procedure has a well-defined interface (in terms of parameters & results)
• Each procedure can call any other one: No information hiding
• Composed of main program, service procedures and utility procedures
• Has one big monolithic kernel
• Implemented as a single process
• To get service:
• User program puts the parameters in well-defined places (registers/stack)
• A special trap instruction known as kernel/supervisor call is invoked
• Switches the machine from user mode to kernel mode
• Transfers control to the OS
• OS determines the required service
• OS calls the required service procedure
• Control is returned to user program
Layered/Hierarchical Systems
• Organizes the system as a series of levels (layers).
• Each level performs a related subset of functions
• Each level relies on the next lower level
• To perform more primitive functions
• To conceal the details of those functions
• Each level provides service to the next higher level
• Levels are defined in a way that changes in one level does not require changes
in other levels
• The first layered system was called THE and has 6 layers
• Layer 0: Process allocation and multiprogramming
• Processor allocation
• Process switching
• Layer 1: Memory and drum management
• Allocate space for processes
• Layer 2: Operator process communication
• Handle communication between process and operator console
• Layer 3: I/O management
• Manages I/O devices and buffering information streams to and from them
• Layer 4: User programs
• Layer 5: Operator
Virtual Machines
• The essence of virtual machine systems is to separate the two functions of
timesharing systems
• Multiprogramming
• Extending the machine with a more convenient interface
• VM/370
• Virtual machine system developed for IBM/360s
• Originally called CP/CMS (conversional monitor system)
• Radically different from TSS/360, official timesharing system for IBM/360s,
which was delivered late
• Virtual Machine Monitor
• The heart of VM/370
• Runs on the bare hardware
• Provides multiprogramming & several virtual machines (CPMs) to the next
layer up
• The virtual machines are not extended machines but they are exact
copies of the bare hardware
• Each virtual machine can run any operating systems
Client-Server Model
• Most OS functions are implemented in user processes
• Moves the code up into higher layers and leaves a minimal kernel
(microkernel)
• User process (called client process) sends a request to a server process,
which does the work and sends back the answer
• All the kernel does is handling the communication between clients and
servers
Advantages
• Manageability (flexibility and easy implementation)
• The OS is broken down into parts
• Each part handles only one function of the system
• Each part becomes small and manageable
• Better system protection
• The whole machine will not be down easily since all servers run in user mode,
i.e. servers do not have direct access to the hardware
• Adaptability to distributed systems
• Client need not know where its request is handled: locally or on remote
machine