Lecture 14 - More on IO Software

Tips for Lab 3

What is ipc.h? It is a union of a bunch of structures? How do you use them? Look at com.h.

Also look at the back half of chapter 3 for answers for lab 3.

More on IO

The goal for this lecture is to talk about the ISR and generic interrupts. We want to have:

Components of IO software include:

Minix has its own IPC (inter-process control):

Minix also only has 1 asynchronous interrupt IPC:

How do we make these Interrupt Handlers?

It obviously handles interrupts. Remember, this only runs when there's an interrupt. That means that:

A more complex example would be a terminal. Every single character you type has to be handled. Every time, you release, a key. You need to be handle these interrupts, and stacks of them.

Another complex example is the clock. If it has to count the number of ticks++; for every interrupt, you'll have to make it much more versatile (what happens if there's many other interrupts).

Device Tasks

We'll have device tasks, which are just state machines:

initialize();
for(;;){
	recv(oth, msg);
	switch(m, m_type){
		// do something
	}
	send(m, m_sound, reply);
}
cleanup();
Because the format of this code is super similar, Minix 2 abstracted away all this structure with a new struct.

Disk Scheduling

The Minix disk scheduling algorithm is pretty simple:

This is a problem with elevators, so we have an algorithm from it called the elevator algorithm. Using only one bit of state direction, it's a simple and effective way of solving this problem.