An operating system compiler written in PASCAL allows the programmer to write operating systems for a very general abstract mini-computer, and produces code for the mini-computer of his choice. This approach provides global optimization, good documentation and improved reliability of operating systems, as well as complete portability. One such portable operating system called SOD has been written and runs on Nova and PDP-11 mini-computers