Operating system 3

14
CECOS DATA INSTITUTE Operating System WINDOWS 7 & LINUX Prepare by: Mohsin Khan You can contact me with the following links Cell: 0336-9759874 Skype: MOHSIN.KHAN1341

Transcript of Operating system 3

Page 1: Operating system 3

CECOS DATA INSTITUTE

Operating System

WINDOWS 7 & LINUX

Prepare by: Mohsin Khan You can contact me with the following links Cell: 0336-9759874Skype: MOHSIN.KHAN1341

Page 2: Operating system 3

1

Operating System

April 1, 2014

OPERATING SYSTEM

Operating System can be defined as below;

“An operating system is system software that manages all the resources of a computer system” “An Operating system is a program that manages computer hardware” “An operating system is a group of computer programs that coordinates all

the activities among computer hardware devices, It is the first program loaded into the computer by a boot program and remains in memory at all times”

FUNCTIONS OF OPERATING SYSTEM

The Operating System provides following functions:

Booting the computer Provides a user interface Handles system resources Provides file management Multiprogramming Multitasking Multiprocessing Multithreading

I. BOOTING THE COMPUTER

“The process of starting or restarting the computer is known as booting. A cold boot is when you turn on a computer that has been turned off completely. A warm boot is the process of using the operating system to restart the computer”

II. PROVIDES USER INTERFACE

A user interacts with software through the user interface. The two main types of user interfaces are: command line and a graphical user interface (GUI).

Disk Operating System (DOS): With a command line interface, the user interacts with the operating system by typing commands to perform specific tasks. An example of a command line interface is DOS (disk operating system).

Graphical User Interface (GUI): With a graphical user interface, the user interacts with the operating system by using a mouse to access windows, icons, and menus. An example of a graphical user interface is Windows Vista or Windows 7. 

III. HANDLES SYSTEM RESOURCES

The operating system also handles system resources such as the computer's memory and sharing of the central processing unit (CPU) time by various applications or peripheral devices.

Page 3: Operating system 3

2

Operating System

April 1, 2014

IV. PROVIDES FILE MANAGEMENT

The file management system allows the user to perform such tasks as creating files and directories, renaming files, coping and moving files, and deleting files. The operating system keeps track of where files are located on the hard drive through the type of file system. The type two main types of file system are File Allocation table (FAT) or New Technology File system (NTFS).

V. MULTIPROGRAMMING

In multiprogramming the operating system executes part of one program, then part of another, and so on. To the user it appears that all programs are executing at the same time. If a process needs an IO only then that process is sent to waiting queue and other process gets the attention of the CPU

VI. MULTITASKING

Multitasking is the extension of multiprogramming. The concept of time sharing was implemented in multitasking. So that all the process gets the attention of processor, Different scheduling algorithms are used to implement multitasking.

VII. MULTIPROCESSING

Multiprocessor systems (also known as parallel systems or multi core systems)Such systems have two or more processors in close communication, sharing the computer bus and sometimes the clock, memory, and peripheral devices.

The multiple-processor systems in use today are of two types. Some systems use asymmetric multiprocessing, in which each processor is assigned a specific task. A boss processor controls the system; the other processors either look to the boss for instruction or have predefined tasks. This scheme defines a boss–worker relationship. The boss processor schedules and allocates work to the worker processors.

The most common systems use symmetric multiprocessing (SMP), in which each processor performs all tasks within the operating system. SMP means that all processors are peers; no boss–worker relationship exists between processors.

Page 4: Operating system 3

3

Operating System

April 1, 2014

Major Part of Operating System

The OS can be broken down into four main parts,

1. Kernel2. Device Drivers3. User Interface4. System Utilities

1) KERNEL

This has the task of loading the applications into memory, making sure they do not interfere with one another and allowing them to share use of the CPU efficiently. The kernel also handles file storage to and from secondary storage devices such as hard disks and optical drives.

In other words the kernel handles:

Loading / unloading applications from memory Scheduling tasks to run on the CPU Memory management File management Data security

2) DEVICE DRIVERS

More commonly known as a driver, a device driver is a group of files that enable one or more hardware devices to communicate with the computer's operating system. Without drivers, a hardware device such as a computer printer would not be able to work with the computer.

3) USER INTERFACE

Alternatively referred to as a human-computer interface, a user interface is the portion of a software program or hardware device that is used to navigate and control aspects of the software program or hardware device.

4) SYSTEM UTILITIES

This part of operating system provides all basic facilities that run in background without user interaction. For example,

Print Spool Services Cryptographic password management File management services

Page 5: Operating system 3

4

Operating System

April 1, 2014

Types of operating system

I. SINGLE-USER, SINGLE TASK: As the name implies, this operating system is designed to

manage the computer so that one user can effectively do one thing at a time. The Palm

OS for Palm handheld computers is a good example of a modern single-user, single-task

operating system.

II. SINGLE-USER, MULTI-TASKING: This is the type of operating system most people use on their

desktop and laptop computers today. Microsoft's Windows and Apple's Mac-OS platforms

are both examples of operating systems that will let a single user have several programs

in operation at the same time. For example, it's entirely possible for a Windows user to be

writing a note in a word processor while downloading a file from the Internet while printing

the text of an e-mail message.

III. MULTI-USER: A MULTI: user operating system allows many different users to take advantage

of the computer's resources simultaneously. The operating system must make sure that

the requirements of the various users are balanced, and that each of the programs they

are using has sufficient and separate resources so that a problem with one user doesn't

affect the entire community of users. UNIX, VMS and mainframe operating systems, such

as MVS, are examples of multi-user operating systems.

Scheduling

“Scheduling is the job of allocating CPU time to different tasks within an operating system” “Select from among the processes in memory that are ready to execute, and allocates the CPU to

one of them”

Types of Scheduling

In general, there are two types of scheduling: In general, there are two types of scheduling: non-preemptive scheduling, and preemptive scheduling.

In non-preemptive scheduling, a process runs until it terminates stops, blocks, suspends, or yields.

In preemptive scheduling, even if the current thread is still running, a context switch will occur when its time slice is used up. Or (An interrupt causing currently running program to give up the CPU and be replaced by another process)

Scheduling Algorithm

FIRST-COME, FIRST SERVE (FCFS):

Page 6: Operating system 3

5

Operating System

April 1, 2014

FCFS also called FIFO (First-in, first-out)

Simple, fair, but poor performance, the average waiting time will be long. The process that comes last, have to wait longer.

The algorithm simply schedules the jobs in the order in which they arrive, and runs each one to completion.

EXAMPLE DATA:

Process Arrival Time Service Time

1 0 8

2 1 4

3 2 9

4 3 5

FCFS IS APPLIED THEN THE PROCESSES WILL EXECUTE IN FOLLOWING FASHION.

SHORTEST JOB FIRST (SJF):

A different approach to CPU scheduling is the shortest-job-first (SJF) scheduling algorithm. When the CPU is available, it is assigned to the process that has the smallest next CPU process. Moving a short process before long one decrease the waiting time of the short process more than it increases the waiting time of the long process.

Process Arrival Time Service Time

1 0 8

2 1 4

3 2 9

4 3 5

Page 7: Operating system 3

6

Operating System

April 1, 2014

SJF IS APPLIED THEN THE PROCESSES WILL EXECUTE IN FOLLOWING FASHION.

ROUND ROBIN (RR):

The round-robin (RR) scheduling algorithm is designed especially for time-sharing systems. A small unit of time, called a time quantum or time slice, is defined. A time quantum is generally from 10 to 100 milliseconds.

Example Data:

Process Arrival Time Service Time

1 0 8

2 1 4

3 2 9

4 3 5

RR IS APPLIED THEN THE PROCESSES WILL EXECUTE IN FOLLOWING FASHION.

Page 8: Operating system 3

7

Operating System

April 1, 2014

Deadlock

Deadlock is defined as the permanent blocking of a set of processes that compete for system resources. In a multiprogramming environment, several processes may compete for a finite number of resources.A process requests resources; and if the resources are not available at that time, the process enters a waiting state. Sometimes, a waiting process is never again able to change state, because the resources it has requested are held by other waiting processes.

NECESSARY CONDITIONS

A deadlock situation can arise if the following four conditions hold simultaneously in a system:

Mutual exclusionAt least one resource must be held in a non-sharable mode;That is, only one process at a time can use the resource.If another process requests that resource, the requesting process must be delayed until the resource has been released.

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 processes.

No preemption Resources cannot be preempted, that is, a resource can be released only voluntarily by the process holding it, after that process has completed its task.

Circular wait A set of waiting processes must exist such that is

waiting for a resource held by , is waiting for a resource held by is

waiting for a resource held by , is waiting for a resource held by .There must be a circular chain of two or more processes, each of which is waiting for a resource held by the next member of the chain.

Page 9: Operating system 3

8

Operating System

April 1, 2014

Methods for Handling Deadlocks

Generally speaking, we can deal with the deadlock problem in one of three ways:

1. We can use a protocol to prevent or avoid deadlocks, ensuring that the system will never enter a deadlock state.

o To ensure that deadlocks never occur, the system can use either a deadlock-prevention or a deadlock-avoidance scheme.

o Deadlock prevention provides a set of methods for ensuring that at least one of the necessary conditions cannot hold.

o Design a system in such a way that the possibility of deadlock is excluded a priori (compile-time/statically, by design).

o Deadlock avoidance requires that the OS be given in advance additional information concerning which resources a process will request and use during its lifetime. With this additional knowledge, it can decide for each request whether or not the process should wait.

o Make a decision dynamically checking whether the request will, if granted, potentially lead to a deadlock or not. (run-time/dynamically, before it happens).

2. We can allow the system to enter a deadlock state, detect it, and recover.o If a system does not employ either a deadlock-prevention or a

deadlock-avoidance algorithm, then a deadlock situation may arise.

o In this environment, the system can provide an algorithm that examines the state of the system to determine whether a deadlock has occurred and an algorithm to recover from the deadlock.

o Let deadlocks occur, detect them, and take action (run-time/dynamically, after it happens)

3. We can ignore (The Ostrich Algorithm; maybe if you ignore it, it will ignore you) the problem altogether and pretend that deadlocks never occur in the system.

o If a system neither ensures that a deadlock will never occur nor provides a mechanism for deadlock detection and recovery, then

Page 10: Operating system 3

9

Operating System

April 1, 2014

we may arrive at a situation where the system is in a deadlocked state yet has no way of recognizing what has happened.

o Eventually, the system will stop functioning and will need to be restarted manually.

o In many systems, deadlocks occur infrequently (say, once per year); thus, this method is cheaper than the prevention, avoidance, or detection and recovery methods.

Page 11: Operating system 3

10

Operating System

April 1, 2014

INSTALLING WINDOWS 7

Windows 7 Hardware Requirements

The Windows 7 Minimum hardware requirements are as follows: At least 800MHz 32-bit (x86) or 64-bit (x64) processor 512MB of RAM A video card capable of at least 800×600 resolution and DirectX 9 with at least 32MB of

graphics RAM A DVD drive Audio output capability A hard drive that is at least 40GB in total size, with at least 16GB of free space

By comparison, here are the Windows 7 Recommended specifications: A 1GHz (or faster) 32-bit (x86) or 64-bit (x64) processor A minimum of 1GB of RAM A video card that supports DirectX 9 graphics with a WDDM driver and has at least

128MB of graphics memory Video card support for Pixel Shadier 2.0 and 32 bits per pixel A hard drive that is at least 80GB in total size, with at least 40GB of free space A DVD drive Audio output capability Internet connectivity for product activation

Steps for Installation

Turn your computer on then press Del or F2 (depend on your computer’s mainboard) to enter the system BIOS

Go to Boot menu and choose Boot from CD/DVD. Press F10 to save the configuration and exit BIOS then reset your computer. Insert Windows 7 DVD into your DVD drive then start up your computer, Windows 7 will

be loading files. Language to Install, Time and currency format, Keyboard or input method. Then click

NEXT. Choose the Windows 7 version that you want to install in 'Select the operating system

you want to install’. Here we choose Windows 7 Ultimate then click next (depending on your Windows DVD, this step is an option).

Click 'I accept the license terms' in 'Please read the license' then click NEXT. Choose 'Upgrade' in 'Which type of installation do you want' if you want to upgrade from

an older Windows version to Windows 7, 'Custom (advance)' if you want to install a new version of Windows.

Choose Partition for installation, if your computer has only one hard disk, it will be easy for selection, but if it has some Partition, you will have to consider which Partition to choose.

Your computer might be restarted during the process. Type you’re a user account and computer name. After click NEXT.

Page 12: Operating system 3

11

Operating System

April 1, 2014

Type a password for your account, you can also Type a password hint to help in case of forgetting the password in the future, and then click NEXT.

Type in activation code or key for your license in Product key box if you have any. Click NEXT.

Choose how to protect your Windows. Here we choose Use recommended settings. Set up your Time zone then click NEXT. Public Network, Work Network, Home Network. Choose Home Network for using Internet

at home.

RELEASED DATE OF

WINDOWS 7:

I Was Released on 22nd July, 2009

MAIN EDITIONS

Windows 7 Starter Windows 7 Home

Basic Windows 7 Home

Premium Windows 7