The major function of operating system :
Program Execution :It provides the capability to load a program into memory and to run it.
I/O operations :Since user programs cannot execute I/O operations directly, the operating system must provide some means to perform I/O operations.
Process Management :A process is a program in execution.The operating system is responsible for - process creation and deletion, process suspension and resumption, process synchronization and communication.
Main Memory Management :Memory is a large array of words or bytes, each with its own address.It is a respository of quickly accessible data shared by the CPU and I/O devices.The operating system is responsible for the following activities in connections with memory management :
Keep track of which parts of memory are currently being used and by them.
Decide which processes to load when memory space becomes available.Allocate and de-allocate memory space as needed.
File Management :It provides the capability to read, write, create, and delete files.
Communications :Exchange of information between processes executing either on the same computer or on different systems tied together by a network.
Error Detection :It ensures correct computing by directing errors in the CPU, memory, I/O devices, or in user programs.
Resource Allocation :It allocates resources to multiple users or multiple jobs running at the same time.
Accounting :It keeps track of end records which users use how much and what kind of computer resources for account billing or for accumulating usage statistics.
Protection :It ensures that all access to system resources is controlled.
The types of Opearting Systems :
Based on command, the operating system can be classified into two categories, as :
- Text/CLI based operating system
- Graphicsl User Interface(GUI) based operating system
Based on tasks, number of user and other features - the operating system can be classified into the following categories:
- 1.batch processing operating system
- 2.multiprogramming operating system
- 3.multiprocessing operating system
- 4.time sharing operating system
- real time operating system
- network operating system
Important features of command line interface system(CLI) :
- The user gives instructions to the operating system by typing in the commands at a command prompt
- It requires the memorization and familiarity to operate a command line interface by user.So, new users find it much more difficult to successfully navigate and operate a command line interface.
- Text based systems run faster because the machine does not expand resources on processing the graphics.
- Text based applications use memory more efficiently.
- Command line interface often provide the user more control on the software than a graphical user interface, by taking all the details of a command as parameters and/or by redirecting the outputs between commands.
Important features of Graphical User Interface system(GUI) :
- In the graphical user interface a visual environment(most commonly with windows, buttons, icons and a mouse pointer) is present
- The multi-tasking nature of modern computers means that there can be several windows open at the same time..
- It is more attractive for non-technical people.
- Windown can be moved, resized etc.
- Applications run in windows.
- It is user friendly
- It does not require a lot more system resources because of each of the elements that need to be loaded such as icons, fonts, etc.
- GUI users have windows that enable a user to easily view, control, and manipulate thing at once.
Advantages of Virtual Machine Structure?
- The VM concept provides coomplete protection of system resources since each virtual machine is isolated from all other virtual machines.This isolated permits no direct sharing of resources.
- A VM system is a perfect vehicle for OS research and development.System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation.Disadvantages of Virtual Machine Structure?
- THe VM concept id difficult to implement due to the effort required to provide an exact duplicate to the underlying machine.
The Process Sheduling Queues :
Job Queue :All processes are stored in the job queue.Each entering process goes into job queue.Processes in job queue reside on mass storage await allocation of main memory.
Ready Queue :Processing residing in main memory and awaiting CPU time are kept in ready queue.
Device Queue :Processes waiting for allocation of a certain I/O device reside in device queue.Processes waiting for a device to become available or to deliver.
The Process Control Block :
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory management information
- Accounting information
- I/O status information
Process state :Running, waiting, etc, as discussed above.
Process Number :Numeric identifies that may be stored with the process control block includes :
- Identifies of this process
- Identifies of the process that created this process
- User identifier
CPU registers :Result of the most recent arithmetic or logical operation(e.g, sign, zero, carry, equal, overflow)
Program counter :Contains the address of the next instruction to be fetched.
CPU-Scheduling information :Such as priority information and pointers to scheduling queues.
Memory Management information :This section may include pointers to segment and/or page tables that describe the virtual memory assigned to this process.
Accounting information :User and kernel CPU time consumed, account numbers, limits, etc.
I/O Status information :Devices allocated, open file tablet, etc.
The Cooperating processes :
Information Sharing :There may be several processes which need access to the same file for example.
Computation speedup :Often a solution to a problem can be solved faster if the problem can be broken down into sub-tasks to be solved simultaneously particularly when multiple processors are involved
Modularity :The most efficient architecture may be to break a system down into cooperating modules.
Convenience :Even a single user may be multi-tasking, such as editing, compiling, printing, and running the same code in different windows.
The types of System call :
1. Process Control :
- load, execute(exe)
- end, abort
- create process(fork), terminate process(exit)
- get/set process attributes
- wait for the, wait event, signal event
- allocate, free memory
2.File Management :
- create file, delete file
- open, close
- read, write, reposition
- get/set file attributes
3.Device Management :
- request device, release device
- read, write, reposition
- get/set device attributes
- logically attach or deattach devices
4.Information Maintenance :
- get/set time or date
- get/set system data
- get/set process, file, or device attributes
- create, delete communication connection
- send, receive message
- transfer status information
- attach or deattach remote devices
The System Program :
4.Programming Language Support
5.Programming loading and execution
1.File Manipulation :create, delete, copy, rename, print, dump, list, and generally manipulate files and directories
2.Status information :Some task the system for information as, -date, time, amount of available memory, disk space, number of users.Others provide detailed performance, logging, and debugging information
3.File modification :Text editors to create and modify files.Special commands to search contents of files or perform transformations of the text.
4.Programming Language Support :Compiles, assemblers, debuggers and interpreters are sometimes provided as system programs
5.Programming loading and execution :Absolute loaders, re-locateable, loaders, linkage editors, and overlay-loaders, debugging systems for high level and machine language
6.Communications :Provide the mechanism for creating virtual connections among processes, users, and computer systems.Allow users to send message to one anothers screens, browse web pages, send electronic-mail message log in remotely, transfer files from one maintenance to another.
Describe batch processing operating system :
1. Job submission :-entering job parameters to the operating system with a scripting language, such as JCl, usually contained in a data set or hitorically on punched cards
2. Job reading :-Operating system parses JCL data set
3. Job spooling :-
4. Job selection :-
5. Job execution :-with output spooling -executing actual computer programs included in a job and collecting their output
6. Job output :-print or punch
7. Job purge :-All resources associated with the job are released
The advantages of batch processing operating system :
Batch jobs together :batch jobs was submitted together to the computer and job-to-job transition was done automatically by the operating system.It reduces setup time by batching similar jobs.
Manage Large Volumes of work :This method of processing becomes advantages when a large volume of work requires repetitive actions without direct supervision.
No interactivity :Once a batch process begins, an operator cannot interject himself into the process without stopping the process completely.The item to process are placed in a list, and that list is worked on without user input.
The Advantages of multiprogramming system :
- To the user, the advantages of multitasking is the ability to have several applications open and working at the same timFor example, a user can edit a file with one application while another application is recalculating a spreadsheet.
- To the application developer, the advantages of multitasking is the ability to create application that user more than one process and to create processes that use more than one thread of execution.
- Multiprogramming makes efficient use of the CPU by overlapping the demands for the CPU and its I/O devices from various users.
- It attempts to increase CPU utilization by always having something for the CPU to execute.
The Advantages of Time Sharing system :
- A number of terminals simultaneously connected to the system, so that multiple users can use the system in interactive mode .
- By allowing large number of users to interact concurrently with a single computer, time-sharing dramatically lowered the cost of providing computing capability.
- It reduces CPU idle time.
- It can be effectively used for interactive programming and debugging to improve programmers efficiency.
Limitations of Time Sharing System :
- A relatively large memory is required to support multiprogramming .
- Memory protection mechanism is required to prevent one job's instructions and data from other jobs in a multiprogramming environment.
- It requires special CPU scheduling algorithm to allocate the time slice.
- For small organization it is not cost effective.
- As the number of user increases, the system throughtput decreases.