Twitter Delicious Facebook Digg Stumbleupon Favorites More

Showing posts with label operating system. Show all posts
Showing posts with label operating system. Show all posts

Wednesday, 5 October 2011

BOOTING OF AN OPERATING SYSTEM OR UNDERSTANDING OF HOW OS BOOTS

HOW OS BOOTS 

Hello every one here I am going to explain how operating system boots i.e what happens when we start our PC. This is a very large process and here I am presenting it in a short form.

When we power on the computer then it takes some time, until it gets power good signal and in this duration it sends a reset signal to CPU. Power good signal is a sign that shows that it is appropriate to start the booting sequence. The value of power good signal is generally 5V.

When the booting of BIOS starts it first do the POST (power on self test) which checks the devices that is connected and if there is an error it makes notification in the form of BEEP (A sound of indication ).

The BIOS then looks for other devices like ROM to see if any of them have BIOSes. Normally, the IDE/ATA hard disk BIOS will be found at C8000H and executed. If any other is associated have BIOS, they are executed as well.
Then the BIOS display the welcome screen. Which is nothing but the drawing which is displayed over the screen and the selected OS is chosen by reading the ASCII values of the up down arrow key.

The selected OS is then start its own MBR and the OS comes into the main memory.

Friday, 16 September 2011

Process Synchronisastion

Process Synchronization

Introduction: In operating system if two or more co-operating processes some logical space i.e both data and code section or only data using some message call. In the process of sharing if two processes starts manipulating the same data at the same time then data inconsistency may occur, hence we need some rules by which we can restrict two or more process to manipulate data at the same time, so that data consistency is maintained.

we can view this problem from this example.
Let two process P1 and P2 is working on the same resource(data)  a=30(initially).

     P1                                          P2
 temp = a;                                temp = a;
 temp = temp+10;                    temp = a-5;
 a = temp;                                a = temp;

Here temp is a local variable

Let first process P1 starts executing it and stores value of   'a'   to temp then it adds 10 to temp.
now a = 30   and   temp = 40 (here temp is local to P1)
let there is a context switch and process P2 starts executing then it stores  a =30 to its local variable temp and decrements it by 5 i.e
now a = 30(still)    temp = 25 (here temp is local to P2)
now let again their is a context switch and process P1 starts executing  and it stores 40 to 'a' (from its local temp). and gets terminated, again process P2 starts and finally it stores 25 (from its local temp) to 'a' .

Hence we end up with 'a = 25' which may be different (i.e  40) if process ends lastly.
so we can see that for different execution sequences we have different end results. This anomaly is known as 'Race Condition'.
Hence we need to insure that only one process may change the variable at a time, in order to achieve this we require that process should be synchronized.

Wednesday, 7 September 2011

Process Scheduling

Process Scheduling

In a single processor system where there are many processor fighting for their execution or in the multiprocessor system where the same fight occurs, we need some mechanism or some rules to allocate the CPU one by one to them, and in such a system we need that the CPU of the system must be used efficiently, and this mechanism is known as Process Scheduling.
Suppose in a situation where one process starts I/O, then in case of without scheduling the processor will sit idle and hence it decreases the CPU utilization.
When a process is waiting in the ready queue and if CPU becomes idle then the operating system selects one of   the process in the ready queue using Short term Scheduler and here is the work of Process Scheduling comes.

There are two types of process Scheduling:
1. Preemptive Scheduling: In preemptive scheduling if a process is waiting for an I/O or a high priority process comes in the time of their execution that process leaves the CPU for that process using a context switch and it is preemption and this scheduling is known as Preemptive scheduling.
2. Non Preemptive scheduling: In non-preemptive scheduling if a process starts executing, it leaves after its termination, hence all process has to wait if a process is executing in CPU.

There are different types of scheduling algorithms used for process scheduling.
1. First come First serve (FCFS)
2. Shortest job first (SJF)
3. Round-Robin Scheduling (R-R)
4. Priority Scheduling
5. Multilevel Queue Scheduling
6. Multilevel Feed-back queue Scheduling

Tuesday, 6 September 2011

Inter-process communication (IPC)

           
Inter process Communication
If there are two processes executing parallel in an operating system then they may have two types
1. Independent process: Those process who do not affect or affected by another process which is executing in the OS(Operating System). 


2. Co-operating Process: These processes need some communication between them to complete their work.


Since there are lots of processes who communicates with another process due to several reasons like Information sharing, To increase the computation speed. etc..
Co-operating process needs some mechanism which may allow them to make communication with other processes and this mechanism is known as Inter Process Communication(IPC). 
Inter Process Communication is of two types
1. Shared memory System.
2. Message passing System.


Shared memory System:
In Shared memory System two process shares some part of their address space.(since it is not allowed by OS to share address space by two processes hence for shared memory system they(sharing processes) must agree to remove this restriction). This address space is then used by all co-operating process, here programmer has to explicitly develop the code for process in such a way the will not be updating at the same location simultaneously(using semaphore). Operating System dosen't take overhead for these things.


Message passing System:
If two processes are co-operating process then they communicate by message passing system also but message passing can slow the execution since message passes through the kernel. But this type of communication is very helpful in distributed computing environment where there is no common address space for communicating process.

Sunday, 4 September 2011

Thread in Operating System

Threads

Saturday, 3 September 2011

Process in Operating System

                PROCESS

Friday, 2 September 2011

Evolution of Operating System

Now in these days we are working with Operating System like Win7, Vista, Xp, Mac, these are highly graphical and very fast Operating Systems. There are other OS Android, Symbian etc for mobile phone these are also very advanced.
      Initially users( basically the scientist or programmer) use batch system, then after Multitasking, Real time system, Multi-programming system, Time sharing system has came.

Wednesday, 31 August 2011

Operating System Calls

To use the functions which are provided by an Operating System we use system calls, in other words we can say  system calls provides an interface to the services provided by an operating system.

Types of System Call

What is Operating System


                    Operating System

To define a Operating System we must have to know, what is the work of an operating system, since the work done by operating system is different in different situation hence defining an operating system in terms of either of
the particular area of work, just can't define it fully.
So from the last paragraph one question comes what is an operating system, why can't we define it easily, and an answer of these question is nothing but the implementation of OS in different way.
               First we consider the work of an OS for a single user, for a single user an OS is nothing but a software which gives him the facility to play video, audio, pictures, internet surfing and some more stuff, in this case the operating system has a little bit to do with the resource utilization.
               But if the user is on a terminal from where a number of computers are connected and all are accessing the terminal then there is a lots of work of resource utilization is evolved, here operating system is working as a resource utilizer.

            If we view the OS from the system prospective then it work as a resource allocator since if a system is   running then there are many resource like CPU time, main memory, VDU(visual display unit), Keyboards, Printers etc are to be allocated in such a way that there should be no any conflict and from this view operating system works as the allocator, which reduces conflict and manages the process in utilizing them.
         From the above discussion we understood that OS works different in different situation. Hence we can define Operating System as:


Operating System is a tool to solve the computing needs of its users with an efficient utilization of the resources.
or you can say,
Operating System is a bridge between user and hardware.(general definition)





 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Blogger Templates