Software Systems Fall 2006 For today you should have 1) worked on your project 2) read Rosenblum and Ousterhout (questions below) 3) read the next section of LBoS and done the barbershop problem 4) prepared for a quiz Coming up: exam #2 November 16 Today: 1) quiz 2) LFS 3) file system interface 4) Archy For next time you should: 1) work on your project -- progress report due Monday November 13 2) read Chapter 23 of the Cow Book 3) read the handout from Raskin, "The Humane Interface" http://wb/ss/handouts/raskin00humane.pdf the Wikipedia page on Archy: http://en.wikipedia.org/wiki/Archy You may also want to read http://en.wikipedia.org/wiki/Jef_Raskin 4) optional: read the next section of LBoS and do the H2O problem File system interface --------------------- What is the primary abstraction created by the file system? What details of the implementation are generally hidden? What is the interface to the abstraction (for example, what is the sequence of operations to read a byte from a file and write a new byte)? Most file systems provide interfaces at several layers: 1) user interface: what is the user's model of a file? What tools does the user have to interact with files? a) Graphical: file = document, click and drag. b) command line: file = sequence of bytes; ls, wc, awk, grep, etc. In most graphical systems, documents belong to applications. In UNIX, many applications can operate on the same file. 2) High-level API cat file1 > file2 print open(filename).read() 3) Middle-level API fopen, fscanf, fprintf, fclose 4) Low-level API creat, open, read, write, close 5) Really low-level API getblk, bread, bwrite 6) Really, really low-level interface SCSI 7) The hardware interface The ioloop.c that I gave you demonstrates level 4: #define FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) int main (int argc, char *argv[]) { int i = 0; int iterations; double x; FILE *fp; int fd; int n; char buf[] = "a"; if (argc == 2) { iterations = atoi (argv[1]); } else { printf ("Usage: loop [iterations]\n"); exit (-1); } fd = creat ("temp", FILE_MODE); for (i=0; i