Close

Simple OS and programming language

A project log for Self-hosting 8051-based retro computer system

The system is based around an 8051 microcontroller with 128K of external RAM and 4Mb serial flash memory. It has a 256 by 256 pixel display.

will.stevenswill.stevens 08/24/2016 at 21:401 Comment

This system has an OS and language developed from scratch. I have tried to make both as simple as possible, while still being useful. The language (called MC) borrows heavily from C and Forth. It is easier to parse than C. It uses stack based semantics for expression evaluation and function call / return. The compiler does a few simple optimisations. The compiler source code is 2300 lines of C, I'm currently in the process of rewriting the compiler in MC so that I can compile programs on the 8051 system.

The OS has a flat file system and a simple shell that supports passing arguments to programs and input/output redirection. The OS is currently about 1300 lines of assembly language and 1000 lines of MC.

Regardless of any future developments and increases in complexity of the OS and language, I intend to always retain a minimalistic version, always less than 10000 lines of code.

Below is a photo showing examples of MC code.

Discussions

Thomas wrote 12/20/2019 at 15:28 point

Are you're using indentation for program structures?

  Are you sure? yes | no