ChaOS Source Index

ChaOS Home       ChaOS Source Notes       ChaOS Downloads       Diary       Back to CTPP

July 2010

The ChaOS compiler uses the C language for source code, embedded in a simple HTML wrapper. The default file extension for source files is .html. This allows the source code files to be viewed by internet browsers, and allows hyperlinks to be embedded to help explain the code. Early versions of ChaOS compilers used MSDOS-style 8:3 filenames, so the current compiler supports the old .HTM file extension, along with .C and .CTP (rarely used).

The standard C syntax for the #include <filename> directive clashes with HTML syntax because <filename> looks like a HTML tag. So I have modified the compiler to accept #include {filename}, and this syntax now used throughout ChaOS. Since header files are specified using the full filename, #include {stdlib.h} becomes #include {stdlib.html}.

To invoke HTML, the first non-blank characters of a file need to be <HTML. As a quick and easy way of skipping HTML tags within the source code, if the first character on a source line is <, the compiler ignores the whole line. This speeds compilation, and allows for more complex HTML tags to be included in source files in the future. HTML tags are also identified and skipped within the source code stream, with some limitations. These relate mainly to code which implements the HTML support - special measures are needed to make sure that data definitions containing HTML constructs are NOT skipped by the compiler!

All source file uploads are now in the new format. Links below are snapshots of ChaOS source code - they may be useful if you are trying to write your own operating system, but really need the ChaOS compiler and linker to be of practical use...

Header files

bs - Bootstrap

os - Operating System Kernel

ed - Source File Editor

com - RS232 Serial Port Driver

ide - IDE Driver

The ChaOS development environment uses simple one-character directory names for system directory tree branches, which are:

      /i     include directory

      /l     library directory (not used: common functions are implemented by a direct dynamic link into the operating system)

      /z     project directory, containing subdirectories for each project, e.g. operating system source code is found in /z/os

      /b     includebin directory

      /x     compiled .XEC files, (serves as PATH, to locate executable programs)

      /d     compiled .DRV files, device drivers and protocol drivers

      /u     user directory (user-specific info)

      /g     graphics directory

      /g/f  fonts

      /g/i  icons

      /g/c  cursors