




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
CS – Operating Systems. Instructor: David Mazières. CAs: Emma Dauterman, Peter Dunn, and Francis Yan. Stanford University.
Typology: Slides
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Stanford University
1 / 35
2 / 35
3 / 35
Course goals
7 / 35
Programming Assignments
Grading
max
Style
Assignment requirements
Outline
Multi-user OSes
Protection
18 / 35
Typical OS structure
driver driver driver
System calls
System calls (continued)
System call example
UNIX file system calls
23 / 35
Error returns
24 / 35
Operations on file descriptors
25 / 35
File descriptor numbers
26 / 35
type.c
void typefile (char *filename) { int fd, nread; char buf[1024];
fd = open (filename, O_RDONLY); if (fd == -1) { perror (filename); return; }
while ((nread = read (fd, buf, sizeof (buf))) > 0) write (1, buf, nread);
close (fd); }
Protection example: CPU preemption
Resource allocation & performance
Useful properties to exploit