Wednesday 5 February 2014

Operating System

Operating System Definition and OS Types

An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is an essential component of the system software in a computer system. Application programs usually require an operating system to function.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and will frequently make a system call to an OS function or be interrupted by it. Operating systems can be found on almost any device that contains a computer—from cellular phones and video game consoles to supercomputers and web servers.

Examples of popular modern operating systems include Android,BSDiOSLinuxOS XQNXMicrosoft WindowsWindows Phone, and IBM z/OS. All these, except Windows, Windows Phone and z/OS, share roots in UNIX.

Operating system placement.svg


Operating System Types: 

After reading this section you will be able to categorize operating systems into neat categories, and readily identify what each OS is for. There are many kinds of operating systems; however, they usually fall into four broad categories. They are distinguished from one another by nature of interaction between the user and the OS and the purpose that they intend to serve. 

1-Real-time Operating System {RTOS}.
2-Single-task, Single user Operating System.
3-Single user, Multitasking Operating System.
4-Multi-user Operating System.

1- Real-time Operating System {RTOS} 

This OS is used specifically to control instruments, machineries, industrial systems and scientific instruments. They have very little user-interface capabilities. One of the most remarkable aspects of an RTOS is the management of the resources of the computer so that a particular operation executes in the same amount of time every time it occurs. That’s the main reason of using this OS in the industries as the prices time is really a big matter. 

Real-time operating system, in turn, is further broken up into two categories:

a.Hard real-time OS: This OS fully guarantee critical tasks will be completed in a given amount of time. This type accepts new critical commands from an external device, in this case, it is common that it will suspend the execution of other less critical commands, so if a process completes correctly but takes longer than its given amount of time, the process fails. 

b.Soft real-time OS: This type is by far less restrictive than the Hard type. This type prioritizes tasks into critical and non-critical. The non-critical tasks are bounded to give the critical tasks enough time to be performed; however these bounds are as severe as in the Hard type. Compared to the Hard type, if a process completes correctly but takes longer than its given amount of time, the results may still useful.

Well, I would like to add that finding details about on these systems can be relatively hard, however some manufacturers like QNX offer more insight into these kinds of OSs .

2-Single-task, single-user Operating Systems 

This is another kind of OS. As the name implies this OS is designed to manage to manage so that one user can perform one single task at a time. A proof-of-concept OS is MS-DOS. 

3-Single-user, multitasking Operating Systems
 

This is the most famous OS and some times called Desktop OS. It is the OS that most people use at home and office. Most people have got this OS installed on their PCs or laptops. Good examples are, Linux SuSE, Slackware, Windows XP, Windows 5.0, MacOS. 
In this OS you may perform many tasks at the same time. For instance, writing an email while downloading a file or listening to your favorite music bands.


4-Multi-user Operating System 

This OS can let many and different users to take the advantage of the resources of the computer simultaneously. It is usually used on servers to let many users use the same set of programs and to effectively share resources. Before letting user commencing to use and work on the OS, the OS makes sure that the requirements of different users are balanced, and each program they are using has a sufficient and separate resources so that in case of one user failure won’t effect the other users.
Examples: VMS, Unix, and mainframe OSs like MVS. 

Important Note: Please don’t mix up between multi-user and single-user operating systems. People usually use the term multi-users for any OS that support the creation of different users like Win2000, WinXP, this is very wrong. Even though, these OSs can handle thousands of user but they are not truly multi-user OS, the ONLY functional user is the System Administrator. The remote user logins and the programs being run by them are actually being run by the Administrative user.

How Computer Boots Up?


Have you ever given it a thought that when you press the power button on your laptop or PC, what happens behind the logo of Windows XP/Vista/Seven or Linux? From the pressing of the power button to the appearance of the login screen there are more than hundred components/peripherals that are initialized and thousand lines of code is executed during the process of booting. But what is booting? We will look inside the machine, that actually what all happens. So let us start… 
What is Booting?Booting is a process or set of operations that loads and hence starts the operating system, starting from the point when user switches on the power button.

What is Booting Sequence?Basically documents related to booting are generally confusing as they are often related to some specific operating system that is Linux machine or Windows machine. But I will keep it as general as possible.


 Booting sequence comprises of the following steps:·    


  •   Turn on the Power button.
  •   CPU pins are reset and registers are set to specific value.
  •   CPU jump to address of BIOS (0xFFFF0).      
  •   BIOS run POST (Power-On Self Test) and other necessary checks.
  •   BIOS jumps to MBR(Master Boot Record).
  •   Primary Boot loader runs from MBR and jumps to Secondary Boot-loader.       
  •  Secondary Boot-loaders loads Operating System.These are the tasks that are carried during booting process. Now let us discuss them in detail.

As soon as we turn the power button, the reset signal is sent and the registers in the CPU are set to their pre defined value.  The first and foremost is the reset vector as shown in the figure (example is taken of 4GB RAM). It should be noted that RAM contains the garbage value at this time, and the instructions/data stored at any memory location is due to the memory map of the chipset. Memory map maps the location (address) to flash memory containing values or instructions.  It is ensured that the instruction stored at this reset vector location is jump to system BIOS, as BIOS takes up further process of powering up the system.


How Computer boots up


BIOS-Basic Input Output SystemAs we have seen that at power up CPU is reset and its registers are set to the default value, which is an address pointing or directing to the hardware containing BIOS. Generally the hardware is EEPROM containing the BIOS. The tasks performed by BIOS are categorized as follows:



  •  POST- Power on Self Test is the foremost routine which checks and tests the basic hardware. If it fails then it displays error.     


  • Initialization of the hardware devices by letting them run their individual BIOS( eg. video card have their own inbuilt BIOS code).

  • Searching for the Master Boot Record and reading it.



  • Copying the boot sector code to RAM and then switching the control to it.




Boot SectorsA sector is a part of the hard disk having length of 512 bytes. A sector is termed as boot sector because of its location and because this sector is responsible for the further boot process of the system. This boot sector is generally called Master Boot Record. The MBR is a 512-byte sector, which is located in the first sector on the disk (sector 1 of cylinder 0, head 0). As soon as BIOS gets the boot sector, it tends to copy MBR to RAM and switches the execution authority to it.

  • ·In the MBR the first 446 bytes are the primary boot loader, which is also referred as PBL.         
  • The next sixty-four bytes are the partition table, which has the record for each of the partitions.         
  • The MBR ends with two bytes that should be 0xAA55. These numbers act as validation that this sector is the boot sector or Master Boot Record.



  • How PC boots up2



History of Operating Systems

Historically operating systems have been tightly related to the computer architecture, it is good idea to study the history of operating  systems from the architecture of the computers on which they run.
Operating systems have evolved through a number of distinct phases or generations which corresponds roughly to the decades.

The 1940's - First Generations

The earliest electronic digital computers had no operating systems. Machines of the time were so primitive that programs were often entered one bit at time on rows of mechanical switches (plug boards). Programming languages were unknown (not even assembly languages). Operating systems were unheard of .

The 1950's - Second Generation

By the early 1950's, the routine had improved somewhat with the introduction of punch cards. The General Motors Research Laboratories implemented the first operating systems in early 1950's for their IBM 701. The system of the 50's generally ran one job at a time. These were called single-stream batch processing systems because programs and data were submitted in groups or batches.

The 1960's - Third Generation

The systems of the 1960's were also batch processing systems, but they were able to take better advantage of the computer's resources by running several jobs at once. So operating systems designers developed the concept of multiprogramming in which several jobs are in main memory at once; a processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use.
For example, on the system with no multiprogramming, when the current job paused to wait for other I/O operation to complete, the CPU simply sat idle until the I/O finished. The solution for this problem that evolved was to partition memory into several pieces, with a different job in each partition. While one job was waiting for I/O to complete, another job could be using the CPU.
Another major feature in third-generation operating system was the technique called spooling (simultaneous peripheral operations on line). In spooling, a high-speed device like a disk interposed between a running program and a low-speed device involved with the program in input/output. Instead of writing directly to a printer, for example, outputs are written to the disk. Programs can run to completion faster, and other programs can be initiated sooner when the printer becomes available, the outputs may be printed.
Note that spooling technique is much like thread being spun to a spool so that it may be later be unwound as needed.
Another feature present in this generation was time-sharing technique, a variant of multiprogramming technique, in which each user has an on-line (i.e., directly connected) terminal. Because the user is present and interacting with the computer, the computer system must respond quickly to user requests, otherwise user productivity could suffer. Timesharing systems were developed to multiprogram large number of simultaneous interactive users.

Fourth Generation

With the development of LSI (Large Scale Integration) circuits, chips, operating system entered in the system entered in the personal computer and the workstation age. Microprocessor technology evolved to the point that it become possible to build desktop computers as powerful as the mainframes of the 1970s. Two operating systems have dominated the personal computer scene: MS-DOS, written by Microsoft, Inc. for the IBM PC and other machines using the Intel 8088 CPU and its successors, and UNIX, which is dominant on the large personal computers using the Motorola 6899 CPU family.



No comments:

Post a Comment