Computer Systems 1 Fundamentals of Computing


Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Computer Systems 1 Fundamentals of Computing

  1. 1. Computer Systems 1 Fundamentals of Computing Operating Systems
  2. 2. CS1 - Week 22 <ul><li>Introduction to the OS </li></ul><ul><li>OS Fundamentals </li></ul><ul><ul><li>Processes </li></ul></ul><ul><ul><li>Memory </li></ul></ul><ul><ul><li>Files </li></ul></ul><ul><ul><li>I/O </li></ul></ul>
  3. 3. The Operating System (OS) <ul><li>Manages the hardware and software resources of the system </li></ul><ul><li>Resources </li></ul><ul><ul><li>Processor </li></ul></ul><ul><ul><li>Memory </li></ul></ul><ul><ul><li>Disk space, etc. </li></ul></ul><ul><li>Allows applications to deal with the hardware without having to know all the details of the hardware </li></ul>
  4. 4. Operating Systems Hardware Operating System User Application Application Application User User <ul><li>The OS acts a a ‘shell’ around the hardware. </li></ul><ul><li>The applications software need an OS to work, and users need the applications software to interact with the hardware via the OS. </li></ul>
  5. 5. Types of OS <ul><li>Real-Time Operating System (RTOS) </li></ul><ul><ul><li>Fast Response (‘Real Time’ / Instant) </li></ul></ul><ul><ul><li>Used to control machinery and industrial systems </li></ul></ul><ul><ul><li>Usually Poor HCI </li></ul></ul><ul><li>Single-User, Single Task </li></ul><ul><ul><li>One user can do one thing at a time </li></ul></ul><ul><ul><li>Useful for low spec systems </li></ul></ul><ul><li>Single-User, Multi-Tasking </li></ul><ul><ul><li>One user can perform many tasks at a time </li></ul></ul><ul><ul><li>Common for current PC systems </li></ul></ul><ul><li>Multi-User </li></ul><ul><ul><li>Many users can use the computer's resources simultaneously </li></ul></ul><ul><ul><li>OS balances resources allocation against users and tasks </li></ul></ul><ul><ul><li>N.B- A machine on a network is not necessarily multi-user!!! </li></ul></ul>
  6. 6. OS Generic Structure <ul><li>Kernel </li></ul><ul><li>Memory & Process Management </li></ul><ul><li>Input / Output </li></ul><ul><li>File System </li></ul><ul><li>User Interface </li></ul>
  7. 7. The Kernel <ul><li>Heart of the OS </li></ul><ul><li>Provides secure access to the computer hardware </li></ul><ul><li>Low-level software / hardware transfer </li></ul><ul><li>Manages resource availability / usage </li></ul><ul><li>A kernel includes </li></ul><ul><ul><li>Interrupt handler </li></ul></ul><ul><ul><ul><li>Handles all requests for kernel service </li></ul></ul></ul><ul><ul><li>Scheduler that </li></ul></ul><ul><ul><ul><li>Decides how and which programs share the kernel processing time </li></ul></ul></ul><ul><ul><li>Supervisor </li></ul></ul><ul><ul><ul><li>Gives use of the computer to each process when required </li></ul></ul></ul>
  8. 8. Types of kernels <ul><li>Monolithic Kernel </li></ul><ul><ul><li>Runs most of its services in the kernel workspace </li></ul></ul><ul><ul><li>Error prone due to the amount of tasks in the kernel itself </li></ul></ul><ul><ul><li>Used in most Linux systems </li></ul></ul><ul><li>Microkernel </li></ul><ul><ul><li>Runs most services - like networking, filesystem, etc. - in user space </li></ul></ul><ul><ul><li>More stable, but more complex designs </li></ul></ul><ul><li>Hybrid (Modified Microkernel) </li></ul><ul><ul><li>Microkernels that have some &quot;non-essential&quot; code in kernel space in order for that code to run more quickly. </li></ul></ul><ul><ul><li>Windows NT/2000 and Macintosh OS X use hybrid kernels </li></ul></ul>
  9. 9. Process Management <ul><li>Process </li></ul><ul><ul><li>A single sequence of operation(s) </li></ul></ul><ul><ul><li>The basic unit of software the operating system deals with in scheduling the work done by the processor </li></ul></ul><ul><ul><li>Not the same as an application </li></ul></ul><ul><ul><ul><li>An application can contain multiple processes </li></ul></ul></ul><ul><li>Process has some key attributes </li></ul><ul><ul><li>Process ID (PID) </li></ul></ul><ul><ul><li>Priority Level </li></ul></ul><ul><ul><li>Pointers to upper and lower bounds of memory allocated </li></ul></ul><ul><ul><li>Status of all I/O devices needed </li></ul></ul>
  10. 10. Process Management <ul><li>CPU can only do one thing at a time </li></ul><ul><ul><li>If a process wants to use the CPU it must tell the CPU </li></ul></ul><ul><ul><ul><li>Interrupts or Polling </li></ul></ul></ul><ul><li>To give the appearance multi-tasking, the quickly OS switches between different processes </li></ul><ul><ul><li>This function is performed by a process scheduler </li></ul></ul><ul><li>Schedulers decide what process should run, when , and for how long </li></ul><ul><li>Scheduling decision factors </li></ul><ul><ul><li>Priority </li></ul></ul><ul><ul><li>Resources needed </li></ul></ul><ul><ul><li>Resources used to date </li></ul></ul><ul><ul><li>Waiting time to date </li></ul></ul>
  11. 11. Memory Management <ul><li>Provide memory space to enable multiple processes to be executed at the same time </li></ul><ul><li>Give satisfactory level of performance for users </li></ul><ul><li>Protect each process </li></ul><ul><ul><li>Don’t get data mixed-up between processes </li></ul></ul><ul><li>Enable sharing of memory between processes </li></ul><ul><ul><li>More dynamic & efficient use of the memory resources </li></ul></ul><ul><li>Make addressing of memory transparent to programmers </li></ul><ul><li>Provides Virtual Memory </li></ul><ul><ul><li>Extra memory, larger than the physical allocation </li></ul></ul><ul><ul><li>Done by storing portions of data to backing storage </li></ul></ul>
  12. 12. Input / Output Need more input…. <ul><li>Devices use an I/O sub-system of a computer use to communicate </li></ul><ul><ul><li>Communication carried out via registers </li></ul></ul><ul><li>I/O devices use interrupts to signal to the CPU that a task has been completed </li></ul><ul><ul><li>IRQ – Interrupt ReQuests. </li></ul></ul><ul><ul><li>Each device has a unique IRQ </li></ul></ul><ul><li>On ISA buses, data can be sent from the I/O controller to memory, bypassing the the CPU </li></ul><ul><ul><li>This is DMA (Direct Memory Access) </li></ul></ul>
  13. 13. Input / Output <ul><li>Input / Output Control System (IOCS) </li></ul><ul><ul><li>The part of the O/S that deals with I/O activity </li></ul></ul><ul><ul><li>Deals with requests and routes to and from devices </li></ul></ul><ul><li>Device Driver </li></ul><ul><ul><li>A software module which manages the communication with, and control of, a specific I/O device </li></ul></ul><ul><ul><li>Interprets requests from the application to specific commands to the I/O device </li></ul></ul>Application Program Input-output Control System (IOCS) Device Driver Device Controller I/O Device System Calls I/O Bus } Operating System
  14. 14. File System <ul><li>File can be stored data, although programs and folders are also considered files at a low level </li></ul><ul><li>OS knows nothing about file structure </li></ul><ul><ul><li>Applications can interpret file data </li></ul></ul><ul><li>File System tasks </li></ul><ul><ul><li>Creating & deleting files </li></ul></ul><ul><ul><li>Storing and organising files on storage medium </li></ul></ul><ul><li>A new file is allocated one cluster </li></ul><ul><li>As the file grows the cluster becomes filled and more clusters are assigned to the file </li></ul>
  15. 15. File System <ul><li>Ideally, successive file clusters should be in sequence on the disk </li></ul><ul><ul><li>Faster access as less disk movement in required </li></ul></ul><ul><li>Usually a disk contains many files </li></ul><ul><ul><li>Clusters get mixed out of sequence </li></ul></ul><ul><ul><li>This is known as fragmentation </li></ul></ul><ul><li>Fragmentation can reach a critical level where system performance becomes greatly reduced </li></ul>A A B A B C C B B End of file A Free cluster End of file B
  16. 16. File System <ul><li>Windows file systems are FAT </li></ul><ul><ul><li>File Allocation Table </li></ul></ul><ul><ul><li>FAT16 </li></ul></ul><ul><ul><ul><li>Uses 16-bit value to record file properties </li></ul></ul></ul><ul><ul><li>FAT32 </li></ul></ul><ul><ul><ul><li>Very similar to FAT16, except it uses 32-bit values </li></ul></ul></ul><ul><li>Linux / UNIX Use iNodes </li></ul><ul><ul><li>Similar procedure to Windows </li></ul></ul><ul><ul><li>Usually 32-bit values </li></ul></ul><ul><ul><li>Every file has an iNode </li></ul></ul><ul><ul><li>OS tracks iNodes and file names </li></ul></ul>
  17. 17. User Interface <ul><li>The user interface (UI) is a layer above the operating system </li></ul><ul><ul><li>What users “see” or interact with </li></ul></ul><ul><li>UI deals with getting user commands and providing feedback / representation </li></ul><ul><li>Two common types of user interfaces: </li></ul><ul><ul><li>Command-Line Interface (CLI) </li></ul></ul><ul><ul><li>Graphical User Interface (GUI) </li></ul></ul>
  18. 18. Command-Line Interface <ul><li>Textual commands </li></ul><ul><ul><li>Either from the keyboard or from a script </li></ul></ul><ul><li>User types a command after the computer displays a prompt character </li></ul><ul><ul><li>For example, MS-DOS, UNIX, etc. </li></ul></ul><ul><li>Advantages </li></ul><ul><ul><li>Faster for skilled users </li></ul></ul><ul><ul><li>All options and commands available in a standard format </li></ul></ul><ul><ul><li>Can perform operations in a batch processing mode without user interaction </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Perplexes new users / Not user-friendly </li></ul></ul><ul><ul><li>Multiple operations made complex </li></ul></ul><ul><ul><li>Have to remember commands / not intuitive </li></ul></ul>
  19. 19. Graphical User Interface <ul><li>Graphical representations & metaphors </li></ul><ul><li>GUIs have a number of common features: </li></ul><ul><ul><li>Windows, Icons, Menus, Pointers (WIMP) </li></ul></ul><ul><ul><li>As well as buttons, toolbars, etc. </li></ul></ul><ul><li>Advantages </li></ul><ul><ul><li>Consistent look and feel, even across platforms </li></ul></ul><ul><ul><li>Commands can be executed using either mouse or keyboard </li></ul></ul><ul><ul><li>High levels of operation and dialog </li></ul></ul><ul><li>Disadvantages </li></ul><ul><ul><li>Often restrictive </li></ul></ul><ul><ul><li>Use more system resources / more intense </li></ul></ul>
  20. 20. UNIX <ul><li>Designed by Ken Thomson of AT&T Bell Laboratories improved by Dennis Ritchie </li></ul><ul><li>Multi-user </li></ul><ul><ul><li>More than one person suing the OS at a time </li></ul></ul><ul><li>Multitasking </li></ul><ul><ul><li>Each user can run more than one process </li></ul></ul><ul><li>Platform independent </li></ul><ul><ul><li>Runs on almost any hardware platform </li></ul></ul><ul><li>Complex </li></ul><ul><li>Large distribution </li></ul><ul><li>User control and administration </li></ul><ul><li>Used as multiple types of server </li></ul>
  21. 21. LINUX <ul><li>Created by Linus Torvalds </li></ul><ul><li>Particularly aimed at PC users </li></ul><ul><li>Two parts: </li></ul><ul><ul><li>Kernel </li></ul></ul><ul><ul><ul><li>The Linux operations section </li></ul></ul></ul><ul><ul><ul><li>The UNIX part of things </li></ul></ul></ul><ul><ul><li>Distribution </li></ul></ul><ul><ul><ul><li>Particular flavour of Linux </li></ul></ul></ul><ul><li>Open source </li></ul><ul><ul><li>Free! (more or less) </li></ul></ul><ul><li>Many now have a windows style interface </li></ul><ul><ul><li>Easy to get to grips with </li></ul></ul><ul><ul><li>Some expertise is required to become a master </li></ul></ul><ul><li>Low hardware requirements </li></ul><ul><ul><li>100 MHz CPU, 12Mb RAM, 500Mb HDD </li></ul></ul>
  22. 22. Microsoft Windows <ul><li>Founded by Bill Gates </li></ul><ul><li>Developed from MS-DOS </li></ul><ul><ul><li>Microsoft Disk Operating System </li></ul></ul><ul><ul><ul><li>‘ Borrowed’ from XEROX Q-DOS </li></ul></ul></ul><ul><li>Windows 1.0 began life as an interface running on MS-DOS </li></ul><ul><li>GUI improved and networking capabilities added in future versions </li></ul><ul><li>Is now independent of MS-DOS </li></ul><ul><li>Many varieties available </li></ul><ul><ul><li>Majority are multi-user and multi-task </li></ul></ul><ul><ul><ul><li>Windows XP </li></ul></ul></ul><ul><ul><ul><li>Windows Server </li></ul></ul></ul><ul><ul><ul><li>Windows 2000 </li></ul></ul></ul>
  23. 23. Macintosh OS X <ul><li>Rooted in a UNIX system </li></ul><ul><ul><li>Providing all the good bits of a powerful UNIX OS </li></ul></ul><ul><li>Super-nice GUI as front-end </li></ul><ul><ul><li>Ease of use and interaction </li></ul></ul><ul><li>Macintosh OS have always been pioneers in user-friendly interfaces and functionality </li></ul><ul><li>High level of accessibility </li></ul><ul><li>Scalable from first-time users to advanced </li></ul><ul><li>Seamless integration of OS and system applications </li></ul>
  24. 24. Week 22 <ul><li>Operating System Structure & Components </li></ul><ul><ul><li>Kernel </li></ul></ul><ul><ul><li>Memory management </li></ul></ul><ul><ul><li>Process management </li></ul></ul><ul><ul><li>Input / output </li></ul></ul><ul><ul><li>File system </li></ul></ul><ul><ul><li>User interface </li></ul></ul>