What we saw. Desarrollo de Aplicaciones en Red. 1. OS Design. 2. Service description. 1.1 Operating System Service (1)

Similar documents
The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Chapter 2 Operating-System Structures

CS420: Operating Systems. OS Services & System Calls

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition

Chapter 2: Operating-System

Chapter 2: Operating-System Structures

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

Operating-System Structures

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

Chapter 2: System Structures

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

Chapter 2. Operating-System Structures

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

Chapter 2: Operating-System Structures

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Introduction to PC Operating Systems

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures

Lecture 2 Operating System Structures (chapter 2)

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

Chapter 2: Operating-System Structures

CS370 Operating Systems

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

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

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

Four Components of a Computer System

Operating System Architecture. CS3026 Operating Systems Lecture 03

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

Chapter 2: System Structures

Chapter 2: OS Structures

Operating System: Chap2 OS Structure. National Tsing-Hua University 2016, Fall Semester

Operating-System Structures

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

CS307: Operating Systems

Lecture 2 - Fundamental Concepts

What does an Operating System do?

ELEC 377 Operating Systems. Week 1 Class 2

Architectural Support for Operating Systems. Jinkyu Jeong ( Computer Systems Laboratory Sungkyunkwan University

Operating System Services

Chapter 3: Operating-System Structures

Chapter 3: Operating-System Structures

CSE 4/521 Introduction to Operating Systems

Processes and Threads

Operating System Concepts Ch. 2: Operating System Structures

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Fall 2015 COMP Operating Systems. Lab #3

Full file at

Processes and Threads

CSE 4/521 Introduction to Operating Systems

518 Lecture Notes Week 3

Chap2: Operating-System Structures

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 3 Process Description and Control

A process. the stack

Announcements Processes: Part II. Operating Systems. Autumn CS4023

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

CHAPTER 2: PROCESS MANAGEMENT

CSC Operating Systems Spring Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. January 17 th, 2007.

Announcements. Operating System Structure. Roadmap. Operating System Structure. Multitasking Example. Tevfik Ko!ar

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition,

System Call System Program Linker/Loader with Examples Types of computing Environment

OPERATING SYSTEMS. Prescribed Text Book Operating System Principles, Seventh Edition By Abraham Silberschatz, Peter Baer Galvin and Greg Gagne

Processes. Johan Montelius KTH

Chapter 2 Operating System Structures

Threads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Module 1 Introduction/OS Overview

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

* What are the different states for a task in an OS?

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

CS 300 Leftovers. CS460 Pacific University 1

Operating Systems. Lecture 05

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

Interrupts, Fork, I/O Basics

CS 390 Chapter 2 Homework Solutions

OS concepts and structure. q OS components & interconnects q Structuring OSs q Next time: Processes

Chapter 3: Processes. Operating System Concepts 8th Edition

Operating Systems CS3502 Spring 2018

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Chapter 4: Processes. Process Concept

! Software ( kernel ) that runs at all times. ! OS performs two unrelated functions: Maria Hybinette, UGA. user! 1! Maria Hybinette, UGA. user! n!

Process management 1

CSE 380 Computer Operating Systems. Instructor: Insup Lee. University of Pennsylvania Fall 2003

Chapter 4: Processes

Chapter 4: Threads. Chapter 4: Threads

CS510 Operating System Foundations. Jonathan Walpole

2/14/2012. Using a layered approach, the operating system is divided into N levels or layers. Also view as a stack of services

Chapter 4: Threads. Operating System Concepts 8 th Edition,

Chapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems

Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

NON SCHOLAE, SED VITAE

Transcription:

What we saw Desarrollo de Aplicaciones en Red José Rafael Rojano Cáceres http://www.uv.mx/rrojano Distributed system: Collection of independent computers that for the user works like if it where one CPU. Distributed operating system: Is the actor in charge to achieve the past. Network operating systems: is the actual result, wait to to became in a true DOS. Each machine have their kernel. 1 2 1. OS Design The design of OS can be saw from three points of view: What services are offered Interface available for users and programmers Component and interconnections 1.1 Operating System Service (1) The number and type of service differs between each OS. The basic interface offered are: User interface CLI, GUI, and batch interface Program execution I/O operations ports or device File-system manipulation Communications Shared memory or message passing Error detection 3 4 1.1 Operating System Service (2) Secondary services can be found Resource allocation CPU scheduling routines according to the complexity of the job Accounting Protection and security 2. Service description 5 6 1

2.1 User interface (1) As we saw, CLI a GUI approach exists CLI are operated by a command interpreter The command interpreter is called shell Two approach for building a interpreter by itself execute programs (size of interpreter) Implements command as a system programs (to load and execute programs) 2.1 User interface (2) GUI started in the early of 70s at Xerox Widespread by the Macintosh in the 80s Several GUIs does exist Mac OS Windows CDE and X-window KDE, GNome 7 8 3.1 System calls 3. System calls It provides an interface for calling services in an OS Imagine how many system calls does exist in order to copy from one file to another System programmers usually consider this aspect to provide an API (application programming interface) for the developer 9 Acquire input file name Acquire output file name Open the input file Create output file Loop read write Until Close output file Write result on screen Terminate normally 10 For APIs use does exist different ones for example: Win32 Java Posix API for posix systems includes Linux, Mac, Unix Also it s important to say that many times the programmer use API to do system calls in stead of invoke system calls, this help to the portability #include User <stdio.h> int main() { application printf(); } System call Standard C Library {stdio} interface User Mode Kernel Mode 3.2 Type of System Calls Five general group are found: Process control File manipulation Device manipulation Information maintenance Communications Code implementation for open System call to Write() return 11 12 2

3.2.1 Process control Process control refers to the mechanism that OS use for handling the termination of a program. It can be normal (end) or abnormal (abort). In such case of error, a trap is issue causing dump file. In the next slide you will see a resume of type of system call 13 Process control End, abort Load, execute Create or terminate process Get or set process attribute Wait Allocate memory File management Create, delete, Open, close, read, write Device management Request, release a device. Read or write Information maintenance Get or set, time, system data or process properties Communications Create, delete connection, send or receive message 14 Example of getting process properties /** Identifica el id del proceso hijo y padre */ 1. #include <sys/types.h> 2. #include <stdio.h> 3. #include <unistd.h> 4. void main(void) 5. { 6. pid_t id_proceso; 7. pid_t id_padre; 8. id_proceso = getpid(); 9. id_padre = getppid(); 10. printf("identificador de proceso: %d\n", id_proceso); 11. printf("identificador del proceso padre: %d\n", id_padre); 12. } 15 3.2.1.1 Multitasking environment In multitasking environment in stead of single-tasking child process can be executed. Mechanism are different, Ex.: Free memory Command interpreter kernel Free memory New process Command interpreter kernel a) b) DOS environment 1) Forked new process 1.1 System call fork() 2) Execute program 2.1 System call exec() Process D Free memory Process c interpreter Process B kernel Unix environment 16 Example of create process 3.2.2 File management 1. #include <sys/types.h> 2. #include <stdio.h> 3. #include <unistd.h> 4. void main(void) 5. { 6. pid_t pid; 7. int status; 8. pid = fork(); 9. switch(pid) 10. { 11. case -1: /* error del fork() */ 12. perror("error el el proceso fork"); 13. break; 14. case 0: /* proceso hijo */ 15. execlp("ls","ls","-l",null); 16. perror("error en el proceso de creación exec"); 17. break; 18. default: /* padre */ 19. printf("yo soy el proceso padre\n"); 20. } 21. } The design of File System has many aspect, however we can identify some common system calls in this aspect: Basic operations over files (O,C, R, W, S) Get or set attributes to files and directories 17 18 3

3.2.3 Device management One a process is executed in need access to different resource, the resource controlled by the system can be seen as device Device can be hardware or software Disk, printers Virtual devices So, in this category is necessary to consider the administration for accessing and releasing devices 3.2.4 Information maintenance In this aspect many systems provide functionality for date and time. Also the system provides mechanism to identify process, as we saw in the example on page 15. 19 20 3.2.5 Communication As we said there are two ways for Shared memory Message passing 3.2.5.1 Shared memory To use this model the process employ system calls to access shared memory owned by other process Shared memory requires that process removes or grant access level It is necessary for this model that programs provide mechanism for concurrency There is a variant to this model, thread, where shared memory is the default mechanism 21 22 3.2.5.2 Message passing In this model through message are send between process Communication must be establish in advanced Name of the other process and communicator (PC) must be known Identify this properties through system calls are sent to the correspondent system calls for processing 3.3 System Programs It s another aspect to consider in the design of an OS Many system programs are just interface of the system calls They are divided in the next categories File management Status information File modification Programming language support Programming loading and execution communications Programación de sistemas 23 24 4

General aspects 4. Design & implementation in OS Define goals and specification at highest level: considering hardware But, beyond this consideration basically we have two approach User goals System goals In general we found the rules of design in software engineering 25 26 5.1 General aspects 5. Operating System Structure The approach to design the structure of an OS is in general based in the partition task this is because of complexity 27 28 5.2 Simple structure 5.3 Layered structure (1) Many commercial OS does not have defined structures, because are small like Msdos In Msdos interfaces and levels are not well separated for that applications can access basic functionalities of I/O Another example is the early Unix which was separated in kernel and system programs, later the kernel was layered in services (see fig 5.2) Fig. 5.1 With proper hardware support, OS can be broken into smaller and efficient pieces. In the figure 5.2 and 5.3 you can see an approach where OS is broken in layers or levels. The bottom (0) is hardware and upper level (N) are applications The main advantage in this approach is simplicity and debugging Each layer is implemented with those functions provides for the lower layer A layer does not need to know how are operations implemented, only need to know what it does 29 30 5

5.3 Layered structure (2) Unix systems structure Also layered approach can be less efficient that others types For example a system call can take so much time going from upper to lower considering that it may needs execute I/O operations, the system call can be longer that in a non layered system. Fig. 5.2 Fig. 5.3 31 32 5.4 Microkernel As was said the expansion of kernel in UNIX become complex, in 80s, Carnegie Mellon University develop Mach system with an approach in microkernel. This method consist in remove all nonessential components from the kernel implementing them as system or user-level programs. The main function is to provide an interface between user and services through message passing. Modularity and easily modifications without affect the kernel There is also more security because programs are executed with user privileges Ex.: Tru64 unix, QNX 5.5 Modules Another approach is the construction of OS as modules This approach is based in the object oriented paradigm Here the kernel has some core components and dynamically links to services Examples of this are Solaris, Linux and MacOS 33 34 A core kernel structure Virtual Machines Fig. 5.4 MacOs knows as Darwin as hybrid: layers Message passing does not exist A virtual machine is the conclusion of a layered system. The idea in a VM is the abstraction of hardware into several different execution environments, creating the idea of a own computer. Virtual memory Scheduling Fig. 5.5 and microkernel 35 36 6

Model of VM VMware example Vmware abstract Intel x86 hardware into isolated VM. It let run different guest OS 37 38 VMware architecture Java VM example Java defines an architectural-neutral byte code Two components for java architecture 39 40.Net platform example.net architecture Also program are targeted to run on platform instead of specific architecture The core of the architecture is the CLR (Common Language Runtime) Which run intermediate code representation call MS-IL (Microsoft Intermediate Language) 41 42 7

Reference Silberschatz et Al, Operating Systems concepts 7th. Wiley. 43 8