OS Structure. COMP755 Advanced OS

Similar documents
Chapter 3: Operating-System Structures. Common System Components

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Operating System Components

Chapter 3 Operating-System Structures

Common Operating-System Components

Introduction. What is an Operating System?

LECTURE-7. Introduction to DOS. Introduction to UNIX/LINUX OS. Introduction to Windows. Topics:

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Chapter 2 System Structures

ELEC 377. Operating Systems. Week 1 Class 3

Example of Standard API

Operating System Structures

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Operating Systems 4 th Class

Operating system Dr. Shroouq J.

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

OPERATING SYSTEMS STRUCTURES

Operating System Components and Services

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

System Structures. Services Interface Structure

Operating System Structures

CHAPTER 15: Operating Systems: An Overview

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

Kernel. What is an Operating System? Systems Software and Application Software. The core of an OS is called kernel, which. Module 9: Operating Systems

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Tutorial 0A Programming on the command line

Page 1 of 5. IS 335: Information Technology in Business Lecture Outline Operating Systems

Operating System Structure

OPERATING SYSTEM SERVICES

LSN 10 Linux Overview

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Cisco Networking Academy Program Curriculum Scope & Sequence. Fundamentals of UNIX version 2.0 (July, 2002)

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

CS3600 SYSTEMS AND NETWORKS

Components of a Computer System

CS 103 Lab Linux and Virtual Machines

Programming for GCSE Topic H: Operating Systems

Chapter 3. Operating Systems

Computer Systems II. Unix system calls. fork( ) wait( ) exit( ) How To Create New Processes? Creating and Executing Processes

CPS221 Lecture: Operating System Structure; Virtual Machines

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Understanding the Boot Process and Command Line Chapter #3

Linux System Administration on Red Hat

Chapter 11 I/O Management and Disk Scheduling

Shree M. & N. Virani Science College. DOS Commands. By Milan Kothari. Yogidham, Kalawad Road, Rajkot 5 Ph :

Overview of Operating Systems Instructor: Dr. Tongping Liu

CS420: Operating Systems OS Services & System Calls

Linux command line. An introduction to the Linux command line for genomics. Susan Fairley

Introduction to Linux and Cluster Basics for the CCR General Computing Cluster

Fred Hantelmann LINUX. Start-up Guide. A self-contained introduction. With 57 Figures. Springer

Kernel Types System Calls. Operating Systems. Autumn 2013 CS4023

Chapter 2: OS Overview

Thirty Useful Unix Commands

PHP Debugging. Draft: March 19, Christopher Vickery

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Command Line Crash Course For Unix

Lecture 1 Operating System Overview

Linux Driver Devices. Why, When, Which, How?

Open Source Computational Fluid Dynamics

Operating System Overview. Otto J. Anshus

HP-UX Essentials and Shell Programming Course Summary

How To Understand The History Of An Operating System

Multiprogramming. IT 3123 Hardware and Software Concepts. Program Dispatching. Multiprogramming. Program Dispatching. Program Dispatching

Introduction to Sun Grid Engine (SGE)

CS10110 Introduction to personal computer equipment

Undergraduate Course Syllabus

DOS Command Reference DOS Commands Found in DOS 6.22, Windows 95, and Windows 98

Computer Engineering

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

VMware Server 2.0 Essentials. Virtualization Deployment and Management

Operating System Organization. Purpose of an OS

Running your first Linux Program

THE UNIVERSITY OF AUCKLAND

System Calls and Standard I/O

Unix Sampler. PEOPLE whoami id who

Tools Page 1 of 13 ON PROGRAM TRANSLATION. A priori, we have two translation mechanisms available:

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

Origins of Operating Systems OS/360. Martin Grund HPI

How To Understand How A Process Works In Unix (Shell) (Shell Shell) (Program) (Unix) (For A Non-Program) And (Shell).Orgode) (Powerpoint) (Permanent) (Processes

DOS Command Reference

CSI 402 Lecture 13 (Unix Process Related System Calls) 13 1 / 17

Lab 1: Introduction to the network lab

Hadoop Shell Commands

Hadoop Shell Commands

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

Introduction to Running Hadoop on the High Performance Clusters at the Center for Computational Research

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

Beginners Shell Scripting for Batch Jobs

SOFTWARE TECHNOLOGIES

SYSTEM ecos Embedded Configurable Operating System

Operating Systems PART -A

ICS 351: Today's plan

Linux Overview. Local facilities. Linux commands. The vi (gvim) editor

Lesson 06: Basics of Software Development (W02D2

Embedded Programming in C/C++: Lesson-1: Programming Elements and Programming in C

Introduction to Operating Systems

OS Concepts and structure

HDFS File System Shell Guide

Chapter 1 Fundamentals of Java Programming

Transcription:

OS Structure COMP755 Advanced OS

"Today's scientists have substituted mathematics for experiments, and they wander off through equation after equation, and eventually build a structure which has no relation to reality." Nikola Tesla

Programming Assignment A simple programming assignment has been posted on Blackboard under assignments You can write the programs in C++, Java or another OO programming language Due by midnight on Friday, August 30

Short Term Schedule Monday, August 26 OS structure read chapter 2 Monday, September 2 Labor Day Holiday (no class) Monday, September 9 Concurrent Programming Monday, September 16 CPU scheduling & review read chapter 5 Wednesday, August 21 Introduction read chapter 1 Wednesday, August 28 Concurrent Programming read chapter 6 Wednesday, September 4 Concurrent Programming Wednesday, September 11 Deadlock & thread implementation read chapter 7 Wednesday, September 18 Exam 1

The OS is a BIG program The operating system is a large program composed of many modules. Writing and updating an OS requires careful software engineering techniques. Errors in the OS can cause the whole system to fail.

System Implementation Once written in assembly language, operating systems are now written in higher-level languages Code written in a high-level language: Can be written faster Is more compact. Is easier to understand and debug An operating system is far easier to port (move to some other hardware) if it is written in a high-level language

System Design Goals User goals operating system should be convenient to use, easy to learn, reliable, safe, and fast System goals operating system should be easy to design, implement, and maintain, as well as flexible, reliable, errorfree, and efficient

System Components Process management Memory management File management I/O management Security manager Shell

OS kernel The kernel of the OS is that portion providing privileged high priority functions. Dispatcher Interrupt handling I/O control Memory management Some parts of the operating system do not reside in the kernel.

Traditional UNIX System Structure

Microkernel System Structure Moves as much from the kernel into user space Communication takes place between user modules using message passing

Microkernel System Structure Benefits: Easier to extend a microkernel Easier to port the operating system to new architectures More reliable (less code is running in kernel mode) More secure Detriments: Performance overhead of user space to kernel space communication

Solaris Modular Approach

Shell Interface Program The shell is the user interface. It is part of the OS Runs at the user level (not kernel level) The shell reads the user s commands and then causes the applications to be loaded and executed.

Shell Features Reads user input and executes programs. Provides the prompt. Implements redirection Implements parallel execution with & May implement simple commands Shells may provide a graphical user interface.

Human Interface The shell is the part of the OS that is most important to most users. Considerable effort has gone into trying to make the interface intuitive and easy to use

Popular Shells command.com in DOS C shell in Unix Korn shell in Unix Borne shell in Unix explorer.exe Windows user interface Cygwin Unix shell for Windows

Shell Outline do forever { print prompt; read command; if (fork()==0) { // child process use exec() to load program; } wait for child process to terminate; }

execv function int _execv( const char *cmdname, const char *argv[ ] ); where: cmdname is the name of the program file. argv is an array of pointer to strings containing the parameters. By convention argv[0] = cmdname; The last argv entry must be NULL. The execv function causes the specified program to overlay the calling program. This function does not return if successful.

Simple C Program int main ( int argc, char *argv[] ) { }... return 5; The argv array passed to the main function when you start a C programs is the argv array passed to execv by the shell.

Standard I/O Streams When a program is started, it has three I/O streams open: 0 stdin Standard input, usually keyboard 1 stdout Standard output, usually screen 2 stderr Standard error, usually screen

Redirection Standard I/O streams can be redirected from the command line ls > myfile.txt myprog < usualstuff.txt cc nogood.c >&2 Errmsg.Txt

Redirection Implementation The freopen( filename, mode, *stream) function will direct output to stream to the specified filename. The shell can redirect stdin or stdout to the filename specified on the command line. The shell forks a new process, redirects stdin and/or stdout then does the exec()

Multiple Processes If you put a & at the end of a command, the shell will not wait for the process to terminate before printing the next prompt. You can run a process in the background by putting a & at the end of the line. You can put a & between commands to execute them in parallel.

Example Multiple Processes makefile bigthing & xterm & ls & cc myprog.c ls & cc myprog.c & ps

Shell Outline do forever { print prompt; read command; if (fork()==0) { // child process use exec() to load program; } if (no & ) wait for child to terminate; }

Scripts The shell can execute script files to produce commands for the shell. Scripts are a program whose output is a series of commands to the shell. DOS batch files are a simple example of scripting. Unix scripts can be much more elaborate.

Utilities An operating system is more than just the kernel, there are many utilities. The utilities are just user applications. Different user interfaces require different utilities

DOS Commands attrib find set cd or chdir format setver chkdsk help share cls join smartdrive copy label sort ctty md or mkdir sys defrag mem time and date del or erase more tree deltree move type dir rd or rmdir xcopy echo ren fdisk scandisk

Unix Commands at env nice cat grep ps cd head rm chmod kill rmdir chown lp sort cmp make tail compres man touch cp mkdir uncompress date more who du mv

Windows Utilities

In Windows the user interface is called the Explorer. It runs in 1. Kernel mode 2. High priority OS 3. Low priority OS 4. User mode 25% 25% 25% 25% Kernel mode High priority OS Low priority OS User mode

Process Management A process is a program in execution A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task The operating system is responsible for the following activities in connection with process management creation, deletion suspension, resumption synchronization, communication

Main-Memory Management Memory is a large array of words or bytes, each with its own address RAM is a volatile storage device. It loses its contents without power. The operating system is responsible for the following activities in connection with memory management Keep track of which parts of memory are currently being used and by whom Decide which processes to load when memory space becomes available Allocate and deallocate memory space as needed

File Management The operating system is responsible for the following activities in connections with file management: File creation and deletion Directory creation and deletion Support of primitives for manipulating files and directories Mapping files onto secondary storage

Secondary-Storage Management Since RAM is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory Most modern computer systems use disks (or simulated disks) as the primary storage medium, for both programs and data The operating system is responsible for: Free space management Storage allocation Disk scheduling

I/O System Management The I/O system consists of: A buffer-caching system A general device-driver interface Drivers for specific hardware devices

Security manager The Security manager provides a mechanism for controlling access by programs, processes, or users to both system and user resources The protection mechanism must: distinguish between authorized and unauthorized usage specify the controls to be imposed provide a means of enforcement

Priorities The many different parts of the OS may run at different priorities Non-process High priority Lower priority User level

OS Services Program Execution I/O control Communications Error detection Resource allocation Protection

Privileged Instructions Most machines allow certain instructions only in "OS mode" When a user wants to do something that they cannot do directly, the user program requests the OS to do the task The Intel Pentium supports 4 levels of privilege.

Supervisor Calls Supervisor Calls (SVC) are a means of making a function call to an OS service. The normal function call mechanism will not work since you have to change to the OS environment. An SVC or INT call generates an interrupt. The OS gets control and executes the desired function.

Virtual Machines A virtual machine provides an interface identical to the underlying bare hardware Programs running in a virtual machine appear to be running on their own computer An OS can run in a virtual machine and run application programs Multiple virtual machines can run on the same computer at the same time

Virtual Machines (Cont.) The resources of the physical computer are shared to create the virtual machines CPU scheduling can create the appearance that users have their own processor A virtual disk drive might be simulated as a file on the host OS

Java Virtual Machine Compiled Java programs are platformneutral bytecodes executed by a Java Virtual Machine (JVM) JVM consists of Class loader Class verifier Runtime interpreter Just-In-Time (JIT) compilers increase performance

Java Environment

System Generation (SYSGEN) Older OS had to be recompiled whenever you made a configuration change. Most modern OS contain code for every possible configuration. Code is dynamically added when new hardware is found.