



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Feedback, homework questions, and class activities related to the TCSS 422 course on Operating Systems Objectives. The document covers topics such as the Process API, Limited Direct Execution, Operating System Design Goals, Virtualizing the CPU, and Linux Output Redirection. The document also includes feedback from students and examples of when to launch new processes. The document could be useful as study notes or lecture notes for students taking the TCSS 422 course or a similar course on Operating Systems.
Typology: Lecture notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma
Wes J. Lloyd
TCSS 422: OPERATING SYSTEMS
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. OBJECTIVES
https://goo.gl/forms/XAxxuZtut5o707Ip January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. VIRTUAL MACHINE SURVEY
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. SELECTED FEEDBACK FROM 1/
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. FEEDBACK - 2 What are these three different states? RUNNING READY BLOCKED January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. FEEDBACK - 3
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. LINUX OUTPUT REDIRECTION
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. FEEDBACK - 5 CH. 2: INTRODUCTION TO OPERATING SYSTEMS January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. SUMMARY: OPERATING SYSTEM DESIGN GOALS
January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. SUMMARY: OPERATING SYSTEM DESIGN GOALS - 2 ABSTRACTING THE HARDWARE PROVIDE HIGH PERFORMANCE PROVIDE ISOLATION RELIABILIT Y January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. OPERATING SYSTEM DESIGN GOALS
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3. EXEC EXAMPLE - 2 … execvp(myargs[ 0 ], myargs); // runs word count } else^ printf("this { shouldn’t print out");// parent goes down this path (main) int printf("hello, wc = wait(NULL); I am parent of %d (wc:%d) (pid:%d)\n", }^ rc, wc, (int)^ getpid()); }^ return^0 ; prompt> hello world ./p3 (pid:29383) hello, 29 107 I 1030 am childp3.c (pid:29384) hello, prompt> I am parent of 29384 (wc:29384) (pid:29383) January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3. EXEC WITH FILE REDIRECTION (OUTPUT) #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <fcntl.h> #include <sys/wait.h> int main(int argc, char *argv[]){ int if (rc <rc = fork(); 0 ) { // fork failed; exit fprintf(stderr, exit( 1 ); "fork failed\n"); } else if close(STDOUT_FILENO); (rc == 0 ) { // child: redirect standard output to a file open("./p4.output", O_CREAT|O_WRONLY|O_TRUNC, … S_IRWXU); January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3. FILE MODE BITS S_IRWXU read, write, execute/search by owner S_IRUSR read permission, owner S_IWUSR write permission, owner S_IXUSR execute/search permission, owner S_IRWXG read, write, execute/search by group S_IRGRP read permission, group S_IWGRP write permission, group S_IXGRP execute/search permission, group S_IRWXO read, write, execute/search by others S_IROTH read permission, others S_IWOTH write permission, others January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3. EXEC W/ FILE REDIRECTION (OUTPUT) - 2 … // now exec "wc"... char myargs[ *myargs[ 0 ] = strdup("wc"); 3 ]; // program: "wc" (word count) myargs[ myargs[ 12 ]] = strdup("p4.c");= NULL; // argument:// marks end fileof array to count } else^ execvp(myargs[ { 0 ],^ myargs);^ // parent// runs goes down this path (main)^ word^ count }^ int^ wc^ = wait(NULL); }^ return^0 ; prompt> ./p4 prompt> cat p4.output 32 109 prompt> 846 p4.c January 10, 2018 TCSS422: Operating Systems [Winter 2018] Institute of Technology, University of Washington - Tacoma L3. CH. 6: LIMITED DIRECT EXECUTION January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.
January 10, 2018 TCSS422: Operating Systems [Spring 2017] Institute of Technology, University of Washington - Tacoma L3.