Operating Systems and Systems Programming



Kernel of a simple OS in C++

This is yet another UNIX-like toy operating system, which runs on emulated hardware. This was an extended class project, so I was not at liberty to choose architecture, the instruction set, or the system calls to implement.

Highlights: UNIX-like OS kernel with semaphores, virtual memory and asynchronous I/O, hardware emulator, ``bus'' paradigm for both OS and hardware, extensibility to multi-processor architecture.

This project was carried out in Fall 1992.

The current version is 1.1, Nov 1992
toy_OS.txt [8K]
C++ is good for writing OS kernels. Here's an example
Article posted on the newsgroup comp.lang.c++ on Tue Sep 13 09:43:22 CDT 1994

toyOS.cpp.tar.gz [158K]
Complete source code archive, sample programs, traces, and their analysis
It was published in comp.sources.misc, vol 44, issues 53-56


Macintosh Software

Detect Volume Mount
detects a newly mounted volume and ``double-clicks'' on a document/ application at a ``standard'' location on that volume. This application can be used to tell the user (a student) what's new on some particular volume or how to use it. The document being ``clicked'' may be a simple message-of-the-day text or an application that somehow prepares the student for using the (file server) volume, whenever the volume is mounted. A distinct feature is a dynamic, transient patching of a system trap -- the patching that does not require restarting the system and gets uninstalled when the daemon quits. March 1994.
DetectNewVolume.cpt.hqx [80K]
Saving/restoring PRAM and Extended PRAM
tells in great detail what xPRAM is, what is in there, and how to read and write it.
Get a full (path) file name from an AliasRecord
determines the full path name of a file from the corresponding AliasRecord or FSSpec. The function is especially useful when dealing with odoc, pdoc or any other file-related AppleEvent. June 1996.
alias_to_fname.cc [6K]
``Double-click'' on a file from within a running program
This simple function, given a file name, launches an application-creator and has it handle the file. That is, it gets the Finder to do what the Finder normally does when you double-click on an icon. The name of the file/folder to open can be specified either as an ASCII C string, or as a FSSpec. There is also code to convert FSSpec to the full path name, and to figure out the full path name to the System Folder. June 1996.
launch-creator.cpt.hqx [24K]
My own ``standard'' programming environment
utility C++ functions/classes for several common Mac chores. Among them are posting of synchronous and asynchronous notifications, doing printf() into an alert box, and the automatic conversion from a C to a Pascal string. Also included is the code for handling of Mandatory Apple Events OpenApplication, {Open|PrintDocument}, Quit, and a template for getting hold of the files dropped on the application.
mymenv-notify.cpt.hqx [40K]
Pick a sound at random and play
The sound is picked from a folder of sound files or from suitcase(s). This makes for a good start-up application. November 1993.
sound-at-random.cpt.hqx [87K]