Presentation is loading. Please wait.

Presentation is loading. Please wait.

Outline Introduction to Operating Systems Using the Operating Systems

Similar presentations


Presentation on theme: "Outline Introduction to Operating Systems Using the Operating Systems"— Presentation transcript:

1 Outline Introduction to Operating Systems Using the Operating Systems
The abstract model of computing System calls

2 System Overview A computer system consists of hardware and software that are combined to provide a tool to solve specific problems Hardware includes CPU, memory, disks, printers, screen, keyboard, mouse ... Software includes System software A general environment to create specific applications Application software A tool to solve a specific problem 11/30/2018 COP4610

3 System Overview – cont. 11/30/2018 COP4610

4 Hardware Resources Processor: execute instructions
Memory: store programs and data Input/output (I/O)controllers: transfer to and from devices Disk devices: long-term storage Other devices: conversion between internal and external data representations 11/30/2018 COP4610

5 Hardware Resources – cont.
11/30/2018 COP4610

6 Hardware Interface – cont.
Everything that a programmer needs to know in order to write programs that perform desired operation on the hardware Disk drive is an example Disk interface provides functions to move disk head, transfer data Monitor Monitor interface provides functions to move the cursor, display characters/graphics 11/30/2018 COP4610

7 Software Classification
System software Provides a general programming environment in which programmers can create specific applications Application software Intended to solve a specific problem 11/30/2018 COP4610

8 Software Classification - continued
11/30/2018 COP4610

9 What is an Operating System?
The operating system is the part of the system software that manages the use of the hardware used by other system software and all application software It is the system program that acts between the hardware and the user programs 11/30/2018 COP4610

10 What is an Operating System? - continued
It provides services to user programs Through system calls / message passing File system services Memory services I/O services It hides hardware from user programs When your program shows a message on the monitor, it does not need to know the details When your program generates a new file, it does not need to know where the free space is on your hard drive 11/30/2018 COP4610

11 Differences between OS and System Software
Major differences between OS and general system software OS abstracts the hardware directly General system software relies on the abstractions provided by OS OS provides the fundamental trusted mechanisms for resource sharing A general purpose OS is domain-independent 11/30/2018 COP4610

12 Operating System Functions
Resource manager manage hardware and software resources Resource abstraction and sharing A nicer environment implement a virtual machine for processes to run in A program in execution is called a process a nicer environment than the bare hardware 11/30/2018 COP4610

13 Resource Management Functions
Transform physical resources to logical resources Resource abstraction Make the hardware resources easier to use Multiplex one physical resource to several logical resources Create multiple, logical copies of resources Schedule physical and logical resources Decide who gets to use the resources 11/30/2018 COP4610

14 Resource Abstraction Provides an abstract model of the operation of hardware components Like data abstraction in Object-Oriented programming Interface functions Internal functions and status 11/30/2018 COP4610

15 A Disk Device Abstraction
Three interface functions Load(block, length, device) seek(device, track) out(device, sector) 11/30/2018 COP4610

16 A Disk Device Abstraction – cont.
An abstract function for writing 11/30/2018 COP4610

17 Resource Abstraction – cont.
Multi-level abstractions Disk controller -> disk driver -> file system 11/30/2018 COP4610

18 Resource Sharing Two types of sharing Time multiplexed sharing
time-sharing schedule a serially-reusable resource among several users Space multiplexed sharing space-sharing divide a multiple-use resource up among several users 11/30/2018 COP4610

19 Time-multiplexing the Processor
- Called multiprogramming 11/30/2018 COP4610

20 Time-multiplexing the Processor – cont.
- Resulted in concurrent execution or concurrency 11/30/2018 COP4610

21 Time-multiplexing the Processor – cont.
- Multiprogramming can improve the overall system performance 11/30/2018 COP4610

22 Space-multiplexing Memory
11/30/2018 COP4610

23 Time-multiplexing I/O Devices
11/30/2018 COP4610

24 Space-multiplexing the Disk
11/30/2018 COP4610

25 Issues in Resource Sharing
Resource isolation and sharing Protection Sharing Resource allocation Scheduling 11/30/2018 COP4610

26 Do We Need an OS? Not always But they are very useful
When resource abstraction or sharing is not needed Some programs run “stand-alone” Early computers did not have a sophisticated OS OS was evolved along the hardware technology But they are very useful Reusable functions Easier to use than the bare hardware 11/30/2018 COP4610

27 Operating Systems Strategies
Several different strategies have been used Earliest computers were dedicated to a single program and there was no multiprogramming and no OS Batch systems Timesharing systems There are a few other recent strategies Personal computers and workstations Embedded systems Small, communicating computers Network technology 11/30/2018 COP4610

28 Batch Processing Systems
Reduce setup time by batching similar jobs Automatic job sequencing – automatically transfers control from one job to another. First rudimentary operating system. Resident monitor initial control in monitor control transfers to job when job completes control transfers back to monitor 11/30/2018 COP4610

29 Batch Processing Systems - continued
11/30/2018 COP4610

30 Memory Layout for a Simple Batch System
11/30/2018 COP4610

31 Spooling Overlap I/O of one job with computation of another job. While executing one job, the OS Reads next job from card reader into a storage area on the disk (job queue). Outputs printout of previous job from disk to printer. Job pool – data structure that allows the OS to select which job to run next in order to increase CPU utilization 11/30/2018 COP4610

32 Multi-programmed Batch Systems
Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them. 11/30/2018 COP4610

33 OS Features for Multi-programming
I/O routine supplied by the system Memory management – the system must allocate the memory to several jobs CPU scheduling – the system must choose among several jobs ready to run Allocation of devices 11/30/2018 COP4610

34 Time-sharing Systems The goal is to enable users to interact with the computer system Batch processing systems do not allow user interactions On-line communication between the user and the system is provided When the operating system finishes the execution of one command, it seeks the next “control statement” not from a card reader, but rather from the user’s keyboard. On-line system must be available for users to access data and code. 11/30/2018 COP4610

35 Time-sharing Systems - continued
11/30/2018 COP4610

36 Personal-computer Systems
Personal computers – computer system dedicated to a single user. I/O devices – keyboards, mice, display screens, small printers. User convenience and responsiveness. Can adopt technology developed for larger operating system often individuals have sole use of computer and do not need advanced CPU utilization of protection features. 11/30/2018 COP4610

37 Personal-computer Systems - continued
11/30/2018 COP4610

38 Embedded Systems Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems. Well-defined fixed-time constraints. Hard real-time system. Secondary storage limited or absent, data stored in short-term memory, or read-only memory (ROM) Conflicts with time-sharing systems, not supported by general-purpose operating systems. Soft real-time system Limited utility in industrial control or robotics Useful in applications (multimedia, virtual reality) requiring advanced operating-system features. 11/30/2018 COP4610

39 Parallel systems Multiprocessor systems with more than one CPU in close communication. Tightly coupled system – processors share memory and a clock; communication usually takes place through the shared memory. Advantages of parallel system: Increased throughput Economical Increased reliability graceful degradation fail-soft systems 11/30/2018 COP4610

40 Distributed Systems Distribute the computation among several physical processors Loosely coupled system – each processor has its own local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines Advantages of distributed systems Resources Sharing Computation speed up – load sharing Reliability Communications 11/30/2018 COP4610

41 Distributed systems - cont.
Network operating system provides file sharing provides communication scheme runs independently from other computers on the network Distributed operating system less autonomy between computers gives the impression there is a single operating system controlling the network. 11/30/2018 COP4610

42 Migration of Operating-System Concepts and Features
11/30/2018 COP4610

43 Genesis of Modern OS 11/30/2018 COP4610

44 Using the O.S. For a programmer, the operating system interface is most important The functions provided by the OS Abstract resources that are available 11/30/2018 COP4610

45 Requesting Services from O.S.
Two techniques System call Message passing 11/30/2018 COP4610

46 Requesting Services – cont.
Two techniques System call Message passing 11/30/2018 COP4610

47 System Call Interface System call interface
Operating system provides a set of operations called system calls A programming interface 11/30/2018 COP4610

48 How to Make a System Call
For a programmer A system call is similar to a procedure/function call in a traditional programming language System calls are available in C/C++ as library routines For example, fork to create a new process 11/30/2018 COP4610

49 How to Make a System Call – cont.
Do the parent and the child have the same sequence of instructions when fork() is successful? Why do we say this is the child and this the parent? How about here? pid = fork(); if (pid == ((pid_t)-1)) { // Something must be wrong with the fork // error processing } else { if (pid == 0) { // This is the child process // This is the parent process } //How about here, the parent or the child ? 11/30/2018 COP4610

50 System Call Overview man –s 2 intro Process management system calls
List of all the system calls available Process management system calls Memory management system calls File and I/O system calls Communication system calls Information maintenance system calls 11/30/2018 COP4610

51 Process Management System Calls
fork – Create a new process exit – Terminate a process wait – Wait for a child process to terminate exec – Execute a file nice – Change scheduling priority for a process _lwp_create – Create a new lightweight process yield – Yield execution to another lightweight process 11/30/2018 COP4610

52 Thread Related Functions and System Calls
POSIX Thread pthread_create pthread_join pthread_exit Solaris Thread thr_create thr_join thr_exit 11/30/2018 COP4610

53 Memory Management System Calls
brk – Change the size of data segment of process memcntl – Memory management control mmap – Map pages of memory (Memory mapped I/O) Note: malloc and free are library functions using memory management system calls 11/30/2018 COP4610

54 File Management System Calls
open – Open a file for reading or writing creat – Create a new file and open it read – Read bytes from an open file write – Write bytes to an open file close – Close an open file seek – Change the location in the open file of the next read or write stat – Get information about a file mkdir – Make a directory mount – Mount a file system 11/30/2018 COP4610

55 File Management System Calls
open – Open a file for reading or writing creat – Create a new file and open it read – Read bytes from an open file write – Write bytes to an open file close – Close an open file seek – Change the location in the open file of the next read or write stat – Get information about a file mkdir – Make a directory mount – Mount a file system An open file is a dynamic object that can provide bytes from a file or accept bytes to be stored in the file. It has a set attributes, such as file pointer. It is a virtual device created by the operating system. Files however are passive containers of data 11/30/2018 COP4610

56 I/O System Calls open – Open a device for reading or writing
read – Read bytes from an open device write – Write bytes to an open device close – Close an open device ioctl – Control device 11/30/2018 COP4610

57 Communication System Calls
pipe – Create an inter-process channel kill – Send a signal to a process or a group of processes msgctl – Message control operations shmat, shmctl, shmget, shmop – Shared memory operations Semctl, semget, semop – Semaphore operations 11/30/2018 COP4610

58 Information Maintenance System Calls
acct – Enable or disable process accounting stime – Set system time and date times – Get process and child process times utimes – Set file times 11/30/2018 COP4610

59 Interactive and Programming Interfaces
Interactive interfaces have advantages: for exploration for interactive use Programming interfaces have advantages : for detailed interactions Inter-application programming Scripting It is useful for a program to have both interfaces 11/30/2018 COP4610

60 Examples Shell System calls Interactive interface to OS
Programming interface to OS 11/30/2018 COP4610

61 Shell as an Interactive Interface
Interactive access to the OS system calls and system and user programs cd to change current working directory System call is chdir Started by the system for a user Contains a simple programming language Popularized by UNIX Bourne shell, C shell (csh), Korn shell (ksh), Bourne-again shell (bash), etc. 11/30/2018 COP4610

62 Two views of a shell 11/30/2018 COP4610

63 Summary Operating system is the system software that controls the basic operation of a computer The layer between the hardware and the user programs Resource manager: manage hardware and software resources Goals of operating systems Convenience for users by providing a wide range of functions Efficient operation of the computer system Operating system provides services to user programs through system calls Shell as an interactive interface to system calls and system and user programs 11/30/2018 COP4610


Download ppt "Outline Introduction to Operating Systems Using the Operating Systems"

Similar presentations


Ads by Google