Upload
new-era-university
View
1.429
Download
1
Embed Size (px)
Citation preview
Part2: Computer Systems
Chapter 2: Basic Software
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
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
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.
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)
File Concept
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
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
File Management– File operations in GUI environments
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
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
Roles inFile Management
• Roles– Utilities
• List, copy, move, delete, and rename
• Backup and recovery
• Disk diagnose
• Defragmentation
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
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
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)
Failure Management
• Utility to manage failed processes
• Utility to manage failed resources
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
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
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.
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
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
OS Categories
• Real-time OS
• Single-user, single-task OS
• Single-user, multi-task OS
• Network OS
• Multi-user OS
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
Single-user, Single-task OS
• No user differentiation
• Only one task can execute at anytime
• Example Palm OS
Single-user, Multi-task OS
• No user differentiation
• Multiple tasks can execute at anytime
• Example: Windows 95
Network OS
• User differentiation– Separate software and hardware profiles– Only one user can operate at anytime
• Resources are shared simultaneously
• Example: Windows 2000/XP
Multi-user OS
• User differentiation– Separate working segment– Separate software and hardware profiles
• Resources are shared simultaneously
• Example Unix
Types of OS
• Multiple Virtual Storage (MVS)
• UNIX
• Windows
• MacOS
• Linux
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
MVS Configuration
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
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
UNIX Configuration
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)
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
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
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
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
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.
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
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
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
Unix Structure
Shell
File System Kernel
Device Drivers Process Memory
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
Unix File Management
• Hierarchical File System
• Each user has his own workspace
/
var lib dev bin usr
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
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
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.
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
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)
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.
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
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.
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.
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
Win2K
Win9x configuration
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)
Windows .Net Boot-up
Power On
BootstrapLoader
Load OS &Device drivers
Launch startup
Power-On Self Test
Reset
Initialize hardware
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
Windows .NetSecurity Management
• System Level– RAID 0, RAID 1, and RAID 5
• File Level– Permission modes– Data encryption
• Printer Level– Permission modes
Windows .NetJob Management
• Two interfaces– Command interface– Graphical interface
• Startup versus scheduled
Windows .NetFile Management
• Hierarchical file system
• Windows explorer interface
• Virtual file system
• Compression
Windows .NetDisk Management
• Enhanced check disk utility
• Volume shadow copies and shadow copy restore
• Virtual disk services
• Area network (SAN) participation
Windows .NetProcess Management
• 64-bit operating system
• Pre-emptive and prioritized multi-tasking
• Symmetric multi-processing (SMP)
Windows .NetMemory Management
• Up to 256GB RAM
• Dynamic virtual memory
• Memory mirroring
• Hot-add memory support
• Non-uniform memory access
Windows .NetFailure Management
• Update service patches and hot fixes without restart
• Automated system recovery
MacOS
• Developed by Apple Computer for Macintosh
• http://www.apple.com/
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
OS X Interface
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
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)
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
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)
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
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
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
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
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