Wednesday, November 08, 2017

The Kernel

(photo credit: Dale Courte)

The Kernel - which is the only name it ever had, long predating the use of the term in the context of Linux - was a tiny little real-time operating system kernel written in PDP-11 assembler language circa 1980 by Dayton Clark when he was a graduate student in computer science at Wright State University. The Kernel was used in the infamous CS431 Advanced Programming course, which later became CEG431 Real-Time Software Design when the degree program split into seperate Computer Science and Computer Engineering majors. CS431 was developed by Wright State professors Bob Dixon and Joe Kohler. Over the span of the ten week quarter, students had to complete a complex multi-threaded application which used the Kernel to synchronize and communicate among several threads, each of which controlled interrupt driven I/O devices, some of which supported DMA. It was all written in PDP-11 assembler and ran in a total of eight kilobytes of core memory on a PDP-11/05. The course culminated in an oral exam featuring a dump analysis. You had to pass the oral exam to pass the course.

CS431 was required for undergraduate computer science/computer engineering majors to graduate, and for graduate students to take upper division graduate courses. Students either loved it or hated it. Area employers, who for the most part were heavily into defense-related embedded development in the neighborhood of the ginormous Wright-Patterson Air Force Base, loved it. And perhaps for that reason, some students came to love it in retrospect.

Around 1982 through 1985, the code was substantially cleaned up, refactored, and documented by John Sloan and David Hemmendinger, both of whom, along with Dale Courte and others, all graduate students, went on to teach the course. The kernel was split into two source files, the pure code System part, and the impure data Control Block part, to expedite burning the pure portion into EEPROM. It supported process creation and destruction, counting semaphore wait and signal, and asynchronous message passing. It did so in only a handful of PDP-11 machine instructions.

Besides being used pedagogically, the Kernel made its way into a number of other research projects, including SLICK (which supported message passing among a network of LSI-11 microprocessors), TASK4TH (a FORTH-based LSI-11 workstation for real-time data acquisition and robotic control), and FPS (a functional programming system). The Kernel was ported to a number of other microprocessor targets, re-written in C and C++, and, rumor has it, used by former students in their own production systems in the commercial and defense sectors. My alter ego John Sloan wrote a technical report describing the Kernel in detail, as well as suggesting techniques for debugging embedded applications that use it, which was always a challenge.

It is tempting to say that the Kernel is of historical interest only. But tiny little microkernels taking only a few machine instructions have come into vogue as minuscule microcontrollers become embedded in everything. The Kernel was more than a tool used to teach a class. It has informed my career for the past thirty-five years.
(2017-11-08: To facilitate the efforts of far future - and, it must be said, extremely hypothetical - cyberarcheologists, the source code for the Kernel, the technical report, and other related material, have been stored in a repository on GitHub: .)

1 comment:

Chip Overclock said...

I remember sitting around in a lab with some of my college friends, computer science majors all. I opened a desk drawer, pulled out a hardcopy of my CS431 projects, and said that in times of trial and tribulation I found solace in reading this code to remind myself what I was capable of. Everyone laughed. Not because what I said was stupid. Because, as I knew full well, they all had hardcopies of their CS431 projects too that they turned to when overstressed and challenged.