Module 1 Introduction to Operating System - 2014

2,160 views

Published on

Concept of OS, What is OS, Functionalities

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,160
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
72
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Module 1 Introduction to Operating System - 2014

  1. 1. Module 1 - Introduction Hemang Kothari Assistant Professor Computer Engineering Department MEFGI, Rajkot. Email: hemang.kothari@marwadieducation.edu.in Slides: http://www.slideshare.net/hemangkothari 30-Dec-13 Computer Engineering Department - MEFGI 1
  2. 2. Content • • • • • • What is an OS ? Evolution Of OS. OS Services. Types Of OS. Concepts of OS. Different Views Of OS. 30-Dec-13 Computer Engineering Department - MEFGI 2
  3. 3. The Big Picture 30-Dec-13 Computer Engineering Department - MEFGI 3
  4. 4. More .. 30-Dec-13 Computer Engineering Department - MEFGI 4
  5. 5. What is an Operating System • It is an extended machine – Hides the messy details which must be performed – Presents user with a virtual machine, easier to use • It is a resource manager – Each program gets time with the resource – Each program gets space on the resource 30-Dec-13 Computer Engineering Department - MEFGI 5
  6. 6. Evolution of Operating Systems (1) Early batch system – – – – 30-Dec-13 bring cards to 1401 read cards to tape put tape on 7094 which does computing put tape on 1401 which prints output Computer Engineering Department - MEFGI 6
  7. 7. Evolution of Operating Systems (2) • First generation 1945 - 1955 – vacuum tubes, plug boards • Second generation 1955 - 1965 – transistors, batch systems • Third generation 1965 – 1980 – ICs and multiprogramming • Fourth generation 1980 – present – personal computers 30-Dec-13 Computer Engineering Department - MEFGI 7
  8. 8. Evolution of Operating Systems (3) • Multiprogramming system – three jobs in memory – 3rd generation 30-Dec-13 Computer Engineering Department - MEFGI 8
  9. 9. Types of Operating System • • • • • • • Mainframe operating systems Server operating systems Multiprocessor operating systems Personal computer operating systems Real-time operating systems Embedded operating systems Smart card operating systems 30-Dec-13 Computer Engineering Department - MEFGI 9
  10. 10. OS Services • • • • • • • • • • Program execution Error handling Job sequencing Input/output operations Interrupt handling File system manipulation Scheduling Resource Allocation Accounting of computer resources Protection 30-Dec-13 Computer Engineering Department - MEFGI 10
  11. 11. Let’s dig it • Program execution: Users are interested in executing programs. The system must be able to load a program into memory and run it. The program must be able to end its execution, either normally or abnormally. • Error handling: For each type of error, the operating system should take the appropriate action to assure correct ant consistent computing. Example: – Power failure in the CPU or memory. – Parity error on tape. – Printer out of paper. – Arithmetic overflow. – Access illegal memory location. 30-Dec-13 Computer Engineering Department - MEFGI 11
  12. 12. Continue .. • Job sequencing: The system must determine the sequence in which jobs should be processed. In the first operating systems to transfer control from one Job to the next, a Job Control language interpreter(a command interpreter) had to be used. • Input / output operations: Since a user program cannot execute I/O operations directly, the O.S. must provide some means to do so. • Interrupt handling: Operating systems are event driven programs. If there are no programs to execute, no I/O devices to service, and no user to respond to, an O.S. will sit quietly, waiting for something to happen. Events are almost always signaled by the occurrence of an interrupt or trap. 30-Dec-13 Computer Engineering Department - MEFGI 12
  13. 13. Services Continue … • File system manipulation: Users will be able to create, delete, read, or write files. • Scheduling: The system has to decide when to introduce new processes into the system and the order in which processes should run. • Resource Allocation: When there are multiple process running concurrently, resources must be allocated to each one of them. 30-Dec-13 Computer Engineering Department - MEFGI 13
  14. 14. Still Services • Accounting of computer resources: The operating system must keep track of the type and amount of resources used by each user. This information can be used for the purpose of paying for the use of the system or for accumulating usage statistics. • Protection: When several processes are being executed concurrently to increase CPU utilization, it should not be possible for one process to interfere the others 30-Dec-13 Computer Engineering Department - MEFGI 14
  15. 15. OS Concepts - Process • Definition • A program in execution • Consists of: executable code, data, stack, CPU registers value, and other information • A process hierarchy (tree) • A created two child processes: B and C • B created three child processes: D, E, and F • Process synchronization • Inter-Process Communication (IPC) 30-Dec-13 Computer Engineering Department - MEFGI 15
  16. 16. System Calls • Definition – a call to an OS service – a trap into the OS code • Programs want the OS to perform a service – Access a file – Create a process – Others… • Examples of system calls – File manipulation: open(), read(), write(), lseek(), close() … – File system management: mkdir(), mount(), link(), chown() … – Process management: fork(), exec(), wait(), exit() … 30-Dec-13 Computer Engineering Department - MEFGI 16
  17. 17. Making a system call 0xffffffff Library (read call) Return to caller Trap to kernel 3 Trap code in register User space 8 2 4 Increment SP 9 7 • System call: read(fd,buffer,length) • Program pushes arguments, calls library • Library sets up trap, calls OS • OS handles system call • Control returns to library • Library returns to user program Call read 1 Push arguments Kernel space (OS) Dispatch 0 30-Dec-13 5 6 Sys call handler User code Computer Engineering Department - MEFGI 17
  18. 18. System Calls Examples Call Description fd = open(name,how) Open a file for reading and/or writing s = close(fd) Close an open file n = read(fd,buffer,size) Read data from a file into a buffer n = write(fd,buffer,size) Write data from a buffer into a file s = lseek(fd,offset,whence) Move the “current” pointer for a file s = stat(name,&buffer) Get a file’s status information (in buffer) s = mkdir(name,mode) Create a new directory s = rmdir(name) Remove a directory (must be empty) Create a new entry (name2) that points to the same object as name1 Remove name as a link to an object (deletes the object if name was the only link to it) s = link(name1,name2) s = unlink(name) 30-Dec-13 Computer Engineering Department - MEFGI 18
  19. 19. More system calls Call Description pid = fork() Create a child process identical to the parent pid=waitpid(pid,&statloc,options) Wait for a child to terminate s = execve(name,argv,environp) Replace a process’ core image exit(status) Terminate process execution and return status s = chdir(dirname) Change the working directory s = chmod(name,mode) Change a file’s protection bits s = kill(pid,signal) Send a signal to a process seconds = time(&seconds) Get the elapsed time since 1 Jan 1970 30-Dec-13 Computer Engineering Department - MEFGI 19
  20. 20. Deadlock Actual Deadlock Potential Deadlock 30-Dec-13 Computer Engineering Department - MEFGI 20
  21. 21. Memory Management • The memory management function keeps track of the status of each memory location, either allocated or free. • It determines how memory is allocated among competing processes, deciding who gets memory, when they receive it, and how much they are allowed. • When memory is allocated it determines which memory locations will be assigned. It tracks when memory is freed or unallocated and updates the status. 30-Dec-13 Computer Engineering Department - MEFGI 21
  22. 22. Input / Output Management • Components – controller and the device itself • Controller – Directly controls the physical device – Receives commands from the OS • Device driver – Supplied by controller manufacturer – Inserted into the OS – run in kernel mode • Functionality – Busy waiting – Interrupts 30-Dec-13 Computer Engineering Department - MEFGI 22
  23. 23. File System 30-Dec-13 Computer Engineering Department - MEFGI 23

×