TCSS 422: Operating Systems - Course Syllabus and Introduction, Exams of Operating Systems

▫Final exam Monday June 4th. ▫ 71 days from now… TCSS 422. SPRING. 2018. March 26, 2018. TCSS422: Operating Systems [Spring 2018].

Typology: Exams

2022/2023

Uploaded on 05/11/2023

ebby
ebby 🇺🇸

4.2

(17)

243 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
TCSS 422 A – Spring 2018
Institute of Technology
3/26/2018
L1.1
Slides by Wes J. Lloyd
March 26, 2018 TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma
INTRO DUC TIO N
Wes J. Lloyd
Institute of Tec hnology
Uni versity of Wa shing ton - Taco ma
TCSS 422: OPERATING SYSTEMS
Syl lab us, C our se I ntr oduc tion
C R evie w
De mogr aphi cs S urve y
Cha pte r 4: Ope rati ng S yste ms – Thr ee E asy P iece s
Intr oduc e oper ating syste ms
Man agemen t of r esour ces
Con cepts of vi rtual izati on/ab stract ion
CPU, Mem ory, I/O
Ope rati ng sys tem de sign goal s
March 26, 2018
TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma
L1.2
OB JECTI VE S
Sy llab us
Gr adi ng
Sch edu le
As sig nme nts
March 26, 2018
TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma
L1.3
TCSS4 22 SP RING 2018
CO MPUTE R OP ER ATING SYSTEM S
TC SS 4 22 – Sp ring 2018
Sp ecia l fe atur es!
Go ing gre en…
20% red uction of ca rbon f ootpr int
16 in p ers on class mee ting s
Onl ine le cture s:
Mond ay Ap ril 16 , Wedn esday A pril 1 8
No class:
Mond ay Ap ril 9, Monda y May 28
Sav es comm utin g ti me
Les s fuel expen ses
Eas ier to a chie ve pe rfec t at tend anc e
Fin al e xam Mo nday June 4
th
71 d ays fro m now…
TCS S 4 22
SPR ING
201 8
March 26, 2018 TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma L1.4
As sig nme nts
Ass ignmen t 0: L inux / scri pting
Ass ignmen ts 1 – 3 (4) : rou ghly e very t wo we eks
Qu izz es
~ 6- 8 qui zzes
Dro p lowe st two
Vari ety of form ats: i n clas s, on line, readi ng, tu toria l / ac tivi ty
Ex ams: Mi dter m an d Fi nal
Two p ages o f not es, ca lcula tor
Fina l exa m is c ompre hensiv e, wit h emp hasis on new mater ial
March 26, 2018
TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma
L1.5
TCS42 2 COUR SE W OR K
Pr ogra ms - pl ease sta rt earl y:
March 26, 2018
TCSS422: Operating Systems [Spring 2018]
Institute of Technology, University of Washington -Tacoma
L1.6
TCS S 4 22: P ROGR AM D UE DATES
From Virginia Tech Department of Computer Science -2011
Better than 50%
chance of A/B
Less than 50%
chance of A/B
pf3
pf4
pf5

Partial preview of the text

Download TCSS 422: Operating Systems - Course Syllabus and Introduction and more Exams Operating Systems in PDF only on Docsity!

Institute of Technology

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma

INTRODUCTION

Wes J. Lloyd

Institute of Technology

University of Washington - Tacoma

TCSS 422: OPERATING SYSTEMS

 Syllabus, Course Introduction
 C Review
 Demographics Survey
 Chapter 4: Operating Systems – Three Easy Pieces
 Introduce operating systems
 Management of resources
 Concepts of virtualization/abstraction
 CPU, Memory, I/O
 Operating system design goals

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

OBJECTIVES

 Syllabus
 Grading
 Schedule
 Assignments

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

TCSS422 – SPRING 2018

COMPUTER OPERATING SYSTEMS

TCSS 422 – Spring 2018

Special features!

 Going green…

 20% reduction of carbon footprint

 16 in person class meetings

 Online lectures: Monday April 16, Wednesday April 18  No class: Monday April 9, Monday May 28

 Saves commuting time

 Less fuel expenses  Easier to achieve perfect attendance

 Final exam Monday June 4th

 71 days from now…

TCSS 422
SPRING

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

 Assignments
 Assignment 0: Linux /scripting
 Assignments 1 – 3 (4): roughly every two weeks
 Quizzes
 ~ 6-8 quizzes
 Drop lowest two
 Variety of formats: in class, online, reading, tutorial / activity
 Exams: Midterm and Final
 Two pages of notes, calculator
 Final exam is comprehensive, with emphasis on new material

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

TCS422 COURSE WORK

 Programs - please start early: March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

TCSS 422: PROGRAM DUE DATES

From Virginia Tech Department of Computer Science - 2011 Better than 50% chance of A/B Less than 50% chance of A/B

Institute of Technology

 Programs - please start early  Work as if deadline is several days earlier  Allows for a “buffer” for running into unexpected problems

 Underestimation of the task at hand
 Allows time to seek C help from SCI 106/108 lab
mentors
 If less familiar with C/pointers (TCSS 333),
BUDGET MORE TIME

 This quarter: 5% bonus for submitting on the original posted due date

 Excludes any class-wide extensions

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

TCSS 422: PROGRAM DUE DATES

 Ubuntu 16.
 Open source version of Debian-package based Linux
 Package management: “apt get” repositories
 See: https://packages.ubuntu.com/
 Ubuntu Advantages
 Enterprise Linux Distribution
 Free, widely used by developers
 Long term releases (LTS) every 2 years, good for servers
 6 month feature releases, good for sharing new features
with the community

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

UBUNTU 16.04 – VIRTUAL MACHINE

 Ubuntu 16.
 Search online for YouTube videos, tutorials
 Search how to install the “Guest Additions”
 Provides file system sharing, clipboard integration, mouse
tricks
 Windows 10
 https://www.youtube.com/watch?v=DPIPC25xzUM
 Mac OS X
 https://www.youtube.com/watch?v=sNixOS6mHlU

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

UBUNTU 16.04 – VIRTUAL MACHINE

INSTALLATION

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

C PROGRAMING IN TCSS 422

 Many OSes are coded primarily in C and Assembly Language
 Computerworld, 2017 Tech Forecast Survey
 https://www.tacoma.uw.edu/institute-technology/student-
support-workshops-mentors
 Institute of Technology Mentors
 Located in Science 106 / 108 Labs
 Monday – Thursday: ~10 am – 7 pm
 Friday: ~ 1 2-5pm
 Spring quarter hours to be posted

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

C MENTORING

 Office hours: to be announced, and by appointment
 End of class: good for quick questions, assignment Q&A
 It will be difficult to tutor all 50 students individually on C
 Take ownership of your educational outcome
 Time spent in TCSS 422 is just ~0.4% of an IT career
 Make the most of this limited time

 Maximize your educational investment

 *** Ask questions in class ***
 Also questions after class, email, Canvas discussion boards
 Seek help using UWT resources, the internet, YouTube videos
(video.google.com) and online tutorials

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

INSTRUCTOR HELP

Institute of Technology

 Responsible for:  Making it easy to run programs  Allowing programs to share memory  Enabling programs to interact with devices March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

OPERATING SYSTEMS

OS is in charge of making sure the system operates correctly and efficiently.  The OS is a resource manager  Manages CPU, disk, network I/O  Enables many programs to  Share the CPU  Share the underlying physical memory (RAM)  Share physical devices

 Disks
 Network Devices

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

RESOURCE MANAGEMENT

 Operating systems present physical resources as virtual representations to the programs sharing them

 Physical resources: CPU, disk, memory, …

 The virtual form is “abstract”  The OS presents an illusion that each user program runs in isolation on its own hardware  This virtual form is general, powerful, and easy-to-use March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZATION

 What form of abstraction does the OS provide?  CPU

 Process and/or thread

 Memory

 Address space
  large array of bytes
 All programs see the same “size” of RAM

 Disk

 Files

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

ABSTRACTIONS

 Allow applications to reuse common facilities  Make different devices look the same  Easier to write common code to use devices  Linux/Unix Block Devices  Provide higher level abstractions  More useful functionality March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

WHY ABSTRACTION?

 What level of abstraction?  How much of the underlying hardware should be exposed?  What if too much?  What if too little?  What are the correct abstractions?  Security concerns March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

ABSTRACTION CHALLENGES

Institute of Technology

 Each running program gets its own “virtual” representation of
the CPU
 Many programs seem to run at once
 Linux: “top” command shows
process list
 Windows: task manager

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZING THE CPU

 Simple Looping C Program

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZING THE CPU - 2

12 #include#include <stdio.h><stdlib.h> 34 #include#include <sys/time.h><assert.h> 56 #include "common.h" 78 intmain(int argc, char *argv[]) 910 { if (argc != 2 ) { 1112 fprintf(stderr,exit( 1 ); "usage: cpu \n"); 1314 }char *str = argv[ 1 ]; 1516 while ( 1 )Spin( { 1 ); // Repeatedly checks the time and 17 returnsprintf("%s\n", str);^ once^ it^ has run for a second 1819 }return 0 ; 20 }

 Runs forever, must Ctrl-C to halt…

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZING THE CPU - 3

prompt> gcc prompt> ./cpu "A" -o cpu cpu.c -Wall A A A ˆC prompt> March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZATION THE CPU - 4

prompt> ./cpu A [1] 7353 & ; ./cpu B & ; ./cpu C & ; ./cpu D & [2] 7354 [3] 7355 [4] 7356 A B D C A B D C A C B D ... Even though we have only one processor, all four of programs seem to be running at the same time!

 Computer memory is treated as a large array of bytes
 Programs store all data in this large array
 Read memory (load)
 Specify an address to read data from
 Write memory (store)
 Specify data to write to an address

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZING MEMORY

 Program to read/write memory:

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

VIRTUALIZING MEMORY - 2

12 #include#include <unistd.h><stdio.h> 34 #include#include <stdlib.h>"common.h" (^56) int 78 main({ int argc, char *argv[]) 9 int *p = malloc(sizeof(int)); memory // a1: allocate some 1011 assert(pprintf("(%d) != NULL address); of p: %08x\n", 12 getpid(), (unsigned) address p); (^) of the// a2: memmoryprint out the 1314 p =while 0 ;( (^1) )// a3: { put zero into the first slot of the memory 1516 Spin(p = *p 1 ); + 1 ; (^1718) } printf("(%d) p: %d\n", getpid(), *p); // a (^1920) } return 0 ;

Institute of Technology

 Program creates two threads
 Check documentation: “man pthread_create”
 worker() method counts from 0 to argv[1] (loop)

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

CONCURRENCY - 3

1617 intmain(int argc, char *argv[]) 1819 { if (argc != 2 ) { 2021 fprintf(stderr,exit( 1 ); "usage: threads \n"); 2223 }loops = atoi(argv[ 1 ]); 2425 pthread_t p1, p2;printf("Initial value : %d\n", counter); (^2627) Pthread_create(&p1, NULL, worker, NULL); 2829 Pthread_create(&p2,Pthread_join(p1, NULL NULL);, worker, NULL); 3031 Pthread_join(p2,printf("Final value : %d\n", NULL); counter); (^3233) } return 0 ; March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

Linux

“man”

page

example

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

CONCURRENCY - 4

 Command line parameter argv[1] provides loop length
 Defines number of times the shared counter is incremented
 Loops: 1000
 Loops 100000

prompt> prompt> gcc./thread 1000 -o thread thread.c -Wall -pthread Initial Final value value : : 2000 0 prompt> Initial ./thread 100000value : 0 Final value prompt> ./thread 100000 : 143012 // huh?? Initial Final value value : : 137298 (^0) // what the??

 When loop value is large why do we not achieve 200000?
 C code is translated to (3) assembly code operations
1. Load counter variable into register
2. Increment it
3. Store the register value back in memory
 These instructions happen concurrently and VERY FAST
 (P1 || P2) write incremented register values back to memory,
While (P1 || P2) read same memory
 Memory access here is unsynchronized (no n-atomic)
 Some of the increments are lost

March 26, 2018 TCSS422: Operating Systems [Spring 2018] Institute of Technology, University of Washington - Tacoma L1.

CONCURRENCY - 5

QUESTIONS