24
Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 Fundamentals of Computing Operating Systems

Embed Size (px)

Citation preview

Page 1: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1Fundamentals of Computing

Operating Systems

Page 2: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

CS1 - Week 22

Introduction to the OSOS Fundamentals

ProcessesMemoryFilesI/O

Page 3: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

The Operating System (OS)

Manages the hardware and software resources of the system

Resources Processor Memory Disk space, etc.

Allows applications to deal with the hardware without having to know all the details of the hardware

Page 4: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Operating Systems

Hardware

Operating System

User

Application

Application

Application

User

User

•The OS acts a a ‘shell’ around the hardware.

•The applications software need an OS to work, and users need the applications software to interact with the hardware via the OS.

Page 5: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Types of OS

Real-Time Operating System (RTOS) Fast Response (‘Real Time’ / Instant) Used to control machinery and industrial systems Usually Poor HCI

Single-User, Single Task One user can do one thing at a time Useful for low spec systems

Single-User, Multi-Tasking One user can perform many tasks at a time Common for current PC systems

Multi-User Many users can use the computer's resources simultaneously OS balances resources allocation against users and tasks N.B- A machine on a network is not necessarily multi-user!!!

Page 6: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

OS Generic Structure

•Kernel

•Memory & Process Management

•Input / Output

•File System

•User Interface

Page 7: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

The Kernel

Heart of the OS Provides secure access to the computer hardware Low-level software / hardware transfer Manages resource availability / usage A kernel includes

Interrupt handler Handles all requests for kernel service

Scheduler that Decides how and which programs share the kernel

processing time Supervisor

Gives use of the computer to each process when required

Page 8: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Types of kernels

Monolithic Kernel Runs most of its services in the kernel workspace Error prone due to the amount of tasks in the kernel itself Used in most Linux systems

Microkernel Runs most services - like networking, filesystem, etc. - in

user space More stable, but more complex designs

Hybrid (Modified Microkernel) Microkernels that have some "non-essential" code in

kernel space in order for that code to run more quickly. Windows NT/2000 and Macintosh OS X use hybrid kernels

Page 9: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Process Management

Process A single sequence of operation(s) The basic unit of software the operating system deals with

in scheduling the work done by the processor Not the same as an application

An application can contain multiple processes Process has some key attributes

Process ID (PID) Priority Level Pointers to upper and lower bounds of memory

allocated Status of all I/O devices needed

Page 10: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Process Management CPU can only do one thing at a time

If a process wants to use the CPU it must tell the CPU Interrupts or Polling

To give the appearance multi-tasking, the quickly OS switches between different processes This function is performed by a process scheduler

Schedulers decide what process should run, when, and for how long

Scheduling decision factors Priority Resources needed Resources used to date Waiting time to date

Page 11: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Memory Management Provide memory space to enable multiple processes

to be executed at the same time Give satisfactory level of performance for users Protect each process

Don’t get data mixed-up between processes Enable sharing of memory between processes

More dynamic & efficient use of the memory resources Make addressing of memory transparent to

programmers Provides Virtual Memory

Extra memory, larger than the physical allocation Done by storing portions of data to backing storage

Page 12: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Input / Output

Need more input….

Devices use an I/O sub-system of a computer use to communicate Communication carried out via registers

I/O devices use interrupts to signal to the CPU that a task has been completed IRQ – Interrupt ReQuests. Each device has a unique IRQ

On ISA buses, data can be sent from the I/O controller to memory, bypassing the the CPU This is DMA (Direct Memory Access)

Page 13: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Input / Output Input / Output Control System (IOCS)

The part of the O/S that deals with I/O activity Deals with requests and routes to and from devices

Device Driver A software module which manages the communication

with, and control of, a specific I/O device Interprets requests from the application to specific

commands to the I/O device

Application Program

Input-output Control System

(IOCS)

Device Driver

Device Controller

I/O Device

System Calls

I/O Bus

}Operating System

Page 14: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

File System

File can be stored data, although programs and folders are also considered files at a low level

OS knows nothing about file structure Applications can interpret file data

File System tasks Creating & deleting files Storing and organising files on storage medium

A new file is allocated one cluster As the file grows the cluster becomes filled and

more clusters are assigned to the file

Page 15: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

File System Ideally, successive file clusters should be in

sequence on the disk Faster access as less disk movement in required

Usually a disk contains many files Clusters get mixed out of sequence This is known as fragmentation

Fragmentation can reach a critical level where system performance becomes greatly reduced

A A B A B C C BB

End of file A

Free cluster

End of file B

Page 16: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

File System Windows file systems are FAT

File Allocation Table FAT16

Uses 16-bit value to record file properties FAT32

Very similar to FAT16, except it uses 32-bit values

Linux / UNIX Use iNodes Similar procedure to Windows Usually 32-bit values Every file has an iNode OS tracks iNodes and file names

Page 17: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

User Interface

The user interface (UI) is a layer above the operating system What users “see” or interact with

UI deals with getting user commands and providing feedback / representation

Two common types of user interfaces: Command-Line Interface (CLI) Graphical User Interface (GUI)

Page 18: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Command-Line Interface

Textual commands Either from the keyboard or from a script

User types a command after the computer displays a prompt character For example, MS-DOS, UNIX, etc.

Advantages Faster for skilled users All options and commands available in a standard format Can perform operations in a batch processing mode without user

interaction Disadvantages

Perplexes new users / Not user-friendly Multiple operations made complex Have to remember commands / not intuitive

Page 19: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Graphical User Interface

Graphical representations & metaphors GUIs have a number of common features:

Windows, Icons, Menus, Pointers (WIMP) As well as buttons, toolbars, etc.

Advantages Consistent look and feel, even across platforms Commands can be executed using either mouse or keyboard High levels of operation and dialog

Disadvantages Often restrictive Use more system resources / more intense

Page 20: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

UNIX Designed by Ken Thomson of AT&T Bell Laboratories

improved by Dennis Ritchie Multi-user

More than one person suing the OS at a time Multitasking

Each user can run more than one process Platform independent

Runs on almost any hardware platform Complex Large distribution User control and administration Used as multiple types of server

Page 21: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

LINUX Created by Linus Torvalds Particularly aimed at PC users Two parts:

Kernel The Linux operations section The UNIX part of things

Distribution Particular flavour of Linux

Open source Free! (more or less)

Many now have a windows style interface Easy to get to grips with Some expertise is required to become a master

Low hardware requirements 100 MHz CPU, 12Mb RAM, 500Mb HDD

Page 22: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Microsoft Windows Founded by Bill Gates Developed from MS-DOS

Microsoft Disk Operating System ‘Borrowed’ from XEROX Q-DOS

Windows 1.0 began life as an interface running on MS-DOS

GUI improved and networking capabilities added in future versions

Is now independent of MS-DOS Many varieties available

Majority are multi-user and multi-task Windows XP Windows Server Windows 2000

Page 23: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Macintosh OS X

Rooted in a UNIX system Providing all the good bits of a powerful UNIX OS

Super-nice GUI as front-end Ease of use and interaction

Macintosh OS have always been pioneers in user-friendly interfaces and functionality High level of accessibility Scalable from first-time users to advanced Seamless integration of OS and system applications

Page 24: Computer Systems 1 Fundamentals of Computing Operating Systems

Computer Systems 1 (2004-2005)

Week 22

Operating System Structure & ComponentsKernelMemory managementProcess management Input / outputFile systemUser interface