Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: Operating System
Description: This note explains how the operating system is designed, its architecture and functioning. It also covers brief explanation on how RAM works and highlights the topics like Threads, CPU, Dead Lock, Process Synchronization,Memory Management, etc with complete details.
Description: This note explains how the operating system is designed, its architecture and functioning. It also covers brief explanation on how RAM works and highlights the topics like Threads, CPU, Dead Lock, Process Synchronization,Memory Management, etc with complete details.
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Operating System
http://www
...
com/virtim/index
...
An operating system (OS) is a collection of software that manages computer hardware resources and provides common
services for computer programs
...
Application programs usually require an operating system to function
...
The purpose of an operating system is to provide an environment in which a user can execute programs in a convenient and
an efficient manner
...
The four components are:
Hardware
Operating System
Application/System Software
User
Hardware
In the computer, the parts which are visible by humans are called hardware
...
Operating System:
(refer above mentioned definition)
Application/System Software:
The software is which are required by the system to execute any program, like compiler, assembler, is called system
software
...
Eg: word processor, spread sheets, any game software, etc
...
3) What are the services of operating System?
Depending upon the Structure of a System the operating systems have its own responsibilities and the services
...
virtim
...
php/2015-05-26-07-47-04/operating
...
b) I/O Operations:
After getting the input from the user, reply to the user with the correct output
...
c) File system manipulation:
Reading from a file, writing to a file, deleting a file and deleting the content of a file is done by the operating system
...
d) Communication:
When two or more than two processes want to transfer some data or they want to communicate, operating system is
responsible for the particular task
...
e) Error detection:
Operating system is responsible for the detection of error or correcting the error
...
f) Resource allocation:
If one resource is available and more than one user is requesting for that particular resource then the operating system
process all those user requests
...
Some resources like CPU, main memory, file storage, I/O devices, are managed by the operating system
...
for all those purpose the operating system
used to keep track
...
After providing some particular name and password the operating system can be able to save secret information
...
Batch System
Always operating system occupies half of the memory
...
virtim
...
php/2015-05-26-07-47-04/operating
...
Input devices: punch cards, card reader, tape drives
...
Job Scheduling:
If several jobs are ready to bring into main memory, and if there is not enough room for all of them, then the system must
choose among them
...
(i
...
; it is the preference of the task)
CPU Scheduling:
If several processes are ready to run at the same time, the system must choose among them
...
Multiprogramming System:
Advantages:
It reduces CPU idle time
It can process the multiple-task simultaneously
...
Time Sharing System or Multi-Tasking
If there are two or more programs to be executed, the operating system will provide a time quantum/time slice
...
Virtual memory
If the program size is larger than the physical memory then by using the virtual memory concept, it is possible to execute that
larger size program
...
After the completion of execution, the program is again reloaded to the secondary storage (hard disk)
...
Parallel System or Multi-Processor
Advantages:
Increased through put (per unit of time, how many process completed)
...
Increased reliability
...
virtim
...
php/2015-05-26-07-47-04/operating
...
They are:
1) Hard real time: This system guarantees that critical tasks to be completed on time
...
Operating System Components
Depending upon the functionality, operating system can be divided into smaller pieces (components)
...
The different components of operating system are:
Process Management
Memory Management
File Management
I/O system Management
Secondary Storage Management
Networking
Protecting System
Process Management:
Creating and deleting the process
...
Providing mechanism for process synchronization
...
Providing the mechanism for data handling
...
Deciding which process to be loaded into memory when memory space is available
...
File Management:
Creating and deleting files
...
Manipulating files and directories
...
I/O System Management:
4 of 18
I/O system consists of a memory management component that includes a buffering, spooling and caching
...
Drivers for specific hardware devices
...
virtim
...
php/2015-05-26-07-47-04/operating
...
Storage allocation
...
Networking:
A networked system is a collection of programs and associated protocols, which do not share memory or peripheral devices
...
The set of computers are intercollected by a communication network
...
The order of execution is as follows:
Read a set of data from input device
After CPU starts execute the data, the input device begins to read the next set of data
...
Spooling:
It is possible for the operating system to keep all the jobs on a disk, rather than in a card reader
...
During execution, the operating system takes the input from the disk
...
After completion of job, output is printed
...
virtim
...
php/2015-05-26-07-47-04/operating
...
The
higher levels are expensive, but they are fast
...
Where as in magnetic disk it is random
access, so it will access in short time
...
They can be divided into
the following categories:
a) File Management
b) Status Synchronization
c) File Modification
d) Programming Language Support
e) Program Loading and Execution
f) Communication
a) File Management:
Creating files
Deleting files
Copy the file
Resume the file
b) Status Synchronization:
Some programs simply ask the system for the date, time, amount of available memory or disk space, number of users, etc
...
6 of 18
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
d) Programming language support:
Some system programs like compiler, interpreter, etc
...
e) Program loading and execution:
Once a program is compiled (assembled), it must be loaded into memory for execution
...
f) Communication:
These programs provide the mechanism for creating virtual connection among processes, users and different computer
systems
...
There are different methods to pass parameters to operating system
...
In some cases there may be more parameters than registers
...
And the address of the block is passed as parameters into register as shown in the figure
...
They are:
Process control
File management
Device management
Information maintenance
Communication
Process:
7 of 18
Process Management
A process can be defined as a program in execution
...
A program by itself is not a process; a program is a passive entity
...
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
Thread:
A thread is a dispatchable unit of work
...
There are two types of thread
...
Single Thread:
A process with single thread is called single threaded process
...
Multi Thread:
A process with multiple threads is called a multi threaded process
...
Write a note on Process States?
As process executes, it changes state
...
Each process
may be in one of the following states:
New:
The process is being created
...
Running:
instructions are being executed
...
Waiting:
the process is waiting for some event to occur or event completion
...
8 of 18
1/31/2016 6:51 PM
Operating System
Terminate:
http://www
...
com/virtim/index
...
the process has completed its execution
...
Only one process can enter into the running state at a time
...
Process Control Block
Each process is represented in the operating system by a Process Control Block (PCB)
...
A PCB contains information associated with a specific process, including following:
Process state:
The state may be New, Ready, Running, Waiting, Terminate and so on
...
CPU Registers:
The registers vary in number and type, depending on the computer architecture
...
Before switching to the next process, it is required to save all the value of this registers into
corresponding
...
Memory management information:
The information may include the value of the base and limit registers, the page tables, segment tables, etc
Accounting information:
This information includes the amount of CPU real time used, time limits, account numbers, process numbers, etc
...
9 of 18
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
Independent Process:
A process is independent if it cannot affect or be affected by the other process executing in the system
...
Cooperating process:
A process is cooperating, if it can affect or be affected by the other process executing in the system
...
CPU Bound Process:
A CPU Bound process is a process which holds the CPU throughout its execution
...
I/O bound process:
An I/O bound process is a process which needs more I/O operation to complete throughout its execution
...
Scheduling Queues:
When a process enters into the system, they are put into a job queue
...
The
processes that are residing in the main memory, which are ready and waiting to execute, are kept on the queue
...
The list of processes waiting for a particular I/O device is called device queue
...
And then the process placed into I/O queue
...
The process could be removed forcibly from the CPU, like an interrupt, time slice expired, etc
...
virtim
...
php/2015-05-26-07-47-04/operating
...
There are three types of scheduler:
1
...
The long term scheduler is responsible for selecting the process carefully
...
Long term scheduler is responsible for increasing the degree of multiprogramming
...
Midterm scheduler:
The midterm scheduler removes processes from memory
...
3
...
The STS selects from among the processes that are ready to execute, and allocates the CPU to one of them
...
CPU Scheduling Algorithm
CPU scheduling is one of the processes in multiprogramming operating system
...
Whenever so many processes are waiting at the main memory at that time it is required to select a particular process for
execution by using CPU scheduling algorithm
...
To select a
best CPU scheduling algorithm, we must consider the properties of various algorithms
...
virtim
...
php/2015-05-26-07-47-04/operating
...
Some basic CPU scheduling criteria are:
CPU utilization
Throughput
Turnaround time
Waiting time
Response time CPU Utilization
CPU utilization
...
Throughput
Throughput is the number of processes are completed the execution per unit time
...
Turnaround Time
Turnaround time is the sum of the periods spent waiting to get into memory, waiting in the ready queue, executing on the
CPU and doing I/O
...
Waiting time
Waiting time is the sum of periods spent waiting in the ready queue
...
To select a best CPU scheduling algorithm, we have to reduce the waiting time
...
So, the time duration after giving the input and getting the
output is called response time
...
Process Synchronization
Whenever more than one process wants to communicate with each other, wants to share the computing resources
...
So, that process execution can be done properly
...
Semaphores:
It is one of the mechanisms using which the process can be synchronized properly
...
virtim
...
php/2015-05-26-07-47-04/operating
...
There are two conditions we have to check
...
The sem-wait operation
checks the semaphore value
...
If the value is 1, then
the value changes to 0
...
The sem-signal operation checks if any process are blocked on the semaphore
...
If no processes are blocked, then the value of semaphore is set to 1
...
First, the semaphore is initialized equal to the number of
resources available
...
When a process releases a resource, it performs signal operation (signal ()) on the semaphore by incrementing the count
...
All resources are in use
...
Critical Section:
A section of code within a process that requires access to share resources and that may not be executed while another
process is in a corresponding section of code
...
That access shared resources; no other process may be in a
critical section
...
Â
Dead-locks:
Dead Lock
When one process holds a particular resource and requesting for another resource but that resource also holding by some
other process and request for this resource
...
Eg: The following figure giving an example of dead-lock
...
And there are
two resources R1 and R2
...
And requests resource R1
...
In this situation neither process P1 nor process P2 can complete their execution
...
13 of 18
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
1) Mutual exclusion:
Only one process at a time can use the resource
...
2) Hold and wait:
A process must be holding at least one resource and waiting to acquire additional resources that are currently being held by
other process
...
4) Circular wait:
A set of process like {P0, P1, P2
...
P2 is waiting for a resource that is held by P3
...
Pn is waiting for a resource that is held by P0
...
Where as an address which is sum of logical address
and the address present in MMU is called Physical address
...
The set of all physical address corresponding to these logical addresses is called physical address space
...
The range for the logical address, suppose 0 to max
then the range for physical address is r+0 to r+max
...
The size of a process is limited to the size of physical memory
...
http://www
...
com/virtim/index
...
In dynamic loading, a routine is not loaded until it is called
...
The main program is loaded into the memory and executed first
...
If not, then the loader loads the desired routine to the memory
...
Better memory space utilization
...
Disadvantages:
Total loading time is more
...
But dynamic linking is postponed until execution time
...
The stub is a piece of code indicating how to find the appropriate
routine, how to load the routine
...
Updating of dynamically linked libraries is at one place
...
Whenever a process needs to be executed, can be swapped temporarily out of memory to disk and
then brought back into memory for continuing the execution
...
Whenever one process is loading from disk to memory is called swap-in
...
Eg: in a multi-programming environment, with a
round robin CPU scheduling, when a quantum expires, the memory manager will start to swap-out the process that just
finished
...
15 of 18
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
Advantages:
Swapping can increase the degree of multi-programming
Disadvantages:
Swapping whole partitions is expensive
...
Memory Allocation:
Â
Â
Demand paging
Virtual Memory
Page fault
Page replacement algorithm
Thrashing:
Virtual memory is a technique that allows the execution of process, which may not be completely fit in memory
...
Overlays and dynamic loading also can solve this type of problems, but they generally require special logic and extra work by
16 of 18
1/31/2016 6:51 PM
Operating System
http://www
...
com/virtim/index
...
the programmer
...
Virtual memory is commonly implemented by demand paging
...
Demand Paging:
The demand paging system is similar to a paging with swapping process resides on secondary memory
...
Rather than swapping the entire process at a time into the memory, we swap one particular page, which is required for
execution
...
A lazy swapper never swaps a page into the memory unless that
page will be needed
...
Instead of
swapping full pages at a time, the pager brings only those necessary pages into memory
...
Page Fault & steps to handle page fault:
When one process is trying to access one particular page, but the page is not present in the memory at that time, page fault
occurs
...
This trap is the result of operating system failure to bring the desired page into memory
...
Step1: We check an internal table for this process, to determine whether the reference was valid or invalid Memory access
...
If it is valid, the page is not yet in the memory
...
Step3: We have to find a free frame
...
Step5: When the disk read is completed, we modify the internal table and the page table to indicate that the page is now in
memory
...
Now the process can access the page and
continue the execution
...
virtim
...
php/2015-05-26-07-47-04/operating
...
After these page is brought
into memory, the process continue to execute, faulting as necessary until every page that it needs is in memory
...
This scheme is known as pure demand paging
Title: Operating System
Description: This note explains how the operating system is designed, its architecture and functioning. It also covers brief explanation on how RAM works and highlights the topics like Threads, CPU, Dead Lock, Process Synchronization,Memory Management, etc with complete details.
Description: This note explains how the operating system is designed, its architecture and functioning. It also covers brief explanation on how RAM works and highlights the topics like Threads, CPU, Dead Lock, Process Synchronization,Memory Management, etc with complete details.