Welcome to ZealOS

ZealOS is a x86_64, multi-cored, non-preemptive multi-tasking, ring-0-only, single-address_mapped (identity-mapped), operating 
system for recreational programming.  Paging is almost not used.

The people whom can most benefit are:
  * Professionals doing hobby projects
  * Teenagers doing projects
  * Non-professional, older-persons projects

Simplicity is a goal to keep the line count down, so it's easy to tinker with.  As it turns-out, simplicity makes it faster in 
some ways, too.  It never switches privilege levels, never changes address maps, tends to load whole contiguous files and 
other, similar things which boost speed.    It's only 98,894 lines of code including the kernel, the 64-bit compiler, the 
graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a 
Hello World application in one line of code and can put graphics on the screen with a three line program!

It's a kayak, not a Titanic -- it will crash if you do something wrong.  You quickly reboot, however.  DOS and the 8-bit home 
computers of the 80's worked fine without memory protection and most computers in the world -- the embedded ones -- operate 
without protection.  The resulting simplicity of no protections is why ZealOS has value.    In facts, that's the point of 
ZealOS.  See the ZealOS Charter.

Conventional thinking is "failure is not an option" for general purpose operating systems.  Since this OS is used in addition 
to Windows or Linux, however, failure is an option -- just use Windows or Linux if you can't do something.  We cherry-pick 
what it will and won't do, to make it maximally beautiful.  The following applications more or less form a basis that spans 
the range of use that ZealOS is intended for:

/Demo/Games/BattleLines.ZC
/Demo/Games/BigGuns.ZC
/Demo/Games/BlackDiamond.ZC
/Demo/Games/BomberGolf.ZC
/Demo/Games/CastleFrankenstein.ZC
/Demo/Games/CharDemo.ZC
/Demo/Games/CircleTrace.ZC
/Demo/Games/Collision.ZC
/Demo/Games/Digits.ZC
/Demo/Games/DunGen.ZC
/Demo/Games/Talons.ZC
/Demo/Games/ElephantWalk.ZC
/Demo/Games/FlapBat.ZC
/Demo/Games/FlatTops.ZC
/Demo/Games/Halogen.ZC
/Demo/Games/MassSpring.ZC
/Demo/Games/Maze.ZC
/Demo/Games/RainDrops.ZC
/Demo/Games/RawHide.ZC
/Demo/Games/Rocket.ZC
/Demo/Games/RocketScience.ZC
/Demo/Games/Squirt.ZC
/Demo/Games/TheDead.ZC
/Demo/Games/TicTacToe.ZC
/Demo/Games/TreeCheckers.ZC
/Demo/Games/Varoom.ZC
/Demo/Games/Wenceslas.ZC
/Demo/Games/Whap.ZC
/Demo/Games/Zing.ZC
/Demo/Games/ZoneOut.ZC
/Apps/Psalmody/Examples/childish.ZC
/Apps/Psalmody/Examples/night.ZC
/Apps/Psalmody/Examples/prosper.ZC

Two things to know about ZealOS are that tasks have MAlloc/Free heap memory, not applications, and tasks have compiler symbol 
tables that persist at a scope like environment variables in other operating systems, and the symbols can include functions.

With ZealOS, the command line feeds right into the ZealC compiler, line by line, and it places code into memory it MAlloc()s.   
The compiler is paused at the command line, waiting for input.  Naturally, you #include a program to load it into memory and, 
usually, start it.

During the boot process, many files get compiled before you have access to the command line.    (Don't worry, booting takes 
only two seconds.)  All the header declarations for the operating system are compiled and are available for use in your 
programs without needing to #include them.  Everything is truly compiled to native x86_64 machine code, nothing is interpreted 
and there is no byte code.

Statements at the global scope -- outside the scope of functions -- execute immediately.    There is no main() function.    In
stead, you give meaningful names to what would be main() functions and you invoke them by calling them with a statement in the 
global scope, usually at the bottom of your file.

Terry Davis started with C syntax, but didn't like the command line for a directory listing looking like this:

>Dir("*.*",FALSE);

So, he added default args from C++ and it looked like this:

>Dir();

He didn't like that, so he made parentheses optional on calls with no args and it, now, looks like this:

>Dir;

The syntax change created an ambiguity when specifying function addresses, like for calling QuickSort().    To resolve it, he 
made a '&' required in front of function names when specifying an address of a function, which is better anyway.

Once Terry was no longer using standard C/C++ syntax, he decided to change everything he didn't like and call it HolyC. Here 
are the new operator precedence rules. It's Biblical! See Luke 5:37.

There are no object files in ZealOS and, normally, you don't make executable files either, but you can.  That's known as 
Ahead-of-Time compilation.  Instead, you Just in Time compile.

Tasks have no priority and are never removed from the queue.    Instead, they often poll whatever they are waiting on and 
swap-out.  (Swapping tasks takes half a microsecond and does not involve disk activity or memory maps.)  See Scheduler. Pollin
g keeps it simple.  It might be a problem if you had lots of tasks busy, which rarely happens on a home computer.  The order 
of the tasks in the queue determines front-to-back window order.

The FAT32 filesystem is supported to makes exchanging files with a dual booted other operating system easy and there is the 
simple, 64-bit ZealOS RedSea filesystem.  The RedSea has allocation bitmap for clusters and all files are stored contiguously.  
You can't grow files.

ZealOS is geared toward reading and writing whole files. There is support for direct block random access into files, however 
-- FBlkRead() and FBlkWrite().

There is no PATH, but parent directories are searched when a file is not found. This feature is especially useful for default 
account files.

ZealOS is for hobbyist programmers on single user (at a time) home computers, not mainframes or servers.    The focus task is 
all-important so symmetrical multiprocessing is almost pointless.  Why does it matter running two apps at the same time twice 
as fast when you really want to run one faster?  You could say ZealOS does master/slave multiprocessing.    The anticipated 
use for multicore is primarily putting graphics on the screen.  Hardware graphics acceleration is not used, so this is 
possible.   See ZealOS MultiCore.

There is no distinction between the terms task, process or thread.  All have a task record, CTask, pointed to by the FS 
segment register and are accessed with Fs-> while Gs-> points to a CCPU for the current CPU core.  Each task can have just one 
window, but a task can have children with windows.  (The segment registers are just used as extra registers -- there is 
nothing segmented about ZealOS' memory.)  It is approximately the case that ZealOS is multi-threading, single-processing.

In ZealOS, System Task refers to the father of all tasks.   It's never supposed to die.  Since tasks inherit the symbols of 
parents, system-wide stuff is associated with System.  Its heap is like kernel memory in other operating systems.  Since Syste
m is immortal, it's safe to alloc objects, not tied to any mortal task, from System's heap.  It stays in a server mode, taking 
requests, so you can ask it to #include something, placing that code system-wide.  A funny story is that originally Terry 
Davis called it the root task and even had a /Root directory :-)    System executes ::/StartOS.ZC at boot time.

For easy back-ups, place everything you author in your /Home directory and subdirectories.  Then, use CopyTree().   That 
should make upgrading easy, too.  Customizable start-up scripts go in your /Home directory. The default start-up scripts are 
in the root directory.  Copy the start-up files you wish to customize into /Home and modify them.   See Home Files. You can 
make your own distro that includes everything and is a bootable live CD with ::/Misc/DoDistro.ZC.

Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a cmd line Dir() 
listing.  You left-click files to edit them and right-click to #include them.   To begin a project, type Ed("filename");, 
supplying a filename.   You can also run programs with <F5> when in the editor. <ESC> to save and exit the file.    You'll 
need to do a new Dir() cmd, periodically, so make a macro on your PersonalMenu. Access your PersonalMenu by pressing <CTRL-m>, 
cursoring until you are on top of it and pressing <SPACE>.

<CTRL-t> toggles plain text mode, showing format commands, a little like viewing html code.
<CTRL-l> inserts a text widgets.
<CTRL-r> inserts or edit a graphic sprite resource at cursor location.
<CTRL-d> brings-up the file manager.    It's pretty crappy.  Terry found he didn't need it very often, believe it or not.
<CTRL-b> toggles window border.

<ALT-m> maximizes a window.
<ALT-SHIFT-a> closes AutoComplete.
<ALT-a> brings back AutoComplete.
<ALT-v> vertically tiles windows.
<ALT-h> horizontally tiles windows.
The ALT keys are defined in ~/HomeKeyPlugIns.ZC.  You can customize them.

<CTRL-ALT-t> new terminal window.
<CTRL-ALT-n> switches to the next window.
<CTRL-ALT-x> kills a window.

Find() is your best friend. There's a wrapper function called F() in your ~/HomeWrappers.ZC file.  Feel free to make wrapper 
functions for functions you use often and customize the args.   By the way, Find() or R() can be used to replace strings 
across multiple files.  You can access Find() using <CTRL-SHIFT-f>.

As you browse code, use the AutoComplete window to look-up functions, etc.  <CTRL-SHIFT-F1> (or whatever number) to follow a 
symbol to it's source.  You can browse deeper and deeper.  You go back with <SHIFT-ESC>.

Use the Help & Index or Demo Index to find-out what exists.  Press <F1> for help or use the links on your menu (<CTRL-m>).  Al
so, look in the /Demo or /Apps directories for inspiration.

Software is distributed as RedSea ISO files.  Burn a CD/DVD, or set your CD/DVD in QEMU, VMware or VirtualBox to the ISO file. 
 Then, access the 'T' drive.    Or, Mount() the ISO.C file and access the 'M' drive in ZealOS.  It must be a contiguous ISO.C 
file, so rename it under ZealOS to ISO.C.

Ideally, do not install applications such as games onto your hard drive because we wish to keep hard drive usage low, so the 
whole 'C' drive can be copied quickly to 'D'.   Also, the FileMgr() <CTRL-d> starts too slowly when there are lots of hard 
drive files, but that is how we want it.

3rd party libraries are banned from being required, since they circumvent the 100,000 line of code limit in the 
ZealOS Charter.  All applications must only depend on the core ZealOS files and whatever they bring along in the ISO.  This is 
similar to how Commodore 64 applications only depended on the ROM.

Take Tour


* "Linux" is a trademark owned by Linus Torvalds.
* "Windows" is a trademark owned by MicroSoft Corp.
* "Commodore 64" is a trademark owned by Polabe Holding NV.
* "QEMU" is a trademark owned by Fabrice Bellard.
* "VMware" is a trademark owned by VMware, Inc.
* "VirtualBox" is a trademark owned by Oracle.