Tonga Institute of Higher Education IT 141 Lecture 5: Operating System
Operating System (OS) Type of software that acts as the master controller for all activities that take place within a computer system E.g. – Microsoft Windows, Mac OS, Linux, DOS, UNIX, Solaris, and BeOS
What does an OS do? You tell the computer what to do using application software Application software tells the OS what to do Operating system tells device drivers Device drivers tell hardware Hardware does the work
What does an OS do?
OS Tasks Manage processor resources Manage memory Keep track of storage resources Ensure that input and output proceed in an orderly manner Establish basic elements of the user interface
How OS manage processor resources Processes – activities Processes compete for your computer’s microprocessor’s attention OS must ensure that each process receives its share of microprocessor cycles
OS handling so many processes Can be managed by i.Multitasking ii.Multithreading iii.Multiprocessing
OS managing memory Microprocessor works with data and executes instructions stored in RAM OS divide up specific areas of memory for each program Prevents a memory leak. Use Ctrl+Alt+Del key to close corrupted programs
OS keeping track of storage resources Acts as a filing clerk Remembers names and locations of files Keeps track of empty spaces
OS and peripheral devices OS communicates with device driver software so that data travel smoothly between computer and peripheral devices OS makes sure that input and output continue in an orderly manner Buffers collect and hold data when busy Buffer – part of memory that holds data waiting to be transferred from one device to another
Different OS needed for different computing tasks Single-user OS – deal with one set of input devices. E.g. DOS Multiuser OS – allows a single, centralized computer to deal with simultaneous input, output, and processing requests from many users. E.g. – IBM’s z/OS Server OS – provides tools for managing distributed works, servers, and Web hosting sites. E.g. – Mac OS X Server, Windows Server 2008 Desktop OS – designed for a PC. E.g. – Microsoft Windows or Mac OS
Interacting directly with OS When you start your computer Manage files (Windows Explorer): allows you to view, move, copy, rename or delete Get help Customize interface: help you customize your screen display and work environment Configure equipment: access and utilities to help set up and configure computer’s hardware and peripheral devices
User Interfaces Definition: mixture of hardware and software that helps people and computers communicate with each other OS defines the look and feel of compatible software Know what – Icon, desktop, window, taskbar, toolbar, ribbon, menu, submenu, tab, etc.
Windows, Mac OS, and Linux similar? They differ in their visual design
Boot Process Digital devices – OS is stored in ROM Larger devices – OS is quite large, stored in hard disk Boot process – operating system kernel loaded into RAM Kernel provides key OS services such as memory management and file access. Kernel stays in RAM all the time your comp is on. Other OS parts are only loaded when needed
Boot Process Steps of events that happen between the time you turn on the comp, and the time it is ready for you to issue commands Bootstrap program is built into special ROM chip in the computer’s system unit. When it receives power, it starts the boot processing by executing the bootstrap program.
Boot process major events Power up Start boot program Power-on self-test Identify peripheral devices Load operating system Check configuration and customization
OS in hard disks Because RAM is volatile, we can’t store OS in hard disks. ROM and EEPROM are non- volatile, and can still store data even when the power is off, but too small for OS. During booting, OS is transferred into RAM
6 major events during the boot process 1.Power up 2.Start boot program 3.power-on self test 4.Identify peripheral devices 5.Load OS 6.Check configuration and customization
Why OS is stored in HD not RAM Because RAM is volatile EEPROM and ROM are non volatile but their storage capacity are not big enough OS is transferred to RAM for quick access
Bootstrap summary
Microsoft Windows OS Microsoft Windows (Windows 1.0, Windows 2.0……Windows 2008) – Adv: variety of hardware platforms, user community, gives excellent support in the form of built-in drivers and plug and play funcitonality – Disadv: reliability and security – There are different Microsoft windows for different computer categories
Microsoft Windows versions Personal computersLAN, Internet, and Web Servers PDAs, Mobile Phones, and Non- personal Computer Devices Windows Vista Starter, Windows Vista Home Basic, Windows Vista Home Premium Windows Server 2008 Windows Server 2003 Windows 2000 Server Windows Mobile OS Windows Embedded OS Windows XP Embedded
MAC OS Macintosh OS For Apple Computer’s Macintosh line of computer systems Classic Mac OS, System 6, System 7/Mac OS,…. Mac OS X 10.5 (Leopard) – Adv: easy to use, reliable, and secure. Offers strong backward compatibility, dual boot options, and good virtual machine platform – Disadv: limited selection of software
UNIX and LINUX OS Linux developed based on a UNIX derivative called MINX Linux adv: distributed with source code for everyone to use. – Disadv: mostly for technical users
DOS (Disk Operating System) -First OS and old, developed by Microsoft -Command-line user interface
Handheld Operating System Palm OS, Windows Mobile OS, iPhone OS X, Symbian OS OS for handheld and desktop gives similar services but handheld devices are simpler therefore their OS are simpler and smaller. The OS can be stored in ROM.
File Basics File – named collection of data that exists on a storage medium File-naming conventions. Each OS has a unique set of rules. Max length for naming files is 255 characters. File name extension – optional file identifier separated from the main file by a period (E.g. pain.exe,.dat – document,.doc – word processing
File Basics Reserved words – words used as commands or special identifiers that you CANNOT USE as a file name (e.g. – Nul, Aux, Com1, Com2, Con, Lpt1, Lpt 2) Some OS are case sensitive. Upper and Lowercase letters.
File Directories and folders You can choose a file’s location Disk partition – section of a hard disk drive that is treated as a separate storage unit. Can be assigned drive letters. Partition C, or D. It is NOT like folders. It is more permanent, and a special utility is required to create, modify, or delete them
File Directories and folders Directory – list of files for each storage disk Root directory – main directory Subdirectory – smaller list subdivided from the root director Folder File specification (Path) – includes the drive letter, folder(s), file name, and extension.
File Directories and folders File size – measured in bytes OS keeps track of file sizes and supplies that information when you ask the list of the files File date File format – organization and layout of data that is stored in a file. File header – section of data at the beginning of a file (date created, date updated, size, file type)
FILE FORMATS (OS and Executable Extensions) Type of FileDescriptionExtension Batch fileSequence of OS commands executed automatically when the comp boots.bat Configuration fileInfo about program the comp uses to distribute the resources needed to run them.cfg.sys.mif.bin.ini HelpThe info shown by on-screen Help.hlp Temporary fileA sort of scratch pad that has data while a file is open, but is discarded when you close the file.tmp Support progProgram instructions executed along with the main.exe file for a prog.ocx.vbx.vbs.dll ProgramMain executable files for a comp prog.exe.com
Data File Extensions Type of fileExtensions Text.txt.dat.rtf.doc (Microsoft Word 2004).docx (Word 2007).odt (OpenDocument text).wpd (WordPerfect) Sound.wav.mid.mp3.mp4.aac.au.ra(Real Audio) Graphics.bmp.pcx.tif.wmf.gif.jpg.png.eps.ai(Adobe Illustrator) Animation/Video.flc.fli.avi.mpg.mov(QuickTime).rm(RealMedia).wmv(Windows Media Player) Web pages.htm.html.asp.vml.php Spreadsheets.xls (Microsoft Excel 2003).xlsx(Exel 2007).ods(OpenDocument spreadsheet) Database.mdb (Microsoft Access).odb(OpenOffice.org Base) Miscallenous.pdf (Adobe Acrobat).ppt (Microsoft Powerpoint).zip (WindZip).pub (Microsoft Publisher).qxp (QuarkXpress)
Why can’t I open files File damaged Someone changed the file extension Some file formats exist in several variations, and your software might have the capability to open a particular variation of the format.
Converting a file from one format to another Easiest way to convert a file Open the file using that software, and then use the Export option, or Save As dialog box, to select a new file format, assign the file a new name and save it. Some conversions DO NOT keep all the characteristics of the original file.
FILE MANAGEMENT OS helps you organize and manipulate your files from – within an application program – or by using a SPECIAL FILE MANAGEMENT UTILITY
Application-based file management Apps provide a way to open files and save them in a specific folder in designated storage device Some apps allow you to tag a file. File tag in Windows is a piece of information that describes the file
Save and Save As Option Save As Option allows you to select a name and storage device for a file, whereas the Save option simply saves the latest version of a file under its current name and its current location
Save As option Using apps, software interact with OS’s file management system when you’re opening and saving files OS needs to know the name of a newly created file Apps checks with the OS to get list of available files (searching)
FILE MANAGEMENT UTILITIES OS provide file management utilities that shows you the files stored on your disks and lets you work with them – Mac OS X – Finder – Windows Vista – Explorer Helps you view a list of files, find files, move files from one place to another, make copies of files, delete files, discover file properties, and rename files.
FILE MANAGEMENT METAPHORS Logical storage models – metaphors that help you form a mental (logical) picture of the way in which files are stored – Filing cabinet – Tree structure Microsoft programmer combined the filing cabinet metaphor with the tree structure metaphor in the WINDOWS EXPLORER FILE MANAGEMENT UTILITY
Tree Structure
Windows Explorer
Physical File Storage OS help you visualize computer storage as files and folders Physical storage model describes what really happens on the disks and in circuits – Before storing, the storage medium must be formatted – Formatting: process of dividing disk into tracks and sectors
Tracks and Sectors
OS keeping track of a file’s location OS uses file system. Different systems use different file systems – Mac OS: Macitonsh Hierarchical File System Plus (HFS+) – Linux: Ext3fs (third extended file system) – Windows NT, 2000, Vista: New Technology File System (NTFS) Windows 95, 98, Me: FAT32
OS keeping track of a file’s location To speed up the process of storing and retrieving data, a disk drive usually works with group of sectors called cluster or a “block”. The number of sectors that form a cluster varies A file system primary task is to maintain a list of clusters and keep track of which are empty and which hold data.
OS keeping track of a file’s location This information is stored in a special index file – FAT32 file system: index file is called File Allocation table (FAT) – NTFS file system: index is called Master File Table (MFT) – If MFT or FAT is damaged or corrupted data can be lost. Important to backup.
OS keeping track of a file’s location When you save a file, the operating system looks at the file allocation table to see what cluster is free. Then it will update the allocation table to indicate that the file is saved in that cluster If the file is too big to fit in one cluster, it will use more clusters that are next to it
MFT keeps track of file names and locations
Opening a file When you open a file, – The OS looks up the filename in the Master File Table. – It finds the correct cluster and sector on the hard drive – Then it moves the read-write head on the hard disk to that spot. – The read-write head will read that data – The data is sent back to the RAM for the OS to use
Deleting a file If you want to delete a file, you might think that it is erased from the hard disk Instead the master file table is updated to say that cluster is now empty and can be used for new data There are programs that allow users to recover deleted items, because THEY ARE NOT REALLY DELETED To really delete a file, you can use special “file shredder software”, that overwrites supposedly empty sectors with random 1s and 0s.
Can deleted files be undeleted? The Windows Recycle Bin and similar utilities in other OS are designed to protect you from accidentally deleting hard disk files you actually need Files in the Recycle Bin Folder can be undeleted so that they again appear in the regular directory. The Recycle Bin can be emptied to permanently delete any files it contains.
Fragmentation As computer writes files on a disk, parts of files tend to become scattered all over the disk and stored in noncontiguous clusters which refer to Fragmented files. Drive performance generally declines as the read-write heads move back and fourth to locate the clusters containing the parts of a file.
Defragmentation
Data Backup It is often important to save your data in two places, in case one place goes bad. Maybe your hard disk will break, your file system will break or your CD-ROM will get scratched If you have important data, save it in another place, because you never know what will happen
Data Backup You can make a backup of your entire computer (called full backup), but often it’s not worth it. You can always re-install the operating system and get the applications you had before The things you cannot replace are documents and files that you create. Those should be saved.
FILE COPIES AND SYNCHRONIZATION File synchronization software: automatically make copies of files in specified folders. Ensures files in two or more locations contain the same data (E.g. Time Machine with Mac OS X)
File and system software Backup software – Full backup: makes a fresh copy of every file in the folders you’ve specified for backup – Differential backup: makes a backup of only those files that were added or changed since your last full backup session – Incremental backup: makes a backup of the files that were added or changed since the last backup