<a name="l12"></a>Simplicity is a goal to </span><a href="/Wb/Doc/Strategy.DD.HTML#l1"><span class=cF4>keep the line count down</span></a><span class=cF0>, so it's easy to tinker with.
<a name="l18"></a>count down -- you can do a </span><a href="/Wb/Doc/HelloWorld.DD.HTML#l1"><span class=cF4>Hello World</span></a><span class=cF0> application in one line of code and can
<a name="l69"></a>Two things to know about TempleOS are that <u>tasks</u> have </span><a href="/Wb/Kernel/Mem/MAllocFree.HC.HTML#l387"><span class=cF4>MAlloc</span></a><span class=cF0>/</span><a href="/Wb/Kernel/Mem/MAllocFree.HC.HTML#l383"><span class=cF4>Free</span></a><span class=cF0> heap memory,
<a name="l76"></a>right into the </span><a href="/Wb/Doc/HolyC.DD.HTML#l1"><span class=cF4>HolyC</span></a><span class=cF0> compiler, line by line, and it places code into memory it </span><span class=cF4>
<a name="l77"></a></span><a href="/Wb/Kernel/Mem/MAllocFree.HC.HTML#l387"><span class=cF4>MAlloc</span></a><span class=cF0>()s. The compiler is paused at the command line, waiting for input.
<a name="l80"></a>During the boot process, many files get </span><a href="/Wb/StartOS.HC.HTML#l1"><span class=cF4>compiled</span></a><span class=cF0> before you have access to the
<a name="l81"></a>command line. (Don't worry, booting takes only two seconds.) All the header
<a name="l82"></a>declarations for the operating system are compiled and are available for use in
<a name="l83"></a>your programs without needing to </span><span class=cF2>#include </span><span class=cF0>them. Everything is truly compiled to
<a name="l84"></a>native </span><a href="http://en.wikipedia.org/wiki/Amd64#AMD64"><span class=cF2>x86_64</span></a><span class=cF0> machine code, nothing is </span><span class=cF2>interpreted</span><span class=cF0> and there is no </span><span class=cF2>byte code</span><span class=cF0>.
<a name="l85"></a>
<a name="l86"></a>Statements at the global scope -- outside the scope of functions -- execute
<a name="l87"></a>immediately. There is no </span><span class=cF2>main()</span><span class=cF0> function. Instead, you give meaningful names
<a name="l88"></a>to what would be </span><span class=cF2>main()</span><span class=cF0> functions and you invoke them by calling them with a
<a name="l89"></a>statement in the global scope, usually at the bottom of your file.
<a name="l90"></a>
<a name="l91"></a>I started with </span><span class=cF2>C</span><span class=cF0> syntax, but didn't like the command line for a directory
<a name="l106"></a>for calling </span><a href="/Wb/Kernel/QSort.HC.HTML#l85"><span class=cF4>QSort</span></a><span class=cF0>(). To resolve it, I made a '</span><span class=cF2>&</span><span class=cF0>' required in front of function
<a name="l110"></a>I didn't like and call it </span><a href="/Wb/Doc/HolyC.DD.HTML#l1"><span class=cF4>HolyC</span></a><span class=cF0>. Here are the new </span><a href="/Wb/Doc/HolyC.DD.HTML#l215"><span class=cF4>operator precedence</span></a><span class=cF0> rules.
<a name="l114"></a>files either, but you can. That's known as </span><a href="/Wb/Doc/Glossary.DD.HTML#l208"><span class=cF4>Ahead-of-Time</span></a><span class=cF0> compilation. Instead,
<a name="l115"></a>you </span><a href="/Wb/Doc/Glossary.DD.HTML#l221"><span class=cF4>Just in Time</span></a><span class=cF0> compile.
<a name="l120"></a></span><a href="/Wb/Kernel/Sched.HC.HTML#l1"><span class=cF4>Scheduler</span></a><span class=cF0>. Polling keeps it simple. It might be a problem if you had lots of
<a name="l125"></a>other operating system easy and there is the simple, 64-bit TempleOS </span><a href="/Wb/Doc/RedSea.DD.HTML#l1"><span class=cF4>RedSea</span></a><span class=cF0>
<a name="l126"></a>filesystem. The </span><a href="/Wb/Doc/RedSea.DD.HTML#l1"><span class=cF4>RedSea</span></a><span class=cF0> has allocation bitmap for clus and all files are stored
<a name="l132"></a>support direct block random access into files, however -- </span><a href="/Wb/Kernel/BlkDev/DskCFile.HC.HTML#l129"><span class=cF4>FBlkRead</span></a><span class=cF0>() and </span><span class=cF4>
<a name="l135"></a>If a file is not found, "</span><span class=cF2>.Z</span><span class=cF0>" is added or removed and a search is done, again.
<a name="l136"></a>There is no </span><span class=cF2>PATH</span><span class=cF0>, but parent directories are searched when a file is not found.
<a name="l137"></a>This feature is especially useful for default account files.
<a name="l138"></a>
<a name="l139"></a>The graphic resolution is poor, </span><span class=cF2>640x480 16 color</span><span class=cF0>, but God said it was a covenant
<a name="l140"></a>like circumcision. Also, that's all I feel comfortable with without GPU
<a name="l141"></a>acceleration supported. A </span><span class=cF2>1600x1200x24</span><span class=cF0> bit scrn takes 37 times more memory,
<a name="l142"></a>implying 37 times the CPU power. Also, a fixed size keeps it simple with
<a name="l143"></a>everybody machine having the same appearance. Look on the bright-side -- you
<a name="l144"></a>won't spend as much time twiddling pixels for your game art and you'll have tons
<a name="l145"></a>of CPU power available, especially with multicore systems.
<a name="l146"></a>
<a name="l147"></a>TempleOS is for hobbyist programmers on single user (at a time) home computers,
<a name="l148"></a>not mainframes or servers. The focus task is all-important so symmetrical
<a name="l149"></a>multiprocessing is almost pointless. Why does it matter running two apps at the
<a name="l150"></a>same time twice as fast when you really want to run one faster? You could say
<a name="l151"></a>TempleOS does master/slave multiprocessing. The anticipated use for multicore
<a name="l152"></a>is primarily putting graphics on the scrn. Hardware graphics acceleration is
<a name="l153"></a>not used, so this is possible. See </span><a href="/Wb/Doc/MultiCore.DD.HTML#l1"><span class=cF4>TempleOS MultiCore</span></a><span class=cF0>.
<a name="l155"></a>There is no distinction between the terms </span><span class=cF2>task</span><span class=cF0>, </span><span class=cF2>process</span><span class=cF0> or </span><span class=cF2>thread</span><span class=cF0>. All have a
<a name="l156"></a>task record, </span><a href="/Wb/Kernel/KernelA.HH.HTML#l3271"><span class=cF4>CTask</span></a><span class=cF0>, pointed to by the </span><span class=cF2>FS</span><span class=cF0> segment reg and are accessed with </span><span class=cF4>Fs-></span><span class=cF0>
<a name="l157"></a>while </span><span class=cF4>Gs-></span><span class=cF0> points to a </span><a href="/Wb/Kernel/KernelA.HH.HTML#l3391"><span class=cF4>CCPU</span></a><span class=cF0> for the current CPU core. Each task can have just
<a name="l163"></a>In </span><span class=cF2>TempleOS</span><span class=cF0>, </span><a href="/Wb/Doc/Glossary.DD.HTML#l171"><span class=cF4>Adam Task</span></a><span class=cF0> refers to the father of all tasks. He's never supposed
<a name="l164"></a>to die. Since tasks inherit the symbols of parents, system-wide stuff is
<a name="l165"></a>associated with </span><span class=cF2>Adam</span><span class=cF0>. His heap is like kernel memory in other operating
<a name="l166"></a>systems. Since </span><span class=cF2>Adam</span><span class=cF0> is immortal, it's safe to alloc objects, not tied to any
<a name="l167"></a>mortal task, from </span><span class=cF2>Adam</span><span class=cF0>'s heap. He stays in a server mode, taking requests, so
<a name="l168"></a>you can ask him to </span><span class=cF2>#include</span><span class=cF0> something, placing that code system-wide. A funny
<a name="l169"></a>story is that originally I called it the </span><span class=cF2>root</span><span class=cF0> task and even had a </span><span class=cF2>/Root</span><span class=cF0>
<a name="l173"></a>subdirectories. Then, use </span><a href="/Wb/Adam/ABlkDev/ADskA.HC.HTML#l122"><span class=cF4>CopyTree</span></a><span class=cF0>(). That should make upgrading easy, too.
<a name="l176"></a>customize into </span><span class=cF2>/Home</span><span class=cF0> and modify them. See </span><a href="/Wb/Doc/GuideLines.DD.HTML#l37"><span class=cF4>Home Files</span></a><span class=cF0>. You can make your own
<a name="l181"></a>clicking on filenames in a cmd line </span><a href="/Wb/Kernel/BlkDev/DskDirB.HC.HTML#l102"><span class=cF4>Dir</span></a><span class=cF0>() listing. You left-click files to edit
<a name="l182"></a>them and right-click to </span><span class=cF2>#include</span><span class=cF0> them. To begin a project, type </span><a href="/Wb/Adam/DolDoc/DocEd.HC.HTML#l204"><span class=cF4>Ed</span></a><span class=cF0>("filename");
<a name="l183"></a>, supplying a filename. You can also run programs with </span><span class=cF2><F5></span><span class=cF0> when in the editor. </span><span class=cF2>
<a name="l184"></a><ESC></span><span class=cF0> to save and exit the file. You'll need to do a new </span><a href="/Wb/Kernel/BlkDev/DskDirB.HC.HTML#l102"><span class=cF4>Dir</span></a><span class=cF0>() cmd,
<a name="l185"></a>periodically, so make a macro on your PersonalMenu. Access your PersonalMenu by
<a name="l186"></a>pressing </span><span class=cF2><CTRL-m></span><span class=cF0>, cursoring until you are on top of it and pressing </span><span class=cF2><SPACE></span><span class=cF0>.
<a name="l187"></a>
<a name="l188"></a></span><span class=cF2><CTRL-t></span><span class=cF0> toggles plain text mode, showing format commands, a little like viewing
<a name="l189"></a>html code.
<a name="l190"></a></span><span class=cF2><CTRL-l></span><span class=cF0> inserts a text widgets.
<a name="l191"></a></span><span class=cF2><CTRL-r></span><span class=cF0> inserts or edit a graphic sprite resource at cursor location.
<a name="l192"></a></span><span class=cF2><CTRL-d></span><span class=cF0> brings-up the file manager. It's pretty crappy. I find I don't need
<a name="l193"></a>it very often, believe it or not.
<a name="l201"></a>The </span><span class=cF2>ALT</span><span class=cF0> keys are defined in </span><a href="/Wb/Home/HomeKeyPlugIns..HTML#l1"><span class=cF4>~/HomeKeyPlugIns.HC</span></a><span class=cF0>. You can customize them.
<a name="l207"></a></span><a href="/Wb/Adam/Opt/Utils/Find.HC.HTML#l145"><span class=cF4>Find</span></a><span class=cF0>() is your best friend. There's a wrapper function called </span><a href="/Wb/Home/HomeWrappers.HC.HTML#l8"><span class=cF4>F</span></a><span class=cF0>() in your </span><span class=cF2>~/Hom
<a name="l209"></a>often and customize the args. By the way, </span><a href="/Wb/Adam/Opt/Utils/Find.HC.HTML#l145"><span class=cF4>Find</span></a><span class=cF0>() or </span><a href="/Wb/Home/HomeWrappers.HC.HTML#l13"><span class=cF4>R</span></a><span class=cF0>() can be used to replace
<a name="l210"></a>strings across multiple files. You can access </span><a href="/Wb/Adam/Opt/Utils/Find.HC.HTML#l145"><span class=cF4>Find</span></a><span class=cF0>() using </span><span class=cF2><CTRL-SHIFT-f></span><span class=cF0>.
<a name="l212"></a>As you browse code, use the </span><span class=cF2>AutoComplete</span><span class=cF0> window to look-up functions, etc. </span><span class=cF2><CTR
<a name="l213"></a>L-SHIFT-F1></span><span class=cF0> (or whatever number) to follow a sym to it's source. You can browse
<a name="l214"></a>deeper and deeper. You go back with </span><span class=cF2><SHIFT-ESC></span><span class=cF0>.
<a name="l216"></a>Use the </span><a href="/Wb/Doc/HelpIndex.DD.HTML#l1"><span class=cF4>Help & Index</span></a><span class=cF0> or </span><a href="/Wb/Doc/DemoIndex.DD.HTML#l1"><span class=cF4>Demo Index</span></a><span class=cF0> to find-out what exists. Press </span><span class=cF2><F1></span><span class=cF0> for help
<a name="l217"></a>or use the links on your menu (</span><span class=cF2><CTRL-m></span><span class=cF0>). Also, look in the </span><span class=cF2>/Demo</span><span class=cF0> or </span><span class=cF2>/Apps</span><span class=cF0>
<a name="l220"></a>Software is distributed as </span><a href="/Wb/Doc/RedSea.DD.HTML#l1"><span class=cF4>RedSea</span></a><span class=cF0> ISO files. Burn a CD/DVD, or set your CD/DVD
<a name="l222"></a></span><a href="/Wb/Adam/ABlkDev/Mount.HC.HTML#l138"><span class=cF4>Mount</span></a><span class=cF0>() the ISO.C file and access the </span><span class=cF2>'M'</span><span class=cF0> drive in TempleOS. It must be a
<a name="l227"></a>quickly to </span><span class=cF2>'D'</span><span class=cF0>. Also, the </span><a href="/Wb/Adam/ABlkDev/FileMgr.HC.HTML#l579"><span class=cF4>FileMgr</span></a><span class=cF0>() </span><span class=cF2><CTRL-d></span><span class=cF0> starts too slowly when there are
<a name="l231"></a>limit in the </span><a href="/Wb/Doc/Charter.DD.HTML#l1"><span class=cF4>TempleOS Charter</span></a><span class=cF0>. All applications must only depend on the core
<a name="l235"></a>Create a </span><a href="/Wb/Doc/RedSea.DD.HTML#l1"><span class=cF4>RedSea</span></a><span class=cF0> ISO file with </span><a href="/Wb/Adam/Opt/Boot/DskISORedSea.HC.HTML#l136"><span class=cF4>RedSeaISO</span></a><span class=cF0>(). Send an email to
<a name="l236"></a></span><a href="mailto:tdavis@templeos.org"><span class=cF0>tdavis@templeos.org</span></a><span class=cF0> if you want me to post a link to your TempleOS code in the