79
Part2: Computer Systems Chapter 2: Basic Software

16. Computer Systems Basic Software 2

Embed Size (px)

Citation preview

Page 1: 16. Computer Systems   Basic Software 2

Part2: Computer Systems

Chapter 2: Basic Software

Page 2: 16. Computer Systems   Basic Software 2

File Management

• Helps the user to keep track of data and programs

• Most data is stored in auxiliary storage devices, file handling plays an important role in data management

Page 3: 16. Computer Systems   Basic Software 2

1. File systemAn OS component that allows the user or

programmer to create, delete, modify, and

manipulate files and programs by name

I. File concept and configuration in low-end computers Files simple record character strings There is no difference between data and programs Cluster – basic unit of disk space allocation, with one or more

contiguous sectors Directory – list of files stored on a disk or other device. Often

used to convert a file name to a physical address

File Management

Page 4: 16. Computer Systems   Basic Software 2

File Management1. File system

• Cluster • set of several sectors

• I/O unit between auxiliary devices and RAM

• When data cannot be filled in one cluster, an unused cluster is coupled and the remaining data written in this cluster. Not necessary for the coupled cluster to be contiguous.

Page 5: 16. Computer Systems   Basic Software 2

File Management

1. File system– Directory

• Register where the file management information is recorded and stored

• Hierarchical structure

• Root, directories (folders), sub-directories (sub-folders)

Page 6: 16. Computer Systems   Basic Software 2

File Concept

Page 7: 16. Computer Systems   Basic Software 2

File ManagementII. File operation

Directory is automatically setup by the OS when PCs or workstations start up

It is a root directory, user have access to it User has to move to target directory in order to access a

directory or file Directory

- Home directory : can be used by the user; user can create and access the sub-directories

and files

- Current directory: directory in current use

Page 8: 16. Computer Systems   Basic Software 2

File Management

Path: the route along which to search for that file is specified.

- Absolute path: path to target directory or file from the

root directory

- Relative path: path to target directory or file from the

current directoryCommand

- A request to the OS for a service (DOS command)Extension and wild cards:

E.g. dir *.doc – show all files with extension DOC

Page 9: 16. Computer Systems   Basic Software 2

File Management– File operations in GUI environments

Page 10: 16. Computer Systems   Basic Software 2

File Management

• Hierarchical Structure

.

DIR 1 DIR 2 DIR N FILE 1 FILE 2 FILE N

DIR 2.1 DIR 2.N FILE 2.1 FILE 2.N

Page 11: 16. Computer Systems   Basic Software 2

Roles inFile Management

• Roles– Maintain File Allocation Table (FAT)

• Chain of clusters for each directory or file

• Properties for each directory or file

– Read/Write Operations• Exclusive write

• Multiple reads

– Backup Operation

Page 12: 16. Computer Systems   Basic Software 2

Roles inFile Management

• Roles– Utilities

• List, copy, move, delete, and rename

• Backup and recovery

• Disk diagnose

• Defragmentation

Page 13: 16. Computer Systems   Basic Software 2

Security Management• Protection of a computer and its resources from

unauthorised access by persons, acts, or influences and that includes many sub-functions, such as creating, deleting, and controlling security services and mechanisms

Page 14: 16. Computer Systems   Basic Software 2

Aims of Security Management

• Confidentiality– Against illegal access (e.g. data encryption)

• Integrity– Against unauthorized modification (e.g.

security access list)

• Availability– Prevents the obstruction of the use by a

legitimate user

Page 15: 16. Computer Systems   Basic Software 2

Security Management• OS performs security control through:

o Access controlPermissions assigned to legitimate users, who have access to

computer resources

o Flow controlPrevents leakage of information to users that are not authorized

as legitimate users

o AuthenticationValidating the user (login)

Page 16: 16. Computer Systems   Basic Software 2

Failure Management

• Utility to manage failed processes

• Utility to manage failed resources

Page 17: 16. Computer Systems   Basic Software 2

Failure Management• Concerned with impact of system failure:

o Instruction RetryAutomatically retries execution of specific instructions when

failure occurs

o Failure Management ProgramFailure circumstances are recorded if computer operates

normally after retryIf failure occurs again after retries, location where failure

occurred is isolatedReconstruct the system

Page 18: 16. Computer Systems   Basic Software 2

Failure Management

Normal operation

Retry

Malfunction

System reconstruction

MalfunctionNormal operation

Failure management program

Failure management program

The failure circumstancesare recorded

The location where the failure occurred is separated

Instruction retry and failure management program

Page 19: 16. Computer Systems   Basic Software 2

Supervisor

• A monitoring program functioning as the central part of OS

• Contains a command processor or shell, an I/O control system (IOCS), a file system, and interrupt handler routines

• Performs resource distribution and program control to implement TSS (Time sharing system), multi-programming, etc.

Page 20: 16. Computer Systems   Basic Software 2

Where to Get More Information

• Deitel, H.M., 1990, Operating Systems. (Second Edition). Addison Wesley.

• Silberschatz, A. and Galvin, P.B., 1994, Operating System Concepts. Addison Wesley.

• Tanenbaum, A., 1995, Distributed Operating Systems. Prentice Hall.

• Davis Rajkumar, 2001, Operating Systems A systematic View (Fifth Edition), Addison Wesley

Page 21: 16. Computer Systems   Basic Software 2

Operating System

System disk

Printer

System constants and parameters

Interrupt handler routines

Command processor

I/O Control system

File system

Transient area

The components of a typical microcomputer operating system

Resident operating system

Page 22: 16. Computer Systems   Basic Software 2

OS Categories

• Real-time OS

• Single-user, single-task OS

• Single-user, multi-task OS

• Network OS

• Multi-user OS

Page 23: 16. Computer Systems   Basic Software 2

Real-time OS

• To control machinery, scientific instruments and industrial systems

• Usually a "sealed box"– Very little user-interface capability

• Manage resources such that each operation executes in precise amount of time

Page 24: 16. Computer Systems   Basic Software 2

Single-user, Single-task OS

• No user differentiation

• Only one task can execute at anytime

• Example Palm OS

Page 25: 16. Computer Systems   Basic Software 2

Single-user, Multi-task OS

• No user differentiation

• Multiple tasks can execute at anytime

• Example: Windows 95

Page 26: 16. Computer Systems   Basic Software 2

Network OS

• User differentiation– Separate software and hardware profiles– Only one user can operate at anytime

• Resources are shared simultaneously

• Example: Windows 2000/XP

Page 27: 16. Computer Systems   Basic Software 2

Multi-user OS

• User differentiation– Separate working segment– Separate software and hardware profiles

• Resources are shared simultaneously

• Example Unix

Page 28: 16. Computer Systems   Basic Software 2

Types of OS

• Multiple Virtual Storage (MVS)

• UNIX

• Windows

• MacOS

• Linux

Page 29: 16. Computer Systems   Basic Software 2

Multiple Virtual Storage (MVS)

• An old IBM mainframe operating system that continues to be used for some systems.

• The most commonly-used operating system used on IBM mainframes; other operating systems are VM and DOS/VSE.

• http://search390.techtarget.com/sDefinition/0,,sid10_gci212618,00.html

Page 30: 16. Computer Systems   Basic Software 2

MVS Configuration

Page 31: 16. Computer Systems   Basic Software 2

Multiple Virtual Storage (MVS)

• Characteristics:– OS for high-end general-purpose computers– Provides multi-user function, which enables

simultaneous MVS use by multiple users– Provides multi-task function, which enables

simultaneous processing of multiple tasks– Adopts approach of multiple address space– One logical address space reaches up to 2GB– Contains all file organization functions

Page 32: 16. Computer Systems   Basic Software 2

UNIX• An interactive time-sharing operating system

invented in 1969 by Ken Thompson after Bell Labs left the Multics project, originally so he could play games on his scavenged PDP-7.

• Dennis Ritchie, the inventor of C, is considered a co-author of the system.

• http://whatis.techtarget.com/definition/0,289893,sid9_gci213253,00.html

Page 33: 16. Computer Systems   Basic Software 2

UNIX Configuration

Page 34: 16. Computer Systems   Basic Software 2

UNIX• An OS that can be used by multiple users, which each

user can simultaneously perform multiple job processing

• Contains control program called Kernel:o Controls the system resourceso Performs process management

• Shells and commands:o Interprets commands input by the users and calls the kernel

functiono Execute a program called shell script (which combines

commands)

Page 35: 16. Computer Systems   Basic Software 2

UNIX• Characteristics

– Distributed processing is presupposed– Developed assuming that would be used in workstations– Provide multi-user functions

• Procedure called log-in: receive service; log-out: report completion

– Multiprocessing function (multi-programming)– Communication protocol TCP/IP used to connect computers

of different manufacturers– Use of commands in an interactive mode– Instruction rights in interactive mode – human interface e.g.

X-Window– Program development tools are abundant

Page 36: 16. Computer Systems   Basic Software 2

Unix Family Tree

UNICS (Uniplexed Operating and Computing System)

7th Edition [1978]

BSD (Berkeley Software

Distribution)

BSD (Berkeley Software

Distribution)

[1969]

5th Edition [1973]6th Edition [1976]

SVR5 (System V)SVR5 (System V)[1979][1983]

Sun OS 5.x/SolarisHP HP-UXIBM AIXSGI IRIXDEC Digital UNIX (formerly OSF/1)

Sun OS 4.xDEC UltrixCanon NextStepApple OS X

Page 37: 16. Computer Systems   Basic Software 2

Why UNIX?

• Universally used for high-end number crunching applications (e.g. CAD/CAM and scientific visualisation)

• Preferred OS platform for running internet services such as WWW, DNS, DHCP, NetNews, Mail, etc. due to networking being in the kernel for a long time now

• Easy access to the core of the OS (the kernel) via C, C++, Perl, etc.

• Stable operating environment• The availability of a network extensible window system• The open system philosophy

Page 38: 16. Computer Systems   Basic Software 2

Reading the boot program

Read in the boot kernel

Initialize the system

Start dummy system processes

Start init

Execute startup scripts

Unix Cold Boot

Power-On Self Test (POST)

Probing the bus for boot device

RO

M

Page 39: 16. Computer Systems   Basic Software 2

Unix Shut Down

• All logged on users are warned about the impending shutdown and given a chance to close files and to log out.

• Further login may be blocked.

• init is asked to change the run level from the multiuser state to either a single user or a safe-to-power-off state.

• All running processes are notified that the system is going down (this allows a number of programs to save vital information to disk).

• The system goes through the appropriate shutdown scripts to shut down running services and daemons.

• The file systems on disks are synchronized; that is, unwritten buffers are committed to disk.

• Machine may be powered off.

Page 40: 16. Computer Systems   Basic Software 2

Unix Security Management

• System Level– Login/logout– Supervisor versus user– Auditing

• File Level– Permission modes (read, write, execute) for

owner and group association for a file

Page 41: 16. Computer Systems   Basic Software 2

Unix Job Management

• Job control is basically an explicit interaction with processes via shell command

• Three types of shell– Bourne shell – input and output control– C shell – good for C programming– Korn shell – combining Bourne and C shell

Page 42: 16. Computer Systems   Basic Software 2

Unix Job Management

• Kernel– Core of the operating system– Manages hardware resources like CPU,

memory, input/output devices, etc.

Unix command

s

Unix command

s

Interpret requestsInterpret requests

Execute requestsExecute requests

User Shell Kernel

Page 43: 16. Computer Systems   Basic Software 2

Unix Structure

Shell

File System Kernel

Device Drivers Process Memory

Page 44: 16. Computer Systems   Basic Software 2

Unix Commands

UNIX DOS REMARKS

tar1 backup tape archivecd cd change directoryfsck chkdsk file system checkclear cls clear screencmp compare compare filescp copy copy a filedate date set/show date and timerm del remove a filels dir list directorygrep find global regular expression printformat format format diskmkdir md make directorymore more show file page at a timelp print line printerrmdir rd remove directoryset set show/set environment variablessort sort sort a filecat type concatenate a file

Page 45: 16. Computer Systems   Basic Software 2

Unix File Management

• Hierarchical File System

• Each user has his own workspace

/

var lib dev bin usr

Page 46: 16. Computer Systems   Basic Software 2

Unix Process Management

• For each new process, the kernel sets up an address space (in memory) consisting of the following logical segments:

text

data

bss

user stack

kernel stack

program's instructions

initialized program's variables

uninitialized program's variables

variables allocated locally and parameters passed to functions in the program

Page 47: 16. Computer Systems   Basic Software 2

Unix Process Management

• Mode switching– Kernel-mode – those processes carrying out

kernel instructions– User-mode – those processes, created directly

by the users, whose instructions are currently executing in the CPU

– At any given time, a process can be in user-mode, kernel-mode, sleeping, waiting on I/O, and so on

Page 48: 16. Computer Systems   Basic Software 2

Unix Process Management

• The process scheduling subsystem within the kernel uses a time slice of typically 20ms to rotate among currently running processes.

• Each process is given its share of the CPU for 20ms, then left to sleep until its turn again at the CPU.

• This process of moving processes in and out of the CPU is called context switching.

• The kernel makes the operating system appear to be multi-tasking (i.e. running processes concurrently) via the use of efficient context-switching.

Page 49: 16. Computer Systems   Basic Software 2

Unix Process Management

• Process States– Resident – currently on the run queue

– Sleeping – waiting on a pipe, completion of I/O, terminal input, memory

– Zombie – a process with no swappable image but a structure in memory

– Stop

Page 50: 16. Computer Systems   Basic Software 2

Unix Memory Management

• Virtual memory (VM)– VM = Physical RAM + Swap space (disk space)

• Pages– The Memory is divided into manageable chunks called

pages (usually 4KB or 8KB per page)

Page 51: 16. Computer Systems   Basic Software 2

Unix Memory Management

• Caching– When the kernel loads a page from RAM for use by the

CPU, it also prefetches a number of adjacent pages and stores them in the cache.

– Since programs typically use sequential memory access, the next page needed by the CPU can now be supplied very rapidly from the cache.

Page 52: 16. Computer Systems   Basic Software 2

Unix Memory Management

• Cache Memory– The RAM cache is simply a small amount of

very fast (and thus expensive) memory which is placed between the CPU and the (slower) RAM

• L1 cache – on-chip cache is small but fast (being on-chip)

• L2 cache – not on-chip (thus a bit slower) and can be quite large, sometimes as big as 16MB for high-end CPUs

Page 53: 16. Computer Systems   Basic Software 2

Unix Memory Management

• Demand Paging– When a process starts in Unix, only few and not all its

memory pages are read into RAM from the disk at once.

– After the CPU digested the pages in RAM, a page fault occurs; signaling the kernel to load the next few pages from disk into RAM. This is called demand paging.

Page 54: 16. Computer Systems   Basic Software 2

Unix Memory Management

• Swapping– This occurs when there is not enough physical

RAM to accommodate all the processes.– It makes use of the available virtual memory by

a process known as swapping.– It selects the least busy process and moves it to

disk.– As more RAM becomes available, it swaps the

process back in from disk into RAM.

Page 55: 16. Computer Systems   Basic Software 2

Windows

• More than half of PCs around the world is Windows– Windows– Windows 95/98//ME– Windows NT/2000/XP

(http://www.microsoft.com/windowsxp/default.asp)• http://www.microsoft.com/ms.htm• http://www.mactech.com/macintosh-c/chap04-

1.html

Page 56: 16. Computer Systems   Basic Software 2

Win2K

Page 57: 16. Computer Systems   Basic Software 2

Win9x configuration

Page 58: 16. Computer Systems   Basic Software 2

Windows

• GUI characteristicso Desktop approacho Multitask functiono Mouse pull down menu / dialog box manipulation

• WinXP– Strengths of security, manageability and reliability of

WinNT– GUI features of Win9x and WinME– Plug-and-play– Different versions to suit different users (cost)

Page 59: 16. Computer Systems   Basic Software 2

Windows .Net Boot-up

Power On

BootstrapLoader

Load OS &Device drivers

Launch startup

Power-On Self Test

Reset

Initialize hardware

Page 60: 16. Computer Systems   Basic Software 2

Windows .NetSecurity Management

• System Level– Login/logout– Enterprise administrator, local administrator,

backup operator, user– User account and computer account– Security policy and group policy– Auditing– Hibernation

Page 61: 16. Computer Systems   Basic Software 2

Windows .NetSecurity Management

• System Level– RAID 0, RAID 1, and RAID 5

• File Level– Permission modes– Data encryption

• Printer Level– Permission modes

Page 62: 16. Computer Systems   Basic Software 2

Windows .NetJob Management

• Two interfaces– Command interface– Graphical interface

• Startup versus scheduled

Page 63: 16. Computer Systems   Basic Software 2

Windows .NetFile Management

• Hierarchical file system

• Windows explorer interface

• Virtual file system

• Compression

Page 64: 16. Computer Systems   Basic Software 2

Windows .NetDisk Management

• Enhanced check disk utility

• Volume shadow copies and shadow copy restore

• Virtual disk services

• Area network (SAN) participation

Page 65: 16. Computer Systems   Basic Software 2

Windows .NetProcess Management

• 64-bit operating system

• Pre-emptive and prioritized multi-tasking

• Symmetric multi-processing (SMP)

Page 66: 16. Computer Systems   Basic Software 2

Windows .NetMemory Management

• Up to 256GB RAM

• Dynamic virtual memory

• Memory mirroring

• Hot-add memory support

• Non-uniform memory access

Page 67: 16. Computer Systems   Basic Software 2

Windows .NetFailure Management

• Update service patches and hot fixes without restart

• Automated system recovery

Page 68: 16. Computer Systems   Basic Software 2

MacOS

• Developed by Apple Computer for Macintosh

• http://www.apple.com/

Page 69: 16. Computer Systems   Basic Software 2

MacOS

• Almost all operations can be performed with the mouse• Consistent GUI• GUI elements are abundant, hence claims to be “easy” for

beginners• Different versions for different types of users

– Mac OS X– Mac OS X Server– Rhapsody

• Latest Mac OS X 10.1.1 provides improved USB, FireWire, and Networking support

Page 70: 16. Computer Systems   Basic Software 2

OS X Interface

Page 71: 16. Computer Systems   Basic Software 2

OS X

• Features– Multi-user– Virtual file system– Symmetric multi-processing (SMP)– Basic threading packages– Pre-emptive multi-tasking– Virtual memory with memory protection and

dynamic memory allocation

Page 72: 16. Computer Systems   Basic Software 2

Linux

• UNIX-based OS launched in 1991 by Linus Torvalds

• The software is free: source code released to public

• Copyright is protected by GPL (GNU Public License)

Page 73: 16. Computer Systems   Basic Software 2

Network OS

• OS used to construct LANs• SNMP functions• Netware

– Developed by Novell– File sharing / printer sharing functions

• LAN Manager– Distributed file system developed and

supported by Microsoft

Page 74: 16. Computer Systems   Basic Software 2

Middleware• A class of software that helps with the translation of

messages and communications between client and servers• Any set of routines or functions that allow two dissimilar

programs to interoperate– Database Management System (DBMS)– Communication Management System– Software Development Support Tool– Operation Management Tool– Object Request Broker (ORB)

Page 75: 16. Computer Systems   Basic Software 2

Database Management System

• Aimed at efficient database creation/maintenance/operation

• 3 main characteristics– Integrity: prevents generation of data inconsistently

– Security: protect data secrecy by setting database access rights

– Failure recovery: failure and recovery plan to recover database promptly in the event that database fails

Page 76: 16. Computer Systems   Basic Software 2

Communication Management System

• Aimed at supporting computer network construction/operation

• 3 main characteristics– Network Independence– Network Flexibility: provides flexibility to

devices and network mechanism; construction of network systems with high expandability is enabled

– Network Transparency

Page 77: 16. Computer Systems   Basic Software 2

Software Development Support Tool

• Supports computer-aided software development• Aimed at achieving development labour savings and

software quality improvements• CASE tools

– Upstream CASE tools: support high-end process (e.g. analysis, design, etc) of software development

– Downstream CASE tools: support lower-end process (e.g. programming, testing, etc)of software development

– Maintenance CASE tools: support operation and maintenance of developed software

– Integrated CASE tools: support overall functions from upstream to maintenance CASE tools

Page 78: 16. Computer Systems   Basic Software 2

Operation Management Tool• Aimed at supporting the operation duties of system

operation• Characteristics

– Multiplicity optimization of multi-programming– Allocation of system resources to reduce response time at peak

periods– Grasp of operating conditions of system resources– Recording of accounting information and creation of summaries– Logging of operation records

Page 79: 16. Computer Systems   Basic Software 2

Object Request Broker• It is the programming technique that acts as a "broker" between a

client request for a service from a distributed object or component and the completion of that request

• Having ORB support in a network means a client program can request a service without having to understand where the server is in a distributed network or exactly what the interface to the server program looks like

• Components can find out about each other and exchange interface information as they are running

• An ORB uses the CORBA Interface Repository to find out how to locate and communicate with a requested component

• http://searchmiddleware.techtarget.com/sDefinition/0,,sid26_gci214209,00.html