December 2009 Demo Release Notes

DEMO CONTENTS:
==============
ChaOS MULTIXEC containing DEMO4.XEC operating system image,
CC.XEC (ChaOS C compiler), CL.XEC (ChaOS linker),
ED.XEC (ChaOS source file editor),
EX.XEC (ChaOS .XEC system table browser and source file extractor), and
LAUNCH.XEC (launcher for recompiled OS image files).

A complete, self-modifying operating system including source code,
less than 10Mb

This demo is a glimpse into the environment used the develop ChaOS, a
command-line environment where programs are launched by typing the name of
the program followed by 'arguments' (information to be passed the the program).
The program is launched when the ENTER key is pressed.

DEC2009.ISO   - non-EDD boots into CGA text mode
DEC2009.ISOE  - EDD fast boot into VESA mode

VESA mode switch HOTKEY:
CTL|ATL|'v' - switch between VESA and CGA text mode

EDITOR COMMANDS:
================

Start the editor:
ED <file> - open <file> for editing, or create <file>
ED - open the last file editied in the current directory

Editor control keys:

ESC - choose file to edit (max 100 files in memory per session)
      cursor up or down to choose
      ENTER to load that file, or switch back to it if already loaded)

CURSOR KEYS - move the text cursor
INS - toggle text insert mode on/off
DEL - delete character at the text cursor
BACKSPACE - delete the character to the left of the text cursor

F1 - arg toggle (described later)
F2 - save file, and run CC compiler
F3 - insert blank line
F4 - delete current line (line is added to undelete buffer)
F5 - duplicate current line
F6 - undelete line (from F4 undelete buffer)
F7 - undelete all stored lines:
     code blocks can be moved by F4 F4 F4 etc, move to new cursor position
     or change file, then F6 F6 F6 etc or F7 to insert the block
ALT|F3 - reload the current file from disk
F10 - save all files and exit
F12 - abandon all changes and exit

ED stores the names and cursor positions of all edited files in E.CON,
for easy return to latest work. A separate E.CON is created for each project.


Here are some shortcut keys for C programmers:

CTL|'d' - insert "#define "
CTL|'r' - insert "return;"
CTL|'i' - insert "#include {.htm}"
CTL|'m' - insert main() function template
CTL|'f' - insert for(;;) template

F1: used to create text selections (args) Press F1 once to switch arg mode on, press F1 again to cancel arg

If arg mode is on, character keypresses are
directed to the bottom line of the ED screen, cursor keypresses highlight
a block of text. Having created an arg, it can be processed by further
function keypresses:

arg ESC - switch to file
arg CTL|F2 - find text below
arg CTL|F3 - find text above
arg ALT|NUMENTER - copy highlighted text to clipboard
arg DEL - delete highlighted text to clipboard

the clipboard can be used as follows:

ALT|NUMENTER - paste clipboard contents
CTL|F2 - find next
CTL|F3 - find previous

The bottom line of the ED screen is used for arg, error messages, and
a source code scanner which matches pairs of {} () [], double quotes and single quotes
If pairs are mismatched, then C source code is unlikely to compile successfully,
and the scanner displays the mismatch: e.g.

{  = left brace with no right brace
)  = right parenthesis with no left parenthesis,  etc


COMPILER:
=========
CC <filename> - compile source code in
                <filename.htm>.<filename.ctp>, or <filename.c>,
                into <filename.cbj>

CC <project> /@ - compile source files listed in <project.lnk>,
                  if they have changed

LINKER:
=======
CL <project> - link .cbjs corresponding to sources listed in <project.lnk>.
Output is to project.xec, or project.drv (.drv directive in .lnk file)

MAKE A PROJECT:
===============
SP <project> - set current project (needed for MAKE),
               and change directory to \z\project

GP - get the current project setting,
     and change directory to \z\project

MAKE - make the current project, i.e. run CC <current project> /@
       if successful run CL <current project>,
       if successful copy project.xec to \x or \d as appropriate,
       overwriting previous program

Each project has a subdirectory in the \z tree which contains the source files.
Compiled programs are stored in \x (.XEC files) or \d (.DRV files)

Many commands are inbuilt (see SHELL COMMANDS below), but can be overridden
by creating a program of the same name.
For instance, to modify the 'DIR' command (list files),
CP DIR - will create the necessary files, and open
         a new main.htm file in the editor ED)
copy source code from the operating system DIR command (in
         fscmd.htm) into the \z\dir\main.htm main() function.
Modify the source code as required, then MAKE will build a ChaOS executable
file DIR.XEC, which takes precedence over any inbuilt command of the same name.
This is great way of making changes to the operating system without breaking
existing code. To revert to the status quo, delete \x\DIR.XEC

SOME SHELL COMMANDS:  ( variable items denoted thus: <wxyz> )
====================
DIR - list files in the current directory
DIR <filespec> - list files matching filespec

CD  <path> - change current directory to <path>, if <path> exists

MD <path> - make new directory, if <path> does not exist

RD <path> - remove directory, if <path> exists and contains no files


REALINT - allows investigation of system BIOS calls. A knowledge of
          the register settings for BIOS calls, and real-mode memory addressing
          is required to use this command successfully.
          For BIOS calls which use DS and ES, values below 0x3000 and above
          0x4fff may overwrite ChaOS real-mode structures.

DISP <address> - hex dump of memory at linear <address>, address can be
                 anywhere in 4Gb address space,
                 e.g. 0 = real-mode IVT,
                  b8000 = CGA screen memory,
                  c0000 = (usually) video BIOS ROM,
             0xfee00000 = local APIC

MEM - summary of memory blocks in use

HEAP <node number> - view memory block, cursor up/down to browse

TYP <file> - display file, in text or hex according to file content
TYP <file> /a - display file as text
TYP <file> /b - display file as hexadecimal

CPY <filespec0> <filespec1> - copy a file(s) from filespec0 to filespec1

CMP <file0> <file1> - compare file0 to file1, if different, shows
                      hexadecimal dump with differences highlighted

DEL <filespec> - delete files

DRIVES - show BIOS drives in the system

SECTOR <drive:> <lba> - view raw disk sector on <drive:>
                        at logical block address <lba>
                        cursor up/down to browse more sectors
                        F10 to edit raw sector data, ENTER to write to disk

PCI> - summary of PCI devices in the system

READPCI <bus.dev.fn.reg0> <reg1> - show PCI configuration registers
                                   from reg0 to reg1
READPCI <bus.dev.fn.reg0> - read and write back
                            single PCI configuration register.
                            Note registers must be read and written
                            on dword boundaries

INP <port> - input from byte port

INPW <port> - input from word port

INPD <port> - input from dword port

OUTP <port> <value> - output value to byte port

OUTPW <port> <value> - output value to word port

OUTPD <port> <value> - output value to dword port

DEV - summary of all devices in the system, with driver details

DEV <name> - summary of information for the named device, if found

SYMBOL <name> - hex dump of memory at global symbol <name>, if found

Full inbuilt command list is defined by the INTCMD array in source file cli.htm