In my previous article I talked about how I managed to create a self-contained operating system for transputer. This included the basic operating system, a text editor, a Small-C compiler, and an assembler.
The year was 1995, I was age 16, Lemon Tree and Zombie were being played in the radio, ARPANET closed around 1990, and it started to be known as Internet, and in Mexico only a handful of people used it through Compuserve Mexico. I wasn’t so lucky to have this service.
I was evolving my operating system, modifying it and improving it, recompiling and rebooting. I was pretty interested in compiling any C language source code I could get my hands on, and I got hold of several CD-ROM discs, but I couldn’t compile most things because I had a Small-C compiler, not a full C compiler.
This prompted me to extend my C language compiler to support more C features. Because youth is bold, I kept doing comparisons with text pieces from the input just like Small C did. I was working in a platform with only 128 KB. of RAM, and I could manage that feat because the transputer instruction set generated very small executables. But of course, a proper lexer would have made faster compilations.
As I progressed in my implementation of the C language features, following the K&R book’s appendix A, I discovered that developing most of these was pretty direct, like struct, and union. Typedef was the most complicated to understand. The pointer arithmetic syntax precedence was very difficult, in particular for getting an array of function pointers. I’m still proud of how I made byte-code descriptions of C types, the only difficult thing was getting right the recursive calls to handle precedence. Also getting initializers to work was hard to do as these had very loose syntax in real compilers.
The C compiler took me a lot more time than the Pascal compiler, and from my revision notes I used almost a full year to get an almost full K&R C compiler (K&R means Kernighan & Ritchie, or a compiler as described in their original book). My information was outdated, because I had the 1978 book, but the book was updated in 1988, and ANSI C was approved in 1989.
I tuned the preprocessor with each new source code I found for testing. I was amazingly happy when my compiler finally managed to run a chess program by Vern Paxson from an obscure contest ran in USENET, the IOCCC (International Obfuscated C Code Contest). I found this program in the book Expert C Programming by Peter Van Der Linden (1994).
Once the C compiler was supporting floating point, I was able to port back the Ray Tracer I made in Pascal, and I developed a 3D poligonal model program following the course and exercises in the book 3D Computer Graphics by Alan Watt (1993).
The last additions to the host Z280 computer were a SCSI card, and all the peripherals were basically recycled from tech trash, for example, a SCSI hard disk drive (powerful 40 MB when the common ones were 500 MB), a SCSI DAT tape drive, and a SCSI CD-ROM reader (at least this was new!).
I added to my transputer operating system a way to read High-Sierra and ISO-9660 format structures to access CD-ROM data, and a program to unzip files from these discs. I was pretty proud of how I managed to compile the source code of a public domain version of Inflate for ZIP files. Another thing is that these CD-ROM drives could play audio CD automatically, you just put a CD (mine was Everybody Else Is Doing It, So Why Can’t We?) and hear music while working.
The tape drive was DAT format, and I made some backups using my TAR program. I have forgotten completely where are these tape stored, now that’s the most secure backup storage! The one no one can find.
I reached the high-point of my development for transputer around the summer of 1996, but the processor started to show its age. 128K RAM of memory was barely enough for working. As I bloated my programs with more features, the transputer started to look more and more slow. And unfortunately, another board was never made. I would have been very interested in handling multiprocessing.
Restoring the operating system
The work for restoring my operating system wasn’t so easy as I thought. I had to expand the buildboot.c program to create floppy disk images in the latest file system format, and also hard disk images. Later as I put together the image file, I needed support for growing disk directories.
The main difference is the expansion of directory entries to 64 bytes. This was a by-product of discovering that I was free to specify my operating system as I liked, so the first thing for me was “the great escape” from the 8.3 filename format common in MS-DOS at the time (Windows 95 was barely released a few months ago). It wasn’t done in a single step, my first expansion of the file system was fifteen letter names using the 32 bytes directory entries (Jan/01/1996), and the next expansion was thirty-one letter names using 64 byte entries (Feb/06/1996).
The 64-byte entries of my file system. Notice flags for the C subdirectory.
Once the disk image builder was ready, I put the SOM.32.bin file along Interfaz.p inside the floppy image, and tried to boot it up after adding the required services in the transputer emulator (including three drive units: floppy disk, RAM disk, and hard drive). It got stuck after reading the boot sector, and the cause was the byte order for the sector number was big-endian. After doing the change in the emulator, it was able to read the whole file inside the memory and it got stuck.
Apparently the timers didn’t work as the screen wasn’t updated, so I added timer handling for low-priority threads, and the screen become visible. Still, it got stuck. I made a brief modification to the interface code with the host (a semaphor), but it still didn’t operate. The only reason for this is that the MAESTRO.CMG file used a different protocol to interface with the operating system. I searched in my files until I found the correct file and source code, I used this file to boot up the operating system and it worked on the first try, and it advanced enough to complain of a missing C:/Interfaz.p
I had forgotten how my operating system booted up!
Very worn 3.5″ floppy disk from 1993 with MAESTRO assembler code for transputer.
Notice it is double density (720 kb).
The minimum required files
It turns out that the floppy disk was used to boot the operating system (the file SOM.32.bin), and in turn it would access a hard disk through drive C: to load the command-line processor.
Once this file was loaded, I needed a few more files to be able to compile programs inside the operating system: editor.p, cc.p, ens.p, and ejecutable.p.
I started by testing my text editor, and it was pretty pleased watching how it colorized the preprocessor directives and the C language elements. All the source code is written with Spanish comments, and it is just too much code to translate it to English.
The visual text editor displaying C source code with syntax coloring.
I never implemented a current directory feature, so you need to type the full path for each file. A feature of my operating system is that the A: drive is assumed, so you n
5 Comments
kragen
This is so wonderful. I hope I can get your Transputer emulator running to try it. I wish I'd spent my teen years doing something so awesome.
One minor grammar thing: "didn't worked" should be "didn't work", because "do" in English as an auxiliary verb always takes the root form of the verb, just as "will", "may", and "can" do. Similarly "don't exists" should be "doesn't exist".
dang
Submitted title was "Released my full transputer OS, K&R C compiler and utilities (1996)". We've changed that to the title on the page.
(Actually we sometimes make exceptions when the author is the submitter, and I'd be happy to do that here, but the original title is pretty damn cool and will probably attract more readers!)
tomcam
All that and he has the name Oscar Toledo. I am pretty sure he’s going to be the subject of a Wes Anderson movie within five years.
karparov
CD-ROMs and only 128k of RAM? Sorry, that doesn't pass the smell test. Once CD-ROMs were available, 2-digit megabytes of RAM were standard (and affordable) for home PCs.
bjoli
I realized just this month I miss the days of being able to crash my computer completely with a typo. Such a weird feeling. I was debugging some pcie passthrough issues this week and the feeling that the computer could go dark whenever I started the VM was fantastic. It took sooooo much time, and I loved it. Of course, I hated it at the same time. But I got the same feeling as when I was writing ring0 code at 14.
This text makes me relive it!