------------------------------------------------------ Lecture 16 - March 10, 2003 ------------------------------------------------------ AGENDA: 0 Admin 1 P5 (V1) 2 Ch 3.4: Overview of I/O in MINIX ------------------------------------------------------ 0 - ADMIN ------------------------------------------------------ Startout Q: Due today: Nothing Due Wednesday: * RI #5: Covers Ch 3.4-7 (pp. 179-222) Local friendly Dungeon programming contest this Saturday (March 15). 1-3:30pm or so. Details TBA, but pencil it in on your calendars. ------------------------------------------------------ 1 - P5 (V1) ------------------------------------------------------ Virtual Serial Port (VSP?) Anticipate iterating through this program several times. Server * Reads data from the serial port * Writes a raw copy of data to a log file * Fulfills read requests to 1 client * Makes available to client all data since server started running. * Stops running when killed - Don't run as official daemon, just as a regular process at present. * reads "vspserver.conf" to get configuration details DEVICE="/dev/DEVICE_NAME" SPEED=N Client * Opens connection to server * Reads data and writes to standard output until server indicates that no more data is available. * reads "vspclient.conf" to get configuration details HOSTIP=N.N.N.N HOSTPORT=N LOGFILE="name" Thoughts? ------------------------------------------------------ 2 - CH 3.4: OVERVIEW OF I/O IN MINIX ------------------------------------------------------ What questions do you have? Did you understand the part about the clock & pending_ticks? How do you decide what work to do in interrupt handler vs. in task? Discuss how keyboard hardware works, scan codes, etc. Esp. keypress & release, special keys. Compare process-structured system vs. monolithic in how system calls are processed. Fig 3-14 p. 182. * trade-offs. Which way do you vote? Message fields. fig 3-15 p. 184. Structure for a block device driver. Fig 3-16 p. 185. Driver.c - pp. 636-641 User-level I/O software: library routines like printf, scanf, interface to read, write, etc. Deadlock handling: "Deadlock, what deadlock?" * Primary place deadlocks could occur is with implicit shared resources, such a proc tab slots, i-node slots, etc. * Have taken steps to reduce possibility of deadlock. /usr/spool/locks * discuss reliability COS 421 - Lecture Notes #16 SPRING 2003 COS421-lect-2003-03-10.doc Page 2 Printed 10.03.03