<aname="l3"></a></span><spanclass=cF2>/Home</span><spanclass=cF0> All your user data should be placed in here to ease backing-up your data. When you install an application it will
<aname="l4"></a>create a subdirectory of your </span><spanclass=cF2>/Home</span><spanclass=cF0> directory for storage.
<aname="l6"></a></span><spanclass=cF2>/Apps</span><spanclass=cF0> Applications are placed in subdirectories of </span><spanclass=cF2>/Apps</span><spanclass=cF0>. Applications should have a file called </span><spanclass=cF2>Install.CC</span><spanclass=cF0> which will
<aname="l7"></a>install the app, possibly making files or directories in </span><spanclass=cF2>/Home</span><spanclass=cF0>. The file, </span><spanclass=cF2>Load.CC</span><spanclass=cF0> will load the application into mem. The
<aname="l8"></a>file, </span><spanclass=cF2>Run.CC</span><spanclass=cF0>, will usually load and execute the app. To add an app to your PersonalMenu, use </span><spanclass=cF2><CTRL-l></span><spanclass=cF0>, insert a macro with
<aname="l9"></a>the PopUp option checked and invoke the </span><spanclass=cF2>Run.CC</span><spanclass=cF0> file.
<aname="l15"></a></span><spanclass=cF2>/Kernel</span><spanclass=cF0> The core of the operating system is found here. Since priviledge levels are not used, calling it a </span><spanclass=cF2>kernel</span><spanclass=cF0> is
<aname="l16"></a>deceptive. It is </span><spanclass=cF2>AOT</span><spanclass=cF0> compiled by </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Boot/BootHDIns.CC.html#l25"><spanclass=cF4>BootHDIns</span></a><spanclass=cF0>(). It is loaded by the boot loader and must fit in 640K.
<aname="l18"></a></span><spanclass=cF2>/Compiler</span><spanclass=cF0> The compiler module src code is found here. The compiler is </span><spanclass=cF2>AOT</span><spanclass=cF0> compiled to produce a binary file which is loaded
<aname="l19"></a>at boot. It, too, is </span><spanclass=cF2>AOT</span><spanclass=cF0> compiled by </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Boot/BootHDIns.CC.html#l25"><spanclass=cF4>BootHDIns</span></a><spanclass=cF0>().
<aname="l21"></a></span><spanclass=cF2>/System</span><spanclass=cF0> The non-kernel part of the operating system is found here. It is </span><spanclass=cF2>JIT</span><spanclass=cF0> compiled during boot. The </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l154"><spanclass=cF4>System Task</span></a><spanclass=cF0> is the
<aname="l24"></a></span><spanclass=cF2>/Boot</span><spanclass=cF0> Boot files go here. Stage 2 of the ZealOS hard drive master boot loader, the old hard drive master boot record which is
<aname="l25"></a>just blk#0, and the HDD & CD/DVD </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Kernel.PRJ.html#l1"><spanclass=cF4>Kernel.BIN.C</span></a><spanclass=cF0> file go here.
<aname="l31"></a>The home dir is specified with </span><spanclass=cF2>'~'</span><spanclass=cF0>. The home dir is </span><spanclass=cF2>::/Home</span><spanclass=cF0> unless you change it with </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/BlkDev/DiskDirB.CC.html#l1"><spanclass=cF4>HomeSet</span></a><spanclass=cF0>() or compile the kernel with a
<aname="l32"></a>config option. An empty </span><spanclass=cF2>/Home</span><spanclass=cF0> dir should be valid because it will get default files from the root dir.
<aname="l34"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Home/PersonalMenu.DD.html#l1"><spanclass=cF4>~/PersonalMenu.DD</span></a><spanclass=cF0> a menu viewed with the </span><spanclass=cF2><CTRL-m></span><spanclass=cF0> key or by clicking "</span><spanclass=cF2>MENU</span><spanclass=cF0>" in the upper left border area of a window.
<aname="l36"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Home/PersonalNotes.DD.html#l1"><spanclass=cF4>~/PersonalNotes.DD</span></a><spanclass=cF0> a personal note file viewed with the </span><spanclass=cF2><CTRL-SHIFT-M></span><spanclass=cF0> key.
<aname="l38"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Home/MakeHome.CC.html#l1"><spanclass=cF4>~/MakeHome.CC</span></a><spanclass=cF0> a file compiled by the </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l154"><spanclass=cF4>System Task</span></a><spanclass=cF0> during </span><ahref="https://zeal-operating-system.github.io/ZealOS/StartOS.CC.html#l41"><spanclass=cF4>StartOS</span></a><spanclass=cF0>.
<aname="l40"></a></span><spanclass=cF4>~/Home*</span><spanclass=cF0> Copy </span><spanclass=cF2>Home*</span><spanclass=cF0> files from the root into </span><spanclass=cF2>~</span><spanclass=cF0> and customize them. These files are invoked when the </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l154"><spanclass=cF4>System Task</span></a><spanclass=cF0> starts-up.
<aname="l42"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Home/Once.CC.html#l1"><spanclass=cF4>~/Once.CC</span></a><spanclass=cF0> a file invoked at the start-up of the first user. Customize this!
<aname="l44"></a></span><ahref="https://zeal-operating-system.github.io/ZealOS/Home/Registry.CC.html#l1"><spanclass=cF4>~/Registry.CC</span></a><spanclass=cF0> can be edited by hand or deleted to reset to defaults. Takes affect next boot.
<aname="l50"></a>* Place applications in their own </span><spanclass=cF2>/Apps</span><spanclass=cF0> subdirectory.
<aname="l51"></a>
<aname="l52"></a>* Make a file called </span><spanclass=cF2>Load.CC</span><spanclass=cF0> to load the application.
<aname="l53"></a>
<aname="l54"></a>* Make a file called </span><spanclass=cF2>Run.CC</span><spanclass=cF0> to load and run the application, preferable by </span><spanclass=cF2>#include</span><spanclass=cF0>ing the </span><spanclass=cF2>Load.CC</span><spanclass=cF0> file.
<aname="l55"></a>
<aname="l56"></a>* Place user data in a subdirectory of </span><spanclass=cF2>/Home</span><spanclass=cF0>, preferably naming the subdirectory the same as the </span><spanclass=cF2>/Apps</span><spanclass=cF0> subdirectory. Or,
<aname="l57"></a>place data in the </span><spanclass=cF2>Registry.CC</span><spanclass=cF0> file. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Demo/RegistryDemo.CC.html#l1"><spanclass=cF4>::/Demo/RegistryDemo.CC</span></a><spanclass=cF0>.
<aname="l59"></a>* If the app needs files in the </span><spanclass=cF2>/Home</span><spanclass=cF0> directory, make an </span><spanclass=cF2>/Apps</span><spanclass=cF0> file called </span><spanclass=cF2>Install.CC</span><spanclass=cF0> or </span><spanclass=cF2>Install.IN</span><spanclass=cF0> to create the </span><spanclass=cF2>/Home</span><spanclass=cF0>
<aname="l66"></a>* Virtual mem/Paging is not used -- it is identity mapped in </span><spanclass=cF2>x86_64</span><spanclass=cF0> mode. The stack does not grow, so alloc enough when the
<aname="l67"></a>task (process) is </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KTask.CC.html#l264"><spanclass=cF4>Spawn</span></a><spanclass=cF0>ed and use the heap for most things. (The </span><spanclass=cF2>heap</span><spanclass=cF0> refers to </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l391"><spanclass=cF4>MAlloc</span></a><spanclass=cF0>() and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l387"><spanclass=cF4>Free</span></a><spanclass=cF0>().)
<aname="l69"></a>* You can </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Memory/MAllocFree.CC.html#l387"><spanclass=cF4>Free</span></a><spanclass=cF0>(</span><spanclass=cF2>NULL</span><spanclass=cF0>).
<aname="l71"></a>* See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l261"><spanclass=cF4>Naming Convention</span></a><spanclass=cF0> and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l3"><spanclass=cF4>Abbreviations</span></a><spanclass=cF0>.
<aname="l73"></a>* There are two modes of compiling, </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l179"><spanclass=cF4>AOT Compile Mode</span></a><spanclass=cF0> and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l188"><spanclass=cF4>JIT Compile Mode</span></a><spanclass=cF0>. Compilation is done in both -- neither is
<aname="l74"></a>"interpreted". Use </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/Glossary.DD.html#l188"><spanclass=cF4>JIT Mode</span></a><spanclass=cF0>.
<aname="l78"></a>* Use </span><spanclass=cF2>I64</span><spanclass=cF0> instead of smaller int sizes because the compiler converts everything to 64-bit. Don't use unsigned unless it
<aname="l79"></a>actually breaks. A policy of signed keeps it simple so you don't have to agonize over choices.
<aname="l94"></a>The </span><spanclass=cF2>Bool</span><spanclass=cF0> type is just an alias for a 1 byte signed int -- nothing forces it to </span><spanclass=cF2>1</span><spanclass=cF0> or </span><spanclass=cF2>0</span><spanclass=cF0>. There is a </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelB.HH.html#l90"><spanclass=cF4>ToBool</span></a><spanclass=cF0>() function that will
<aname="l95"></a>for to </span><spanclass=cF2>1</span><spanclass=cF0> ot </span><spanclass=cF2>0</span><spanclass=cF0>, however.
<aname="l96"></a>
<aname="l97"></a>* Global vars in </span><spanclass=cF2>AOT</span><spanclass=cF0> BIN modules are initialized to zero. They occupy space in BIN files.
<aname="l98"></a>
<aname="l99"></a>* Bracketing code with </span><spanclass=cF2>PUSHFD CLI</span><spanclass=cF0> and </span><spanclass=cF2>POPFD</span><spanclass=cF0> will protect against simultaneous accesses from tasks on <u>one</u> core. To protect
<aname="l100"></a>against multiple cores, you need a locked semaphore. Semaphores might need to be in their own cache line. Lock bits are used
<aname="l103"></a>* </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.CC.html#l247"><spanclass=cF4>SysDebug</span></a><spanclass=cF0>() and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KMisc.CC.html#l252"><spanclass=cF4>IsSysDebug</span></a><spanclass=cF0>() are really handy when working on the compiler or kernel. It's just a bit you can set and test.
<aname="l113"></a>* See </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Hash.CC.html#l1"><spanclass=cF4>::/System/Hash.CC</span></a><spanclass=cF0> for examples of how the hash tables are set-up. Basically, syms are placed into hash tables and child
<aname="l116"></a>* </span><spanclass=cF2>sys_task->hash_table</span><spanclass=cF0> holds the </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/CosmiC.DD.html#l1"><spanclass=cF4>CosmiC</span></a><spanclass=cF0> syms loaded in on start-up.
<aname="l118"></a>* </span><spanclass=cF2>Fs->hash_table</span><spanclass=cF0> holds user CosmiC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the
<aname="l119"></a>table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes
<aname="l120"></a>and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem
<aname="l121"></a>is low. If you wish your applications to free themselves instead of staying in mem, spawn or </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/Job.CC.html#l447"><spanclass=cF4>PopUp</span></a><spanclass=cF0>() a task to run the
<aname="l124"></a>* To display the contents of a hash table, use the </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Hash.CC.html#l169"><spanclass=cF4>Who</span></a><spanclass=cF0>() routine or the varients. </span><ahref="https://zeal-operating-system.github.io/ZealOS/System/Hash.CC.html#l370"><spanclass=cF4>HashDepthRep</span></a><spanclass=cF0>() gives a histogram of how
<aname="l133"></a>* </span><spanclass=cF2>FS</span><spanclass=cF0> must always point to the cur </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l4006"><spanclass=cF4>CTask</span></a><spanclass=cF0>.
<aname="l135"></a>* </span><spanclass=cF2>GS</span><spanclass=cF0> must always point to the cur </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l4125"><spanclass=cF4>CCPU</span></a><spanclass=cF0>.
<aname="l137"></a>* Don't change the segment regs unless interrupts are off. It's hard to do, anyway. </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KUtils.CC.html#l536"><spanclass=cF4>SET_FS_BASE</span></a><spanclass=cF0> and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KUtils.CC.html#l522"><spanclass=cF4>SET_GS_BASE</span></a><spanclass=cF0>.
<aname="l139"></a>* When interacting with </span><ahref="https://zeal-operating-system.github.io/ZealOS/Doc/CosmiC.DD.html#l1"><spanclass=cF4>CosmiC</span></a><spanclass=cF0> compiled code, preserve </span><spanclass=cF2>RBP, RSI, RDI, R10-R15</span><spanclass=cF0> because the compiler uses these for reg vars. Yo
<aname="l140"></a>u are free to clobber </span><spanclass=cF2>RAX, RBX, RCX, RDX</span><spanclass=cF0>, </span><spanclass=cF2>R8</span><spanclass=cF0> and </span><spanclass=cF2>R9</span><spanclass=cF0>. See </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1939"><spanclass=cF4>Compiler Reg Masks</span></a><spanclass=cF0>, </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1911"><spanclass=cF4>PUSH_C_REGS</span></a><spanclass=cF0> and </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KernelA.HH.html#l1912"><spanclass=cF4>POP_C_REGS</span></a><spanclass=cF0>
<aname="l142"></a>* It is recommended to use the standard stack frame for functions because </span><ahref="https://zeal-operating-system.github.io/ZealOS/Kernel/KDebug.CC.html#l53"><spanclass=cF4>Caller</span></a><spanclass=cF0>() is used to display the call stack, such as