Presentation is loading. Please wait.

Presentation is loading. Please wait.

COMP5102/5122 Lecture 1 Operating Systems (OS) Introduction phones off (please)

Similar presentations


Presentation on theme: "COMP5102/5122 Lecture 1 Operating Systems (OS) Introduction phones off (please)"— Presentation transcript:

1 COMP5102/5122 Lecture 1 Operating Systems (OS) Introduction phones off (please)

2 © De Montfort University, 2005Comp5102/5122 - L12 Lecture Outline Personal Introduction Assessment Operating System? A general overview History of UNIX Overview of UNIX

3 © De Montfort University, 2005Comp5102/5122 - L13 Personal Introduction –Morteza Safavi RoomGH5.10 Tel207 8477 emailmsaf@dmu.ac.ukmsaf@dmu.ac.uk http://www.cse.dmu.ac.uk/~msaf

4 © De Montfort University, 2005Comp5102/5122 - L14 Assessment Assessment by – Coursework: 50% Assignment (Friday end of week 10) 20% Phase test- (Tuesday/Thursday week 11) 5% Computer System Coursework 25% OR Network Coursework 25% –ExamFor both OS and CS and Networks 50%

5 © De Montfort University, 2005Comp5102/5122 - L15 What is an Operating System? A program that acts as an intermediary between a user and the computer hardware. –manages and allocates resources. –controls the execution of user programs and operations of I/O devices. Kernel – the one program running at all times (all else being application programs).

6 © De Montfort University, 2005Comp5102/5122 - L16 Hardware Resources CPUMain Memory File Store I/O Devices O.S. User Interface Process Management Memory Management File Management I/O Management Application Program User

7 © De Montfort University, 2005Comp5102/5122 - L17 Process Management A process is a program in execution. A process requires the CPU time, memory, files, and I/O devices, to accomplish its task. OS is responsible for: –Process creation and deletion. –process suspension and resumption. –Provision of mechanisms for: process synchronization process communication

8 © De Montfort University, 2005Comp5102/5122 - L18 Memory Management Memory is a repository of quickly accessible data shared by the CPU and I/O devices. OS is responsible for: –Keeping track of which parts of memory are currently being used and by whom. –Deciding which processes to load when memory space becomes available. –Allocating and de-allocating memory space as needed.

9 © De Montfort University, 2005Comp5102/5122 - L19 File Management A file represent programs (both source and object codes) and data. OS is responsible for: –File creation and deletion. –Directory creation and deletion. –Manipulating files and directories. –Mapping files onto secondary storage. –File backup on stable (nonvolatile) storage media.

10 © De Montfort University, 2005Comp5102/5122 - L110 Protection A mechanism for controlling access by programs, processes, or users to both system and user resources. Protection must: –Distinguish between authorised and unauthorised usage –Specify the controls to be imposed. –Provide a means of enforcing the control.

11 © De Montfort University, 2005Comp5102/5122 - L111 Command Interpreter Commands are given to the OS by control statements which mainly deal with: –Resource management, as explained above The program that reads and interprets control statements is variously called: –Command-line-interpreter –Shell (in UNIX). Its function is to get and execute the next command.

12 © De Montfort University, 2005Comp5102/5122 - L112 System Calls An interface between a running program and the operating system. In another word, the means by which a process requests a specific kernel service. Programming languages provide methods/function called to interface to the system calls, e.g. printf and scanf in C, System.out.println in Java

13 © De Montfort University, 2005Comp5102/5122 - L113 History of UNIX or UNICS In the late 1960’s, once multi-processing had been established, a group of organisations joined forces to create a powerful new OS, MULTICS –MULTiplexed Information and Computing Service Massachusetts Institute of Technology (MIT) General Electric (an electricity generating company) Bell Laboratories (a telephone company) –but it didn’t work! Bell Labs pulled out and one of its researchers, Ken Thompson, wrote a stripped-down version –the system worked on a small minicomputer, a PDP-7 –called UNICS (UNiplexed Information and Computing Service)

14 © De Montfort University, 2005Comp5102/5122 - L114 PDP-11 UNIX The system so impressed colleagues at Bell Labs that they moved it to a more modern PDP-11 –the spelling of the name was changed to UNIX During rewrites to members of the PDP-11 family, Thompson decided to convert UNIX from assembly language to a high-level language –none was suitable, so he (with some help from Dennis Ritchie) invented a new one, which they called C UNIX source code was licensed to Universities, which primarily used PDP-11’s, for a small fee –it was much better than the OS that was supplied

15 © De Montfort University, 2005Comp5102/5122 - L115 Portable UNIX Since UNIX was now written in C, it was quite easy to port it to completely different machines –write a C compiler for the new machine –rewrite the device drivers (which are probably different) –rewrite a small amount of assembly (interrupt handlers) This was made even easier when Steve Johnson (of Bell Labs) wrote the portable C compiler –this made the first step (above) very much easier UNIX spread onto different machines –AT&T (Bell Labs parent) was broken up by the US government and became in part a computer company

16 Overview of UNIX

17 © De Montfort University, 2005Comp5102/5122 - L117 Why Unix? Tree structured hierarchal file system Consistent structure, i.e. all I/O devices look the same Users files are just a sequence of bytes – O/S imposed no structure on them Proper multi-tasking virtual memory O/S Networking built in at early stage, e.g. ftp, email, etc. Simple system interface Powerful Command Line Interpreter (shell) Unix is well documented Free versions (with source) Linux Lots of free software for Unix Most O/S copy Unix’s ideas

18 © De Montfort University, 2005Comp5102/5122 - L118 UNIX Structure UNIX is conceptually built as a pyramid of layers –a user interacts via the user interface –a user program interacts via the library interface –the std. library interacts with the kernel via system calls hardware (CPU, memory, disks, terminals, etc.) UNIX operating system (process / memory management, file system, I/O, etc.) system call interface standard library (open, close, read, write, fork, etc.) library interface standard utilities (shell, editor, compiler, etc.) users user interface kernel mode user mode

19 © De Montfort University, 2005Comp5102/5122 - L119 The UNIX Shell, User Interface The command interpreter, –unprivileged, i.e. not part of the UNIX O/S The layer that understands and executes the commands a user enters e.g. cp ; rm The shell is just another command –there are now many: sh, csh, ksh, bash –(see http://www.faqs.org/faqs/unix-faq/shellhttp://www.faqs.org/faqs/unix-faq/shell –each of the shells has different built-in commands! Each shell includes complex programming facilities

20 © De Montfort University, 2005Comp5102/5122 - L120 UNIX Utilities many utility commands, – short names to save typing ls (directory listing), cp (copy), rm (remove), mv (move), etc. –UNIX designed by programmers, for programmers, hence, the utilities are powerful and terse e.g. ‘rm *’ removes all files with no prompt of ‘are you sure?’ All utilities are programs written in C –it is easy to add new ones to the standard set so lots of different people did, and continue to do so!!

21 © De Montfort University, 2005Comp5102/5122 - L121 Process Management Unix is a multi-tasking/multi-processing OS –Can run many processes (applications, system tasks) concurrently –CPU execution time shared among the processes Processes scheduled to run on available CPU time, using some scheduling algorithm, e.g. priority, round-robin, etc Status of every process maintained –ready, running, suspended, waiting for I/O, etc

22 © De Montfort University, 2005Comp5102/5122 - L122 File System Management Details of the physical organisation is hidden from user Provides users with a logical interface –e.g. named files stored in a tree structure of directories (folders) Elements referred to by name –rather than physical position on disk All I/O made to look the same –data stored on disks, cameras, remote servers, etc.

23 © De Montfort University, 2005Comp5102/5122 - L123 Memory Management O/S decides where programs stored in memory –applications can not access physical memory directly With Virtual Memory, programs have illusion of (almost) infinite memory –program address space is broken in pages stored on disk –O/S moves pages to/from disk and memory as required –a memory management unit (under control of O/S) maps memory references by a program to physical memory programs cannot access physical memory outside their own address space, e.g. operating system memory or memory allocated to other processes

24 © De Montfort University, 2005Comp5102/5122 - L124 Summary Operating System? –A general overview History of UNIX Overview of UNIX Read Appendix (next 2 pages)


Download ppt "COMP5102/5122 Lecture 1 Operating Systems (OS) Introduction phones off (please)"

Similar presentations


Ads by Google