What Is Operating System? Operating Systems, System Calls, and Buffered I/O. Academic Computers in 1983 and Operating System

Similar documents
System Calls and Standard I/O

Operating Systems. Privileged Instructions

Online Network Administration Degree Programs

Help Desk Level Competencies

State of Wisconsin DET Agency Managed Virtual Services Service Offering Definition

Restricted Document. Pulsant Technical Specification

Licensing Windows Server 2012 for use with virtualization technologies

SBClient and Microsoft Windows Terminal Server (Including Citrix Server)

Microsoft SQL Server Administration

Caching Software Performance Test: Microsoft SQL Server Acceleration with FlashSoft Software 3.8 for Windows Server

Chapter 2 Operating System Structures

Have some knowledge of how queries execute. Must be able to read a query execution plan and understand what is happening.

Configuring, Monitoring and Deploying a Private Cloud with System Center 2012 Boot Camp

Aladdin HASP SRM Key Problem Resolution

Data Protection Policy & Procedure

1B11 Operating Systems - 3. Memory Management and Protection

Microsoft Certified Database Administrator (MCDBA)

Serv-U Distributed Architecture Guide

Readme File. Purpose. What is Translation Manager 9.3.1? Hyperion Translation Manager Release Readme

Information Services Hosting Arrangements

Provisioning Services Architecture Overview. User Account Context / Service Account Context

The Organizational NOS (Network Operating System)

HarePoint HelpDesk for SharePoint. For SharePoint Server 2010, SharePoint Foundation User Guide

FOCUS Service Management Software Version 8.5 for Passport Business Solutions Installation Instructions

Serv-U Distributed Architecture Guide

Systems Support - Extended

A Beginner s Guide to Building Virtual Web Servers

How To Install Fcus Service Management Software On A Pc Or Macbook

FOCUS Service Management Software Version 8.5 for CounterPoint Installation Instructions

ASUS PC Diagnostics Guide

State of Wisconsin. File Server Service Service Offering Definition

Understand Business Continuity

CXA-300-1I: Advanced Administration for Citrix XenApp 5.0 for Windows Server 2008

Microsoft has released Windows 8.1, a free upgrade to Windows 8. Follow the steps below to upgrade to Windows 8.1.

Application Note: 202

Licensing Windows Server 2012 R2 for use with virtualization technologies

UC4 AUTOMATED VIRTUALIZATION Intelligent Service Automation for Physical and Virtual Environments

IT Help Desk Service Level Expectations Revised: 01/09/2012

Service Desk Self Service Overview

Überleben im OSB / SOA Dschungel Daniel Joray Trivadis AG Bern

How To Install An Orin Failver Engine On A Network With A Network Card (Orin) On A 2Gigbook (Orion) On An Ipad (Orina) Orin (Ornet) Ornet (Orn

Hardware Requirements

EASTERN ARIZONA COLLEGE Database Design and Development

Ten Steps for an Easy Install of the eg Enterprise Suite

Wireless Light-Level Monitoring

Introduction to Mindjet MindManager Server

Using Sentry-go Enterprise/ASPX for Sentry-go Quick & Plus! monitors

Deployment Overview (Installation):

Cloud Services Frequently Asked Questions FAQ

Often people have questions about new or enhanced services. This is a list of commonly asked questions and answers regarding our new WebMail format.

Welcome to Remote Access Services (RAS)

In addition to assisting with the disaster planning process, it is hoped this document will also::

Service Level Agreement Distributed Hosting and Distributed Database Hosting

Process Automation With VMware

Topic Outline. Page 2 of 5

JOB DESCRIPTION. Job Title: Business Intelligence Developer. Job Holder: Date: April 2016

Samsung Omnia II Software Upgrade for Microsoft Windows XP Instructions

State of Wisconsin DET Dedicated Virtual Host Services Offering Definition

SMART Product Drivers 11.3 for Windows and Mac computers

Version: Modified By: Date: Approved By: Date: 1.0 Michael Hawkins October 29, 2013 Dan Bowden November 2013

Uninstalling and Reinstalling on a Server Computer. Medical Director / PracSoft

Wireless Nurse Calling System Technical Document

Datasheet. PV4E Management Software Features

2. When logging is used, which severity level indicates that a device is unusable?

Norwood Public Schools Internet & Cell Phone Use Agreement School Year

First Global Data Corp.

COPIES-F.Y.I., INC. Policies and Procedures Data Security Policy

CSU STANISLAUS INFORMATION TECHNOLOGY PLAN SUMMARY

How To Configure A GSM Modem Using HyperTerminal

Fermilab Time & Labor Desktop Computer Requirements

Request for Proposal Technology Services

Intel Hybrid Cloud Management Portal Update FAQ. Audience: Public

Client Application Installation Guide

Citrix XenServer from HP Getting Started Guide

Database Services - Extended

CSE 231 Fall 2015 Computer Project #4

CSC IT practix Recommendations

FAQs for Webroot SecureAnywhere Identity Shield

System Business Continuity Classification

The Importance Advanced Data Collection System Maintenance. Berry Drijsen Global Service Business Manager. knowledge to shape your future

Plus500CY Ltd. Statement on Privacy and Cookie Policy

Elite Home Office and Roku HD Setup

Market Research Report - Q4 2015

1)What hardware is available for installing/configuring MOSS 2010?

Level 1 Technical. Management Applications. Contents

DVS Enterprise Test Results for Microsoft Lync 2013 and Citrix XenDesktop 7. Dell Client Cloud Computing Engineering Revision: 1.

Installation Guide Marshal Reporting Console

SITE APPLICATIONS USER GUIDE:

Webalo Pro Appliance Setup

GUIDANCE FOR BUSINESS ASSOCIATES

Configuring SSL and TLS Decryption in ngeniusone

Creating a Wired Home Network with a Linksys Router and a Westell 2200 Modem

Computer Science Undergraduate Scholarship

Customers FAQs for Webroot SecureAnywhere Identity Shield

Health Care Solution

MaaS360 Cloud Extender

Junos Pulse Instructions for Windows and Mac OS X

Design for securability Applying engineering principles to the design of security architectures

HP ilo Video Player Online Help

How To Write A Lcker Rental Software For Renting A Lckers

Transcription:

What Is Operating System? Operating Systems, System Calls, and Buffered I/O emacs gcc Brwser DVD Player Operating System CS 217 1 Abstractin f hardware Virtualizatin Prtectin and security 2 Academic Cmputers in 1983 and 2003 1883 2003 Rati CPU clck 3Mhz 3Ghz 1:1000 $/machine $80k $800 100:1 DRAM 256k 256M 1:1000 Disk 20MB 200GB 1:10,000 Netwrk BW 10Mbits/sec 1GBits/sec 1:100 Cmputing and Cmmunicatins Expnential Grwth! (Curtesy J. Gray) Perfrmance/Price dubles every 18 mnths 100x per decade Prgress in next 18 mnths = ALL previus prgress New strage = sum f all ld strage (ever) New prcessing = sum f all ld prcessing. Aggregate bandwidth dubles in 8 mnths Address bits 16-32 32-64 1:2 s/machine 10s 1 (r < 1) > 10:1 $/Perfrmance $80k < $800/1000 100,000+:1 3 15 years ag 4

Phase 1: Expensive, Human Cheap Phase 2: Cheap, Human Expensive at cnsle, OS as subrutine library Use cheap terminals t share a cmputer Batch mnitr (n prtectin): lad, run, print Time-sharing OS Develpment Unix enters the mainstream Data channels, interrupts; verlap I/O and CPU DMA Memry prtectin: keep bugs t individual prgrams Multics: designed in 1963 and run in 1969 Prblems: thrashing as the number f users increases Assumptin: N bad peple. N bad prgrams. Minimum interactins Applicatin App1 OS... App2 Time-sharing OS hardware App2 5 hardware 6 Phase 4: > 1 Machines per Phase 3: HW Cheaper, Human Mre Expensive Persnal cmputer Parallel and distributed systems Alts OS, Ethernet, Bitmap display, laser printer Pp-menu windw interface, email, publishing SW, spreadsheet, FTP, Telnet Eventually >100M unites per year Parallel machine Clusters Netwrk is the cmputer Pervasive cmputers PC perating system Wearable cmputers Cmputers everywhere Memry prtectin Multiprgramming Netwrking OS are general and specialized 7 8

A Typical Operating System Layers f Abstractin Abstractin: Layered services t access hardware We learn hw t use the services here COS318 will teach hw t implement Virtualizatin: Each user with its wn machine (COS318) Prtectin & security: make the machine safe (COS318) prcess Kernel Appl Prg Stdi Library File System Strage FILE * stream int fd hierarchical file system variable-length segments OS Kernel Driver disk blcks Disk 9 10 System Calls Kernel prvided system services: prtected prcedure call user kernel Appl Prg Stdi Library File System Unix has ~150 system calls; see man 2 intr /usr/include/syscall.h fpen,fclse, printf, fgetc, getchar, pen, clse, read, write, seek System Call Mechanism r mdes mde: can execute nrmal instructins and access nly user memry Supervisr mde: can execute nrmal instructins, privileged instructins and access all f memry (e.g., devices) System calls cannt execute privileged instructins s must ask OS t execute them - system calls System calls are ften implemented using traps (int) OS gains cntrl thrugh trap, switches t supervisr mdel, perfrms service, switches back t user mde, and gives cntrl back t user (iret) 11 12

System-call interface = ADTs ADT peratins File input/utput pen, clse, read, write, dup cntrl frk, exit, wait, kill, exec,... Interprcess cmmunicatin pipe, scket... pen system call pen - pen and pssibly create a file r device flags examples: O_RDONLY O_WRITE O_CREATE #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> mde is the permissins t use if file must be created int pen(cnst char *pathname, int flags, mde_t mde); 13 The pen() system call is used t cnvert a pathname int a file descriptr (a small, nn-negative integer fr use in subsequent I/O as with read, write, etc.). When the call is successful, the file descriptr returned will be... 14 clse system call clse - clse a file descriptr int clse(int fd); clse clses a file descriptr, s that it n lnger refers t any file and may be reused. Any lcks held n the file it was assciated with, and wned by the prcess, are remved (regardless f the file descriptr that was used t btain the lck).... 15 read System Call read - read frm a file descriptr int read(int fd, vid *buf, int cunt); read() attempts t read up t cunt bytes frm file descriptr fd int the buffer starting at buf. If cunt is zer, read() returns zer and has n ther results. If cunt is greater than SSIZE_MAX, the result is unspecified. RETURN VALUE On success, the number f bytes read is returned (zer indicates end f file), and the file psitin is advanced by this number. It is nt an errr if this number is smaller than the number f bytes requested.... On errr, -1 is returned, and errn is set apprpriately. 16

write System Call write write t a file descriptr int write(int fd, vid *buf, int cunt); write writes up t cunt bytes t the file referenced by the file descriptr fd frm the buffer starting at buf. RETURN VALUE On success, the number f bytes written is returned (zer indicates nthing was written). It is nt an errr if this number is smaller than the number f bytes requested.... On errr, -1 is returned, and errn is set apprpriately. Making Sure It All Gets Written int safe_write(int fd, char *buf, int nbytes) { int n; char *p = buf; char *q = buf + nbytes; while (p < q) { if ((n = write(fd, p, (q-p)*sizef(char))) > 0) p += n/sizef(char); else perrr( safe_write: ); return nbytes; 17 18 Buffered I/O Single-character I/O is usually t slw int getchar(vid) { char c; if (read(0, &c, 1) == 1) return c; else return EOF; Buffered I/O (cnt) Slutin: read a chunk and dle ut as needed int getchar(vid) { static char buf[1024]; static char *p; static int n = 0; if (n--) return *p++; n = read(0, buf, sizef(buf)); if (n <= 0) return EOF; p = buf; return getchar(); 19 20

Standard I/O Library #define getc(p) (--(p)->_cnt >= 0? \ (int)(*(unsigned char *)(p)->_ptr++) : \ _filbuf(p)) typedef struct _ibuf { int _cnt; /* num chars left in buffer */ char *_ptr; /* ptr t next char in buffer */ char *_base; /* beginning f buffer */ int _bufsize;/* size f buffer */ shrt _flag; /* pen mde flags, etc. */ char _file; /* assciated file descriptr */ FILE; Why Is getc A Macr? #define getc(p) (--(p)->_cnt >= 0? \ (int)(*(unsigned char *)(p)->_ptr++) : \ _filbuf(p)) #define getchar() getc(stdin) Invented in 1970s, when Cmputers had slw functin-call instructins Cmpilers culdn t inline-expand very well It s nt 1975 any mre Mral: dn t invent new macrs, use functins extern FILE *stdin, *stdut, *stderr; 21 22 fpen FILE *fpen(char *name, char *rw) { Use mallc t create a struct _ibuf Determine apprpriate flags frm rw parameter Call pen t get the file descriptr Fill in the _ibuf apprpriately Stdi library fpen, fclse fef, ferrr, filen, fstat status inquiries fflush make utside wrld see changes t buffer fgetc, fgets, fread fputc fputs, fwrite printf, fprintf scanf, fscanf fseek and mre... This (large) library interface is nt the perating-system interface; much mre rm fr flexibility. This ADT is implemented in terms f the lwer-level file-descriptr ADT. 23 24

Summary OS is the sftware between hardware and applicatins Abstractin: prvide services t access the hardware Virtualizatin: Prvides each prcess with its wn machine Prtectin & security: make the envirnment safe System calls ADT fr the user applicatins Standard I/O example -level libraries layered n tp f system calls 25