Added the code from part 24 of the excellent OS Dev series on brokenthorn.com.