Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

TCSS 422: Operating Systems Objectives and Surveys, Lecture notes of Operating Systems

Information related to the TCSS 422 course on Operating Systems at the University of Washington - Tacoma. It includes objectives, surveys, and feedback on the course material and pace. The document also covers topics such as virtualization/abstraction, CPU, memory, I/O, concurrency, and operating system design goals. The surveys include C Review Survey, Student Background Survey, and Virtual Machine Survey. useful for students studying Operating Systems and related topics.

Typology: Lecture notes

2020/2021

Uploaded on 05/11/2023

palumi
palumi 🇺🇸

4.2

(14)

245 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
TCSS 422 A – Spring 2021
School of Engineering and Technology
4/6/2021
L2.1
Slides by Wes J. Lloyd
April 1, 2021 TCSS422: Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington - Tacoma
Op era ting Sys tems –
Th ree Ea sy Pie ces & Pr ocess es
Wes J. Ll oyd
Sc hoo l of Engi neer ing and T ech nolo gy
Univer sity of Wash ingto n - Taco ma
TCSS 422: OPERATING SYSTEMS
Qu esti ons f rom 3/3 0
C R evie w Su rvey
Stu den t Ba ckgr oun d Sur vey
Vir tua l Ma chin e Su rvey
Cha pte r 2: Ope rati ng S yste ms – Th ree Easy Pie ces
Con cepts of vi rtual izati on/ab stract ion
Thr ee Eas y Piec es: CP U, Me mory, I/O
Con curr ency
Ope ratin g syst em des ign go als
Cha pte r 4: Proc ess es
Pro cess s tates , cont ext sw itche s
Kern el dat a str uctur es for proc esses a nd th reads
April 1, 2021
TCSS422: Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington - Tacoma
L2.2
OB JECTI VES 4/1
Dai ly Feed back Qu iz i n C anva s – Ava ilab le A fte r E ach Clas s
Ext ra cred it avai labl e fo r c omp leti ng s urv eys ON TIM E
Tues day sur vey s: d ue b y ~ Wed @ 1 1:5 9p
Thu rsd ay s urv eys : du e ~ Mon @ 1 1:59 p
April 1, 2021
TCSS422: Computer Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington -Tacoma
L2.3
ON LIN E DAILY F EEDBACK S URVEY
April 1, 2021 TCSS422: Computer Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington -Tacoma L2.4
Ple ase cla ssi fy y our per spe ctiv e on ma teri al c ove red in t oday ’s
cla ss (63 res pon dent s):
1-m ost ly r evi ew, 5 -eq ual new /rev iew , 10- mos tly new
Ave rag e – 5.5 9 ( no p rev ious tr end yet)
Ple ase rat e th e p ace of toda y’s cla ss:
1-s low , 5- just ri ght, 10 -fas t
Ave rag e – 5.3 3 ( no p rev ious tr end yet )
April 1, 2021
TCSS422: Computer Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington -Tacoma
L2.5
MATERIAL / PACE
April 1, 2021
TCSS422: Operating Systems [Spring 2021]
School of Engineering and Technology, University of Washington - Tacoma
L2.6
FE EDBAC K
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download TCSS 422: Operating Systems Objectives and Surveys and more Lecture notes Operating Systems in PDF only on Docsity!

School of Engineering and Technology

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma

Operating Systems –

Three Easy Pieces & Processes

Wes J. Lloyd

School of Engineering and Technology

University of Washington - Tacoma

TCSS 422: OPERATING SYSTEMS

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 Daily Feedback Quiz in Canvas – Available After Each Class
 Extra credit available for completing surveys ON TI ME
 Tuesday surveys: due by ~ Wed @ 11:59p
 Thursday surveys: due ~ Mon @ 11:59p

April 1, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. ONLINE DAILY FEEDBACK SURVEY April 1, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

 Please classify your perspective on material covered in today’s
class (63 respondents):
 1-mostly review, 5-equal new/review, 10-mostly new
 Average – 5 .59 (no previous trend yet)
 Please rate the pace of today’s class:
 1-slow, 5-just right, 10-fast
 Average – 5 .33 (no previous trend yet)

April 1, 2021 TCSS422: Computer Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. MATERIAL / PACE April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. FEEDBACK

School of Engineering and Technology

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/ C REVIEW SURVEY April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 Please complete the Student Background Survey

https://forms.gle/yr6Dc9x9rX516U6t

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. STUDENT BACKGROUND SURVEY

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 Please complete the Virtual Machine Survey to request
a “School of Engineering and Technology” remote
hosted Ubuntu VM

https://forms.gle/BR2G1wr9RDBVB9AK

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUAL MACHINE SURVEY

School of Engineering and Technology

 Simple Looping C Program

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. 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…

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUALIZING THE CPU - 3 prompt> prompt> gcc./cpu "A" -o cpu cpu.c -Wall A A A ˆC prompt> April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUALIZATION THE CPU - 4 prompt> [1] 7353 ./cpu A & ; ./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 instances of our program seem to be running at the same time!

 & - run a job in the background
 fg – brings a job to the foreground
 bg – sends a job to the background
 CTRL-Z to suspend a job
 CTRL-C to kill a job
 “jobs” command – lists running jobs
 “jobs –p” command – lists running jobs by process ID
 top –d .2 top utility shows active running jobs like
the Windows task manager
 top –H –d .2 display all processes & threads
 top –H –p display all threads of a process
 htop alternative to top, shows CPU core graphs

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. MANAGING PROCESSES FROM THE CLI

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 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

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUALIZING MEMORY

School of Engineering and Technology

 Program to read/write memory:

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. 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) != NULLaddress); of p: %08x\n", 12 getpid(), (unsigned) address of the p); // 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 ;

 Output of mem.c
 int value stored at 00200000
 program increments int value

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUALIZING MEMORY - 3 prompt> (2134) memory address./mem of p: 00200000 (2134) (2134) p:p: (^12) (2134) (2134) p:p: (^34) (2134) ˆC p: 5

 Multiple instances of mem.c
 (int*)p receives the same memory location 00200000
 Why does modifying (int*)p in program #1 (PID=24113), not
interfere with (int*)p in program #2 (PID=24114)?
 The OS has “virtualized” memory, and provides a “virtual” address

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUALIZING MEMORY - 4 prompt> [1] 24113 ./mem &; ./mem & [2] 24114 (24113) memory address of p: 00200000 (24114) (24113) memoryp: 1 address of p: 00200000 (24114) (24114) p: 1p: 2 (24113) (24113) p: 2p: 3 (24114) ... p: 3

 Key take-aways:

 Each process (program) has its own vir tual address space
 The OS maps virtual address spaces onto
physical memory
 A memory reference from one process can not affect the
address space of others.

 Isolation

 Physical memory, a shared resource, is managed by the OS

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. VIRTUAL MEMORY

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 DRAM: Dynamic Random Access Memory: DIMMs/SIMMs
 Stores data while power is present
 When power is lost, data is lost (volatile)
 Operating System helps “persist” data more permanently
 I/O device(s): hard disk drive (HDD), solid state drive (SSD)
 File system(s): “catalog” data for storage and retrieval

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. PERSISTENCE

School of Engineering and Technology

thread.c
Listing continues …

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. CONCURRENCY - 2 12 #include#include <stdio.h><stdlib.h> 34 #include "common.h" 56 volatile intint loops; counter = 0 ; (^78) void *worker(void *arg) { 910 intfor i;(i = 0 ; i < loops; i++) { (^1112) } counter++; (^1314) } return NULL; 15 ...

Not the same as Java volatile: Provides a compiler hint than an object may change value
unexpectedly (in this case by a separate thread) so aggressive
optimization must be avoided.
 Program creates two threads
 Check documentation: “man pthread_create”
 worker() method counts from 0 to argv[1] (loop)

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. 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 ; April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

Linux

“man”

page

example

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. CONCURRENCY - 4

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

prompt> gcc prompt> ./thread 1000 -o thread thread.c -Wall -pthread Initial value : Final value : 2000 0 prompt> ./thread 100000 Initial value : 0 Final value prompt> ./thread 100000 : 143012 // huh?? Initial value : Final 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

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. CONCURRENCY - 5 April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

School of Engineering and Technology

 To perform parallel work, a single process may:
 A. Launch multiple threads to execute code in parallel while
sharing global data in memory
 B. Launch multiple processes to execute code in parallel
without sharing global data in memory
 C. Both A and B
 D. None of the above

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. PARALLEL PROGRAMMING

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 ABSTRACTING THE HARDWARE
 Makes programming code easier to write
 Automate sharing resources – save programmer burden
 PROVIDE HIGH PERFORMANCE
 Minimize overhead from OS abstraction
(Virtualization of CPU, RAM, I/O)
 Share resources fairly
 Attempt to tradeoff performance vs. fairness  consider
priority
 PROVIDE ISOLATION
 User programs can’t interfere with each other’s virtual
machines, the underlying OS, or the sharing of resources

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. SUMMARY: OPERATING SYSTEM DESIGN GOALS

 RELIABILIT Y
 OS must not crash, 24/7 Up-time
 Poor user programs must not bring down the system:
Blue Screen
 Other Issues:
 Energy-efficiency
 Security (of data)
 Cloud: Virtual Machines

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. SUMMARY: OPERATING SYSTEM DESIGN GOALS - 2 WE WILL RETURN AT 5:00PM April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

School of Engineering and Technology

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. static data^ code heap stack Process Memory static data^ code heap Program

Loading:
Reads program from
disk into the address
space of process

CPU

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 RUNNING
 Currently executing instructions
 READY
 Process is ready to run, but has been preempted
 CPU is presently allocated for other tasks
 BLOCKED
 Process is not ready to run. It is waiting for another event
to complete:
 Process has already been initialized and run for awhile
 Is now waiting on I/O from disk(s) or other devices

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. PROCESS STATES April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. PROCESS STATE TRANSITIONS Running Ready Blocked Descheduled Scheduled I/O: initiate I/O: done

 Can inspect the number of CONTEXT SWITCHES made by a
process
 Let’s run mem.c (from chapter 2)
 cat /proc/{process-id}/status
 proc “status” is a virtual file generated by Linux
 Provides a report with process related meta-data
 What appears to happen to the number of context s witches
the lo nger a process runs? (mem.c)

April 2, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L2. OBSERVING PROCESS META-DATA

 How long does a context s witch take?
 10,000 to 50,000 ns (.01 to .05 ms)
 2,000 context switches is near 100ms

April 2, 2020 TCSS422: Operating Systems [Spring 2020] School of Engineering and Technology, University of Washington - Tacoma L2. CONTEXT SWITCH

School of Engineering and Technology

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2.

 When a process is in this state, it is advantageous for the
Operating System to perform a CONTEXT SWITCH to
perform other work:
 (a) RUNNING
 (b) READY
 (c) BLOCKED
 (d) All of the above
 (e) None of the above

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. QUESTION: WHEN TO CONTEXT SWITCH

 Questions from 3/
 C Review Survey
 Student Background Survey
 Virtual Machine Survey
 Chapter 2: Operating Systems – Three Easy Pieces
 Concepts of virtualization/abstraction
 Three Easy Pieces: CPU, Memory, I/O
 Concurrency
 Operating system design goals
 Chapter 4: Processes
 Process states, context switches
 Kernel data structures for processes and threads

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. OBJECTIVES – 4/

 OS provides data structures to track process information
 Process list
 Process Data
 State of process: Ready, Blocked, Running
 Register context
 PCB (Process Control Block)
 A C-structure that contains information about each
process

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. PROCESS DATA STRUCTURES

 xv6: pedagogical implementation of Linux
 Simplified structures shown in book

April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. XV6 KERNEL DATA STRUCTURES // // theto stopregisters and subsequently restart xv6 will save and restore a process struct int context { eip; // Index pointer register int int esp;ebx; //// Stack pointerCalled the base register register int int ecx;edx; //// Called the counterCalled the data register register int int esi;edi; //// Source indexDestination index register register };^ int^ ebp;^ //^ Stack base pointer^ register // enum the proc_state different { UNUSED,states a processEMBRYO, SLEEPING, can be in RUNNABLE, RUNNING, ZOMBIE }; April 1, 2021 TCSS422: Operating Systems [Spring 2021] School of Engineering and Technology, University of Washington - Tacoma L2. XV6 KERNEL DATA STRUCTURES - 2 // the information xv6 tracks about each process // including its struct proc { register context and state char uint *mem;sz; // Start of// Size of processprocess memory memory char *kstack; // Bottom of // for this processkernel stack enum int pid;proc_state state; // Process// Process stateID struct void *chan; proc *parent; // Parent process// If non-zero, sleeping on chan int struct killed; file (^) *ofile[NOFILE];// If // Open files non-zero, have been killed struct inode *cwd; // Current directory struct struct context context;trapframe *tf; // Switch here to run// Trap frame for the process };^ // current^ interrupt

School of Engineering and Technology

OFFICE HOURS HAVE STEPPED OUT WILL RETURN SHORTLY