Instructor: R. Newman
Email: nemo@cise.ufl.edu
TA: Ryan Cobb
Hours: MW 4-5PM, F 3-4PM in E309
TA: Elham Sakhaee
Hours: TR 9:30-11:30AM in E309
TA: Hang Guan
Hours: TR 3:30-5:30PM in E309
Notices
- 3/14: Posted some general hints/tips for Project #2.
- 3/14: Ryan will be in the TA office area (E309) an extra hour earlier from 2-4PM on Friday(3/15).
- 3/9: Project #2 assigned. Any project hints/tips will be posted on this page.
- 2/18: Simple caesar cipher encryption as a character device driver: src
- 2/12: Ryan's Wednesday(2/13) office hours are being temporarily moved to 10-11AM due to a conflict with a seminar.
- 2/7: Ryan's Friday office hours are being changed to 3-4PM.
- 2/5: Ryan will be extending his office hours tomorrow (2/6) to be from 3-5PM to help out with Project #1.
- 2/4: I've posted my solutions to last semester's projects for those interested. Proj1 Proj2 Proj3 The project descriptions are listed here.
- The first project added a system call and kernel call to get the remaining quantum of a process.
- Second project added a new device driver to Minix.
- Third project extended the unix permission system to have ACLs.
- 1/23: Project #1 assigned. Any project hints/tips will be posted on this page.
- 1/18: Project #1 should be released this weekend or early next week. You will be creating a new system call to Minix so please look over the tutorials to familiarize yourself with Minix.
- 1/18: System call tutorials: Detailed Tutorial(Latest Minix) | Pictorial Tutorial(Older Minix)
- 1/14: Unix Discussion Slides: here
- 1/7: Please install Minix with VirtualBox in preparation for the first project.
- Minix 3.2.1 Download, Virtual Box
- Minix install instructions: here. You do not need to do any of the 5. Post installation steps.
- Installing OpenSSH and configuring Eclipse: here. Please configure your root password to simply be "password" for TA convenience.
- If any Minix install issues occur, try VMWare Player here. To configure port forwarding for VMWare you will also need vmnetcfg. Put this executable in your VMWare player install directory.
Project Assignments
- Project 1
- Project 2
- Project 3
FAQ
- Project 2 Hints
- Refer to Project #1 for adding system calls to PM. You can add either 4 new system calls (create,up,down,close) or you can multiplex those operations through 1/2 system calls.
- For passing arguments for your system calls (semaphore descriptors), refer to your Project #1 implementation and how you passed the child's PID for promote. (e.g., message m; m.m1_i1 = 1;)
- An important part of semaphore down/up is blocking/waking threads on resource contention. (waitpid does something similar in forkexit.c)
- Blocking processes: You can simply return a special value (SUSPEND) which indicates to PM that it should not respond to the calling process's system call yet.
- Waking processes: Use the setreply function in PM (main.c) to signal a wakeup to a process. The first parameter of this method indicates what process to wake. The second parameter is the return value of the system call for that process.
- Many processes can be blocked on a single semaphore, thus these processes must be stored in a queue (FIFO) in order to wake them later. In particular, you want to store the process's index, -not- its PID.
- Inheritance of semaphores must be performed whenever a child process is forked. The fork code can be found in PM's forkexit.c in do_fork().
- Releasing unclosed semaphores must also be handled for a process when it dies/exits. This can be found in two areas, forkexit.c for clean exits and signal.c for signals that will kill a process (signal.c modifications aren't necessary, the kill code is forwarded back to forkexit.c.).
- Tip: When developing the project, it is easy to test semaphores if one process performs: sem_down, scanf(...) /*wait for user input*/, sem_up. The other process can simply do: sem_down, printf(...), sem_up. This allows for controlled access of semaphores for functionality verification.
- Dining Philosophers: You will need to use shared memory in order to share the philosopher's states (THINKING, HUNGRY, EATING). This can be done with shmget and shmat. Simple example
Helpful Resources
-
Minix Resources:
-
C Programming Resources: