Initial (manual) import

This commit is contained in:
minexew committed 2017-01-22 20:26:44 +01:00
1 parent f39611c506
commit 895fe109de
661 files changed
+245862

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
$WW,1$$FG,5$$TX+CX,"TempleOS"$$FG$
$FG,5$Websites:$FG$
$TX,"www.templeos.org",HTML="http://www.templeos.org"$
$FG,5$Owner/President:$FG$
$TX,"Terry A. Davis",HTML="mailto:tdavis@templeos.org"$
$HC,"<center><img src=\"http://www.templeos.org/images/140414TerryADavis.jpg\" width=\"432\" height=\"324\" alt=\"\"></center>"$
8144 Sickle Lane
Las Vegas, NV 89128
(702)254-4223
$TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$
$FG,5$About Me:$FG$
$TX,"ASU_Transcripts",HTML="http://www.templeos.org/files/ASU_Transcripts.pdf"$ $TX,"ASU Course Catalog (See page 261)",HTML="https://catalog.asu.edu/files/shared/archives/1994-1996/general/UG1994-1996.pdf/1994-1996-UG-241-267.pdf"$ $TX,"Dr. David Pheanis",HTML="https://webapp4.asu.edu/directory/person/77201"$
I was a National Merit Scholar with a 1440 SAT at Arizona State University. I have a bachelor's in Computer System Engineering from ASU, basically, embedded systems, and a master's in Electrical Engineering from ASU, control systems. I worked as a software, hardware and mechanical engineer at Ticketmaster from 1990-1996.
I designed a 3 axis stepper-motor-driven milling machine 1996-1997 with a CAD/CAM package for a company I started called Home Automation and Robotic Equipment.
$HC,"<center><img src=\"http://www.templeos.org/images/Machine.jpg\" width=\"600\" height=\"400\" alt=\"\"></center>"$
I worked for a company named Xytec Corp. 1997-1999. We made FPGA-based image processing equipment. I wrote $FG,2$$TX,"SimStructure",HTML="http://www.templeos.org/files/SimStrSetUp.zip"$$FG$ from 2000-2001 for H.A.R.E. I worked as head software/electrical engineer for a company called Graphic Technologies, 2001-2002, making replacement chips for toner printer cartridges so they could be refilled.
$FG,5$Credits:$FG$
See $LK,"::/Doc/Credits.DD"$.
+47
View File
@@ -0,0 +1,47 @@
$WW,1$$FG,5$$TX+CX,"Assembler"$$FG$
See $LK,"::/Compiler/OpCodes.DD"$ for opcodes. They're not standard. Some invalid insts are not flagged and some valid insts are not implemented. 16-bit asm support is limited.
Here are example inst formats:
$HL,1$ ADD RAX,I64 FS:DISP[RSI+RDI*8]
$HL,0$$HL,1$ ADD RAX,I64 [DISP]
$HL,0$
$FG,2$$$$FG$ Current compiler output pos (inst ptr). Even works in HolyC expressions.
$FG,2$$$$FG$ works in $FG,2$class$FG$es.
$FG,2$class MyFun
{
$$=-16;
I64 local1;
I64 local2;
$$=$$+256;
I64 crazy;
};$FG$
$FG,4$LABEL$FG,2$::
$FG$ Defines an exported glbl label.
$FG,4$LABEL$FG,2$:
$FG$ Defines an non-exported glbl label.
$FG,2$@@$FG,4$LABEL$FG,2$:
$FG$ Defines a local label with scope valid between two global labels.
$FG,2$DU8$FG$, $FG,2$DU16$FG$, $FG,2$DU32$FG$, $FG,2$DU64$FG$
Define BYTE, WORD, DWORD or QWORD. Can be used with $FG,2$DUP()$FG$ and ASCII strings. For your convenience, the ASCII strings do not have terminating zeros. Define cmds must end with a semicolon.
$FG,2$USE16$FG$, $FG,2$USE32$FG$, $FG,2$USE64$FG$
$FG,2$IMPORT$FG$ $FG,4$sym1name$FG$, $FG,4$sym2name$FG$;
$FG,2$LIST$FG$, $FG,2$NOLIST$FG$
$FG,2$ALIGN$FG$ $FG,4$num$FG$, $FG,4$fill_byte$FG$
Align to $FG,4$num$FG$ boundary and fill with $FG,4$fill_byte$FG$.
$FG,2$MODULE_ORG$FG$ $FG,4$num$FG$
Set code addr for JIT or set module $LK,"Load",A="MN:Load"$() addr -- has 16-byte $LK,"CBinFile",A="MN:CBinFile"$ header and patch table trailing.
$FG,2$BINFILE$FG,4$ "FileName.BIN"$FG$;
See $LK,"Assembly Language",A="FF:::/Doc/GuideLines.DD,Assembly Language"$, $LK,"::/Demo/Asm/AsmAndC1.HC"$, $LK,"::/Demo/Asm/AsmAndC2.HC"$ and $LK,"::/Demo/Asm/AsmAndC3.HC"$.
+19
View File
@@ -0,0 +1,19 @@
$FG,2$$WW,1$AutoComplete$FG$ is the $FG,7$LTGRAY$FG$ window on the right of the scrn. $LK,"ACInit",A="MN:ACInit"$() collects words from all text files in subdirectories. Normally, the call to $LK,"ACInit",A="MN:ACInit"$() is in $LK,"HomeSys.HC",A="FF:~/HomeSys.HC,ACInit"$. It provides auto-complete for typing, jump-to-code and jump-to-dictionary functionality.
$FG,2$<ALT-SHIFT-A>$FG$ Closes the $FG,7$LTGRAY$FG$ AutoComplete window.
$FG,2$<ALT-a>$FG$ Opens the $FG,7$LTGRAY$FG$ AutoComplete window.
$FG,2$<CTRL-SHIFT-F1>$FG$ Jumps to the source code for 1st symbol in the window.
$FG,2$<CTRL-SHIFT-F2>$FG$ Jumps to the source code for 2nd symbol in the window.
$FG,2$<CTRL-SHIFT-Fn>$FG$ Jumps to the source code for n-th symbol in the window.
$FG,2$<CTRL-F1>$FG$ Autocompletes the 1st symbol in the window.
$FG,2$<CTRL-F2>$FG$ Autocompletes the 2nd symbol in the window.
$FG,2$<CTRL-Fn>$FG$ Autocompletes the n-th symbol in the window.
$FG,2$<CTRL-SHIFT-1>$FG$ Jumps to the dictionary for 1st symbol in the window.
$FG,2$<CTRL-SHIFT-2>$FG$ Jumps to the dictionary for 2nd symbol in the window.
$FG,2$<CTRL-SHIFT-n>$FG$ Jumps to the dictionary for n-th symbol in the window.
$FG,2$<CTRL-1>$FG$ Autocompletes the 1st dictionary word in the window.
$FG,2$<CTRL-2>$FG$ Autocompletes the 2nd dictionary word in the window.
$FG,2$<CTRL-n>$FG$ Autocompletes the n-th dictionary word in the window.
If you have the raw Project Gutenberg dictionary file, you can generate the TempleOS processed dictionary files with the stand-alone program $LK,"::/Adam/AutoComplete/ACDictGen.HC"$.
+14
View File
@@ -0,0 +1,14 @@
$FG,5$These take a pointer to a bit field.$FG$
$WW,1$$FG,2$Bt$FG$: Bit Test
$FG,2$Bts$FG$: Bit Test and Set to one
$FG,2$Btr$FG$: Bit Test and Rst to zero
$FG,2$Btc$FG$: Bit Test and Compliment (toggle)
$FG,2$BEqu$FG$: Set bit to value.
$FG$Bit operations are "atomic", no interrupt between the reading and writing the bit, important when multitasking. For multicore use "locked" forms.$FG$
$FG,5$These don't take a pointer, but the actual field.$FG$
$FG,2$Bsf$FG$: Bit Scan Fwd (Pos of first low one bit or -1)
$FG,2$Bsr$FG$: Bit Scan Rev (Pos of first high one bit or -1)
$FG,2$BCnt$FG$: Bit Cnt (Cnt of set bits)
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
$WW,1$$FG,5$$TX+CX,"Char Overview"$$FG$
A $FG,2$Char$FG$acter is a single byte holding an ASCII code for a letter, num or sym. The $FG,2$TempleOS$FG$ term is a $FG,2$U8$FG$.
Standard ASCII values range from 0 to 127. Values below 32 are ctrl key's. So, an ASCII #3 is a $FG,2$<CTRL-c>$FG$. TempleOS uses a few nonstandard values below 32. See $LK,"Char Definitions",A="MN:CH_SHIFT_SPACE"$.
ASCII #5 is the cursor location in a saved file.
ASCII #28 is $FG,2$<SHIFT-ESC>$FG$.
ASCII #31 is a $FG,2$<SHIFT-SPACE>$FG$.
TempleOS ASCII is 8-bit instead of 7-bit, so it also uses the range from 128-255. Press $FG,2$<CTRL-ALT-a>$FG$ to see shapes for 128-255. Technically, $FG,2$<CTRL-ALT-a>$FG$ are $LK,"scrn codes",A="HI:TextBase Layer"$.
A $FG,2$Key$FG$ is typically specified with a scan code. TempleOS scan codes contain the key value in the lowest $FG,2$U8$FG$, and flags in the upper 3 bytes. See $LK,"Scan Code Flags",A="MN:SCF_CTRL"$ and $LK,"Scan Codes",A="MN:SC_INS"$.
TempleOS stores scan codes in 8 bytes.
$FG,2$Byte 0$FG$ is the code. NumPad keys, SHIFT, ALT, CTRL and GUI keys combined.
$FG,2$Byte 1-3$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$
The upper 4-bytes are copied from lower 4-bytes.
$FG,2$Byte 4$FG$ is the code. Left, Right and NumPad keys distinct.
$FG,2$Byte 5-7$FG$ are $LK,"flags",A="MN:SCf_KEY_UP"$
Run the program $LK,"::/Demo/MsgLoop.HC"$ to examine scan code. Press $FG,2$<CTRL-SHIFT-l>$FG$ and "Insert ASCII/ScanCode".$FG$
See $LK,"Key Allocations",A="FI:::/Doc/KeyAlloc.DD"$ and $LK,"CKbdStateGlbls",A="MN:CKbdStateGlbls"$.
A $FG,2$String$FG$ is a bunch of ASCII characters terminated with a zero.
+73
View File
@@ -0,0 +1,73 @@
$FG,5$$WW,1$$TX+CX,"TempleOS Charter"$$FG$
Why did they make Solomon's Temple? It was a direction to look, to focus on, a special place for meditation, to do offerings, a community center, a home to God's beauty, that encouraged love of God. People cherished God's temple, beautifying it with gold and all fine things to show love of God, as great $TX,"cathedrals",HTML="https://www.youtube.com/watch?v=xkfmK-CLvcc"$ were decorated with astounding, awe-striking intricate art and gargoyles, incredible devotion to God with hours of effort, toiling and slaving-away for the glory of God, for families with children to see $TX,"stained-glass",HTML="https://www.youtube.com/watch?v=t8g1e-JLrhM"$ windows and tomes with ridiculously elaborate $TX,"calligraphy",HTML="https://www.youtube.com/watch?v=Oa8gMb0YC68"$ to show love of God, from a people who did little else but show love toward God, lived in dire conditions by today's standards, yet with so much difficulty scraping-by, found the time to devote $TX,"even all free-time",HTML="https://www.youtube.com/watch?v=tZw5V4XuUIo"$ to God!
1 Kings 6:21 (King James)
$ID,5$6:21 So Solomon overlaid the house within with pure gold: and he made
a partition by the chains of gold before the $FG,4$oracle$FG$; and he overlaid
it with gold.
6:22 And the whole house he overlaid with gold, until he had finished
all the house: also the whole altar that was by the $FG,4$oracle$FG$ he overlaid
with gold.
6:23 And within the $FG,4$oracle$FG$ he made two cherubims of olive tree, each
ten cubits high.
$ID,-5$
* TempleOS is God's official temple. Just like Solomon's temple, this is a community focal point where offerings are made and God's oracle is consulted.
* God said $FG,2$640x480 16 color$FG$ graphics is a covenant like circumcision. Children will do offerings. Think of 16 colors like the Simpson's cartoons. In the future, even if one GPU were universal, we would keep 640x480 16 color and not use GPU acceleration. Graphics operations should be transparent, not hidden in a GPU.
* God said to use a single-voice 8-bit signed MIDI-like sample for sound. God does not want death screams, perhaps, because God has PTSD or soldiers have PTSD. (Imagine wounded on battlefields.)
* God said His temple must be perfect. $FG,4$We don't think twice about breaking compatibility.$FG$ God said we do a seven year release cycle. I say the PC hardware follows a 49 year, jubilee cycle, like broadcast TV upgrades.
* The vision is the same usage model and niche as the Commodore 64 -- a non-networked, simple machine where programming was the goal, not just a means to an end. However, it is modern, 64-bit and $FG,2$multi-cored$FG$. It is special purpose, not general purpose, so some things it will not do. Also, it's a kayak, not a Titanic. The priority is $FG,2$user developers$FG$, not $FG,2$3rd party developers$FG$.
* We do not put any hooks for future changes. "Perfect" means we always act as though it is final, for all time. Microsoft allowed the $FG,2$$TX,"Windows BMP",HTML="http://en.wikipedia.org/wiki/BMP_file"$$FG$ file format to adapt to the future and it became grotesque.
* Low line count is the highest good, so it is easy to learn the whole thing. Users should see the light at the end of the tunnel. One file system, for example, is better than many file systems.
* There is a limit of 100,000 lines of code for all time, not including applications and demos. $FG,4$Code comments count$FG$, however. Currently, there are $TX,"81,390",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of code. $FG,4$3rd party libraries are banned$FG$ because they circumvent the intent of this limit. The vision is a Commodore 64 ROM -- a fixed core API that is the only dependency of applications. Dependency on components and libraries creates a hell that is no longer blissful.
* Minimal abstraction is a goal. Sheep are fools. They always respect a design that is more complicated than another. Any genius can make it complicated. Like in physics, it takes a supra-genius to make it simple.
* One platform. $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC compatibles. Desk-tops are all we design for, but laptops can tag along.
* All hardware access will be done through x86 IN/OUT instructions, not PCI drivers. A frame buffer for VGA is an exception.
* One driver for each class of device. Limited exceptions are allowed. With divergent device capabilities, it is a nightmare for user applications and what is gained? A three bttn mouse is like a leg you cannot put weight on.
* $FG,2$Ring-0-only$FG$. Everything runs in kernel mode, including user applications.
* Full access to everything. All memory, I/O ports, instructions, and similar things must never be off limits. All functions, variables and class members will be accessible. There are no C++ $FG,2$public$FG$/$FG,2$private$FG$ protections and all functions, even secondary ones in the kernel, can be called.
* $FG,2$Single-address-map$FG$ as though paging is not used. Long mode requires paging, however, so the nearest thing is keeping all memory $FG,2$identity-mapped$FG$.
* $FG,4$No networking$FG$, so malware is not an issue.
* No encryption or passwords. Files are compressed, not encrypted.
* $FG,2$Free$FG$ and $FG,2$public domain$FG$.
* $FG,2$100% open source$FG$ with all source included.
* Documents are not for printing. They're dynamic, intended for the scrn.
* Just one 8x8 fixed-width font. $FG,4$No Unicode, just Extended ASCII$FG$. Other countries can make their own versions. The versions should be just for one language and platform.
* $FG,4$No multimedia$FG$. Sounds and images will be primarily calculated in real-time, not fetched from storage.
$FG,8$
* "Commodore 64" is a trademark owned by Polabe Holding NV.
* "The Simpsons" is a trademark owned by Fox.
* "Windows" is a trademark owned by MicroSoft Corp.
$FG$
$FG,5$$WW,1$$TX+CX,"Possible Amendments"$$FG$
The compiler's parser makes RISC code which it optimizes to CISC. I discovered this does not matter because the CPU converts it back to RISC and schedules it, internally. A TempleOS zealot with more zeal than I, might say we should save lines-of-code by removing the CISC optimizing.
+335
View File
@@ -0,0 +1,335 @@
$WW,1$$FG,5$$TX+CX,"Change Log"$$FG$
Use $LK,"R",A="MN:R"$() to rename if I change a label.
$IV,1$----01/22/17 06:08:00----$IV,0$
* $BK,1$TempleOS version 5.02 Released$BK,0$
* Changed polling of $LK,"KbdMsHndlr",A="MN:KbdMsHndlr"$() in $LK,"WinMgrSleep",A="MN:WinMgrSleep"$(), increased fifos.
$IV,1$----01/17/17 18:11:53----$IV,0$
* Fixed $FG,2$$$$FG$ class offset so $FG,2$#assert$FG$'s don't lag a token.
$IV,1$----01/17/17 14:39:41----$IV,0$
* Added $LK,"blkdev.ins_base0",A="MN:CBlkDevGlbls"$ and $LK,"blkdev.ins_unit",A="MN:CBlkDevGlbls"$.
* Added make $LK,"RedSeaISO",A="MN:RedSeaISO"$() to $LK,"FileMgr",A="MN:FileMgr"$().
* Added $LK,"blkdev.dft_iso_c_filename",A="MN:CBlkDevGlbls"$ $TX,"\"::/Tmp/CDDVD.ISO.C\"",D="DFT_ISO_C_FILENAME"$.
$IV,1$----01/17/17 06:12:21----$IV,0$
* $LK,"R",A="MN:R"$("MIN_...","..._MIN");
* $LK,"R",A="MN:R"$("MAX_...","..._MAX");
* $LK,"R",A="MN:R"$("NUM_...","..._NUM");
$IV,1$----01/14/17 19:16:51----$IV,0$
* Created $FG,2$/Demo/AcctExample/TOS$FG$.
* $LK,"R",A="MN:R"$("MAX_...","_NUM...");
$IV,1$----01/14/17 09:43:12----$IV,0$
* Improved $LK,"::/Demo/AcctExample/TOS/TOSHolySpirit.HC"$.
* Added cmp $LK,"U0 Expression",A="FF:::/Compiler/PrsExp.HC,U0 Expression"$ warn.
* Improved syntax highlighting.
$IV,1$----01/11/17 03:33:33----$IV,0$
* $BK,1$TempleOS version 5.01 Released$BK,0$
* $LK,"R",A="MN:R"$("ChangeLog","ChgLog");
* Added show mouse pos to $FG,2$<CTRL-ALT-G>$FG$.
* Improved $LK,"TOSRegen",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,TOSRegen("$().
* Added $LK,"Let2Let",A="MN:Let2Let"$().
$IV,1$----01/10/17 14:27:58----$IV,0$
* Made $LK,"DocPut",A="MN:DocPut"$() use parent task's doc if input filter task.
* Added $LK,"Once",A="MN:Once"$(), $LK,"AOnce",A="MN:AOnce"$(), $LK,"OnceFlush",A="MN:OnceFlush"$(), $LK,"AOnceFlush",A="MN:AOnceFlush"$(), $LK,"OnceDrv",A="MN:OnceDrv"$(), $LK,"AOnceDrv",A="MN:AOnceDrv"$() and $LK,"OnceExe",A="MN:OnceExe"$().
* $LK,"R",A="MN:R"$("DoOnce","Once");
* Added $LK,"RegAppend",A="MN:RegAppend"$() and $LK,"RegCnt",A="MN:RegCnt"$();
* $LK,"R",A="MN:R"$("RegSetDftEntry()","$LK,"RegDft",A="MN:RegDft"$()");
* $LK,"R",A="MN:R"$("RegExeBranch()","$LK,"RegExe",A="MN:RegExe"$()");
* $LK,"R",A="MN:R"$("RegWriteBranch()","$LK,"RegWrite",A="MN:RegWrite"$()");
$IV,1$----01/10/17 11:45:41----$IV,0$
* Added $LK,"::/Adam/InsReg.HC"$ with $LK,"InsReg",A="MN:InsReg"$(), $LK,"InsRereg",A="MN:InsRereg"$() and $LK,"InsUnreg",A="MN:InsUnreg"$().
* Added $LK,"::/Adam/Host.HC"$ with $LK,"HostChgDsk",A="MN:HostChgDsk"$().
* Added $LK,"::/Adam/Opt/Utils/TOS.HC"$ with $LK,"TOSStdIns",A="MN:TOSStdIns"$().
* Added cmd line args for partition % to $LK,"PrtDsk",A="MN:PrtDsk"$().
$IV,1$----01/09/17 21:48:34----$IV,0$
* $LK,"R",A="MN:R"$("a1","arg1");
* $LK,"R",A="MN:R"$("a2","arg2");
* $LK,"R",A="MN:R"$("r","res");
$IV,1$----01/09/17 02:30:59----$IV,0$
* Improved compiler $LK,"ICSlashOp",A="MN:ICSlashOp"$().
* Added $LK,"Panic",A="MN:Panic"$().
* Made it possible to mount just one partition.
* Fixed creation of RedSea ISOs.
* Organized $LK,"::/PersonalMenu.DD"$.
* Moved AfterEgypt to the supplemental disk.
$IV,1$----01/06/17 06:07:19----$IV,0$
* Fixed $LK,"ChgDsk",A="MN:ChgDsk"$().
* Improved $LK,"::/Misc/OSTestSuite.HC"$.
$IV,1$----01/05/17 04:53:21----$IV,0$
* No longer support ASCII#12, <CTRL-l> CH_FORM_FEED.
* Fixed $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$.
* $LK,"GRScrnCaptureRead",A="MN:GRScrnCaptureRead"$().
$IV,1$----01/04/17 18:06:14----$IV,0$
* Added $LK,"::/Demo/AcctExample/TOS/TOSPolicies.DD"$.
* $LK,"R",A="MN:R"$("U0 pad;",";"); for align #asserts.
* Got rid of $FG,4$mouse.throttle$FG$.
* $LK,"R",A="MN:R"$("Button","Bttn");
* $LK,"R",A="MN:R"$("Handler","Hndlr");
* $LK,"R",A="MN:R"$("InputPointer","Mouse");
* Improved $LK,"MemRep",A="MN:MemRep"$().
* Changed $LK,"::/Adam/WallPaper.HC"$.
$IV,1$----01/03/17 12:23:49----$IV,0$
* $LK,"R",A="MN:R"$("chars_cmp...","char_bmp...");
* Added chk for $LK,"Profanity",A="FF:::/Demo/AcctExample/TOS/TOSMisc.HC,Profanity"$.
* Improved $LK,"TOSRegen",A="FF:::/Demo/AcctExample/TOS/TOSDistro.HC,TOSRegen"$.
* Removed $TX,"TempleOSBooks1.ISO",HTML="http://www.templeos.org/files/TempleOSBooks1.ISO"$ and $TX,"TempleOSBooks2.ISO",HTML="http://www.templeos.org/files/TempleOSBooks2.ISO"$ out of $TX,"TempleOSSup1.ISO",HTML="http://www.templeos.org/TempleOSSup1.ISO"$.
$IV,1$----01/01/17 17:16:16----$IV,0$
* $BK,1$TempleOS version 5.00 Released$BK,0$
* Added $LK,"Collapse",A="MN:Collapse"$().
* Added $LK,"CursorRem",A="MN:CursorRem"$().
$IV,1$----12/31/16 07:21:20----$IV,0$
* $LK,"R",A="MN:R"$("SYS_SEMA_...","SEMA_...");
* $LK,"R",A="MN:R"$("SYSf_CTRL_ALT_...","CTRL_ALT_...");
* $LK,"R",A="MN:R"$("ThrowBreak()","$LK,"Break",A="MN:Break"$()");
* Added $LK,"MemPageRep",A="MN:MemPageRep"$().
$IV,1$----12/30/16 23:42:20----$IV,0$
* $LK,"R",A="MN:R"$("Pages512","Pags");
* Overhauled $LK,"::/Kernel/Mem/PageTables.HC"$.
* $LK,"R",A="MN:R"$("BusyWait()","$LK,"Busy",A="MN:Busy"$()");
$IV,1$----12/29/16 10:21:44----$IV,0$
* Changed $LK,"Snd",A="MN:Snd"$() from $FG,2$freq$FG$ to a $FG,2$I8$FG$ val called an $FG,2$ona$FG$.
* Fixed err in music octaves.
* To convert songs, download Supplemental#1 ISO from the AppStore on http://www.templeos.org and run Sup1/Sup1Utils/CvtSong500.HC.
$IV,1$----12/22/16 16:18:32----$IV,0$
* $LK,"R",A="MN:R"$("CSrvCmd","$LK,"CJob",A="MN:CJob"$");
* $LK,"R",A="MN:R"$("CSrvCtrl","$LK,"CJobCtrl",A="MN:CJobCtrl"$");
$IV,1$----12/03/16 13:19:58----$IV,0$
* $LK,"R",A="MN:R"$("SpriteMat3B()","$LK,"Sprite3Mat4x4B",A="MN:Sprite3Mat4x4B"$()");
* $LK,"R",A="MN:R"$("SpriteX3B()","$LK,"Sprite3XB",A="MN:Sprite3XB"$()");
* $LK,"R",A="MN:R"$("SpriteY3B()","$LK,"Sprite3YB",A="MN:Sprite3YB"$()");
* $LK,"R",A="MN:R"$("SpriteZ3B()","$LK,"Sprite3ZB",A="MN:Sprite3ZB"$()");
* Improved $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----12/03/16 10:16:26----$IV,0$
* Changed $LK,"__CMD_LINE__",A="MN:__CMD_LINE__"$.
* Added $LK,"CProgress",A="MN:CProgress"$.tf.
* Added $LK,"sys_staff_mode_flag",A="MN:sys_staff_mode_flag"$.
* $LK,"R",A="MN:R"$("except_caller","except_callers");
$IV,1$----11/30/16 22:44:35----$IV,0$
* Added $LK,"SpriteTransform",A="MN:SpriteTransform"$().
$IV,1$----11/28/16 07:11:41----$IV,0$
* Improved $LK,"::/Apps/Titanium/Titanium.HC"$.
$IV,1$----11/26/16 22:43:51----$IV,0$
* Added solar storms to $LK,"::/Apps/X-Caliber/X-Caliber.HC"$.
* $LK,"R",A="MN:R"$("TimeOut","Titanium");
$IV,1$----11/20/16 19:46:43----$IV,0$
* $BK,1$TempleOS version 4.13 Released$BK,0$
* Improved $LK,"::/Apps/Titanium/Titanium.HC"$.
* Improved $LK,"::/Apps/X-Caliber/X-Caliber.HC"$.
$IV,1$----11/19/16 08:19:51----$IV,0$
* Improved Budget application.
$IV,1$----11/17/16 18:49:51----$IV,0$
* $LK,"R",A="MN:R"$("EagleDive","Talons");
* Improved $LK,"::/Demo/Games/RocketScience.HC"$.
* Improved $LK,"::/Demo/Games/Rocket.HC"$.
$IV,1$----10/28/16 05:54:27----$IV,0$
* Added $LK,"::/Demo/RadixSort.HC"$.
$IV,1$----10/26/16 00:21:06----$IV,0$
* Added $LK,"CProgress",A="MN:CProgress"$.t0.
* Improved $LK,"::/Doc/Boot.DD"$.
$IV,1$----10/25/16 18:02:44----$IV,0$
* Improved $LK,"::/Adam/Gr/SpriteEd.HC"$.
* Improved $LK,"::/Demo/AcctExample/TOS/TOSHolySpirit.HC"$.
$IV,1$----10/12/16 10:55:26----$IV,0$
* Added $LK,"CCF_NO_CHAR_CONST",A="MN:CCF_NO_CHAR_CONST"$.
* Improved $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
$IV,1$----10/03/16 01:09:35----$IV,0$
* Changed $LK,"GodWord",A="MN:GodWord"$().
$IV,1$----09/30/16 18:29:59----$IV,0$
* Improved $LK,"Rand",A="MN:Rand"$()'s.
* Improved $LK,"::/Adam/Opt/Utils/ToTXT.HC"$.
$IV,1$----09/29/16 10:13:14----$IV,0$
* $BK,1$TempleOS version 4.12 Released$BK,0$
* Added $LK,"TASKf_CMD_LINE_PMT",A="MN:TASKf_CMD_LINE_PMT"$.
* Improved $LK,"TaskWait",A="MN:TaskWait"$().
* Improved $LK,"DeathWait",A="MN:DeathWait"$().
$IV,1$----09/27/16 12:40:21----$IV,0$
* Added $LK,"SndRst",A="MN:SndRst"$().
* Got rid of crappy reverb in $LK,"::/Apps/Psalmody/PsalmodyMain.HC"$.
$IV,1$----09/27/16 11:09:25----$IV,0$
* Improved $LK,"::/Misc/OSTestSuite.HC"$.
* Fixed bug in $LK,"EdCharIns",A="MN:EdCharIns"$() printing $$ cmds.
* Added $LK,"FUF_JUST_DD",A="MN:FUF_JUST_DD"$ and $LK,"FILEMASK_DD",A="MN:FILEMASK_DD"$.
$IV,1$----09/27/16 01:05:52----$IV,0$
* Improved $LK,"::/Doc/MemOverview.DD"$.
* Got rid of $FG,4$::/Demo/Lectures/Mem$FG$.
* Made filename paths relative to document location in DolDoc links.
* $LK,"R",A="MN:R"$("Temp","Tmp");
$IV,1$----09/26/16 00:44:42----$IV,0$
* Added CloseAssault and OverRun to $LK,"::/Apps/ToTheFront/ToTheFront.HC"$.
$IV,1$----09/22/16 07:53:20----$IV,0$
* Improved $LK,"::/Demo/Graphics/Box.HC"$.
* Improved $LK,"::/Demo/Graphics/SpritePlot3D.HC"$.
$IV,1$----09/21/16 17:09:40----$IV,0$
* Fixed bug in $LK,"::/Demo/Games/BomberGolf.HC"$.
$IV,1$----09/20/16 15:57:30----$IV,0$
* $LK,"R",A="MN:R"$("Screen","Scrn");
* $LK,"R",A="MN:R"$("WinMgrSync","$LK,"Refresh",A="MN:Refresh"$");
* $LK,"R",A="MN:R"$("InDbg","$LK,"DbgMode",A="MN:DbgMode"$");
* Improved $LK,"::/Doc/Boot.DD"$.
$IV,1$----09/20/16 07:31:52----$IV,0$
* $LK,"R",A="MN:R"$("DAT","DATA");
* $LK,"R",A="MN:R"$("Auto","In");
* $LK,"R",A="MN:R"$("AutoStr","InStr");
* $LK,"R",A="MN:R"$("AutoFile","InFile");
* $LK,"R",A="MN:R"$("AUT","IN");
* $LK,"R",A="MN:R"$("GRA","GR");
$IV,1$----09/18/16 20:40:44----$IV,0$
* Added $LK,"::/Doc/WhyNotMore.DD"$.
$IV,1$----09/18/16 12:52:03----$IV,0$
* $BK,1$TempleOS version 4.11 Released$BK,0$
* Fixed bug in $LK,"IsDotZ",A="MN:IsDotZ"$() and $LK,"IsDotC",A="MN:IsDotC"$().
* $LK,"R",A="MN:R"$("CPP","HC");
* $LK,"R",A="MN:R"$("HPP","HH");
* $LK,"R",A="MN:R"$("TXT","DD");
$IV,1$----09/06/16 13:01:42----$IV,0$
* Added $LK,"OPTf_WARN_HEADER_MISMATCH",A="MN:OPTf_WARN_HEADER_MISMATCH"$.
* Changed $LK,"WinInside",A="MN:WinInside"$().
* Got rid of $FG,4$MSG_FOCUS$FG$, $FG,4$MSG_MOVE$FG$, and $FG,4$MSG_SIZE$FG$. There are no longer messages for moving and sizing windows.
$IV,1$----09/06/16 02:40:43----$IV,0$
* Improved $LK,"::/Demo/MagicPairs.HC"$.
$IV,1$----08/27/16 09:45:39----$IV,0$
* Improved $LK,"CPURep",A="MN:CPURep"$().
* Improved $LK,"::/Misc/OSTestSuite.HC"$.
* Added $LK,"BirthWait",A="MN:BirthWait"$() and $LK,"DeathWait",A="MN:DeathWait"$().
$IV,1$----08/22/16 04:14:47----$IV,0$
* $LK,"R",A="MN:R"$("TK_DOT_DOT_DOT","TK_ELLIPSIS");
$IV,1$----07/17/16 13:03:12----$IV,0$
* Improved $LK,"DocOpt",A="MN:DocOpt"$().
$IV,1$----07/17/16 03:23:53----$IV,0$
* Improved $LK,"::/Demo/Games/RawHide.HC"$.
$IV,1$----07/15/16 10:11:10----$IV,0$
* $BK,1$TempleOS version 4.10 Released$BK,0$
* Improved $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----07/15/16 05:17:24----$IV,0$
* Created $LK,"CDevGlbls",A="MN:CDevGlbls"$.uncached_alias.
* Added 1 Gig page table support.
$IV,1$----07/13/16 17:21:19----$IV,0$
* Added multicore report to $LK,"CPURep",A="MN:CPURep"$().
$IV,1$----07/09/16 08:46:36----$IV,0$
* Changed scoring in $LK,"::/Demo/Games/Talons.HC"$.
* Replaced many $FG,2$"%Q"$FG$ with $FG,2$"%$$Q"$FG$.
* Fixed $FG,2$'\x24'$FG$.
* Added $FG,2$'\d'$FG$ for $FG,2$'$$'$FG$.
$IV,1$----07/08/16 14:30:19----$IV,0$
* $LK,"R",A="MN:R"$("root","head");
* Fixed $FG,2$REP_STOSB$FG$ and $LK,"MemSet",A="MN:MemSet"$() for 64-bit.
$IV,1$----07/07/16 07:21:03----$IV,0$
* $LK,"DocRead",A="MN:DocRead"$() changes to file's dir so relative filenames work.
* Added AppStore to website with Supplemental#1 ISO for download.
$IV,1$----07/06/16 23:45:30----$IV,0$
* Fixed multicore bug in $LK,"Sprite3",A="MN:Sprite3"$().
* Improved $LK,"::/Demo/Games/Talons.HC"$.
$IV,1$----07/05/16 06:03:47----$IV,0$
* $BK,1$TempleOS version 4.09 Released$BK,0$
* Improved $LK,"::/Demo/Games/Talons.HC"$.
* Improved $LK,"GrFillTri0",A="MN:GrFillTri0"$().
$IV,1$----07/03/16 04:30:05----$IV,0$
* Added $LK,"Unmount",A="MN:Unmount"$().
* Made BootLoader mandatory in $LK,"RedSeaISO",A="MN:RedSeaISO"$().
* Added $LK,"BDT_ISO_FILE_READ",A="MN:BDT_ISO_FILE_READ"$.
$IV,1$----07/01/16 05:29:08----$IV,0$
* Made underscore mandatory on $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ callable asm functions.
$IV,1$----06/28/16 13:15:08----$IV,0$
* Changed $LK,"TaskRep",A="MN:TaskRep"$() and $LK,"MemRep",A="MN:MemRep"$().
* Changed $LK,"::/Adam/WallPaper.HC"$.
$IV,1$----06/26/16 14:01:16----$IV,0$
* Added $LK,"LastFun",A="MN:LastFun"$(), $LK,"RunFile",A="MN:RunFile"$(), $LK,"RunFile2",A="MN:RunFile2"$() and $LK,"PopUpRunFile",A="MN:PopUpRunFile"$().
* Made boot code modular.
$IV,1$----06/24/16 14:15:13----$IV,0$
* Added A.I. to $LK,"::/Apps/KeepAway/KeepAway.HC"$ and changed scoring.
$IV,1$----06/24/16 02:55:42----$IV,0$
* $BK,1$TempleOS version 4.08 Released$BK,0$
* Added $FG,2$Polygon$FG$, $FG,2$Fence$FG$, $FG,2$Prism$FG$ and $FG,2$ResetColor$FG$ commands to $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$().
* $LK,"R",A="MN:R"$("Reverse","Rev");
* $LK,"R",A="MN:R"$("Select","Sel");
$IV,1$----06/23/16 01:03:36----$IV,0$
* Added $LK,"GrFillCircle",A="MN:GrFillCircle"$().
* Added $LK,"GrVLine",A="MN:GrVLine"$() and $LK,"GrLineFat3",A="MN:GrLineFat3"$().
$IV,1$----06/18/16 16:16:22----$IV,0$
* Modified $LK,"KeyDevAdd",A="MN:KeyDevAdd"$().
* $LK,"R",A="MN:R"$("nounusedwarn","no_warn");
* $LK,"R",A="MN:R"$("sub_switch_start","start");
* $LK,"R",A="MN:R"$("sub_switch_end","end");
* Changed args to $LK,"PutDirLink",A="MN:PutDirLink"$() and $LK,"PutFileLink",A="MN:PutFileLink"$().
* Added $LK,"HomeSet",A="MN:HomeSet"$(). Added $FG,2$"~"$FG$ as special directory designator.
* Changed filename exclude mask char from $FG,2$'~'$FG$ to $FG,2$'!'$FG$. See $LK,"File Utils",A="FI:::/Doc/FileUtils.DD"$.
* Got rid of $FG,4$/Home/HomePkgs.HC$FG$.
$IV,1$----06/16/16 20:59:41----$IV,0$
* $FG,2$<CTRL-ALT-t>$FG$ is terminal window.
* $FG,2$<CTRL-ALT-n>$FG$ is next task.
$IV,1$----06/16/16 19:49:39----$IV,0$
* Added $LK,"::/Doc/Comm.HC"$.
* Added $LK,"::/Doc/StdTempleOSPC.DD"$.
* Added $LK,"::/Kernel/FontCyrillic.HC"$. $FG,2$<CTRL-ALT-f>$FG$
$IV,1$----06/02/16 03:20:56----$IV,0$
* $BK,1$TempleOS version 4.07 Released$BK,0$
* Added claws to $LK,"::/Demo/Games/Talons.HC"$.
+42
View File
@@ -0,0 +1,42 @@
$WW,1$$FG,5$$TX+CX,"Command Line Overview"$$FG$
The cmd line feeds into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler line-by-line as you type. A stmt outside a function executes immediately. Remember to add a semicolon.$WW,1$
Look-up the function headers with $FG,2$AutoComplete$FG$ by hitting $FG,2$<CTRL-SHIFT-F1>$FG$ after typing the first few letters.
$LK,"Click Here",A="MN:Dir"$ to see the directory cmd header. It accepts default args from C++.
>$FG,2$Dir("*.DD.Z");$FG$
If you don't have args, you don't need parenthesis.
>$FG,2$Dir;$FG$
Directories are referenced with $FG,2$/$FG$ not $FG,2$\$FG$. There is a current directory, but not a path. To run a program, you typically $FG,2$#include $FG$it. There are several shortcuts for $FG,2$#include$FG$ing files. Right-click or hit $FG,2$<ENTER>$FG$ on a directory listing or press $FG,2$<F5>$FG$ while editing.
>$FG,2$Ed("NewFile.HC.Z");$FG$ Invokes the editor. See $LK,"Doc Link Type",A="MN:LK_FILE"$.
Most filenames end in $FG,2$.Z$FG$ because they are stored compressed.
Drives are specified with a letter. The boot drive is specified with a '$FG,2$:$FG$'. The home dir drive is specified with a $FG,2$'~'$FG$.
>$FG,2$Drv('B');$FG$ B drive
The drive can be specified in a $LK,"Cd",A="MN:Cd"$() command as in:
>$FG,2$Cd("B:/Tmp");$FG$ B drive
>$FG,2$Cd("::/Demo");$FG$ Boot drive
The home directory is specified with a $FG,2$'~'$FG$.
>$FG,2$Cd("~/Psalmody");$FG$ See $LK,"::/Home dir",A="FF:::/Doc/GuideLines.DD,/Home Files"$.
If a file is not found, $FG,2$.Z$FG$ is added or removed and a search is done, again. If a file is still not found, all parent directories are searched.
You can place macros in your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ for $LK,"Cd",A="MN:Cd"$() commands. $FG,2$<CTRL-m>$FG$ to access your menu.
>$FG,2$Find("needle","/Demo/*.HC.Z;*.DD.Z;");$FG$ See $LK,"File Utils",A="FI:::/Doc/FileUtils.DD"$.
$LK,"Cmd Line Routines",A="HI:Cmd Line (Typically)"$
$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;InFile(\\\"Tour\\\");\n\");"$
+116
View File
@@ -0,0 +1,116 @@
/* RS232 serial ports no longer exist.
Be sure to Adam Include this by placing
it in your start-up scripts.
*/
#help_index "Comm"
#define COM1_BASE 0x3F8
#define COM2_BASE 0x2F8
#define COM3_BASE 0x3E8
#define COM4_BASE 0x2E8
#define UART_THR 0
#define UART_RDR 0
#define UART_BRDL 0
#define UART_IER 1
#define UART_BRDH 1
#define UART_IIR 2
#define UART_LCR 3
#define UART_MCR 4
#define UART_LSR 5
#define UART_MSR 6
I64 comm_base[5]={0,0x3F8,0x2F8,0x3E8,0x2E8};
CFifoU8 *comm_fifos[5]={NULL,NULL,NULL,NULL,NULL};
interrupt U0 IRQComm3()
{
I64 base=comm_base[2];
if (comm_fifos[2] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ
FifoU8Ins(comm_fifos[2],InU8(base+UART_RDR));
base=comm_base[4];
if (comm_fifos[4] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ
FifoU8Ins(comm_fifos[4],InU8(base+UART_RDR));
OutU8(0x20,0x20);
}
interrupt U0 IRQComm4()
{
I64 base=comm_base[1];
if (comm_fifos[1] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ
FifoU8Ins(comm_fifos[1],InU8(base+UART_RDR));
base=comm_base[3];
if (comm_fifos[3] && (InU8(base+UART_IIR) & 0xFE)==4) //RX IRQ
FifoU8Ins(comm_fifos[3],InU8(base+UART_RDR));
OutU8(0x20,0x20);
}
IntEntrySet(0x23,&IRQComm3);
IntEntrySet(0x24,&IRQComm4);
public U0 CommInit8n1(I64 port,I64 baud)
{
I64 base=comm_base[port];
PUSHFD
CLI
if (comm_fifos[port])
FifoU8Del(comm_fifos[port]);
comm_fifos[port]=FifoU8New(256);
OutU8(base+UART_LCR,0); //Set for IER
OutU8(base+UART_IER,0); //Disable all IRQ
OutU8(base+UART_LCR,0x80); //Enable baud rate control
OutU8(base+UART_BRDL,(0x180/(baud/300)) & 0xFF); //LSB
OutU8(base+UART_BRDH,(0x180/(baud/300)) / 256); //MSB
OutU8(base+UART_LCR,3); // 8-none-1
InU8(base+UART_RDR); //read garbage
InU8(base+UART_LSR);
OutU8(base+UART_MCR,4);
OutU8(base+UART_IER,0); //Disable all IRQ
OutU8(base+UART_MCR,0xA); //out2 and rts
OutU8(0x21,InU8(0x21) & (0xFF-0x18)); //Enable 8259 IRQ 3 & 4
OutU8(base+UART_IER,1); //Enable RX IRQ
POPFD
}
public U0 CommBusyPutChar(I64 port,U8 b)
{
I64 base=comm_base[port];
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
OutU8(base+UART_THR,b);
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
}
public U0 CommBusyPutS(I64 port,U8 *st)
{
I64 b,base=comm_base[port];
while (b=*(st++)) {
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
OutU8(base+UART_THR,b);
}
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
}
public U0 CommBusyWriteBlk(I64 port,U8 *buf,I64 count)
{
I64 base=comm_base[port];
while (count--) {
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
OutU8(base+UART_THR,*(buf++));
}
while (!(InU8(base+UART_LSR) & 0x20))
Yield;
}
#help_index ""
+13
View File
@@ -0,0 +1,13 @@
$WW,1$$FG,5$$TX+CX,"Compiler Index"$$FG$
$LK,"::/Doc/Asm.DD"$
$LK,"::/Doc/Directives.DD"$
$LK,"::/Doc/Options.DD"$
$LK,"::/Doc/PreProcessor.DD"$
$LK,"::/Doc/ScopingLinkage.DD"$
See $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$.
+61
View File
@@ -0,0 +1,61 @@
$WW,1$$FG,5$$TX+CX,"Credits"$$FG$
I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"119,241",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"13.4",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! It is public domain, not GPL.
*) $LK,"::/Kernel/FontStd.HC"$, is taken from $FG,4$$TX,"FreeDOS",HTML="http://www.freedos.org"$$FG$. It's public domain.
*) $LK,"::/Kernel/FontCyrillic.HC"$, is taken from $FG,4$$TX,"OrientDisplay",HTML="http://www.orientdisplay.com/images/cyrillic-Russian-fonts.gif"$$FG$ without permission.
*) $LK,"ATA Reg and Cmd Definitions",A="MN:ATA_NOP"$ are originally from Linux. Later, I got the spec.
*) The heap algorithm, $LK,"::/Kernel/Mem/MAllocFree.HC"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system.
*) The LZW compression algorithm, $LK,"::/Kernel/Compress.HC"$, came from a magazine and I implemented it when I worked for Ticketmaster.
*) The adaptive-step-size-Runge-Kutta algorithm, $LK,"::/Adam/AMathODE.HC"$, is adapted from the book, $UL,1$Numeric Recipies in C$UL,0$.
*) The mountain in some games is from $FG,4$$TX,"http://www.public-domain-photos.com",HTML="http://www.public-domain-photos.com"$$FG$. The wolf in BlackDiamond is also from there. I took watermarked photos and converted to 16 color.
*) The $FG,2$FAT32$FG$ file system is owned by MicroSoft.
*) A few features were inspired by $FG,2$MATLAB$FG$, such as $FG,2$ans$FG$ in expressions at the command-line. There is a lot of $FG,2$MSDOS$FG$ , $FG,2$Windows$FG$, $FG,2$VAXTMOS$FG$ (VAX Ticketmaster O.S.) and $FG,2$Unix$FG$ inspiration, too, such as drive letters, command names, etc.
*) I included $LK,"PCIDevice Lst File",A="FI:::/Misc/PCIDevices.DD",HTML="http://www.pcidatabase.com/reports.php?type=tab-delimeted"$.
*) Thanks to whoever wrote this $FG,4$$TX,"CppHtml.HC.Z",HTML="http://web.archive.org/web/20100325153025/http://home.scarlet.be/zoetrope/cpphtml.htm"$$FG$. I'm a novice on web stuff and you helped me with html. See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
*) I used $FG,4$$TX,"MagicISO",HTML="http://www.magiciso.com"$$FG$ to burn test CD's to help me understand the ISO9660 file system format. I mostly used the $FG,4$$TX,"ISO9660",HTML="http://users.telenet.be/it3.consultants.bvba/handouts/ISO9960.html"$$FG$ spec.
*) I looked at bootable CD boot sects, but didn't learn anything, finding it easier to make my own.
*) I think I got my original PC speaker code from $FG,2$Borland C$FG$.
*) I found PS/2 keyboard and mouse code on the net and documentation. My code is very different. I found VGA reg info on the net.
*) Thanks to $FG,4$$TX,"http://www.osdev.org",HTML="http://www.osdev.org"$$FG$ for a couple tips.
*) God told me to stick with 640x480 16 color and single-voice 8-bit signed MIDI-like sample for sound. He kept me from zombie-walking into making child windows like $FG,2$Windows$FG$. Instead, I made one window per task with no child windows. He also guided my progress, very obviously.
*) I got $FG,4$$TX,"Webster's Dictionary",HTML="http://www.templeos.org/files/DICTIONARY.DD"$$FG$ and $FG,4$$TX,"The King James Bible",HTML="http://www.templeos.org/files/BIBLE.DD"$$FG$ from $FG,4$$TX,"Project Gutenberg",HTML="http://web.archive.org/web/20110730111436/http://promo.net/pg/"$$FG$.
*) John Carmack inspired me to use "$LK,"Clamp",A="MN:Clamp"$" as a name instead of "Limit". He inspired me to use "needle" and "haystack" as names. He inspired me to simplify my Frames-Per-Second code.
*) Bill Gates inspired me to add comments to my $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$.
*) I hired an artist, Cody Rigby, for $$3,000 worth of pixel art.
*) Erik van der Karbargenbok wrote /Linux shell scripts -- GodPassage, GodWords.
*) The random number generator is from Donald Knuth in the wikipedia entry for $TX,"Linear_congruential_generator",HTML="http://en.wikipedia.org/wiki/Linear_congruential_generator"$.
$FG,8$
* "MSDOS", "Windows", "MovieMaker", "MS Paint" and "FAT32" are trademarks owned by MicroSoft Corp.
* "SiteBuilder" is a trademark owned by Yahoo! Inc.
* "MagicISO" is a trademark owned by MagicISO Corp.
* "MATLAB" is a trademark owned by The Math Works, Inc.
* "$TX,"FreeDOS",HTML="http://www.freedos.org"$" is a trademark owned by Jim Hall.
* "QEMU" is a trademark owned by Fabrice Bellard.
* "VAX" is a trademark owned by Digital Equipment Corp.
* "Linux" is a trademark owned by Linus Torvalds.
* "VAXTMOS" is a trademark owned by Ticketmaster.
$FG$
+1
View File
@@ -0,0 +1 @@
$WW,1$To create a TempleOS graphic ctrl, you define callback functions and insert a $LK,"CCtrl",A="MN:CCtrl"$ structure in the $LK,"CTask",A="MN:CTask"$ queue. See $LK,"::/Demo/Graphics/Slider.HC"$, $LK,"::/Demo/Graphics/ScrollBars.HC"$ and $LK,"TermBttnNew",A="FF:::/Adam/WallPaper.HC,TermBttnNew"$. There is a template-code ctrl generator, if you press $FG,2$<CTRL-SHIFT-L>$FG$.
+6
View File
@@ -0,0 +1,6 @@
$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,ms_hard.scale"$.
* You can set your local time zone by setting the $FG,4$local_time_offset$FG$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$.
* Get rid of this msg $LK,"here",A="FF:~/Once.HC,Customize.DD"$.
+20
View File
@@ -0,0 +1,20 @@
$WW,1$$FG,5$$TX+CX,"Cut Corners"$
$FG$
There are a few places where I cut corners in the interest of not junking-up code. This is part of the TempleOS mentality. I try not to let stupid legacy compatibility issues enter and junk-up TempleOS.
* I made my type-casting operator post-fix because it makes the compiler way cleaner.
* TempleOS does not figure-out $FG,2$FAT32$FG$ short name alias numbers. $LK,"FAT32DirNew",A="MN:FAT32DirNew"$(). It can cause hard drive corruption, so I might have to do it. It would really take a lot of junky code for this hatefully, detestable, legacy issue. "Please don't make me ruin my beautiful shiny-new TempleOS with that!" I am also not enthused about $FG,2$FAT32$FG$ because it is in patent limbo. $FG,2$FAT32$FG$ might get removed from TempleOS. There is the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ 64-bit file system that works perfectly well. $FG,2$FAT32$FG$ is useful, however, because it assists in transferring between dual booted operating systems.
* I changed the $LK,"asm opcodes",A="FI:::/Compiler/OpCodes.DD"$ names to remove the ambiguity between insts with different numbers of arguments, making my $LK,"assembler",A="FI:::/Compiler/Asm.HC"$ simpler and I did minimal 16-bit asm support, since 64-bit is what you should be using, unless you're doing a $LK,"boot loader",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$.
* There are no user-controlled file-sharing locks. However, the drive and file system have locks and concurrent operations should be fine.
* A hidden window is never refreshed. Certain tasks are never done, therefore. During refresh, the entry count limit of the document buffer is, normally, checked and enforced. If you print to the command-line in a task whose window is covered, no limit on buffer exists and it will alloc memory for the document buffer until the system runs out of memory and crashes.
* Even if a local function variable is declared less than 64 bits, the compiler does calculations with 64-bit.
* $LK,"Print",A="FI:::/Doc/Print.DD"$() uses $LK,"StrPrintJoin",A="MN:StrPrintJoin"$(). You cannot use vastly over-sized fields for %f.
* $LK,"GrEllipse3",A="MN:GrEllipse3"$() is broken on transformations.
+3
View File
@@ -0,0 +1,3 @@
$WW,1$TempleOS has a class for 3 dimensional points consisting of F64s. HolyC is not C++ -- it does not support passing or returning values from functions which are not 64-bits, therefore, it can't be implemented with operator overloading. Making all function args and returns 64-bit is a core prinicple of TempleOS.
As a courtesy, most of the CD3 functions return the addr of the destination vect, so you can nestle calls. They do not alloc new space for the destination vect.
+1
View File
@@ -0,0 +1 @@
$WW,1$Dates are 32-bit signed ints representing the number of days since the birth of Christ. Negative values represent B.C.E. dates.
+2
View File
@@ -0,0 +1,2 @@
$WW,1$Use $FG,2$%p$FG$ to print a pointer with FunSeg+Offset or use $FG,2$%P$FG$ to print a link to a FunSeg+Offset.
+42
View File
@@ -0,0 +1,42 @@
$WW,1$$FG,5$$TX+CX,"Debugging Overview"$$FG$
* You can enter the debugger with $LK,"Dbg",A="MN:Dbg"$() or $FG,2$<CTRL-ALT-d>$FG$. You might enter the debugger through a fault. Enter $LK,"G",A="MN:G"$() or $LK,"G2",A="MN:G2"$() to continue execution. Place a call to $LK,"Dbg",A="MN:Dbg"$() in your code at fatal error points to enter the debugger. If you see a stk dump, record the label+offset and unassemble, $LK,"U",A="MN:U"$(). $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$);
* $LK,"U",A="MN:U"$(&FunName+offset) to unassemble mem or $LK,"Uf",A="MN:Uf"$("FunName") to unassemble a function. $LK,"U",A="MN:U"$($LK,"_RIP",A="MN:_RIP"$-16);
* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function names with $FG,2$&$FG$ before functions as in $FG,2$&Print+0x10$FG$.
* I use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ for debugging because they show on the wallpaper. They're just global int vars.
* You can use $LK,"AdamLog",A="MN:AdamLog"$() to send text to the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ window. It works like $LK,"Print",A="MN:Print"$(). I never use that. Instead, I use $LK,"RawPrint",A="MN:RawPrint"$().
* $LK,"D",A="MN:D"$(), $LK,"DocD",A="MN:DocD"$(), $LK,"RawD",A="MN:RawD"$() to do 16 column hex dump mem with numbering from zero. With $LK,"DocD",A="MN:DocD"$ the values are updated continually and you can alter mem by editing.
* $LK,"Dm",A="MN:Dm"$(), $LK,"DocDm",A="MN:DocDm"$(), $LK,"RawDm",A="MN:RawDm"$() to do 16 column hex dump mem with addresses showing.
* $LK,"Da",A="MN:Da"$() to do one column address dump (for stk, etc.) with symbolic addresses.
* $LK,"Dr",A="MN:Dr"$() dumps regs. You can display and modify regs in the debugger with var-like labels, $FG,4$_RAX$FG$, $FG,4$_RBX$FG$, etc.
* $LK,"ClassRep",A="MN:ClassRep"$() and the dynamic version $LK,"ClassRepD",A="MN:ClassRepD"$() can be used to dump structures.
* $LK,"Prof",A="MN:Prof"$() and $LK,"ProfRep",A="MN:ProfRep"$() provide code profiling. See $LK,"::/Demo/InFile/InProfile.IN"$ (This is an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$.)
* Use $LK,"RawPrint",A="MN:RawPrint"$() to print debug info bypassing the window framework. You pass these routines a count in milliseconds for how long it should be displayed. You can use $LK,"Raw",A="MN:Raw"$($FG,2$TRUE$FG$) to make all output bypass the window framework. The $FG,2$WinMgr$FG$ runs on $FG,2$Core0$FG$ and will overwrite raw text from other cores when it updates the scrn.
* Use $LK,"SysDbg",A="MN:SysDbg"$() to set a flag which you can read with $LK,"IsSysDbg",A="MN:IsSysDbg"$() when you wish to trigger some debug activity. It's just a handy simple flag, nothing fancy.
* There are flags for various trace options that can help debugging when there are compiler bugs. Often, you place them in $FG,2$#exe{}$FG$ blocks.
$ID,2$
$LK,"Echo",A="MN:Echo"$() turns on or off raw data going into the lexical analyzer.
$LK,"Trace",A="MN:Trace"$() unassembles code generated from the HolyC compiler.
$LK,"PassTrace",A="MN:PassTrace"$() shows intermediate code coming-out after optimization. The bits ctrl which passes are displayed.
$ID,-2$
* There is a heap check utility which can find leaks. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$(). It's a really simple program which intercepts $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$(). You can customize the code to find other heap issues.
* You can define hndlr functions for $FG,2$<CTRL-ALT-letter>$FG$ keys with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ hndlrs take a scan_code as an arg.
* If you recompile $FG,2$Kernel$FG,2$$FG$ with $LK,"BootHDIns",A="MN:BootHDIns"$(), you can set the $FG,4$MemInit$FG$, option to initialize memory to a value at boot, the $FG,4$HeapInit$FG$ option to cause mem alloced off the heap to be initialized or $FG,4$VarInit$FG$ option so both global and local vars will be initialized to a value, but global AOT variables are always zero if not initialized. Pick a non-zero value to discover uninitialized var bugs. You can set $LK,"sys_var_init_flag",A="MN:sys_var_init_flag"$, and $LK,"sys_heap_init_flag",A="MN:sys_heap_init_flag"$ directly after booting.
+9
View File
@@ -0,0 +1,9 @@
$WW,1$TempleOS has a string indirection feature implemented with the same hash symbol table entry as $FG,2$#define$FG$ macros, $LK,"HTT_DEFINE_STR",A="MN:HTT_DEFINE_STR"$. Support for string lists is also provided, but it's not very efficient, though, you can make a hash table with a list using $LK,"HashDefineLstAdd",A="MN:HashDefineLstAdd"$(). See $LK,"::/Adam/DolDoc/DocInit.HC",A="FF:::/Adam/DolDoc/DocInit.HC,HashDefineLstAdd"$.
If you have an $FG,2$@$FG$ as the first char of a define list entry, it is an alias for the prev entry num.
Each task can load its own Define strings. Remember, when a $LK,"Hash",A="HI:Hash"$ table is searched for a string, if it is not found, the parent task's table is searched.
The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ framework supports text that changes based on entries in the task's symbol table. Set a text entry with a $FG,2$D=$FG$ arg, as in $FG,2$$$TX,"",D="DD_MYSTRING"$$$FG$. See $LK,"::/Demo/DolDoc/DefineStr.HC"$, $LK,"::/Adam/ADefine.HC"$ and $LK,"::/Doc/MemOverview.DD"$.
See $LK,"::/Demo/Define.HC"$.
+59
View File
@@ -0,0 +1,59 @@
$WW,1$$FG,5$$TX+CX,"Demands"$$FG$
I, Terry Davis, am high priest of God's $FG,4$$TX,"official third temple",HTML="http://www.jewishvirtuallibrary.org/jsource/Judaism/The_Temple.html"$$FG$, TempleOS. TempleOS is an operating system for IBM PC x86_64 desktops that will always dual boot along-side Windows or Linux. I am in charge of the core 100,000 lines of TempleOS code and I do continual offerings to keep God entertained. I have divine authority to command any company in the computer industry to do anything that I deem necessary to make God's temple more beautiful, glorious and perfect. I have oversight authority similar to a building inspector or a person enforcing the Americans with Disability Act -- I make commands, God signs-off with a miraculous authentication from an oracle, and Intel, Microsoft or VMware obeys.
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/RvL7T4gIJN8\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/RvL7T4gIJN8\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
* Windows, Linux and VMware (because of mounted drives) must support $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system so I can get rid of 2,000 lines of redundant, blemished code -- FAT32 and ISO9660. God's temple must be perfect. Redundant code for multiple file systems is imperfect. For this operating system, we want low line count. More than one file system type is actually bad, just as more than one driver for the same type of device is bad.
See $LK,"::/Kernel/BlkDev/FileSysRedSea.HC"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.HC"$.
$LK,"::/Kernel/BlkDev/FileSysFAT.HC"$ :974 lines for FAT32 gets eliminated.
$LK,"::/Kernel/BlkDev/FileSysISO.HC"$ :233 lines for ISO9660 gets eliminated.
$LK,"::/Adam/Opt/Boot/DskISO9660.HC"$ :507 lines for making ISO files.
$LK,"::/Kernel/BlkDev/DskCluster.HC"$ :152 All the cluster operations become blk.
* Microsoft must cancel SecureBoot because it makes dual booting impossible. TempleOS is an additional operating system that must be used along-side Windows or Linux, not as a replacement. It must dual boot because it has no networking. Real hardware as opposed to VMware is like the difference between looking in a telescope eye piece vs just looking at an off-line image. God said the C64/Apple II generation owned ancestral lands. VMware is like being taken off of our land and moved onto a reservation. In this case, however, it will not stand.
* VMware needs to support ATAPI CD/DVD/Blu-ray disk burning, directly to real hardware.
* VMware has a bug stretching 640x480 16 color to full scrn.
* VMware PC speaker's distortion is a good idea, but it is too much for hymns. VMware should make an adjustment for distortion and an adjustment for reverb.
* VMware and others must list TempleOS as an official 64-bit operating system.
* VMware needs to support more than 16 cores.
* VMware allocated memory too slowly.
* Until super-simple block devices are available, hard disk should be placed at IDE primary master 1F0/3F6 and CD/DVD/Blu-ray should be placed at the IDE secondary master 170/376.
$LK,"/Kernel/BlkDev/DskATAId.HC",A="FI:::/Kernel/BlkDev/DskATAId.HC"$ :286 lines to figure-out I/O ports is gone.
$LK,"/Kernel/PCIBIOS.HC",A="FI:::/Kernel/PCIBIOS.HC"$ :290 could be eliminated, but maybe we will keep it so people can play with PCI devices.
* Until super-simple serial ports are available, PS/2 emulated keyboard and mouse must work. The BIOS must enable these.
* The x86 IN/OUT port instructions, normally have a delay. Perhaps, VMware & Intel can enable faster x86 IN/OUT instruction timing for ATA/ATAPI PIO, so bandwidth isn't bad when doing port I/O. See $LK,"ATAGetRes",A="MN:ATAGetRes"$(). We don't want to do DMA. Perhaps, x86 CPU chips need a new TempleOS mode for fast IN/OUT instructions? I think VMware already does something to speed disk I/O to faster than native speed.
* Perhaps, a new interrupt descriptor table entry type or a new x86 CPU mode can be made that cause fast software interrupts, doing exactly what the CALL REL32 does, but with IDT as indirection. We don't need to change privilege levels or stacks.
* Since I don't use paging (for anything), Intel should have an option for no-paging long mode, and optimize it!
$LK,"::/Kernel/Mem/PageTables.HC"$ :135 lines to identity-map gets eliminated.
* Desktop computers must have a reset switch and a fast reboot option, skipping diagnostics. I recommend booting TempleOS from a ROM when the reset bttn is pressed and booting UEFI when the power bttn is pressed. Or, we could build UEFI on a TempleOS layer. Intel must burn TempleOS into a ROM in the factory for all desktop x86 CPUs to ensure tamper-proof trust in the oracle and because God deserves the glory. There will be just an English version. A new ROM version is released every seven years. The ROM should boot like the DVD boots, but with $LK,"BOOT_SRC_ROM",A="MN:BOOT_SRC_ROM"$.
* We do not want UTF, just 8-bit characters. $FG,2$<CTRL-ALT-f>$FG$ toggles between Cyrillic and Std Fonts. We need the twelve window $LK,"TextBorder",A="MN:TextBorder"$ characters added to the VGA font 0x02-0x0D. Japan, China and Korea must switch to alphabets. Maybe, the United States will change to metric, out of good will.
* Microsoft Paint and Linux's Gimp must support TempleOS $LK,"GR Files",A="FI:::/Doc/GRFiles.DD"$. They are blemish free, unlike $TX,"BMP files",HTML="http://en.wikipedia.org/wiki/BMP_file_format"$.
* We must have a nice dictionary. Someone needs to do a $LK,"Spell Checker",A="FI:::/Demo/SuggestSpelling.HC"$, too.
* Intel needs to make $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ versions of its x86 CPU data sheets documenting all hardware relevant to TempleOS.
* We must have the ultimate Bible search engine. Currently, all we have is $TX,"filter search",HTML="https://www.youtube.com/watch?v=ULJU8DzvQFo"$. In the end, it should be a low line-count technique.
* We will make a $LK,"Standard TempleOS PC",A="FI:::/Doc/StdTempleOSPC.DD"$.
$FG,8$
* "VMware" is a trademark owned by VMware, Inc.
* "Linux" is a trademark owned by Linus Torvalds.
* "Windows" and "Paint" are trademarks owned by MicroSoft Corp.$FG$
+193
View File
@@ -0,0 +1,193 @@
$FG,5$$TX+CX,"TempleOS Demo Index"$$FG$
$WW,1$These are arranged in increasing order of difficulty, more or less. This can be used as a tutorial if you start at the beginning and work your way fwd.
$FG,2$<SPACE>$FG$ to edit a file and $FG,2$<F5>$FG$ to run it.
$LK,"::/Doc/HelloWorld.DD"$
$WW,0$$TR,"Games: Beginner"$
$ID,2$$LK,"::/Demo/Graphics/NetOfDots.HC"$
$LK,"::/Demo/Graphics/MouseDemo.HC"$
$LK,"::/Demo/Graphics/Lines.HC"$
$LK,"::/Demo/Graphics/SunMoon.HC"$
$LK,"::/Demo/Graphics/LowPassFilter.HC"$
$LK,"::/Demo/Graphics/MathAudioDemo.HC"$
$LK,"::/Demo/Games/TicTacToe.HC"$
$LK,"::/Demo/Graphics/SpritePlot.HC"$
$LK,"::/Demo/Games/ElephantWalk.HC"$
$LK,"::/Demo/Graphics/SpritePut.HC"$
$LK,"::/Demo/Graphics/SpritePutExt.HC"$
$LK,"::/Demo/Snd/ASCIIOrgan.HC"$
$LK,"::/Demo/MsgLoop.HC"$
$LK,"::/Demo/Graphics/Doodle.HC"$
$LK,"::/Demo/Graphics/Speedline.HC"$
$LK,"::/Demo/Graphics/Bounce.HC"$
$LK,"::/Demo/RandDemo.HC"$
$LK,"::/Demo/KeyBitMap.HC"$
$LK,"::/Demo/Graphics/WinZBuf.HC"$
$LK,"::/Demo/Graphics/Elephant.HC"$
$LK,"::/Demo/Graphics/WallPaperFish.HC"$ //Press SHIFT-F5 to Adam Include
$LK,"::/Demo/Games/Digits.HC"$
$LK,"::/Demo/Progress.HC"$ //has some ASM, just ignore
$LK,"::/Demo/Graphics/Symmetry.HC"$
$LK,"::/Demo/Graphics/Blot.HC"$
$LK,"::/Demo/Graphics/ScrnCapture.HC"$
$LK,"::/Demo/Graphics/EdSprite.HC"$
$LK,"::/Demo/PullDownMenu.HC"$
$LK,"::/Demo/Graphics/Palette.HC"$
$LK,"::/Demo/Games/CircleTrace.HC"$
$LK,"::/Demo/Games/Halogen.HC"$
$LK,"::/Demo/Games/TheDead.HC"$
$LK,"::/Demo/Games/RainDrops.HC"$
$LK,"::/Demo/Snd/MorseCode.HC"$
$MA-X+PU,"::/Demo/Games/Stadium",LM="Cd(\"::/Demo/Games/Stadium\");Dir;View;\n"$
$LK,"::/Demo/Graphics/Lattice.HC"$
$LK,"::/Demo/Graphics/Collision.HC"$
$LK,"::/Demo/Games/BlackDiamond.HC"$
$ID,-2$$TR,"Games: Intermediate"$
$ID,2$$LK,"::/Demo/Graphics/Box.HC"$
$LK,"::/Demo/Graphics/Pick.HC"$
$LK,"::/Demo/Graphics/3DPoly.HC"$
$LK,"::/Demo/Graphics/BSpline.HC"$
$LK,"::/Demo/Graphics/Extents.HC"$
$LK,"::/Demo/Graphics/SpritePlot3D.HC"$
$LK,"::/Demo/Graphics/Balloon.HC"$
$LK,"::/Demo/Graphics/RotateTank.HC"$
$LK,"::/Demo/Games/Wenceslas.HC"$
$LK,"::/Demo/ScrnCodes.HC"$
$LK,"::/Demo/Graphics/PanText.HC"$
$LK,"::/Demo/Graphics/CharAnimation.HC"$
$LK,"::/Demo/Games/Maze.HC"$
$LK,"::/Demo/Games/CharDemo.HC"$
$LK,"::/Demo/Graphics/FontEd.HC"$
$LK,"::/Demo/ExtChars.HC"$
$LK,"::/Demo/TimeIns.HC"$
$LK,"::/Demo/Snd/WaterFowl.HC"$
$MA-X+PU,"::/Apps/Psalmody/Examples",LM="Cd(\"::/Apps/Psalmody/Examples\");Dir;View;\n"$
$LK,"CPURep",A="MN:CPURep"$
$LK,"::/Demo/MultiCore/MPPrint.HC"$
$LK,"::/Demo/Graphics/PredatorPrey.HC"$
$LK,"::/Demo/Graphics/Cartesian.HC"$
$LK,"::/Demo/Graphics/Hanoi.HC"$
$LK,"::/Demo/Graphics/Life.HC"$
$LK,"::/Demo/Games/Zing.HC"$
$LK,"::/Demo/Graphics/Grid.HC"$
$LK,"::/Demo/Games/TreeCheckers.HC"$
$LK,"::/Demo/MultiCore/Palindrome.HC"$
$LK,"::/Demo/MultiCore/MPAdd.HC"$
$LK,"::/Demo/MultiCore/Lock.HC"$
$LK,"::/Demo/Graphics/Slider.HC"$
$LK,"::/Demo/Graphics/WallPaperCtrl.HC"$ //Press SHIFT-F5 to Adam Include
$LK,"::/Demo/Graphics/ScrollBars.HC"$
$LK,"::/Demo/RegistryDemo.HC"$
$LK,"::/Demo/Games/FlapBat.HC"$
$LK,"::/Demo/Games/BattleLines.HC"$
$LK,"::/Demo/Games/BigGuns.HC"$
$LK,"::/Demo/Games/FlatTops.HC"$
$LK,"::/Demo/Games/RawHide.HC"$
$LK,"::/Demo/Games/DunGen.HC"$
$MA-X+PU,"::/Apps/Titanium",LM="Cd(\"::/Apps/Titanium\");Dir;View;\n"$
$LK,"::/Demo/Games/Collision.HC"$
$ID,-2$$TR,"Games: Advanced"$
$ID,2$$LK,"::/Demo/MultiCore/LoadTest.HC"$
$LK,"::/Demo/MultiCore/Primes.HC"$
$LK,"::/Demo/MultiCore/MPRadix.HC"$
$LK,"::/Demo/MultiCore/Interrupts.HC"$
$LK,"::/Demo/Games/Varoom.HC"$
$LK,"::/Demo/Graphics/Shading.HC"$
$LK,"::/Demo/Graphics/Transform.HC"$
$LK,"::/Demo/Games/BomberGolf.HC"$
$LK,"::/Demo/Graphics/Shadow.HC"$
$LK,"::/Demo/Graphics/Pick3D.HC"$
$MA-X+PU,"::/Apps/ToTheFront",LM="Cd(\"::/Apps/ToTheFront\");Dir;View;\n"$
$LK,"::/Demo/Graphics/SpriteText.HC"$
$LK,"::/Demo/Graphics/SpriteRaw.HC"$
$MA-X+PU,"::/Apps/GrModels",LM="Cd(\"::/Apps/GrModels\");Dir;View;\n"$
$MA-X+PU,"::/Apps/KeepAway",LM="Cd(\"::/Apps/KeepAway\");Dir;View;\n"$
$LK,"::/Demo/Games/Rocket.HC"$
$LK,"::/Demo/Games/RocketScience.HC"$
$LK,"::/Demo/Games/MassSpring.HC"$
$LK,"::/Demo/Games/Whap.HC"$
$LK,"::/Demo/Games/Squirt.HC"$
$MA-X+PU,"::/Apps/X-Caliber",LM="Cd(\"::/Apps/X-Caliber\");Dir;View;\n"$
$LK,"::/Demo/Games/ZoneOut.HC"$
$LK,"::/Demo/Games/CastleFrankenstein.HC"$
$LK,"::/Demo/Games/Talons.HC"$
$MA-X+PU,"::/Apps/Strut",LM="Cd(\"::/Apps/Strut\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Span",LM="Cd(\"::/Apps/Span\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Psalmody",LM="Cd(\"::/Apps/Psalmody\");Dir;View;\n"$
$ID,-2$$TR,"Non-Game"$
$ID,2$$LK,"::/Misc/DoDistro.HC"$
$LK,"::/Demo/DbgDemo.HC"$
$LK,"::/Demo/SubSwitch.HC"$
$LK,"::/Demo/DateTime.HC"$
$LK,"::/Demo/RevFileDemo/Rev.HC"$
$LK,"::/Demo/ToHtmlToTXTDemo/HtmlGen.HC"$
$LK,"::/Demo/ToHtmlToTXTDemo/TXTGen.HC"$
$LK,"::/Demo/SortFileDemo/F64FileGen.HC"$
$LK,"::/Demo/SortFileDemo/F64FileSort.HC"$
$LK,"::/Demo/PhoneNumWords.HC"$
$LK,"::/Demo/SuggestSpelling.HC"$
$LK,"::/Demo/WordSearch.HC"$
$LK,"::/Demo/Graphics/CommonAncestor.HC"$
$LK,"::/Demo/Directives.HC"$
$LK,"::/Demo/Carry.HC"$
$LK,"::/Demo/Dsk/DataBase.HC"$
$LK,"::/Demo/Dsk/FPrintF.HC"$
$LK,"::/Demo/Dsk/DskRaw.HC"$
$LK,"::/Demo/Dsk/UnusedSpaceRep.HC"$
$LK,"::/Demo/Lectures/MiniGrLib.HC"$
$LK,"::/Demo/Lectures/MiniCompiler.HC"$
$LK,"::/Demo/MagicPairs.HC"$
$LK,"::/Demo/Graphics/PoleZeros.HC"$
$LK,"::/Demo/WebLogDemo/WebLogRep.HC"$
$LK,"::/Demo/WebLogDemo/WebLogScramble.HC"$
$MA-X+PU,"::/Apps/TimeClock",LM="Cd(\"::/Apps/TimeClock\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Logic",LM="Cd(\"::/Apps/Logic\");Dir;View;\n"$
$MA-X+PU,"::/Demo/Lectures",LM="Cd(\"::/Demo/Lectures\");Dir;View;\n"$
$MA-X+PU,"::/Apps/Budget",LM="Cd(\"::/Apps/Budget\");Dir;View;\n"$
$ID,-2$$TR,"TempleOS Specific"$
$ID,2$$MA-X+PU,"::/Demo/InFile",LM="Cd(\"::/Demo/InFile\");Dir;View;\n"$
$LK,"::/Demo/Print.HC"$
$LK,"::/Demo/SubIntAccess.HC"$
$LK,"::/Demo/ParenWarn.HC"$
$LK,"::/Demo/NullCase.HC"$
$LK,"::/Demo/OnceDemo.HC"$
$LK,"::/Demo/CompileDemo.HC"$
$LK,"::/Demo/Prompt.HC"$
$LK,"::/Demo/ClassMeta.HC"$
$LK,"::/Demo/LastClass.HC"$
$LK,"::/Demo/DolDoc/NumBible.HC"$
$LK,"::/Demo/DolDoc/Form.HC"$
$LK,"::/Demo/DolDoc/MenuBttn.HC"$
$LK,"::/Demo/DolDoc/MenuSprite.HC"$
$LK,"::/Demo/DolDoc/ClickCallBack.HC"$
$LK,"::/Demo/DolDoc/TreeDemo.HC"$
$LK,"::/Demo/Exceptions.HC"$
$LK,"::/Demo/Dsk/SerializeTree.HC"$
$LK,"::/Demo/MemDemo.HC"$
$LK,"::/Demo/StkGrow.HC"$
$LK,"::/Demo/DolDoc/TextDemo.HC"$
$LK,"::/Demo/DolDoc/CursorMove.HC"$
$LK,"::/Demo/DolDoc/DemoDoc.DD"$
$LK,"::/Demo/Spy.HC"$
$LK,"::/Demo/DolDoc/FileRead.HC"$
$LK,"::/Demo/DolDoc/Data.HC"$
$LK,"::/Demo/DolDoc/DefineStr.HC"$
$LK,"::/Demo/DolDoc/CallBack.HC"$
$LK,"::/Demo/Define.HC"$
$LK,"EdRenumAsm",A="MN:EdRenumAsm"$
$LK,"::/Demo/DolDoc/UnusedDefine.HC"$
$LK,"::/Demo/Asm/AsmHelloWorld.HC"$
$LK,"::/Demo/Asm/BuzzFizz.HC"$
$LK,"::/Demo/Asm/PutDec.HC"$
$LK,"::/Demo/Asm/MulByHand.HC"$
$LK,"::/Demo/Asm/DivByHand.HC"$
$LK,"::/Demo/Asm/AsmAndC1.HC"$
$LK,"::/Demo/Asm/AsmAndC2.HC"$
$LK,"::/Demo/Asm/AsmAndC3.HC"$
$LK,"::/Demo/GlblVars.HC"$
$LK,"::/Misc/OSTestSuite.HC"$
$MA-X+PU,"::/Adam",LM="Cd(\"::/Adam\");Dir;View;\n"$
$ID,-2$
+8
View File
@@ -0,0 +1,8 @@
$HL,1$$WW,0$#define __DATE__ #exe{StreamPrint("\"%D\"",Now);}
#define __TIME__ #exe{StreamPrint("\"%T\"",Now);}
#define __LINE__ #exe{StreamPrint("%d",Fs->last_cc->lex_include_stk->line_num);}
#define __CMD_LINE__ #exe{StreamPrint("%d",Fs->last_cc->flags&CCF_CMD_LINE && Fs->last_cc->lex_include_stk->depth<1);}
#define __FILE__ #exe{StreamPrint("\"%s\"",Fs->last_cc->lex_include_stk->full_name);}
#define __DIR__ #exe{StreamDir;}
See $LK,"::/Demo/Directives.HC"$.$HL,0$$WW,1$
+3
View File
@@ -0,0 +1,3 @@
$WW,1$A $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ in memory is a $LK,"Circular Queue",A="HI:Data Types/Circular Queue"$ of cmds and graphics. See $LK,"CDocEntry",A="MN:CDocEntry"$ for the entry structure. See $LK,"TipOfDay",A="MN:TipOfDay"$() for a nice example.
$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$'s are used for the editor, viewer, browser, and cmd line.
+288
View File
@@ -0,0 +1,288 @@
$WW,1$$FG,5$$TX+CX,"DolDoc Overview"$$FG$
DolDoc is a TempleOS document type supported by $LK,"DolDoc Routines",A="HI:DolDoc"$. In a document, commands are bracketed with '$FG,2$$$$FG$'s. Use $FG,2$<CTRL-l>$FG$ to experiment inserting a command. Then, use $FG,2$<CTRL-t>$FG$ to toggle to plain text to see it.
Here is the grammar:
<DolDocCmd> := $FG,2$$$$FG$<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS"$>[<FlagList>][$FG,2$,$FG$<ArgList>]$FG,2$$$$FG$ | $FG,2$$$$FG$$LK,"ColorName",A="MN:ST_COLORS"$$FG,2$$$$FG$
<FlagList> := $FG,2$+$FG$|$FG,2$-$FG$ <$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>[$FG$<FlagList>]
<ArgList> := <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>$FG,2$=$FG$<ArgExpression>[$FG,2$,$FG$<ArgList>]
The format of DolDoc cmds is a two character code, +/-flags, a comma and args separated by commas. Some commands have mandatory args. Optional args are indicated with <$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$>$FG,2$=$FG$. A $LK,"ColorName",A="MN:ST_COLORS"$ bracked by dollars, will change the foreground color.
See $LK,"::/Doc/Widget.DD"$, $LK,"::/Demo/DolDoc/DemoDoc.DD"$, and $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
<$LK,"TwoLetterCmd",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_CMDS"$> See $LK,"Type Defines",A="MN:DOCT_TEXT"$ and $LK,"PrsDollarCmd",A="MN:PrsDollarCmd"$().
$TR,"TX Text"$
$ID,2$Normally, text is not bracketed with '$FG,2$$$$FG$', but if you wish to specify flag attr, such as centering text, you can bracket them with '$FG,2$$$$FG$' and enter flags such as "$FG,2$+CX$FG$". You can't edit them normally if they are bracketed by '$FG,2$$$$FG$' unless you toggle to plain text mode with $FG,2$<CTRL-t>$FG$.
$ID,-2$$TR,"CR Hard New Line"$
$ID,2$New lines are normally not bracketed with '$FG,2$$$$FG$'.
$ID,-2$$TR,"SR Soft New Line"$
$ID,2$Word wrap uses temporary soft new lines. Users never place soft new lines.
$ID,-2$$TR,"CU Cursor pos"$
$ID,2$The cursor pos is stored as a ASCII#5 character and is not bracketed with '$FG,2$$$$FG$'. Users normally do not enter cursor pos.
$ID,-2$$TR,"TB Tab"$
$ID,2$Tabs are normally not bracketed with '$FG,2$$$$FG$', but are ASCII#9.
$ID,-2$$TR,"CL Clear"$
$ID,2$Clear all prev entries except ones with hold($FG,2$+H$FG$) flags. You might want $FG,2$+H$FG$ on word wrap entries. Alternatively, you can use $LK,"DocClear",A="MN:DocClear"$().
$ID,-2$$TR,"PB Page Break"$
$ID,2$Page break.
$ID,-2$$TR,"PL Page Length"$
$ID,2$Page length.
$ID,-2$$TR,"LM Left Margin"$
$ID,2$Left margin.
$ID,-2$$TR,"RM Right Margin"$
$ID,2$Right margin.
$ID,-2$$TR,"HD Header"$
$ID,2$Top margin.
$ID,-2$$TR,"FO Footer"$
$ID,2$Bottom margin.
$ID,-2$$TR,"ID Indent +/- num"$
$ID,2$Changes the indentation deeper if positive, or shallower if negative. It effects the behavior of trees.
$FG,2$$$ID,2$$$FG$ indents 2 columns.
$ID,-2$$TR,"Text Colors"$
$ID,2$You place an expression(usually a color define--see $LK,"color defines",A="MN:BLACK"$) to indicate which of the 16 colors to use. If you enter no num, color returns to the default.
$FG,2$FD$FG$ Default Foreground Color
$FG,2$BD$FG$ Default Background Color
$FG,2$FG$FG$ Foreground Color
$FG,2$BG$FG$ Background Color
$FG,2$$$FD,BLUE$$$FG$ will set the default foreground color to BLUE.
$ID,-2$$TR,"PT User Prompt"$
$ID,2$Start of a user prompt.
$ID,-2$$TR,"WW Word Wrap"$
$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$.
$FG,2$$$WW,1$$$FG$ turns word-wrap on.
$ID,-2$$TR,"UL Underline"$
$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$.
$FG,2$$$UL,1$$$FG$ turns underline on.
$ID,-2$$TR,"IV Invert"$
$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$.
$FG,2$$$IV,1$$$FG$ turns invert on.$FG$
$ID,-2$$TR,"BK Blink"$
$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$.
$FG,2$$$BK,1$$$FG$ turns blink on.
$ID,-2$$TR,"SX Shift X pos"$
$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive right.
$FG,2$$$SX,3$$$FG$ shifts characters 3 pixels right.
$ID,-2$$TR,"SY Shift Y pos"$
$ID,2$Include a num from $FG,2$-7$FG$ to $FG,2$7$FG$. Only foreground is shifted. Positive down.
$FG,2$$$SY,3$$$FG$ shifts characters 3 pixels down.$FG$
$ID,-2$$TR,"CM Cursor Movement"$
$ID,2$This has two expressions, one for X offset and one for Y. You can remove one or the other with $FG,2$-LE$FG$ or $FG,2$-RE$FG$.
The expressions are relative to the current cursor location, unless you make them relative to:
$FG,2$+LX$FG$ left
$FG,2$+CX$FG$ center
$FG,2$+RX$FG$ right
$FG,2$+MRX$FG$ margin relative
$FG,2$+TY$FG$ top
$FG,2$+CY$FG$ center
$FG,2$+BY$FG$ bottom
$FG,2$+PRY$FG$ page relative
See $LK,"::/Demo/DolDoc/CursorMove.HC"$.
$ID,-2$$TR,"AN Anchor"$
$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the anchor. I don't use these very often, but they're good sometimes.
$ID,-2$$TR,"LK Link"$
$ID,2$The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the link text. With no aux the tag becomes the link text, as in example 3.
See $LK,"Link Types",A="MN:LK_FILE"$.
Examples: <CTRL-t> to see
1)$LK,"File link to HelpIndex.DD",A="::/Doc/HelpIndex.DD"$
2)$LK,"File link to HelpIndex.DD with link type file",A="FI:::/Doc/HelpIndex.DD"$
3)File link with same tag str. $LK,"::/Doc/HelpIndex.DD"$
4)$LK,"File find link searching for 'Admin'",A="FF:::/Doc/HelpIndex.DD,Admin"$
5)$LK,"File find link searching for 5th 'CTRL'",A="FF:::/Kernel/KernelA.HH,CTRL:5"$
6)$LK,"Manual page link",A="MN:Print"$
7)$LK,"File line num link",A="FL:::/Kernel/KernelA.HH,200"$
8)$LK,"File anchor link -- <CTRL-t> to see anchor after you click",A="FA:::/Demo/DolDoc/DemoDoc.DD,MyLittleAnchor"$
9)$LK,"Bible Link",A="BF:Acts,2:3"$ The chapter:verse actually just does a text search.
10) $LK,"Help Index Link",A="HI:Doc"$.
11) $LK,"Address Link",A="AD:0x11000"$.
12) For in-memory document address links, see $LK,"SpriteEdText",A="MN:SpriteEdText"$().
$ID,-2$$TR,"BT Bttn"$
$ID,2$See $LK,"::/Demo/DolDoc/MenuBttn.HC"$.
$ID,-2$$TR,"DA Data"$
$ID,2$Used for forms that prompt for data or just displaying a value. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$, $LK,"::/Demo/Dsk/DataBase.HC"$, and $LK,"::/Adam/DolDoc/DocWidgetWiz.HC"$.
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$DA...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$.
The default raw data type for the $FG,2$$$DA...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
The $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str arg $FG,2$A=""$FG$ is used for the print/scan format string.
The default field length is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$.
$ID,-2$$TR,"CB Check Box"$
$ID,2$Used for forms. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$$FG$ and $LK,"CEdFindText",A="MN:CEdFindText"$.
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$CB...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the $FG,2$->data$FG$ addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$.
The default raw data type for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
$ID,-2$$TR,"LS List Widget"$
$ID,2$Used for forms that prompt for data. You must specify a define list, $FG,2$D=""$FG$. Use $FG,2$<CTRL-l>$FG$ to help you generate the DolDoc command text you need in your $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's $FG,2$fmtstr$FG$ meta-data for $LK,"DocForm",A="MN:DocForm"$(). See $LK,"::/Demo/DolDoc/Form.HC"$.
If you are not using $LK,"DocForm",A="MN:DocForm"$(), make a $FG,2$$$LS...$$$FG$ statement with $LK,"DocPrint",A="MN:DocPrint"$() and fill-in the data addr. See $LK,"task_title",A="FF:::/Adam/DolDoc/DocEd.HC,&Fs->task_title"$.
The default raw data type for the $FG,2$$$LS...$$$FG$ command is $FG,2$RT=I64$FG$. $LK,"DocForm",A="MN:DocForm"$() will automatically reset the raw type to the value from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition if you leave it set to the default. Or, if not using $LK,"DocForm",A="MN:DocForm"$(), specify a raw data type of $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
$ID,-2$$TR,"MA Macro"$
$ID,2$A left macro arg, $FG,2$LM=""$FG$, will send text when the left mouse is clicked.
A left in string, $FG,2$+LIS$FG$, flag will cause text to be sent to $LK,"InStr",A="MN:InStr"$() instead of $LK,"In",A="MN:In"$(). An InStr runs code. Literal text is in quotes and messages are sent with $LK,"Msg",A="MN:Msg"$(). See $MA-X+PU,LM="Dir(\"::/Demo/InFile\");View;"$.
Macro's are usually in your $LK,"~/PersonalMenu.DD"$ and have the '$FG,2$+X$FG$' flag set by $LK,"default",A="MN:DocInit"$. Adding '$FG,2$-X$FG$' prevents the usual $FG,2$<ESC>$FG$ from being sent (which exits the PersonalMenu scrn). Note: When you click a macro on the cmd line, it will go to the bottom and execute unless you cancel the $FG,2$<ESC>$FG$ with a '$FG,2$-X$FG$'.
$ID,-2$$TR,"MU Menu Value"$
$ID,2$A left expression arg, $FG,2$LE=<Exp>$FG$, will return a number when clicked with the left mouse.
See $LK,"PopUpRangeI64",A="MN:PopUpRangeI64"$().
$ID,-2$$TR,"HX Hex Edit"$
$ID,2$See $LK,"DocD",A="MN:DocD"$().
$ID,-2$$TR,"TR Tree Widget"$
$ID,2$A tree widget is a branch in a collapsable tree. The domain of the branch extends from the first +indent until enough -indents bring it back to where it started. Tree's begin collapsed unless a $FG,2$-C$FG$ flag is present.
You might want to use $LK,"DocPrintAtomic",A="MN:DocPrintAtomic"$().
See $LK,"::/Demo/DolDoc/TreeDemo.HC"$.
$ID,-2$$TR,"SP Sprite"$
$ID,2$Insert a sprite into text with $FG,2$<CTRL-r>$FG$. The cursor location at the time you press $FG,2$<CTRL-r>$FG$ is critical because the sprite will be offset from that location. This is important when adding images to programs. Numbers for sprites are automatically chosen because copying to and from the clipboard requires this. You can insert another sprite with the same image by hitting $FG,2$<CTRL-t>$FG$ and manually adding a $FG,2$$$SP...$$$FG$ entry with the same $FG,2$BI=$FG$ num.
You can add a text tag to the $FG,2$$$SP...$$$FG$ cmd by manually adding text into the $FG,2$$$SP...$$$FG$ cmd, as in $FG,2$$$SP,"pic 2",BI=2$$$FG$. If you enter a tag of the form $FG,2$"<1>"$FG$ then the number in the tag will be updated to match the $FG,2$BI=$FG$ number.
$ID,-2$$TR,"IB Insert Binary"$
$ID,2$Tells the compiler to insert a pointer to some binary data stored after the end of text in the document. There is just one type of binary data in DOC's at this point -- sprites -- created with $FG,2$<CTRL-r>$FG$. They have a number associated with them. This number is automatically chosen, because copying to the clip-board and back requires renuming. To use a $FG,2$$$IB...$$$FG$ cmd, toggle to plain text ($FG,2$<CTRL-t>$FG$) after inserting a sprite and check the number in the $FG,2$$$SP...$$$FG$ cmd. Create a $FG,2$$$IB...$$$FG$ cmd with the same $FG,2$BI=$FG$ number and the sprite will be inserted into the compiled stream like a string const.
You can, optionally, include tag text to be displayed for the $FG,2$$$IB...$$$FG$ cmd. If you set the tag to "<1>", then the editor will automatically update the tag if the $FG,2$BI=$FG$ number changes.
The reason for the $FG,2$$$IB...$$$FG$ cmd is to pass a arg to $LK,"Sprite",A="MN:Sprite"$() and $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"::/Demo/Graphics/SpritePlot.HC"$.
$ID,-2$$TR,"IS Insert Binary Size"$
$ID,2$Inserts a number into the compiled stream describing the size of binary data associated with a bin number. I never use this.
$ID,-2$$TR,"SO Song"$
$ID,2$See $LK,"Play",A="MN:Play"$(). $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str $FG,2$A=""$FG$ stores the song note text.
$ID,-2$$TR,"HL Highlighting"$
$ID,2$Include a $FG,2$1$FG$ or $FG,2$0$FG$.
$FG,2$$$HL,1$$$FG$ will turn syntax highlighting on.
$ID,-2$$TR,"HC html"$
$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$ to generate a html version of a document. You can cause html code to be injected with $FG,2$HC$FG$. Use the $FG,2$+HTML$FG$ flag to inject a html link.
$ID,-2$$TR,"ER Error"$
$ID,2$When errors are detected in DolDoc cmds, an $FG,2$ER$FG$ entry is generated.
$ID,-2$
<$LK,"FlagCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$> See $LK,"Flag Defines",A="MN:DOCEf_LEFT_CB"$ and $LK,"Simple Flags",A="FI:::/Doc/Widget.DD"$.
$TR,"+H Hold"$
$ID,2$Causes not to delete this cmd when cleared with $FG,2$CL$FG$ or when the doc->max_entries is exceeded. Word wrap is a good to hold. There is no way to delete these entries, at this point.
$ID,-2$$TR,"+L Link"$
$ID,2$Make a cmd behave as a link. Perhaps, use this on a $FG,2$$$SP...$$$FG$ cmd.
$ID,-2$$TR,"+TR Tree"$
$ID,2$Make a cmd behave as a tree branch. Usually, this is placed on a $FG,2$TX$FG$ entry. The tree extends from the start until another tree entry or when indentation has been expanded and reduced back to the starting value.
A $FG,2$+C$FG$ flag on a tree will start it collapsed.
$ID,-2$$TR,"+LS List"$
$ID,2$Make a cmd behave as a list widget. See above. Usually, this is placed on a $FG,2$TX$FG$ entry.
$ID,-2$$TR,"+PU PopUp"$
$ID,2$A PopUp flag on a $FG,2$MA$FG$ will cause the cmds to run in a new task, a pop-up window.
$ID,-2$$TR,"+C Collapsed"$
$ID,2$A collapsed flag on a $FG,2$TR$FG$ entry will cause it to start collapsed. A $FG,2$-C$FG$ flag will make it start open.
$ID,-2$$TR,"+X <ESC> (Exit)"$
$ID,2$The exit flag will cause a $FG,2$$$MA...$$$FG$ macro to send an $FG,2$<ESC>$FG$ before running to exit the PersonalMenu scrn and return to the cmd prompt. Actually, the default $FG,2$$$MA...$$$FG$ has an exit flag set so you add a $FG,2$-X$FG$ to turn-off $FG,2$ESC$FG$, for a $FG,2$+PU$FG$ pop-up macro. If an entry is already at the cmd prompt, the $FG,2$+X$FG$ will movement to the bottom of the window.
$ID,-2$$TR,"+Q <SHIFT-ESC> (Abort Quit)"$
$ID,2$A quit flag is similar to a $FG,2$+X$FG$ except a $FG,2$<SHIFT-ESC>$FG$ instead of an $FG,2$<ESC>$FG$ to exit.
$ID,-2$$TR,"+Z Zero"$
$ID,2$A zero flag on a $FG,2$HX$FG$ entry will cause the offset from zero. A $FG,2$-X$FG$ will show the actual memory addr. By default, $FG,2$HX$FG$ has the zero flag set.
$ID,-2$$TR,"+RD Refresh Data"$
$ID,2$The Refresh Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value on the scrn updated continuously.
$ID,-2$$TR,"+UD Update Data"$
$ID,2$The Update Data flag on a $FG,2$DA$FG$ or a $FG,2$CB$FG$ makes the value in the $LK,"CDocEntry",A="MN:CDocEntry"$ updated when keys are typed on it.
$ID,-2$$TR,"+TC Tag CallBack"$
$ID,2$See $LK,"::/Demo/DolDoc/CallBack.HC"$.
$ID,-2$$TR,"+LC Left CallBack"$
$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.HC"$.
$ID,-2$$TR,"+RC Right CallBack"$
$ID,2$See $LK,"::/Demo/DolDoc/ClickCallBack.HC"$.
$ID,-2$
<$LK,"ArgCode",A="FF:::/Adam/DolDoc/DocInit.HC,ST_DOC_FLAGS"$> See $LK,"Arg Defines",A="MN:DOCEf_TAG"$.
$TR,"T=\"\" Tag Str"$
$ID,2$Some cmds have a tag by default. See $LK,"TX+T",A="FF:::/Adam/DolDoc/DocInit.HC,TX+T"$. You can code $FG,2$T="tag_text"$FG$ as just $FG,2$"tag_text"$FG$ with no $FG,2$T=$FG$.
$ID,-2$$TR,"LEN=\"\" Field Length"$
$ID,2$The default field length for $FG,2$$$DA...$$$FG$ commands is $FG,2$LEN=64$FG$ characters. For U8 arrays[], $LK,"DocForm",A="MN:DocForm"$() will automatically reset the field length to the string length from the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ $FG,2$class$FG$ member's definition. The length measures starting after the ':' in the $FG,2$A=""$FG$ format string.
The space after the first ':' in the format string marks the first valid cursor pos. See $LK,"Data Tag Width",A="FA:::/Adam/DolDoc/DocPlain.HC,DataTagWidth"$.
$ID,-2$$TR,"A=\"\" Auxilliary Str"$
$ID,2$Some cmds need auxilliary strings. $FG,2$A="str"$FG$ means an $LK,"CDocEntry",A="MN:CDocEntry"$.aux_str is present. aux_str is used for song note text, link text, anchor text, and $FG,2$$$DA...$$$FG$ format string text.
$ID,-2$$TR,"D=\"\" Define Str"$
$ID,2$A $FG,2$D=""$FG$ means either a $LK,"define",A="HI:Define"$ str indirection is present on a text widget, or a define list is present on a list widget.
For indirection, the tag will be regenerated by substituting the value of a system $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string. See $LK,"::/Demo/DolDoc/DefineStr.HC"$, $LK,"::/Adam/ADefine.HC"$ and $LK,"::/Doc/MemOverview.DD"$.
For $FG,2$LS$FG$ widgets, see $LK,"::/Demo/DolDoc/Form.HC"$.
$ID,-2$$TR,"HTML=\"\""$
$ID,2$See $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$ to generate a html version of a document. You can cause html link on an item with $FG,2$HTML=""$FG$.
$ID,-2$$TR,"LE=<Exp> Left Expression"$
$ID,2$Left expression. $FG,2$CM$FG$ has this by default for X offset and you can leave-off the $FG,2$LE=$FG$, just putting the $FG,2$<Exp>$FG$.
See $LK,"::/Demo/DolDoc/MenuBttn.HC"$.
$ID,-2$$TR,"LM=\"\" Left Macro Str"$
$ID,2$Left macro string.
$ID,-2$$TR,"RE=<Exp> Right Expression"$
$ID,2$Right expression. $FG,2$CM$FG$ has this by default for Y offset and you can leave-off the $FG,2$RE=$FG$, just putting the $FG,2$<Exp>$FG$.
See $LK,"::/Demo/DolDoc/MenuBttn.HC"$.
$ID,-2$$TR,"RM=\"\" Right Macro Str"$
$ID,2$Right macro string.
$ID,-2$$TR,"BI=<Exp> Bin Number"$
$ID,2$Binary data item number.
$ID,-2$$TR,"BP=\"\" Bin Ptr"$
$ID,2$The BinPtrLink flags lets you specify a filename and bin num to import a bin$FG$.
$FG,2$$$SP,"<tag>",BI=1,BP="filename,1"$$$FG$ will import bin num "1" from filename.
$FG,2$$$SP,"<1>",BI=1,BP="::/Demo/Graphics/Mountain.HC.Z,Mountain"$$$FG$ will import bin with tag name "Mountain" from "::/Demo/Graphics/Mountain.HC.Z".
$ID,-2$$TR,"RT=<raw_data_type>"$
$ID,2$The default data-type for the $FG,2$$$DA...$$$FG$ and $FG,2$$$LS...$$$FG$ commands is $FG,2$RT=I64$FG$. If you do not specify a raw type and are using $LK,"DocForm",A="MN:DocForm"$(), it will use the $FG,2$class$FG$ member's raw type, automatically. The default for the $FG,2$$$CB...$$$FG$ command is $FG,2$RT=I8$FG$ which is $FG,2$Bool$FG$.
If not using $LK,"DocForm",A="MN:DocForm"$(), change it to $FG,2$I8$FG$, $FG,2$U8$FG$, $FG,2$I16$FG$, $FG,2$U16$FG$, $FG,2$I32$FG$, $FG,2$U32$FG$, $FG,2$I64$FG$, $FG,2$U64$FG$, or $FG,2$F64$FG$. See $LK,"DocDataFmt",A="MN:DocDataFmt"$() and $LK,"DocDataScan",A="MN:DocDataScan"$().
$ID,-2$$TR,"SX=<Exp> Shift X"$
$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ X pixels off the grid.
$ID,-2$$TR,"SY=<Exp> Shift Y"$
$ID,2$Shift tag text $FG,2$+$FG$/$FG,2$- 7$FG$ Y pixels off the grid.
$ID,-2$$TR,"SCX=<Exp> Scroll X"$
$ID,2$Scroll text in a marquee of so many columns.
$ID,-2$$TR,"U=<Exp> User Data"$
$ID,2$User Data.
See $LK,"::/Demo/DolDoc/MenuBttn.HC"$.
$ID,-2$
$FG,5$EXAMPLES:
$FG$<CTRL-t> to see how the following were done.
$UL,1$Underlined$UL,0$ $IV,1$Inverted$IV,0$ $BK,1$Blinking$BK,0$ $SY,-3$super$SY,0$ $SY,0$$SY,3$sub$SY,0$
$TX,"This is a big long scrolling msg.",SCX=10$
$FG,5$Cursor Movements:$FG$
$CM+LX,LE=3,RE=3$Cursor moved 3 rows down and to 3rd column from left.
$CM+RX,LE=-40,RE=3$Note mandatory comma after flags
The following may be changed to modes instead of attr with flags.
$TX+CX,"This is centered"$
$TX+RX,"This is right justified"$
+77
View File
@@ -0,0 +1,77 @@
File
{
Save(,CH_CTRLS);
SaveAs(,CH_CTRLA);
Abort(,CH_SHIFT_ESC);
Exit(,CH_ESC);
}
Edit
{
Undo(,CH_CTRLH,0x80E0000080E);
Cut(,CH_CTRLX);
Copy(,CH_CTRLC);
Paste(,CH_CTRLV);
DelLine(,CH_CTRLY);
FindReplace(,CH_CTRLF);
FindNext(,,0x3D0000003D);
FindLast(,,0x23D0000023D);
GoLine(,CH_CTRLG,0x42200000422);
GoBegin(,,0x4C800000448);
GoEnd(,,0x4D000000450);
GoLeft(,,0x4CB0000044B);
GoRight(,,0x4CD0000044D);
GoLBrace(,0x5B,0x61A0000061A);
GoRBrace(,0x5D,0x61B0000061B);
Macro(,,0x3C0000003C);
PlayMacro(,,0x23C0000023C);
}
Insert
{
TextWidgets(,CH_CTRLL,0x42600000426);
GraphicResource(,CH_CTRLR,0x41300000413);
FileName(,,0x3E0000003E);
DirName(,,0x23E0000023E);
GodWord(,,0x4100000041);
GodBiblePassage(,,0x24100000241);
GodSong(,,0x4000000040);
GodDoodle(,,0x24000000240);
IndentIn(,CH_CTRLI,0x41700000417);
IndentOut(,CH_CTRLI,0x61700000617);
WordWrapOn(,CH_CTRLW,0x41100000411);
WordWrapOff(,CH_CTRLW,0x61100000611);
UnderlineOn(,CH_CTRLU,0x41600000416);
UnderlineOff(,CH_CTRLU,0x61600000616);
BlinkOn(,CH_CTRLK,0x42500000425);
BlinkOff(2,CH_CTRLK,0x62500000625);
InvertOn(,CH_CTRLZ,0x42C0000042C);
InvertOff(,CH_CTRLZ,0x62C0000062C);
SuperToggle(,CH_CTRLP,0x41900000419);
SubToggle(,CH_CTRLP,0x61900000619);
PageBreak(,CH_CTRLJ,0x41C0000041C);
}
Program
{
CodeTools(,CH_CTRLL,0x62600000626);
Include(,0,0x3F0000003F);
AdamInclude(,0,0x23F0000023F);
}
View
{
PlainText(,CH_CTRLT);
Collapse(,CH_CTRLO,0x61800000618);
Uncollapse(,CH_CTRLO,0x41800000418);
Border(,CH_CTRLB);
FileMgr(,CH_CTRLD,0x42000000420);
Search(,CH_CTRLF,0x62100000621);
}
Help
{
Menu(,CH_CTRLM,0x43200000432);
Help(,,0x3B0000003B);
About(,,0x23B0000023B);
}
+96
View File
@@ -0,0 +1,96 @@
$WW,1$$FG,5$$TX+CX,"Frequently Asked Questions"$$FG$
$TR,"How come it is public domain, not GPL?"$
$ID,2$I, $FG,2$Terry A. Davis$FG$, wrote all $TX,"118,851",D="DD_TEMPLEOS_LOC"$ lines of TempleOS over the past $TX,"12.5",D="DD_TEMPLEOS_AGE"$ years (full-time). It can run on some bare metal 64-bit PC's from about 2005-2010 with no layering, libraries, tools, modules or anything from other sources. Otherwise, you run it in a virtual machine, like $FG,2$VMware$FG$, $FG,2$QEMU$FG$ or $FG,2$VirtualBox$FG$. It is independent and stands alone. It has no networking, so it certainly doesn't call home. 100% of the src code is including on all distro's, from the kernel to the compiler to the boot loaders! See $LK,"::/Doc/Credits.DD"$.
$ID,-2$$TR,"Shouldn't it be GNU/TempleOS?"$
$ID,2$TempleOS executes no code not written by me at any time except for a few $FG,2$BIOS$FG$ calls for configuration. I even wrote boot-loaders, so I do not need Grub. See $LK,"::/Doc/Credits.DD"$.
$ID,-2$$TR,"Don't you use GNU's gcc?"$
$ID,2$TempleOS was written from scratch, starting with $FG,2$TASM$FG$ long ago, launching from real-mode DOS. Now, there is no $FG,2$Linux$FG$ or $FG,2$GNU$FG$ or any other code in TempleOS. Yes, I wrote the compiler from scratch. See $LK,"::/Doc/Credits.DD"$.
$ID,-2$$TR,"Why do you dual boot?"$
$ID,2$TempleOS is 100% independent -- it does not access the files of your primary operating system and TempleOS will work as the only operating system on your computer, but it has no networking. In your off hours, you will use your other operating system.
$ID,-2$$TR,"It has links, so is it a browser?"$
$ID,2$TempleOS is an operating system, not a browser. $LK,"TempleOS links",A="MN:LK_FILE"$ are a special format and only link too local files and symbol source addresses.
$ID,-2$$TR,"Where are the animated 3D icon GIFs?"$
$ID,2$3D $LK,"Sprites",A="FI:::/Doc/Sprite.DD"$ are stored as a mesh of triangles. There are no GIF files. It $LK,"rotates",A="MN:Mat4x4MulXYZ"$ 3D sprite objects on the fly.
$ID,-2$$TR,"If the compiler is JIT, isn't it an interpretor?"$
$ID,2$TempleOS compiles, doesn't $FG,2$interpret$FG$, and uses no $FG,2$byte code$FG$ anywhere. I loosely use the word $FG,2$script$FG$ sometimes, but it's actually compiled. The compiler's $LK,"optimization",A="MN:OptPass012"$ code is actually where the compiler evaluates constants to simplify them, like every optimizing compiler.
$ID,-2$$TR,"Are you a Creationist?"$
$ID,2$I am an evolutionist. $FG,2$Adam$FG$ is a better term for the first father of all tasks than $FG,2$root$FG$ was!
$ID,-2$$TR,"Is 'Bt()' in the code Bit Torrent?"$
$ID,2$$LK,"Bt",A="MN:Bt"$() is $FG,2$bit test$FG$, like the $FG,2$x86$FG$ inst, not $FG,2$bit torrent$FG$.
$ID,-2$$TR,"Is 'Fs->' in the code file system?"$
$ID,2$$LK,"Fs",A="MN:Fs"$ is a segment reg, not $FG,2$file system$FG$. ($LK,"Fs",A="MN:Fs"$ is kept pointing to the current task's record.) There is no memory segmentation. It is 64-bit and flat. FS and GS are used as general purpose regs, more or less.
$ID,-2$$TR,"Is it Pascal?"$
$ID,2$TempleOS uses a dialect of C/C++ called $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. It is not $FG,2$Pascal$FG$. I altered the syntax making parenthesis optional on function calls with no paramaters.
$ID,-2$$TR,"Why doesn't Sleep() make my laptop hibernate?"$
$ID,2$$LK,"Sleep",A="MN:Sleep"$() makes a program pause. It is not hibernation for a laptop.
$ID,-2$$TR,"What is Yield() for in loops?"$
$ID,2$$LK,"Yield",A="MN:Yield"$() saves the current task's regs (context) and loads in the next task. In a loop waiting for disk IO, it executes $LK,"Yield",A="MN:Yield"$() which pegs the CPU load, yet the system is responsive.
$ID,-2$$TR,"What is JIT Compiled Mode?"$
$ID,2$The term $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ means it compiles and executes code placed into mem, not stored on disk.
$ID,-2$$TR,"Why do files end in .Z? Are they encrypted?"$
$ID,2$Files with names ending in $FG,2$.Z$FG$ are individually compressed using $LK,"TempleOS Compression",A="FI:::/Kernel/Compress.HC"$. They are not encrypted. $LK,"Copy",A="MN:Copy"$() or rename them with $LK,"Move",A="MN:Move"$() to a name without $FG,2$.Z$FG$ and they will be stored in an uncompressed form. See $LK,"TOSZ",A="FI:::/Doc/TOSZ.DD"$ for Linux or Windows uncompress C/C++ code.
$ID,-2$$TR,"Is it open source? How do I build it?"$
$ID,2$TempleOS is 100% open src. All the src code is included in the distro. Use $LK,"BootHDIns",A="MN:BootHDIns"$() to compile the kernel and compiler. The rest is $LK,"JIT Compiled",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ during boot. See $LK,"::/StartOS.HC"$.
$ID,-2$$TR,"Where are object files? How do I link?"$
$ID,2$TempleOS does not use object files or a linker. $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ is used to directly create flat binary files, $LK,"::/Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.BIN",A="FI:::/Compiler/Compiler.PRJ"$ with no object files and linking.$FG$ $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ place code in memory, ready to run, with no object files or linking. Linking is done when $FG,2$BIN$FG$ modules are $LK,"Load",A="MN:Load"$()ed.
$ID,-2$$TR,"What is the FPS refresh rate?"$
$ID,2$The refresh rate is $TX,"30",D="WINMGR_FPS"$ frames-per-second. That is how often TempleOS updates scrn mem. It is not syncronized to the hardware.
$ID,-2$$TR,"How does a task own the speaker?"$
$ID,2$No task or application has a lock on the speaker so apps will interfere with each other.
$ID,-2$$TR,"Why does it leak memory?"$
$ID,2$TempleOS allocs mem as more items are displayed in the window. Also, TempleOS allocs mem for code as it is compiled at the cmd line. If you $FG,2$#include$FG$ a file twice, it allocs more mem for it. If you have a 50,000 line program with each line taking twenty bytes on a machine with 1 Gig, you could $FG,2$#include$FG$ it a thousand times if it had no data or graphics and no other use of mem. If it bothers you, hit $FG,2$<CTRL-ALT-x>$FG$ and $FG,2$<CTRL-ALT-t>, $FG$periodically, to kill and recreate the task$FG$. Use the pop-up flag on macros in your $LK,"PersonalMenu",A="FI:::Home/PersonalMenu.DD"$ to spawn new tasks, run applications and free the applications when they are finished. Small mem chunks stick to the task when they are freed until it is killed. The only way to get in trouble is allocating multiple Meg chunks and freeing them. These can only be reused if the same size gets alloced again. Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to see who alloced mem and didn't free it. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.DD"$.
$ID,-2$$TR,"Why do I get a memory leak when editing big files?"$
$ID,2$The editor periodically takes a snap-shot of the document for $FG,2$UNDO$FG$ and this looks like a memory leak.
$ID,-2$$TR,"Why is it in text mode?"$
$ID,2$TempleOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call",A="FF:::/Kernel/KStart16.HC,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn by hand",A="MN:GrUpdateTextFG"$. See $LK,"::/Kernel/FontStd.HC"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"Kernel config",A="FI:::/Kernel/KCfg.HC"$ option.
$ID,-2$$TR,"Where is the kernel memory?"$
$ID,2$TempleOS identity-maps all memory, all the time. It is like paging is not used. There is no special kernel $FG,2$high half$FG$ memory space. TempleOS is ring-0-only, so everything is kernel, even user programs. There is a special task called $FG,2$Adam$FG$ and he doesn't die, so his heap never gets freed. That's as close to $FG,2$kernel memory$FG$ as it gets. All code goes in the lowest 2Gig of addresses, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. See $LK,"MemOverview",A="FI:::/Doc/MemOverview.DD"$.
$ID,-2$$TR,"Why does it run code from stack addresses?"$
$ID,2$TempleOS puts all code in the lowest 2Gig, known as the $LK,"Code Heap",A="FF:::/Doc/Glossary.DD,Code and Data Heaps"$, so that the $FG,2$REL32$FG$ addressing mode can be used. TempleOS is 64-bit, but $FG,2$2Gig$FG$ is enough for code. It actually puts global variables there, too, but you can turn that off with $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$. $LK,"MAlloc",A="MN:MAlloc"$() allocs higher memory.
$ID,-2$$TR,"How does it SYSCALL?"$
$ID,2$TempleOS doesn't use software interrupts or $FG,2$SYSCALL$FG$ insts because it never needs to change out of ring-0, even running user programs. Calls are always $FG,2$CALL REL32$FG$ insts.
$ID,-2$$TR,"How do you fault-in stack?"$
$ID,2$The stack does not grow, so do not do deep recursion. In theory, memory gets fragmented, too.
$ID,-2$$TR,"How do I set the PATH?"$
$ID,2$There is no $FG,2$PATH$FG$. You do not enter filenames at the command-line and expect them to run. You enter C-like code. $LK,"Get Started Here",A="FI:::/Doc/CmdLineOverview.DD"$.
$ID,-2$$TR,"How do I boot it with Grub?"$
$ID,2$If you use Grub, you $FG,2$chain-load$FG$ like Windows. See $LK,"Boot",A="FI:::/Doc/Boot.DD"$. You can use the TempleOS boot-loader. $LK,"Master-Boot-Loader-Stage1",A="FI:::/Adam/Opt/Boot/BootMHD.HC"$, $LK,"Master-Boot-Loader-Stage2",A="FI:::/Adam/Opt/Boot/BootMHD2.HC"$, $LK,"Partition-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootHD.HC"$, $LK,"CD-DVD-Boot-Loader",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$.
$ID,-2$$TR,"How do I get Kernel.BIN to boot?"$
$ID,2$The boot-loaders must be patched by you running $LK,"BootHDIns",A="MN:BootHDIns"$() or $LK,"BootMHDIns",A="MN:BootMHDIns"$(). Those will write the block address into the boot-loader because the boot-loaders do not navigate file systems to find the $LK,"Stage2",A="FI:::/Kernel/KStart16.HC"$ if you relocate it.
$ID,-2$$TR,"Why is there some 16-Bit code?"$
$ID,2$TempleOS is 64-bit. Like all PC operating systems, the boot-loader starts in 16-bit real-mode. TempleOS calls a few $FG,2$BIOS$FG$ info routines, switches to VGA-640x480x4bit, switches to 32-bit, then, 64-bit mode. There is an odd thing called a $FG,2$$TX,"PCI BIOS",HTML="http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf"$$FG$ which is 32-bit used for $FG,2$PCI$FG$ config space access. TempleOS calls $LK,"that",A="FI:::/Kernel/PCIBIOS.HC"$ a couple times. It must temporarily drop-out-of 64-bit mode for that and stop multi-tasking.
$ID,-2$$TR,"Why are you pushing 32-bit values on the stack?"$
$ID,2$$FG,2$PUSH EAX$FG$ : All stack operations in 64-bit mode are 64-bits.
$ID,-2$$TR,"Why are you using 32-bit insts and not setting high 32-bits?"$
$ID,2$$FG,2$XOR EAX,EAX$FG$ : Operations on 32-bit regs clear the high 32-bits.
$ID,-2$$TR,"How do you use the FS and GS segment registers."$
$ID,2$$FG,2$MOV RAX,FS:[RAX]$FG$ : FS can be set with a $FG,2$WRMSR$FG$, but displacement is RIP relative, so it's tricky to use. FS is used for the current $LK,"CTask",A="MN:CTask"$, GS for $LK,"CCPU",A="MN:CCPU"$.
$ID,-2$$TR,"How do I set ORG for position of code?"$
$ID,2$The compiler creates $FG,2$pos independent$FG$ code. Don't create code which is loaded at a fixed, specified location. Code in a BIN file is $FG,2$pos independent$FG$ by virtue of a table in the BIN file for patching absolute addresses.
$ID,-2$$TR,"How are symbols loaded?"$
$ID,2$Binary executable files have export syms which are loaded into the sym tables. The operating system $FG,2$Kernel$FG$ has such an export table. In addition, some map files are processed to provide more information on syms -- src file links. This is how the $LK,"Man",A="MN:Man"$()/$FG,2$AutoComplete$FG$ feature can find src lines.
$ID,-2$$TR,"Why doesn't assert work?"$
$ID,2$$FG,2$#assert$FG$ might print a message at COMPILE time, not run time.
$ID,-2$$TR,"Why doesn't C++ public work?"$
$ID,2$The word $FG,2$public$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ does very little except allow the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ and $LK,"Who",A="MN:Who"$() to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA-X+PU,"Click Here",LM="DocMax(1000000);Who;View;\n"$.
$ID,-2$$TR,"How does the debugger do source debugging?"$
$ID,2$When compilation takes place, the structures used by the compiler stick around. Data on classes can be accessed. See $LK,"ClassRep",A="MN:ClassRep"$().
$ID,-2$$TR,"What are the ASCII 5 and ASCII 31 chars doing in my text files?"$
$ID,2$The cursor location is stored as an $FG,2$ASCII 5$FG$ in files. $FG,2$ASCII 31$FG$ is $FG,2$SHIFT-SPACE$FG$, a character which does not get converted to tabs by space-to-tabs, $LK,"S2T",A="MN:S2T"$(). The $FG,2$ASCII 28$FG$ is $FG,2$SHIFT-ESC$FG$.
$ID,-2$$TR,"Why is there garbage at the end of my text files?"$
$ID,2$Binary sprite data is stored beyond the terminating $FG,2$NULL$FG$ in text files. Map files store debug src line addresses.
$ID,-2$$TR,"Why are sprites so small?"$
$ID,2$Sprites can be stored as vector graphics so they might take shockingly little room. They can be converted to bitmaps.
$ID,-2$$TR,"Why don't I need to recompile /Adam and /Home files?"$
$ID,2$If you change code in the $FG,2$/Adam$FG$ or your $FG,2$/Home$FG$ directory, you don't need to recompile, you just need to reboot because those directories get recompiled when you boot. It uses $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. There is no $FG,2$.BIN$FG$ file for $FG,2$JIT$FG$ compilation. See $LK,"::/StartOS.HC"$.
$ID,-2$$TR,"Why does it finds files that aren't there?"$
$ID,2$If not found, $FG,2$.Z$FG$ is added or removed from filename and a search is done again. If a file is still not found, the parent directories are searched for a file of the same name.
$ID,-2$
$FG,8$
* "Windows" is a trademark owned by MicroSoft Corp.
* "Linux" is a trademark owned by Linus Torvalds.
* "QEMU" is a trademark owned by Fabrice Bellard.
* "VMware" is a trademark owned by VMware, Inc.
* "VirtualBox" is a trademark owned by Oracle.
$FG$
+53
View File
@@ -0,0 +1,53 @@
$WW,1$$FG,5$$TX+CX,"TempleOS' Features"$$FG$
* Oracle in with $FG,2$<F7>$FG$ for words or $FG,2$<SHIFT-F7>$FG$ for passages. See $LK,"tongues",A="FI:::/Adam/God/HSNotes.DD"$.
* $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, ring-0-only, single-address-map (identity), multitasking kernel with multicore support.
* Master/Slave MultiCore
* Free, $FG,2$public domain$FG$, $FG,2$100% open source$FG$.
* 64-bit $FG,2$compiler/assembler$FG$ for $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Truly compiles, doesn't interpret. $FG,2$Just-in-Time$FG$ and $FG,2$Ahead-of-Time$FG$ compilation. With $FG,2$JIT$FG$, no need for object or exe files.
* No 32-bit krufty code.
* 640x480 16 color $FG,2$VGA$FG$ graphics.
* Keyboard & Mouse support.
* ATA PIO Hard drives, support for $FG,2$FAT32$FG$ and $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file systems with file compression.
* ATAPI PIO $FG,2$CD/DVD$FG$ support with $FG,2$ISO9660$FG$ file system. Can make bootable $FG,2$ISO9660$FG$ ISO files so you can roll-your-own distro's.
* $LK,"Partitioning",A="MN:PrtDsk"$ tool, installer, $FG,2$boot loaders$FG$ for CD/DVD and hard disk.
* $FG,2$Editor/Browser$FG$ for a new $LK,"Document Format",A="FI:::/Doc/DolDocOverview.DD"$. Source files and the command line window can have graphics, links, icons, trees, colors, super/sub scripts, margins. Everything is seamless through-out the tool chain. No need for separate resource files.
* 8-bit $FG,2$ASCII$FG$, not just 7-bit. Supported in entire tool chain. $FG,2$<CTRL-ALT-a>$FG$
* $FG,2$Graphics in source code$FG$, no resource files, $FG,2$graphic sprite editor$FG$. $FG,2$<CTRL-r>$FG$
* $FG,2$64-bit pointers$FG$. All memory, even more than 4Gig, can be directly accessed by all tasks on all cores at all times.
* $FG,2$Ring-0-only$FG$. Highest CPU privileged mode at all times. No off-limits insts. No time lost changing modes or address maps. Switches tasks in half a microsecond.
* $FG,2$2D/3D$FG$ graphics library
* Real-time fancy $FG,2$differential-equation solver$FG$ for physics engines, to use in games. (Adaptive step-size Runge-Kutta, interpolated for real-time.)
* Auto-completion, jump-to-source tool called $FG,2$AutoComplete$FG$ with Dictionary.
* Window Manager. Pan scrn with $FG,2$<CTRL-LeftDrag>$FG$. Zoom scrn on mouse cursor with $FG,2$<CTRL-ALT-z>$FG$/$FG,2$<CTRL-ALT-SHIFT-Z>$FG$.
* File Manager, $FG,2$<CTRL-d>$FG$.
* Code $LK,"profiler",A="MN:Prof"$, $LK,"merge",A="MN:Merge"$, $LK,"diff",A="MN:Diff"$ utils.
* $FG,2$PC Speaker$FG$ support with many hymns.
* Music composing tool.
* Many games, $LK,"demos",A="FI:::/Doc/DemoIndex.DD"$ and $LK,"documentation",A="FI:::/Doc/HelpIndex.DD"$.
* $FG,2$All source code$FG$ included. Only compiles with the included TempleOS compiler and assembler.
Binary file not shown.
+69
View File
@@ -0,0 +1,69 @@
$WW,1$$FG,5$$TX+CX,"File Manager"$$FG$
$FG,2$<SHIFT CURSOR>$FG$
$ID,2$Select files.
$ID,-2$
$FG,2$<CTRL-y> or <DELETE>$FG$
$ID,2$Delete file or tree.
$ID,-2$
$FG,2$<CTRL-c> or <CTRL-INS>$FG$
$ID,2$Copy select files to clipboard.
$ID,-2$
$FG,2$<CTRL-v> or <SHIFT-INS>$FG$
$ID,2$Paste clipboard.
$ID,-2$
$FG,2$LEFT-CLICK,drag-drop$FG$
$ID,2$Move a file or tree to a dir.
$ID,-2$
$FG,2$LEFT-CLICK,same file or <SPACE>$FG$
$ID,2$Edit file.
$ID,-2$
$FG,2$<SHIFT-SPACE>$FG$
$ID,2$Edit Plain Text File.
$ID,-2$
$FG,2$RIGHT-CLICK or <ENTER>$FG$
$ID,2$Bring-up menu.
$ID,-2$
$FG,2$<F5>$FG$
$ID,2$#include file.
$ID,-2$
$FG,2$<SHIFT-F5>$FG$
$ID,2$Adam #include file.
$ID,-2$
$FG,2$'r'$FG$
$ID,2$Rename file.
$ID,-2$
$FG,2$'d'$FG$
$ID,2$Make Dir.
$ID,-2$
$FG,2$'c'$FG$
$ID,2$ChgDsk (Remount removable media). Do not do this on blank disks.
$ID,-2$
$FG,2$'f'$FG$
$ID,2$Format drive.
$ID,-2$
$FG,2$'i'$FG$
$ID,2$Mount ISO.C file.
$ID,-2$
$FG,2$'u'$FG$
$ID,2$Unmount drive(s).
$ID,-2$
$FG,2$'m'$FG$
$ID,2$Make CD/DVD ISO.C file. This creates a $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ ISO file image of the dir the cursor is on. The name of the ISO file is $FG,2$$TX,"\"::/Tmp/CDDVD.ISO.C\"",D="DFT_ISO_C_FILENAME"$$FG$ $LK,"blkdev.dft_iso_c_filename",A="MN:CBlkDevGlbls"$ and can be redefined in your start-up scripts. You may wish to place it on a different drive.
$ID,-2$
$FG,2$'M'$FG$
$ID,2$Make CD/DVD ISO file. This creates a ISO9660 file image of the dir the cursor is on. The name of the ISO file is $FG,2$$TX,"\"::/Tmp/CDDVD.ISO\"",D="DFT_ISO_FILENAME"$$FG$ $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ and can be redefined in your start-up scripts. You may wish to place it on a different drive.
$ID,-2$
$FG,2$'B'$FG$
$ID,2$Burn CD/DVD ISO file. This burns a CD/DVD using the image file, $FG,2$$TX,"\"::/Tmp/CDDVD.ISO\"",D="DFT_ISO_FILENAME"$$FG$ $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$ to the drive the cursor is on.
$ID,-2$
$FG,5$Instructions on Using CD/DVD's$FG$
$ID,2$If you have not recompiled Kernel and defined your CD/DVD drive, exit the FileMgr and use $LK,"Mount",A="MN:Mount"$ to define your CD/DVD drive. Place a CD/DVD in the drive and press $FG,2$'c'$FG$ when on top of the CD/DVD drive letter to mount the drive. It will call $LK,"ChgDsk",A="MN:ChgDsk"$(), the TempleOS cmd to mount removable media.
$ID,-2$
$FG,5$Instructions on Burning CD/DVD's$FG$
$ID,2$Create a temporary dir to hold files and copy files into the holding dir. Make an ISO image of the dir by pressing $FG,2$'M'$FG$ when on top of the dir. Press $FG,2$'B'$FG$ when on top of the CD/DVD ROM drive to burn the ISO, $FG,2$$TX,"\"::/Tmp/CDDVD.ISO\"",D="DFT_ISO_FILENAME"$$FG$ $LK,"blkdev.dft_iso_filename",A="MN:CBlkDevGlbls"$, to disk. If you have not recompiled $FG,2$Kernel$FG$ and defined your CD/DVD drive, exit the FileMgr and use $LK,"Mount",A="MN:Mount"$.
$LK,"Making Your Own Distro",A="FI:::/Misc/DoDistro.HC"$
$ID,-2$
+33
View File
@@ -0,0 +1,33 @@
File
{
Rename(,'r');
MkDir(,'d');
FmtDrv(,'f');
UnmountDrv(,'u');
Abort(,CH_SHIFT_ESC);
Exit(,CH_ESC);
}
Edit
{
Ed(,CH_SPACE);
Plain(,CH_SHIFT_SPACE);
Copy(,CH_CTRLC);
Paste(,CH_CTRLV);
DeleteFile(,CH_CTRLY);
}
CDDVD
{
ChgDsk(,'c');
MountISOC(,'i');
MakeRedSeaISOC(,'m');
MakeISO9660ISO(,'M');
BurnISOFile(,'B');
}
Program
{
Include(,0,0x3F0000003F);
AdamInclude(,0,0x23F0000023F);
}
+27
View File
@@ -0,0 +1,27 @@
$WW,1$$FG,5$$TX+CX,"File Utils"$$FG$
File util $LK,"FilesFind",A="MN:FilesFind"$() wildcard mask consists of a single base dir with multiple file masks separated by $FG,2$';'$FG$. The $FG,2$'*'$FG$ and $FG,2$'?'$FG$ wildcard chars are accepted. The $FG,2$'~'$FG$ is your home directory and $FG,2$'!'$FG$ indicates an exclusion mask.
$FG,2$"/Kernel/*"$FG$ BaseDir: $FG,2$/Kernel$FG$ Mask: $FG,2$*$FG$
$FG,2$"/Demo/*.BMP*;*.GR*"$FG$ BaseDir: $FG,2$/Demo$FG$ Mask: $FG,2$*.BMP*$FG$ | $FG,2$*.GR*$FG$
$FG,2$"/*.DD*;!*/Bible*"$FG$ BaseDir: $FG,2$Root$FG$ Mask: $FG,2$*.DD*$FG$ but not $FG,2$*/Bible*$FG$
See $LK,"FilesFindMatch",A="MN:FilesFindMatch"$().
Flags are either text or int values.
$LK,"FUF_RECURSE",A="MN:FUF_RECURSE"$ $FG,2$+r$FG$ Recurse
$LK,"FUF_SINGLE",A="MN:FUF_SINGLE"$ $FG,2$+s$FG$ Single File (Optimization for one file in mask.)
$LK,"FUF_FLATTEN_TREE",A="MN:FUF_FLATTEN_TREE"$ $FG,2$+f$FG$ use with '$FG,2$+F$FG$'. Just use $FG,2$+F$FG$, probably.
$LK,"FUF_JUST_DIRS",A="MN:FUF_JUST_DIRS"$ $FG,2$+D$FG$ just directories
$LK,"FUF_JUST_FILES",A="MN:FUF_JUST_FILES"$ $FG,2$+F$FG$ just files (Flattens trees)
$LK,"FUF_CLUSTER_ORDER",A="MN:FUF_CLUSTER_ORDER"$ $FG,2$+O$FG$ sort by cluster (move head one direction)
$LK,"FUF_JUST_TXT",A="MN:FUF_JUST_TXT"$ $FG,2$+T$FG$ just text files : $LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$
$LK,"FUF_JUST_DD",A="MN:FUF_JUST_DD"$ $FG,2$+$$$FG$ just $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ files : $LK,"FILEMASK_DD",A="MN:FILEMASK_DD"$
$LK,"FUF_JUST_SRC",A="MN:FUF_JUST_SRC"$ $FG,2$+S$FG$ just src files : $LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$
$LK,"FUF_JUST_AOT",A="MN:FUF_JUST_AOT"$ $FG,2$+A$FG$ just aot files : $LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$
$LK,"FUF_JUST_JIT",A="MN:FUF_JUST_JIT"$ $FG,2$+J$FG$ just jit files : $LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$
$LK,"FUF_JUST_GR",A="MN:FUF_JUST_GR"$ $FG,2$+G$FG$ just graphic files : $LK,"FILEMASK_GR",A="MN:FILEMASK_GR"$
See $LK,"ST_FILE_UTIL_FLAGS",A="MN:ST_FILE_UTIL_FLAGS"$ when used in calling program taking text flags.
+1
View File
@@ -0,0 +1 @@
$WW,1$If you require separate global vars for multiple instances of a routine, you can use $FG,4$Frame$FG$s. See $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$(), $LK,"::/Demo/Graphics/Pick3D.HC"$ or $LK,"Noise",A="MN:Noise"$().
+45
View File
@@ -0,0 +1,45 @@
$WW,1$GR graphics files are 8-bits-per-pixels but only 4-bits of color, with transparency and no palette. Compression is the standard TempleOS$FG$ LZW compression.
$HL,1$
#define DCF_COMPRESSED 1 //This is the only saved flag.
#define DCF_PALETTE 2
#define TRANSPARENT 0xFF
#define BLACK 0
#define BLUE 1
#define GREEN 2
#define CYAN 3
#define RED 4
#define PURPLE 5
#define BROWN 6
#define LTGRAY 7
#define DKGRAY 8
#define LTBLUE 9
#define LTGREEN 10
#define LTCYAN 11
#define LTRED 12
#define LTPURPLE 13
#define YELLOW 14
#define WHITE 15
class CBGR48
{
U16 r,g,b,pad;
};
CBGR48 gr_palette_std[16]={
0x000000000000,0x00000000AAAA,0x0000AAAA0000,0x0000AAAAAAAA,
0xAAAA00000000,0xAAAA0000AAAA,0xAAAA55550000,0xAAAAAAAAAAAA,
0x555555555555,0x55555555FFFF,0x5555FFFF5555,0x5555FFFFFFFF,
0xFFFF55555555,0xFFFF5555FFFF,0xFFFFFFFF5555,0xFFFFFFFFFFFF};
class GRFile
{
I32 width;
I32 width_internal; //Rounded-up to multiple of 8.
I32 height;
I32 flags; //DCF_COMPRESSED? See $LK,"::/Kernel/Compress.HC"$.
CBGR48 palette[16]; //Included if DCF_PALETTE.
U8 body[];
};$HL,0$
See $LK,"DCSave",A="MN:DCSave"$(), $LK,"GRWrite",A="MN:GRWrite"$(), $LK,"DCLoad",A="MN:DCLoad"$(), and $LK,"GRRead",A="MN:GRRead"$().
+286
View File
@@ -0,0 +1,286 @@
$WW,1$$FG,5$$TX+CX,"Glossery"$$FG$
$TR,"Abbreviations"$
$ID,2$$FG,2$Abs$FG$ Absolute
$FG,2$AC$FG$ AutoComplete
$FG,2$Acct$FG$ Account
$FG,2$ACD$FG$ AutoComplete Dictionary
$FG,2$Addr$FG$ Address
$FG,2$Alloc$FG$ Allocate
$FG,2$Alt$FG$ Alternate
$FG,2$AOT$FG$ Ahead-of-Time
$FG,2$AP$FG$ ApplicationProcessor (Core1 - Core7)
$FG,2$Arg$FG$ Argument
$FG,2$Asm$FG$ Assemble, Assembler or Assembly
$FG,2$Attr$FG$ Attribute
$FG,2$Aux$FG$ Auxilliary
$FG,2$BG$FG$ Backround
$FG,2$Bin$FG$ Binary
$FG,2$Blk$FG$ Block
$FG,2$Bmp$FG$ BitMap
$FG,2$Bttn$FG$ Button
$FG,2$Buf$FG$ Buffer
$FG,2$Bwd$FG$ Backward
$FG,2$CB$FG$ Call-Back, Code Block
$FG,2$Cfg$FG$ Config
$FG,2$Chg$FG$ Change
$FG,2$Chk$FG$ Check
$FG,2$Const$FG$ Consant
$FG,2$Cont$FG$ Continue
$FG,2$Cmd$FG$ Command
$FG,2$Cmp$FG$ Compiler
$FG,2$Cnt$FG$ Count
$FG,2$Ctrl$FG$ Control. The ctrl key is indicated with "$FG,2$^$FG$" in documentation.
$FG,2$Cur$FG$ Current
$FG,2$Cvt$FG$ Convert
$FG,2$Dbg$FG$ Debug
$FG,2$Dbl$FG$ Double
$FG,2$DC$FG$ Device Context
$FG,2$Del$FG$ Delete
$FG,2$Desc$FG$ Descriptor, Description
$FG,2$Dev$FG$ Device
$FG,2$Dft$FG$ Default
$FG,2$Dir$FG$ Directory, Direction
$FG,2$Div$FG$ Divide
$FG,2$Doc$FG$ Document
$FG,2$Drv$FG$ Drive
$FG,2$Dsk$FG$ Disk
$FG,2$Dst$FG$ Destination
$FG,2$Ed$FG$ Edit, Editor
$FG,2$Elem$FG$ Element
$FG,2$Equ$FG$ Equal
$FG,2$Evt$FG$ Event
$FG,2$Exe$FG$ Execute
$FG,2$Ext$FG$ Extern, Extended, Extract
$FG,2$Feat$FG$ Feature
$FG,2$FG$FG$ Foreground
$FG,2$Fmt$FG$ Format
$FG,2$Fwd$FG$ Forward
$FG,2$FPS$FG$ Frames per Second, First Person Shooter
$FG,2$fp_$FG$ Function ptr
$FG,2$Fun$FG$ Function
$FG,2$Gen$FG$ Generate
$FG,2$Glbl$FG$ Global
$FG,2$Gr$FG$ Graphic
$FG,2$Hndlr$FG$ Handler
$FG,2$IDE$FG$ Integrated Drive Electronics, Integrated Development Environment
$FG,2$Id$FG$ Identification
$FG,2$Ident$FG$ Identifier, Identity, Identical
$FG,2$IDT$FG$ Interrupt Descriptor Table
$FG,2$Idx$FG$ Index
$FG,2$Init$FG$ Initialize
$FG,2$Ins$FG$ Insert, Install
$FG,2$Inst$FG$ Instruction
$FG,2$Int$FG$ Interrupt, Integer
$FG,2$Irq$FG$ Interrupt (Request)
$FG,2$JIT$FG$ Just-in-Time
$FG,2$Kbd$FG$ Keyboard
$FG,2$KD$FG$ Keyboard Device
$FG,2$Len$FG$ Length
$FG,2$Let$FG$ Letter
$FG,2$Lex$FG$ Lexical Analyser
$FG,2$Loc$FG$ Location, Lines of Code
$FG,2$Log$FG$ Logarithm, Logical
$FG,2$Lst$FG$ List
$FG,2$Man$FG$ Manual
$FG,2$Mem$FG$ Memory
$FG,2$Mgd$FG$ Managed
$FG,2$Mgr$FG$ Manager
$FG,2$Mid$FG$ Middle
$FG,2$Mon$FG$ Month
$FG,2$MP$FG$ MultiProcessor
$FG,2$Ms$FG$ Mouse
$FG,2$Msg$FG$ Message
$FG,2$Num$FG$ Number
$FG,2$Obj$FG$ Object
$FG,2$Occ$FG$ Occurrence
$FG,2$ODE$FG$ Ordinary Differential Equation
$FG,2$Opt$FG$ Option, Optimize
$FG,2$Paren$FG$ Parenthesis
$FG,2$Pix$FG$ Pixel
$FG,2$Pkg$FG$ Package
$FG,2$Poly$FG$ Polygon
$FG,2$Pos$FG$ Position
$FG,2$Pow$FG$ Power
$FG,2$Prec$FG$ Precedence
$FG,2$Prev$FG$ Previous
$FG,2$Pri$FG$ Primary
$FG,2$Prod$FG$ Product, Production
$FG,2$Prof$FG$ Profile, Profiler
$FG,2$Prs$FG$ Parse, Parser
$FG,2$Prt$FG$ Partition
$FG,2$FunSeg$FG$ Program Section
$FG,2$Pt$FG$ Point
$FG,2$Ptr$FG$ Pointer
$FG,2$Que$FG$ Queue
$FG,2$Rand$FG$ Random
$FG,2$Ref$FG$ Reference
$FG,2$Reg$FG$ Register, Registry, Regular
$FG,2$Rem$FG$ Remove
$FG,2$Rep$FG$ Report, Repeat
$FG,2$Res$FG$ Result
$FG,2$Rev$FG$ Reverse, Reversed
$FG,2$Rqst$FG$ Request
$FG,2$Rst$FG$ Reset
$FG,2$Rot$FG$ Rotation
$FG,2$Rx$FG$ Receive
$FG,2$Sched$FG$ Sceduler
$FG,2$Scrn$FG$ Screen
$FG,2$Sec$FG$ Second, Secondary
$FG,2$Sect$FG$ Sector
$FG,2$Sel$FG$ Select, Selected
$FG,2$Seq$FG$ Sequence
$FG,2$Snd$FG$ Sound
$FG,2$SP$FG$ SingleProcessor
$FG,2$Src$FG$ Source
$FG,2$Srv$FG$ Servant
$FG,2$Stat$FG$ Status, Statistic
$FG,2$Std$FG$ Standard
$FG,2$Stk$FG$ Stack
$FG,2$Stmt$FG$ Statement
$FG,2$Str$FG$ String
$FG,2$Sym$FG$ Symbol
$FG,2$Sync$FG$ Synchronization
$FG,2$Sys$FG$ System
$FG,2$Tbl$FG$ Table
$FG,2$Term$FG$ Terminal
$FG,2$Tmp$FG$ Temporary
$FG,2$Tri$FG$ Triangle
$FG,2$Tx$FG$ Transmit
$FG,2$UAsm$FG$ Unassemble
$FG,2$Val$FG$ Value
$FG,2$Var$FG$ Variable
$FG,2$Vect$FG$ Vector
$FG,2$Vis$FG$ Visible
$FG,2$Vol$FG$ Volume
$FG,2$Win$FG$ Window
$FG,2$Wiz$FG$ Wizard
$ID,-2$$TR,"Task/Process/Thread"$
$ID,2$There is no distinction between $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. The $FG,2$Fs$FG$ segment reg is kept pointing to the current task's $LK,"CTask",A="MN:CTask"$. There is only one window per task, and only $FG,2$Core0$FG$ tasks can have windows. Each task has a code and data heap so memory is returned when it dies. Each task has a $LK,"hash",A="HI:Hash"$ symbol table.
Since there is not friendly disk sharing and all tasks have the same address map, it might be accurate to call TempleOS, "multi-thread/single-process". You run a single application process on $FG,2$Core0$FG$ and it can create threads on the same core or others. If you run multiple processes, it should be safe, but one process will wait until another completely finishes a long disk access.
$ID,-2$$TR,"Adam Task"$
$ID,2$This is Adam, as in Adam and Eve, the parent of all tasks. Adam is immortal. The adam task is created at start-up and appears in the small window at the top beneath the user terminal windows. Since the Adam task is immortal, on Adam's heap go all memory objects which you don't want destroyed by any single task's death. When created, Adam runs the file $LK,"::/StartOS.HC"$. When start-up is finished, the adam task enters a server mode where it accepts requests from other tasks. The $LK,"Adam",A="MN:Adam"$("") routine will make Adam compile and run text src code. $FG,2$#include$FG$ stmts can be sent to $LK,"Adam",A="MN:Adam"$(""), creating system-wide code and data which are immortal.
$ID,-2$$TR,"Seth Tasks"$
$ID,2$In the Bible, $LK,"Seth",A="BF:Genesis,4:25"$$FG$ is Adam and Eve's child. Each CPU core has an executive task called $FG,2$Seth$FG$ that is immortal. The Adam task on $FG,2$Core0$FG$ is also its $FG,2$Seth$FG$ task.
$ID,-2$$TR,"Code and Data Heaps"$
$ID,2$TempleOS uses the asm $FG,2$CALL$FG$ inst, exclusively, and that inst is limited to calling routines $FG,2$+/-2Gig$FG$ from the current code location. To prevent out-of-range issues, I decided to separate code and data, placing all code within the lowest $FG,2$2Gig$FG$ of memory, addresses $FG,2$00000000$FG$-$FG,2$7FFFFFFF$FG$. The compiler and $LK,"Load",A="MN:Load"$()er alloc memory from the code heap to store code and glbl vars, unless the compiler option $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ is used. When programs call $LK,"MAlloc",A="MN:MAlloc"$() is from the data heap, which in not limited in size, except by physical RAM memory. You can alloc from any heap in any task at any time on any core, even making $LK,"independent",A="MN:MemPagAlloc"$ heaps.
$ID,-2$$TR,"Parent, Child and PopUp Tasks"$
$ID,2$Often a task will $LK,"Spawn",A="MN:Spawn"$() or $LK,"PopUp",A="MN:PopUp"$() a task as a helper. The helper is known as a child Task, though you can $LK,"Spawn",A="MN:Spawn"$ a task and assign it a different parent... like $FG,2$Adam$FG$. Links are kept as to who's whose child, so when one task is $LK,"Kill",A="MN:Kill"$()ed the child helper tasks die, too. You can get a report of current system tasks with $LK,"TaskRep",A="MN:TaskRep"$(). There is just one window per task, so child tasks are needed for pop-ups.
$ID,-2$$TR,"HolyC"$
$ID,2$$LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$. It has the default args of $FG,2$C++$FG$ and uses $FG,2$class$FG$ in place of $FG,2$struct$FG$. It uses $FG,2$U0,U8,U16,U32,I64$FG$ and $FG,2$I0,I8,I16,I32,I64$FG$ for signed and unsigned ints. It has different $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$. It has $FG,2$PASCAL$FG$-like function calls with no parens, but requires an $FG,2$&$FG,2$$FG$ when referring to function addresses.
$ID,-2$$TR,"AOT Compile Mode"$
$ID,2$$FG,2$Ahead-of-Time$FG$ compiling is conventional compilation mode. Do not use $FG,2$AOT$FG$, use $FG,2$JIT$FG$ compiling.
In $FG,2$AOT$FG$ mode, $FG,2$.PRJ$FG$ files are compiled to $FG,2$.BIN$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, $FG,2$.BIN$FG$ files are $LK,"Load",A="MN:Load"$()ed.
There is no $FG,2$main()$FG$ routine. Instead, stmts outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$AOT Compiled Mode$FG$, $LK,"Cmp",A="MN:Cmp"$() is used. The $FG,2$Kernel$FG$ module and compiler are made in $FG,2$AOT$FG$ compiled mode. See $LK,"BootHDIns",A="MN:BootHDIns"$() which calls $LK,"MakeAll",A="MN:MakeAll"$() where $LK,"::/Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ and $LK,"::/Compiler/Compiler.BIN",A="FI:::/Compiler/Compiler.PRJ"$ are created.
$ID,-2$$TR,"JIT Compile Mode"$
$ID,2$In $FG,2$just-in-time$FG$ mode, the compiler places code and data in memory alloced from the heap, incrementally, making them immediately ready for in-place execution. This mode is used during cmd line operations. When you $FG,2$#include$FG$ a file, it is compiled function by function and code ends-up all over in the memory, at least in the first 2Gig of memory. The $LK,"ExeFile",A="MN:ExeFile"$() routine is the same as $FG,2$#include$FG$ but can be used in programs. $LK,"ExePrint",A="MN:ExePrint"$() routine will compile and run a string.
$ID,-2$$TR,"Compiler Intermediate Code"$
$ID,2$The compiler generates insts one step before making actual assembly (machine) language insts. This code is rev polish stack machine in nature and can be viewed with $LK,"PassTrace",A="MN:PassTrace"$(). The compiler does not $FG,2$interpret$FG$ code, except in the process of optimization to make the final machine code. Assembly language output can be viewed when code is compiled with the $LK,"Trace",A="MN:Trace"$(), or, afterward, with $LK,"U",A="MN:U"$() or $LK,"Uf",A="MN:Uf"$("").
$ID,-2$$TR,"Drive/Partition"$
$ID,2$There is no distinction between $FG,2$drive$FG$ or $FG,2$partition$FG$. They are specified with a single letter from $FG,2$A$FG$-$FG,2$Z$FG$.
'$FG,2$:$FG$' is the boot drive.
'$FG,2$~$FG$' is the home drive.
The letters are reserved for different uses.
$FG,2$A$FG$-$FG,2$B$FG$ are RAM drives.
$FG,2$C$FG$-$FG,2$L$FG$ are ATA hard drives.
$FG,2$M$FG$-$FG,2$P$FG$ are ISO file read drives.
$FG,2$Q$FG$-$FG,2$S$FG$ are ISO file write drives.
$FG,2$T$FG$-$FG,2$Z$FG$ are ATAPI CD/DVD drives.
For commands taking a drive letter as an argument, char $FG,2$0$FG$ is the current drive.
$ID,-2$$LK,"Bt, Bts, Btr, Btc, BEqu",A="HI:Bit"$
$LK,"Define",A="HI:Define"$
$LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$
$LK,"Editor Link Types",A="MN:LK_FILE"$
$LK,"files_find_mask",A="FI:::/Doc/FileUtils.DD"$
$LK,"Hash Table",A="HI:Hash"$
$LK,"InFile",A="HI:InFile"$
$LK,"Ona",A="HI:Snd"$
$LK,"Pag",A="HI:Memory/BlkPool"$
$LK,"RedSea File System",A="FI:::/Doc/RedSea.DD"$
$LK,"Sprite",A="HI:Graphics/Sprite"$
$TR,"CLI, STI, PUSHFD, POPFD"$
$ID,2$These are x86 assembly insts.
$FG,2$CLI$FG$ disable interrupts.
$FG,2$STI$FG$ enable interrupts.
$FG,2$PUSHFD$FG$ pushes the CPU flags.
$FG,2$POPFD$FG$ pops the CPU flags.
$ID,-2$$TR,"Filename Extention Types"$
$ID,2$$FG,5$*.???.Z$FG$
These files are automatically compressed or uncompresses files when read or written.
$FG,5$*.???.C$FG$
Contiguous files--NOT compressed.
$FG,5$*.DD.Z;*.DD$FG$
Text Files
$FG,5$*.HC.Z;*.HC$FG$
HolyC src files. The default HolyC compiler type is $FG,2$.HC.Z$FG$.
$FG,5$*.PRJ.Z;*.PRJ$FG$
HolyC src files to be compiled $FG,2$AOT$FG$.
$FG,5$*.HH.Z;*.HH$FG$
HolyC src header files.
$FG,5$*.MAP.Z;*.MAP$FG$
Compiler "map" files
$FG,5$*.BIN.Z;*.BIN.C;*.BIN$FG$
Binary executable files, created by $LK,"Cmp",A="MN:Cmp"$() and read by $LK,"Load",A="MN:Load"$().
$FG,5$*.DATA.Z;*.DATA$FG$
Data files
$FG,5$*.ISO$FG$
CD/DVD image file--ISO9660.
$FG,5$*.IN.Z;*.IN$FG$
$FG,2$InFile$FG$ Basically a HolyC program whose stdout goes to the input of a task when $LK,"InFile",A="MN:InFile"$() is called.
$FG,5$*.GR.Z;*.GR$FG$
Graphics file
$LK,"FILEMASK_TXT",A="MN:FILEMASK_TXT"$
$LK,"FILEMASK_SRC",A="MN:FILEMASK_SRC"$
$LK,"FILEMASK_AOT",A="MN:FILEMASK_AOT"$
$LK,"FILEMASK_JIT",A="MN:FILEMASK_JIT"$
$LK,"FILEMASK_GR",A="MN:FILEMASK_GR"$
$ID,-2$$TR,"Naming Convention"$
$ID,2$Since there are no $FG,2$namespaces$FG$ and I don't plan to implement name spaces, I highly recommend putting a 2-3 character module code prefix on syms. e.g. $FG,2$WS$FG$, $FG,2$Doc$FG$, $FG,2$Lex$FG$
$FG,5$ALL_CAPS$FG$
Assembly Language labels are capitalized with underscores between words. So are $FG,2$#define$FG$'s.
$FG,5$_ALL_CAPS$FG$
Asm routines which are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ callable must have a leading underscore.
$FG,5$MixedCaps$FG$
$LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ Functions and class names are MixedCaps.
$FG,5$lower_case$FG$
Local function vars and glbl vars are lower case. Class member names are also lower_case.
$FG,5$_lower_case$FG$
Function args which are outputs (passed as ptrs) have leading underscores. Also, args which have idently named local variable counterparts have leading underscores.
$FG,5$DOCf_????$FG$
Flags bit nums instead of bit values are designated with a lower case $FG,2$f$FG$.
$FG,5$DOCG_????$FG$
Flag groups are designated with "$FG,2$G$FG$".
$FG,5$res$FG$ is reserved for local variables that hold the function return val.
$FG,5$*$FG$ I used C++ like naming. I place $FG,2$New$FG$, $FG,2$Del$FG$, $FG,2$Init$FG$, $FG,2$Rst$FG$, ect. on the end of a function name instead of at the beginning. $FG,2$RstMusicSettings$FG$ should be $FG,2$MusicSettingsRst$FG$.
$ID,-2$$TR,"Fs"$
$ID,2$The CPU FS segment reg. This reg points to the current task's $LK,"CTask",A="MN:CTask"$.
$ID,-2$$TR,"Gs"$
$ID,2$The CPU GS segment reg. This reg points to the current core's $LK,"CCPU",A="MN:CCPU"$.
$ID,-2$$TR,"Heap"$
$ID,2$Programs can dynamically request chunks of memory alloced from a $FG,2$heap$FG$ using $LK,"MAlloc",A="MN:MAlloc"$(). They must $LK,"Free",A="MN:Free"$() it when finished. Ptrs are used to refer to the chunk. The $FG,2$heap$FG$ is dynamically alloced mem.
$ID,-2$$TR,"Join"$
$ID,2$When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin.
$ID,-2$$TR,"user_data"$
$ID,2$Many operating system structures have space set aside for you to store values. You are on your own managing these with multiple applications and libraries.
$ID,-2$$TR,"Multicore Core0/CoreAP"$
$ID,2$Core0, has the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$$FG$, and it is the master. The $FG,2$application processors$FG$ have an executive $LK,"Seth Tasks",A="FF:::/Doc/Glossary.DD,Seth Tasks"$ and are the slave processors. Only $FG,2$Core0$FG$ tasks can have windows and can launch applications. Slave cores are used if the application explicitly $LK,"Spawn",A="MN:Spawn"$s() a task or $LK,"JobQue",A="MN:JobQue"$() a job on them.
$ID,-2$
+2
View File
@@ -0,0 +1,2 @@
The $LK+PU,"Holy Spirit",A="FI:::/Adam/God/HSNotes.DD"$ can puppet you.
Binary file not shown.
+135
View File
@@ -0,0 +1,135 @@
$WW,1$$FG,5$$TX+CX,"Directory Structure"$$FG$
$FG,2$/Home$FG$ All your user data should be placed in here to ease backing-up your data. When you install an application it will create a subdirectory of your $FG,2$/Home$FG$ directory for storage.
$FG,2$/Apps$FG$ Applications are placed in subdirectories of $FG,2$/Apps$FG$. Applications should have a file called $FG,2$Install.HC.Z$FG$ which will install the app, possibly making files or directories in $FG,2$/Home$FG$. The file, $FG,2$Load.HC.Z$FG$ will load the application into mem. The file, $FG,2$Run.HC.Z$FG$, will usually load and execute the app. To add an app to your PersonalMenu, use $FG,2$<CTRL-l>$FG$, insert a macro with the PopUp option checked and invoke the $FG,2$Run.HC.Z$FG$ file.
$FG,2$/Demo$FG$ Here you can find lots of sample code to do various things.
$FG,2$/Doc$FG$ Here you can find documentation.
$FG,2$/Kernel$FG$ The core of the operating system is found here. Since priviledge levels are not used, calling it a $FG,2$kernel$FG$ is deceptive. It is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$(). It is loaded by the boot loader and must fit in 640K.
$FG,2$/Compiler$FG$ The compiler module src code is found here. The compiler is $FG,2$AOT$FG$ compiled to produce a binary file which is loaded at boot. It, too, is $FG,2$AOT$FG$ compiled by $LK,"BootHDIns",A="MN:BootHDIns"$().
$FG,2$/Adam$FG$ The non-kernel part of the operating system is found here. It is $FG,2$JIT$FG$ compiled during boot. The $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ is the father of all tasks, like Adam and Eve.
$FG,2$/0000Boot$FG$ Boot files go here. Stage 2 of the TempleOS hard drive master boot loader, the old hard drive master boot record which is just blk#0, and the CD/DVD $LK,"0000Kernel.BIN.C",A="FI:::/Kernel/Kernel.PRJ"$ file go here. ASCII $FG,2$0000$FG$ is near the top, alphabetically, in case you use $TX,"MagicISO",HTML="http://www.magiciso.com"$.
$FG,5$$TX+CX,"::/Home Files"$$FG$
The home dir is specified with $FG,2$'~'$FG$. The home dir is $FG,2$::/Home$FG$ unless you change it with $LK,"HomeSet",A="MN:HomeSet"$() or compile the kernel with a cfg option. An empty $FG,2$/Home$FG$ dir should be valid because it will get default files from the root dir.
$LK,"~/PersonalMenu.DD"$ a menu viewed with the $FG,2$<CTRL-m>$FG$ key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window.
$LK,"~/PersonalNotes.DD"$ a personal note file viewed with the $FG,2$<CTRL-SHIFT-M>$FG$ key.
$LK,"~/MakeHome.HC"$ a file compiled by the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ during $LK,"StartOS",A="FF:::/StartOS.HC,MakeHome"$.
$FG,4$~/Home*$FG$ Copy $FG,2$Home*$FG$ files from the root into $FG,2$~$FG$ and customize them. These files are invoked when the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ starts-up.
$LK,"~/Once.HC"$ a file invoked at the start-up of the first user. Customize this!
$LK,"~/Registry.HC"$ can be edited by hand or deleted to reset to defaults. Takes affect next boot.
$FG,5$$TX+CX,"Application Policies"$$FG$
* Place applications in their own $FG,2$/Apps$FG$ subdirectory.
* Make a file called $FG,2$Load.HC.Z$FG$ to load the application.
* Make a file called $FG,2$Run.HC.Z$FG$ to load and run the application, preferable by $FG,2$#include$FG$ing the $FG,2$Load.HC.Z$FG$ file.
* Place user data in a subdirectory of $FG,2$/Home$FG$, preferably naming the subdirectory the same as the $FG,2$/Apps$FG$ subdirectory. Or, place data in the $FG,2$Registry.HC.Z$FG$ file. See $LK,"::/Demo/RegistryDemo.HC"$.
* If the app needs files in the $FG,2$/Home$FG$ directory, make an $FG,2$/Apps$FG$ file called $FG,2$Install.HC.Z$FG$ or $FG,2$Install.IN.Z$FG$ to create the $FG,2$/Home$FG$ subdirectory.
$FG,5$$TX+CX,"Programming Guidelines"$$FG$
* Virtual mem/Paging is not used -- it is identity mapped in $FG,2$x86_64$FG$ mode. The stk does not grow, so alloc enough when the task (process) is $LK,"Spawn",A="MN:Spawn"$ed and use the heap for most things. (The $FG,2$heap$FG$ refers to $LK,"MAlloc",A="MN:MAlloc"$() and $LK,"Free",A="MN:Free"$().)
* You can $LK,"Free",A="MN:Free"$($FG,2$NULL$FG$)$FG$.
* See $LK,"Naming Convention",A="FF:::/Doc/Glossary.DD,Naming Convention"$ and $LK,"Abbreviations",A="FF:::/Doc/Glossary.DD,Abbreviations"$.
* There are two modes of compiling, $LK,"AOT Compile Mode",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ and $LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$. Compilation is done in both -- neither is "interpreted". Use $FG,2$$LK,"JIT Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$$FG$.
* $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$
* Use $FG,2$I64$FG$ instead of smaller int sizes because the compiler converts everything to 64-bit. Don't use unsigned$FG$ unless it actually breaks. A policy of signed keeps it simple so you don't have to agonize over choices.
$ID,5$$HL,1$U32 DistDist(U16 x1, U16 y1, U16 x2, U16 y2)
{//This requires zero-extend when fetching args.
return SqrI64(x1-x2)+SqrI64(y1-y2);
}
I64 DistDist(I64 x1, I64 y1, I64 x2, I64 y2)
{
return SqrI64(x1-x2)+SqrI64(y1-y2);
}$HL,0$
$ID,-5$
* In-order, short circuit logic is assumed.
* Avoid boolean expression assignments. Boolean assignments don't have short circuit logic and are not compiled efficiently. The $FG,2$Bool$FG$ type is just an alias for a 1 byte signed int -- nothing forces it to $FG,2$1$FG$ or $FG,2$0$FG$. There is a $LK,"ToBool",A="MN:ToBool"$() function that will for to $FG,2$1$FG$ ot $FG,2$0$FG$, however.
* Glbl vars in $FG,2$AOT$FG$ BIN modules are initialized to zero. They occupy space in BIN files.
* Bracketing code with $FG,2$PUSHFD CLI$FG$ and $FG,2$POPFD$FG$ will protect against simultaneous accesses from tasks on $UL,1$one$UL,0$ core. To protect against multiple cores, you need a locked semaphore. I think semiphores need to be in their own cache line, but I'm not sure. I use lock bits in a lot of places not aligned.
* $LK,"SysDbg",A="MN:SysDbg"$() and $LK,"IsSysDbg",A="MN:IsSysDbg"$() are really handy when working on the compiler or kernel. It's just a bit you can set and test.
* I don't use $FG,2$U0 *$FG$ because the size is zero for ptr arithmetic.
* Use $FG,2$$LK,"CH_SHIFT_SPACE",A="MN:CH_SHIFT_SPACE"$$FG$ for spaces in quotes in source code because I run $LK,"Spaces-to-Tabs",A="FF:::/Adam/Opt/Utils/StrUtils.HC,S2T"$ on source code.
* Do not use $FG,2$#if$FG$ or $FG,2$#ifdef$FG$
$FG,5$$TX+CX,"Hash Sym Tables"$$FG$
* See $LK,"::/Adam/AHash.HC"$ for examples of how the hash tables are set-up. Basically, syms are placed into hash tables and child process hash tables are chained to parents. This provides scopes for vars and functions.
* $FG,2$adam_task->hash_table$FG$ holds the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ syms loaded in on start-up.
* $FG,2$Fs->hash_table$FG$ holds user HolyC syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the prev sym. When developing software, typically you include the file at the cmd prompt, make changes and reinclude it. Old syms are overshadowed but they are still there. Periodically, kill the TASK and start fresh when mem is low. If you wish your applications to free themselves instead of staying in mem, spawn or $LK,"PopUp",A="MN:PopUp"$() a task to run the application and kill it when it's done.
* To display the contents of a hash table, use the $LK,"Who",A="MN:Who"$() routine or the varients. $LK,"HashDepthRep",A="MN:HashDepthRep"$() gives a histogram of how long the chains are, in case you wish to make hash table sizes bigger.
$FG,5$$TX+CX,"Assembly Language"$$FG$
See $LK,"::/Doc/Asm.DD"$.
* $FG,2$FS$FG$ must always point to the cur $LK,"CTask",A="MN:CTask"$.
* $FG,2$GS$FG$ must always point to the cur $LK,"CCPU",A="MN:CCPU"$.
* Don't change the segment regs unless interrupts are off. It's hard to do, anyway. $LK,"SET_FS_BASE",A="MN:SET_FS_BASE"$ and $LK,"SET_GS_BASE",A="MN:SET_GS_BASE"$.
* When interacting with $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for reg vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$. See $LK,"Compiler Reg Masks",A="MN:REGG_LOCAL_VARS"$, $LK,"PUSH_C_REGS",A="MN:PUSH_C_REGS"$ and $LK,"POP_C_REGS",A="MN:POP_C_REGS"$
* I recommend using the standard stk frame for functions because $LK,"Caller",A="MN:Caller"$() is used to display the call stk, such as for the wallpaper.
$FG,2$ PUSH RBP
MOV RBP,RSP
SUB RSP,nnnn
...
LEAVE
RET
$FG$
* The args are removed from the stack with $FG,2$RET1$FG$ stmts.
$FG,2$RET1 16 //remove two args$FG$
* No args are passed in regs.
* RAX holds function return values, of course.
$FG,8$
* "MagicISO" is a trademark owned by MagicISO Corp.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
$WW,1$Recompile the kernel with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$=TRUE if you want more heap debugging. You are on your own.
+99
View File
@@ -0,0 +1,99 @@
$HL,1$//Press F5 in the editor to compile and run.
--------Hello.HC.Z---------
"Hello World\n";
--------Hello.HC.Z---------
U0 Main()
{
"Hello World\n";
}
Main;
--------Hello.HC.Z---------
U0 MyPrint(U8 *st)
{
"%s",st;
}
MyPrint("Hello World\n");
--------Hello.HC.Z---------
U0 MyPrint2(U8 *st1,U8 *st2) //Any number of args.
{
"%s %s\n",st1,st2; //Any number of args.
}
MyPrint2("Hello","World");
--------Hello.HC.Z---------
U0 MyPrint(U8 *st)
{
"" st; //Empty with no comma means first is fmt str.
}
MyPrint("Hello World\n");
--------Hello.HC.Z---------
asm {
MSG: DU8 "Hello World\n",0;
//The convention is underscore on C callable.
//Two colons means exported symbol.
_HELLO_WORLD::
//You can only clobber RAX,RBX,RCX,RDX
PUSH RSI
MOV RSI,MSG
CALL PUT_STR
POP RSI
RET
}
Call(_HELLO_WORLD);
--------Hello.HC.Z---------
asm {
_HELLO_WORLD::
//You can only clobber RAX,RBX,RCX,RDX
MOV RAX,'Hello '
CALL PUT_CHARS //Up to 8 chars packed into one 64-bit int.
MOV RAX,'World\n'
CALL PUT_CHARS
RET
}
Call(_HELLO_WORLD);
--------Hello.HC.Z---------
asm {
_MY_PRINT::
//You can only clobber RAX,RBX,RCX,RDX
PUSH RBP
MOV RBP,RSP
PUSH RSI
MOV RSI,U64 SF_ARG1[RBP]
CALL PUT_STR
POP RSI
POP RBP
RET1 8 //Callee pops the stack to clear args.
}
_extern _MY_PRINT U0 MyPrint(U8 *st);
MyPrint("Hello World\n");
--------Hello.HC.Z---------
asm {
_MY_PRINT::
//You can only clobber RAX,RBX,RCX,RDX
PUSH RBP
MOV RBP,RSP
PUSH U64 SF_ARG1[RBP]
CALL &PutS //Callee pops the stack to clear args.
POP RBP
RET1 8
}
_extern _MY_PRINT U0 MyPrint(U8 *st);
MyPrint("Hello World\n");
$HL,0$
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$$FG,2$#help_index "Topic/SubTopic;OtherTopic"$FG$
The help index preprocessor compiler directive sets the topics for syms subsequently defined. You specify subtopics with a '$FG,2$/$FG$' tree hierarchy and separate multiple topics with a '$FG,2$;$FG$'. The index ctrls $LK,"HI:index",A="MN:LK_HELP_INDEX"$ links.
$FG,2$public$FG$ causes a sym to appear in help_index reports.
$FG,2$#help_file "filename[.DD.Z]"$FG$
The help file preprocessor directive makes a file into the heading of a $LK,"HI:index",A="MN:LK_HELP_INDEX"$ report for the current help index.
+268
View File
@@ -0,0 +1,268 @@
$WW,1$$FG,5$$TX+CX,"HolyC"$$FG$
* See $LK,"::/Doc/CompilerOverview.DD"$.
* See $LK,"Scoping and Linkage",A="FI:::/Doc/ScopingLinkage.DD"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc.
* Built-in types include $FG,2$I0,I8,I16,I32,I64$FG$ for signed 0-8 byte ints and $FG,2$U0,U8,U16,U32,U64$FG$ for unsigned 0-8 byte ints and $FG,2$F64$FG$ for 8 byte floats.
$FG,2$ U0 void, but ZERO size!
I8 char
U8 unsigned char
I16 short
U16 unsigned short
I32 int
U32 unsigned int
I64 long (64-bit)
U64 unsigned long (64-bit)
F64 double$FG$
$FG,4$no F32 float.$FG$
* Function with no args, or just default args can be called without parentheses.
>$FG,2$Dir("*");$FG$
>$FG,2$Dir();$FG$
>$FG,2$Dir;$FG$
* Default args don't have to be on the end. This code is valid:
$ID,2$$FG,2$U0 Test(I64 i=4,I64 j,I64 k=5)
{
Print("%X %X %X\n",i,j,k);
}
Test(,3);$FG$
$ID,-2$
* A char const all alone is sent to $LK,"PutChars",A="MN:PutChars"$(). A string with or without args is sent to $LK,"Print",A="MN:Print"$(). An empty string literal signals a variable fmt_str follows.
$ID,2$$FG,2$void DemoC(char drv,char *fmt,char *name,int age)
{
printf("Hello World!\n");
printf("%s age %d\n",name,age);
printf(fmt,name,age);
putchar(drv);
putchar('*');
}
U0 DemoHolyC(U8 drv,U8 *fmt,U8 *name,I64 age)
{
"Hello World!\n";
"%s age %d\n",name,age;
"" fmt,name,age;
'' drv;
'*';
}
$FG$$ID,-2$
* When dealing with function addresses such as for callbacks, precede the name with "$FG,2$&$FG$".
* Type casting is postfix. To typecast int or F64, use $LK,"ToI64",A="MN:ToI64"$(), $LK,"ToBool",A="MN:ToBool"$() or $LK,"ToF64",A="MN:ToF64"$(). (TempleOS follows normal C float<-->int conversion, but sometimes you want to override. These functions are better than multiplying by "1.0" to convert to float.)
* There is no $FG,2$main()$FG$ function. Any code outside of functions gets executed upon start-up, in order.
* There are no bit fields, but there are $LK,"bit access",A="HI:Bit"$ routines and you can access bytes or words within any int. See $LK,"I64 declaration",A="MN:I64"$. A class can be accessed as a whole are subints, if you put a type in front of the $FG,2$class$FG$ declaration.
$ID,2$
$FG,2$public I64i union I64 //"I64i" is intrinsic. We are defining "I64".
{
I8i i8[8];
U8i u8[8];
I16 i16[4];
U16 u16[4];
I32 i32[2];
U32 u32[2];
};
I64 i=0x123456780000DEF0;
i.u16[1]=0x9ABC;
$FG$$ID,-2$
* Variable arg count functions ($FG,2$...$FG$) can access their args with built-in variables similar to '$FG,2$this$FG$' in C++. They are '$FG,2$I64 argc$FG$' and '$FG,2$I64 argv[]$FG$'.
$ID,2$$WW,0$
$FG,2$I64 AddNums(...)
{
I64 i,res=0;
for (i=0;i<argc;i++)
res+=argv[i];
return res;
}
$FG$>$FG,2$AddNums(1,2,3);$FG$
ans=6
$FG,2$
public U0 GrPrint(CDC *dc,I64 x,I64 y,U8 *fmt,...)
{
U8 *buf=$LK,"StrPrintJoin",A="MN:StrPrintJoin"$(NULL,fmt,argc,argv);//SPrintF() with $LK,"MAlloc",A="MN:MAlloc"$()ed string.
$LK,"GrPutS",A="MN:GrPutS"$(dc,x,y,buf); //Plot string at x,y pixels. GrPutS is not public.
Free(buf);
}
...
GrPrint(gr.dc,(GR_WIDTH-10*FONT_WIDTH)>>1,(GR_HEIGHT-FONT_HEIGHT)>>1,
"Score:%4d",score); //Print score in the center of the scrn.
...
$WW,1$$FG$$ID,-2$
* Allows "$FG,2$5<i<j+1<20$FG$" instead of "$FG,2$5<i && i<j+1 && j+1<20$FG$".
$ID,2$
$FG,2$if (13<=age<20)
"Teen-ager";
$FG$$ID,-2$
* if you know a switch stmt will not exceed the lowest or highest case values. $FG,2$switch []$FG$ is a little faster because it doesn't check.
* $FG,2$switch$FG$ stmts always use a jump table. Don't use them with cases with really big, sparse ranges.
* Allows ranges like "$FG,2$case 4...7:$FG$" in $FG,2$switch$FG$ stmts.
* A no case number causes next higher int case in $FG,2$switch$FG$ stmts. See $LK,"::/Demo/NullCase.HC"$.
$ID,2$$FG,2$I64 i;
for (i=0;i<20;i++)
switch (i) {
case: "Zero\n"; break; //Starts at zero
case: "One\n"; break; //One plus prev case.
case: "Two\n"; break;
case: "Three\n"; break;
case 10: "Ten\n"; break;
case: "Eleven\n"; break; //One plus prev case.
}$FG$$ID,-2$
* Switch statements can be nestled with a single switch expression! This is known as a "sub_switch" statement. $FG,2$start$FG$/$FG,2$end$FG$ are used to group cases. Don't goto out of, throw an exception out of, or return out of the $FG,2$start$FG$ front porch area. See $LK,"::/Demo/SubSwitch.HC"$.
$ID,2$$FG,2$I64 i;
for (i=0;i<10;i++)
switch (i) {
case 0: "Zero "; break;
case 2: "Two "; break;
case 4: "Four "; break;
start:
"[";
case 1: "One"; break;
case 3: "Three";break;
case 5: "Five"; break;
end:
"] ";
break;
}$FG$
$BG$OutPut:
>$FG,2$Zero [One] Two [Three] Four [Five]$FG$
$ID,-2$
* A $FG,2$no_warn$FG$ stmt will suppress an unused var warning.
* You can have multiple member vars of a class named "$FG,2$pad$FG$" or "$FG,2$reserved$FG$", and it won't issue warnings.
* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a reg after the $FG,2$reg$FG$ keyword.
$ID,2$$FG,2$U0 Main()
{
//Only use $LK,"REGG_LOCAL_VARS",A="MN:REGG_LOCAL_VARS"$ or $LK,"REGG_LOCAL_NON_PTR_VARS",A="MN:REGG_LOCAL_NON_PTR_VARS"$ for reg vars or else clobbered.
I64 reg R15 i=5, noreg j=4;
no_warn i;
asm {
MOV RAX,R15
CALL &PUT_HEX_U64
MOV RAX,'\n'
CALL &PUT_CHARS
MOV RAX,U64 &j[RBP]
CALL &PUT_HEX_U64
MOV RAX,'\n'
CALL &PUT_CHARS
}
}
$FG$$ID,-2$
* $FG,2$interrupt$FG$, $FG,2$haserrcode$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags. See $LK,"IRQKbd",A="MN:IRQKbd"$().
* A single quote can encompass multiple characters. $FG,2$'ABC'$FG$ is equ to $FG,2$0x434241$FG$. $LK,"PutChars",A="MN:PutChars"$() takes multiple characters.
$ID,2$$FG,2$asm {
HELLO_WORLD::
PUSH RBP
MOV RBP,RSP
MOV RAX,'Hello '
CALL &PUT_CHARS
MOV RAX,'World\n'
CALL &PUT_CHARS
LEAVE
RET
}
Call(HELLO_WORLD);
PutChars('Hello ');
PutChars('World\n');
$FG$$ID,-2$
* The "$FG,2$`$FG$" operator raises a base to a power.
* There is no question-colon operator.
* TempleOS $LK,"operator precedence",A="FF:::/Compiler/CInit.HC,cmp.binary_ops"$
$FG,2$`$FG$,$FG,2$>>$FG$,$FG,2$<<$FG$
$FG,2$*$FG$,$FG,2$/$FG$,$FG,2$%$FG$
$FG,2$&$FG$
$FG,2$^$FG$
$FG,2$|$FG$
$FG,2$+$FG$,$FG,2$-$FG$
$FG,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$
$FG,2$==$FG$,$FG,2$!=$FG$
$FG,2$&&$FG$
$FG,2$^^$FG$
$FG,2$||$FG$
$FG,2$=$FG$,$FG,2$<<=$FG$,$FG,2$>>=$FG$,$FG,2$*=$FG$,$FG,2$/=$FG$,$FG,2$&=$FG$,$FG,2$|=$FG$,$FG,2$^=$FG$,$FG,2$+=$FG$,$FG,2$-=$FG$
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code.
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find dup local var type stmts.
* With the $FG,2$#exe{}$FG$ feature in your src code, you can place programs that insert text into the stream of code being compiled. See $LK,"#exe {}",A="FF:::/Kernel/KEnd.HC,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. $LK,"StreamPrint",A="MN:StreamPrint"$() places text into a src program stream following the conclusion of the $FG,2$#exe{}$FG$ blk.
* No $FG,2$#define$FG$ functions exist (I'm not a fan)
* No $FG,2$typedef$FG$, use $FG,2$class$FG$.
* No type-checking
* Can't use $FG,2$<>$FG$ with $FG,2$#include$FG$, use $FG,2$""$FG$.
* "$FG,2$$$$FG$" is an escape character. Two dollar signs signify an ordinary $$. See $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$. In $FG,2$asm$FG$ or $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ code, it also refers to the inst's address or the offset in a $FG,2$class$FG$ definition.
* $FG,2$union$FG$ is more like a class, so you don't reference it with a $FG,2$union$FG$ label after you define it. Some common unions are declared in $LK,"KernelA.HH",A="MN:U16"$ for 1,2,4 and 8 byte objects. If you place a type in front of a union declaration, that is the type when used by itself. See $LK,"::/Demo/SubIntAccess.HC"$.
* $FG,2$class$FG$ member vars can have meta data. $FG,2$fmtstr$FG$ and $FG,2$fmtdata$FG$ are two meta data types now used. All compiler structures are saved and you can access the compiler's info about classes and vars. See $LK,"::/Demo/ClassMeta.HC"$ and $LK,"DocForm",A="MN:DocForm"$().
* There is a keyword $FG,2$lastclass$FG$ you use as a dft arg. It is set to the class name of the prev arg. See $LK,"::/Demo/LastClass.HC"$, $LK,"ClassRep",A="MN:ClassRep"$(), $LK,"DocForm",A="MN:DocForm"$() and $LK,"::/Demo/Dsk/BlkDevRep.HC"$.
* See $LK,"::/Demo/Exceptions.HC"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with an 8-byte or less char arg. The char string passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_ch$FG$. Within a $FG,2$catch {}$FG$ blk, set the var $FG,2$Fs->catch_except$FG$ to $FG,2$TRUE$FG$ if you want to terminate the search for a hndlr. Use $LK,"PutExcept",A="MN:PutExcept"$() as a hndlr, if you like.
* A function is available similar to $FG,2$sizeof$FG$ which provides the offset of a member of a class. It's called $FG,2$offset$FG$. You place the class name and member inside as in $FG,2$offset(classname.membername)$FG$. It has nothing to do with 16-bit code. Both $FG,2$sizeof$FG$ and $FG,2$offset$FG$ only accept one level of member vars. That is, you can't do $FG,2$sizeof(classname.membername.submembername)$FG$.$FG$
* There is no $FG,2$continue$FG$ stmt. Use $FG,2$goto$FG$.
* $FG,2$lock{}$FG$ can be used to apply asm $FG,2$LOCK$FG$ prefixes to code for safe multicore read-modify-write accesses. The code bracked with have $FG,2$LOCK$FG$ asm prefix's applied to relevant insts within. It's a little shoddy. See $LK,"::/Demo/MultiCore/Lock.HC"$.
* There is a function called $LK,"MSize",A="MN:MSize"$() which gives the size of an object alloced off the heap. For larger size allocations, the system rounds-up to a power of two, so $FG,2$MSize()$FG$ lets you know the real size and you can take full advantage of it.
* You CAN $LK,"Free",A="MN:Free"$() a $FG,2$NULL$FG$ ptr. Useful variants of $LK,"MAlloc",A="MN:MAlloc"$() can be found $LK,"Here",A="MN:CAlloc"$. Each task has a heap and you can $FG,2$MAlloc$FG$ and $FG,2$Free$FG$ off-of other task's heaps, or make an independent heap with $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example.
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $FG,2$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$(). You can use $LK,"CallStkGrow",A="MN:CallStkGrow"$(), but it's odd. See $LK,"::/Demo/StkGrow.HC"$.
* Only one base class is allowed.
* $FG,2$printf()$FG$ has new codes. See $LK,"Print(\"\") Fmt Strings",A="FI:::/Doc/Print.DD"$.
* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
$ID,2$$FG,2$U0 Main()
{
I16 i1;
I32 j1;
j1=i1=0x12345678; //Resulting i1 is 0x5678 but j1 is 0x12345678
I64 i2=0x8000000000000000;
Print("%X\n",i2>>1); //Res is 0xC000000000000000 as expected
U64 u3=0x8000000000000000;
Print("%X\n",u3>>1); //Res is 0x4000000000000000 as expected
I32 i4=0x80000000; //const is loaded into a 64-bit reg var.
Print("%X\n",i4>>1); //Res is 0x40000000
I32 i5=-0x80000000;
Print("%X\n",i5>>1); //Res is 0xFFFFFFFFC0000000
}
$ID,-2$$FG$
+7
View File
@@ -0,0 +1,7 @@
$WW,1$$FG,2$InFiles$FG$ are used to generate user input to automate operations. The TempleOS tour is done with an $FG,2$InFile$FG$. It reminds me of a Unix pipe because $FG,2$StdOut$FG$ of one gets chained into $FG,2$StdIn$FG$ of another.
When an $FG,2$InFile$FG$ runs, a child task is $LK,"Spawn",A="MN:Spawn"$()ed which intercepts real user input and generates fake input. InFiles are $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ programs run by the child whose stdout goes to the parent's input buffer. $LK,"Msg",A="MN:Msg"$() can be included in an $FG,2$InFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$InFile$FG$ is running, the normal input gets diverted to the InFile task and can be filtered and sent back to the parent task. Unless you are driving functions which prompt for data, you can probably use an $FG,2$#include$FG$ file in place of an $FG,2$InFile$FG$.
See $LK,"::/Demo/InFile/InDir.IN"$.
Note: $LK,"In",A="MN:In"$("") can be used if all you need is to send ASCII characters. It differs from $LK,"InStr",A="MN:InStr"$(). You'll probably use $LK,"In",A="MN:In"$() a lot and not $LK,"InStr",A="MN:InStr"$(). With $LK,"In",A="MN:In"$(), for example, you can place answers to the prompts for recompiling the $FG,2$Kernel$FG$ module during $LK,"BootHDIns",A="MN:BootHDIns"$().
+48
View File
@@ -0,0 +1,48 @@
$WW,1$$FG,5$$TX+CX,"Installing TempleOS"$$FG$
Burn a CD with software that supports ISO files. Then, boot it. It's a live CD, so you can look around with or without installing.
Dual booting with another operating system is the best way to use TempleOS. I only use it in a virtual machine because it won't boot natively on my machine, though. For native dual booting, you need a partition for TempleOS. Windows often comes with a restore disk that does not allow repartitioning. I recommend connecting a spare additional hard drive and using the $FG,2$BIOS$FG$ to select which drive to boot.
The $LK,"::/Misc/OSInstall.HC"$ script will automate much of this. It runs if you boot the CD/DVD-ROM.
See $LK,"Boot.DD",A="FI:::/Doc/Boot.DD"$ for an overview of booting. See $LK,"Requirements",A="FI:::/Doc/Requirements.DD"$ for supported hardware. See $LK,"Upgrading",A="FI:::/Doc/Upgrade.DD"$ if you are upgrading.
Two TempleOS partitions are highly recommended, so you can boot to a back-up and fix the primary when you work on it. Odds are, you only need a couple gigabytes for your TempleOS partitions.
1)
$ID,2$$LK,"Mount",A="MN:Mount"$() use if the drive is partitioned.
$ID,2$This command mounts a drive making it accessible. For simplicity, sel $FG,2$'C'$FG$ as the first drive letter for your hard drive. The first partition will be $FG,2$'C'$FG$, second, $FG,2$'D'$FG$, etc. TempleOS needs 3 numbers to utilize a hard drive -- base0, base1, and unit. When you enter a hexadecimal number, do it like in $FG,2$C$FG$ with a $FG,2$0x$FG$ prefix. If the probe was successful, you can just enter the number in the probe box instead of base0.
$ID,-2$
$LK,"PrtDsk",A="MN:PrtDsk"$($FG,2$'C'$FG$) use if drive is not partitioned
$ID,2$This will perform a special $LK,"Mount",A="MN:Mount"$() automatically.
$BK,1$WARNING:$BK,0$ This command erases everything on a hard drive. It repartitions a whole drive and formats the partitions$FG$. This command should be skipped if you already have your hard drive partitioned.
$BK,1$WARNING:$BK,0$ This command doesn't play well with other operating systems. You'll need to do a $LK,"BootMHDZero",A="MN:BootMHDZero"$() to restore your drive to a state where other operating systems can partition it.
$ID,-2$
$ID,-2$2) $LK,"Fmt",A="MN:Fmt"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,FSt_FAT32$FG$)
$ID,2$This command formats a drive with $FG,2$FAT32$FG$ or the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system type. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
$BK,1$WARNING:$BK,0$ If you are upgrading, be sure not to lose the file, $FG,2$/0000Boot/OldMBR.BIN.C$FG$.
$ID,-2$3) $LK,"CopyTree",A="MN:CopyTree"$($FG,2$"T:/"$FG$,$FG,2$"D:/"$FG$)
$ID,2$This command is used to copy files onto a hard drive partition from the CD/DVD. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
$ID,-2$4) $LK,"BootHDIns",A="MN:BootHDIns"$($FG,2$'D'$FG$)
$ID,2$This command recompiles the source code on a drive and writes to the $UL,1$drive's$UL,0$ boot record. You'll need to reenter the $LK,"Mount",A="MN:Mount"$ information so it can be stored in the kernel.
$ID,-2$5) Use Linux's Grub or TempleOS' $LK,"BootMHDIns",A="MN:BootMHDIns"$($FG,2$'D'$FG$)
$ID,2$
The $LK,"BootMHDIns",A="MN:BootMHDIns"$() command places a boot loader on a drive. It saves the old master boot record to $FG,2$/0000Boot/OldMBR.BIN.C$FG$ and replaces it. When you boot, you will have the option of booting the old master boot record. This command can be skipped if you already have a boot loader. Be sure not to lose the copy of the old boot record, like if you reformat the drive.
Delete $FG,2$/0000Boot/OldMBR.BIN.C$FG$ if you want to get a fresh copy of a mbr, like if installing from your own custom CD containing it's own $FG,2$/0000Boot/OldMBR.BIN.C$FG$ onto a system with a non-TempleOS boot loader.
If you have anti-virus software, it might object to having a different master boot record.
$ID,-2$
$FG,8$
* "Windows" is a trademark owned by MicroSoft Corp.
* "Linux" is a trademark owned by Linus Torvalds.
$FG$
Binary file not shown.
+25
View File
@@ -0,0 +1,25 @@
$WW,1$$FG,5$$TX+CX,"Key Allocations"$$FG$
See $LK,"Char",A="HI:Char"$ for definition of scan codes.
See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a detailed list of key commands.
When you are at the cmd line, editing documents, browsing documentation and help, entering items in forms or in menu's, the $LK,"DolDoc",A="MN:CDoc"$ editor handles keys. It allows you to define your own key hndlrs in a $LK,"MyPutKey",A="MN:MyPutKey"$() function. If you choose, you can catch keys, overriding the default hndlrs. See $LK,"DocPutKey",A="MN:DocPutKey"$(). The following is an overview of key allocations.
$FG,2$<ALT-keys>$FG$ and $FG,2$<ALT-SHIFT-keys>$FG$ Free for user configurations in your $LK,"MyPutKey",A="MN:MyPutKey"$() hndlr, except for $FG,2$ALT-BACKSPACE$FG$ (undo). There are a few examples pre-defined, but you can change them if you wish.
$FG,2$<CTRL-ALT-keys>$FG$ and $FG,2$<CTRL-ALT-SHIFT-keys>$FG$ Handled at a system level, NOT by the $LK,"CDoc",A="MN:CDoc"$ editor. I reserve the right to alloc these, but in the mean time, you can define your own hndlrs with $LK,"CtrlAltCBSet",A="MN:CtrlAltCBSet"$(). They operate either in a interrupt environment or in the window mgr when it queues kbd msgs. You can do $LK,"Raw",A="MN:Raw"$() output. $FG,2$<CTRL-ALT-letter>$FG$ hndlrs take a scan_code as an arg.
$FG,2$<CTRL-function key>$FG$ Auto-completes local words.
$FG,2$<CTRL-digit key>$FG$ $FG$Auto-completes dictionary words.
$FG,2$<CTRL-SHIFT-function key>$FG$ $FG$Jumps to src code.
$FG,2$<CTRL-SHIFT-digit key>$FG$ Jumps to dictionary definition.
$FG,2$<function keys>$FG$ and $FG,2$<SHIFT-function keys>$FG$ $FG$I reserve the right to alloc these, but there are some free now.
$FG,2$<CTRL-key>$FG$ and $FG,2$<CTRL-SHIFT-key>$FG$ I reserve the right to alloc to these. There are not many free.
$AN,"",A="PutKeyHandling"$
See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
+14
View File
@@ -0,0 +1,14 @@
$WW,1$The editor mostly stays in a $LK,"GetKey",A="MN:GetKey"$()/$LK,"PutKey",A="MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. TempleOS has a chain of putkey hndlrs in a $LK,"Circular Queue",A="HI:Circular Queue"$ with priorities. The highest priority hndlrs can choose to terminate handling, otherwise, the keys get sent on down the chain.
$LK,"KeyDevAdd",A="MN:KeyDevAdd"$() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined:
Priority Hndlr
---------- ---------
$FG,2$0x20000000$FG$ $LK,"MyPutKey",A="MN:MyPutKey"$() user hndlr
$FG,2$0x40000000$FG$ $LK,"KDInputFilterPutKey",A="MN:KDInputFilterPutKey"$() for $LK,"In",A="MN:In"$(), $LK,"InStr",A="MN:InStr"$(), and $LK,"InFile",A="MN:InFile"$() handling.
$FG,2$0x60000000$FG$ $LK,"KDRawPutKey",A="MN:KDRawPutKey"$() nonwindowed direct to video mem debug output.
$FG,2$0x80000000$FG$ $LK,"KDDocPutKey",A="MN:KDDocPutKey"$() standard document cmds
Since handling individual keys is slow, TempleOS supports PutS() as well. If no puts hndlr is defined, individual keys are sent.
$LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_key$FG$ and $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_s$FG$ are call back routines which offer some neat tricks. See $LK,"::/Apps/Psalmody/JukeBox.HC"$. There is a var $LK,"CDoc",A="MN:CDoc"$$FG,2$.user_put_data$FG$ which gets passed to them.
+3
View File
@@ -0,0 +1,3 @@
$WW,1$The compiler's lexical analyzer can be used in your programs to simplify parsing. See $LK,"Doc Parsing",A="FF:::/Adam/DolDoc/DocPlain.HC,CmpCtrlNew"$ or $LK,"Parse Opcode File",A="FF:::/Compiler/AsmInit.HC,Opcodes.DD"$.
See $LK,"Tokens",A="MN:TK_IDENT"$.
+62
View File
@@ -0,0 +1,62 @@
$WW,1$$FG,5$$TX+CX,"Memory Overview"$$FG$
Paging is practically not used. 64-bit mode requires paging, however, so it is identity-mapped -- virtual identical to physical. All tasks on all cores use the same page table map, just as though all addresses are physical addresses. 2Meg or 1Gig page table entries are used. Nothing swaps to disk.
In TempleOS, the lowest 2Gig of memory is called the $FG,2$code heap$FG$. TempleOS's compiler always uses 32-bit signed relative JMP & CALL insts because 64-bit CALLs take two insts. With signed +/- 32-bit values, code can only call a function within 2Gig distance. Therefore, TempleOS keeps all code in the lowest 2Gig memory addresses including what would normally be called "the kernel". Two Gig is plenty for code, don't worry.
You can create new, independent heaps using $LK,"HeapCtrlInit",A="MN:HeapCtrlInit"$(). Then, use the $LK,"CHeapCtrl",A="MN:CHeapCtrl"$ as the 2nd arg to $LK,"MAlloc",A="MN:MAlloc"$(). See $LK,"HeapLog",A="MN:HeapLog"$() for an example.
Memory alloced by a task will be freed when the task is killed. The $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ is a task that never dies. His memory is like kernel memory in other operating systems. See $LK,"ACAlloc",A="MN:ACAlloc"$(), $LK,"AMAlloc",A="MN:AMAlloc"$(), $LK,"AMAllocIdent",A="MN:AMAllocIdent"$() and $LK,"AStrNew",A="MN:AStrNew"$().
All of the regular page tables are marked, "cached". When accessing hardware, however, you need uncached page table. The lowest 4Gig addresses have an alias to access hardware located toward the top of mapped space, $FG,2$0x$TX,"01AA000000",D="DD_UNCACHED_ALIAS"$$FG$. See $LK,"dev.uncached_alias",A="FF:::/Kernel/KEnd.HC,dev.uncached_alias"$.
During an extended powered-on session of TempleOS, in theory, memory will become fragmented, requiring a reboot. It has never happens to me.
See $LK,"MemRep",A="MN:MemRep"$() and $LK,"::/Demo/MemDemo.HC"$.
$FG,5$$TX+CX,"Single System-wide Mem Map"$
$FG,2$ 0x00$TX,"00007C00",D="DD_KERNEL"$- 0x00$TX,"00036AEF",D="DD_KERNEL_END"$$FG$
$ID,2$Kernel module, placed here by the boot-loader, $LK,"BOOT_RAM_BASE",A="MN:BOOT_RAM_BASE"$.
$ID,-2$
$FG,2$ 0x00$TX,"00096600",D="DD_BOOT_HIGH_LOC_DVD"$- 0x00$TX,"00096FFF",D="DD_BOOT_HIGH_LOC_DVD_END"$$FG$
$ID,2$$FG$Boot block relocated here before loading the Kernel module, $LK,"BootDVD",A="FI:::/Adam/Opt/Boot/BootDVD.HC"$ & $LK,"BootHD",A="FI:::/Adam/Opt/Boot/BootHD.HC"$.
$ID,-2$
$FG,2$ 0x00$TX,"00097000",D="DD_MP_VECT"$- 0x00$TX,"00097030",D="DD_MP_VECT_END"$$FG$ Multicore start-up vect code, $LK,"MPN_VECT",A="MN:MPN_VECT"$.
$FG,2$~0x000009F000- 0x000009FFFF$FG$ Extended BIOS data area.
$FG,2$ 0x00000A0000- 0x00000BFFFF$FG$ VGA graphics mem with alias at $LK,"text",A="MN:text"$.vga_alias.
$FG,2$ 0x00$TX,"00100000",D="DD_SYS_FIXED_AREA_BASE"$- 0x00$TX,"00101FFF",D="DD_SYS_FIXED_AREA_END"$$FG$ $LK,"CSysFixedArea",A="MN:CSysFixedArea"$ for misc.
$FG,2$ 0x00$TX,"0010F000",D="DD_MEM_HEAP_BASE"$- 0x00$TX,"7FFFFFFF",D="DD_MEM_HEAP_LIMIT"$$FG$ Code Heap mem.
$FG,2$ 0x00E0000000- 0x00FFFFFFFF$FG$
$ID,2$32-bit devices could alloc memory at 0xF0000000 going up, but this is wrong, since some PCs already have devices at 0xF0000000. No PCI devices are supported, so $LK,"Mem32DevAlloc",A="MN:Mem32DevAlloc"$() flaws are not an issue.
$ID,-2$
$FG,2$ 0x0080000000-~0x00DFFFFFFF$FG$
$FG,2$ 0x0100000000-~0x$TX,"01A9FFFFFF",D="DD_PHYSICAL_SPACE_END"$$FG$
$ID,2$Data Heap mem. (The physical memory that exists in this range is data heap.)
$ID,-2$
$FG,2$ 0x$TX,"01AA000000",D="DD_UNCACHED_ALIAS"$- 0x$TX,"02A9FFFFFF",D="DD_MAPPED_SPACE_END"$$FG$
$ID,2$Uncached alias of first 4Gig. (For 32-bit device access.)
$ID,-2$
$FG,2$ - 0x$TX,"02A9FFFFFF",D="DD_MAPPED_SPACE_END"$$FG$
$ID,2$64-bit devices are alloced with $LK,"Mem64DevAlloc",A="MN:Mem64DevAlloc"$() counting bwd, but no PCI devices are actually supported$WW,0$.
$ID,-2$
$WW,1$* Note: There is a break in the data-heap block pool. This has no effect except the obvious effect that fragmentation has on contiguous requests. I can $LK,"MAlloc",A="MN:MAlloc"$() an 8Gig chunk on my 12Gig machine. I can $LK,"MAlloc",A="MN:MAlloc"$() an 32Gig chunk on my 64Gig machine.
* Note: For systems with less than 2Gig RAM, the code and data heap block pools are the same. For systems with 2-4Gig of RAM, the code heap is 1/4 of the total. See $LK,"BlkPoolsInit",A="MN:BlkPoolsInit"$().
$FG,5$$TX+CX,"History"$$FG$
In 2003, I wanted to make a no-paging ring-0-only 64-bit operating system for super speed with simplicity and full access. With paging, every memory request requires 5 accesses -- it must access the address itself, 4K, 2Meg, 1Gig, and 512Gig page tables, but the CPU's translation look-aside buffer mostly removes the penalty for using paging. So, I did not want to use paging, but long mode requires it. I did the next best thing -- I identity-mapped everything and achieved the simplicity I was after with subtle performance boosts, not wasting time changing address maps. And, I look forward to the day I command Intel to make an optimized no-paging long mode.
I needed VGA A0000-BFFFF memory to be write-through and 0xE0000000-0xFFFFFFFF to be uncached for various devices. All 64-bit computers allow stopping address translation at 2Meg page size, not using 4K. I wanted to use 2Meg for everything because it's faster, with one less level of page tables. I had to make A0000-BFFFF write-through, though, so I could not use 2Meg size on the lowest page. I did the lowest 2Meg area as 4K pages. I also unmapped the first 4K to cause a fault when dereferencing NULL.
In 2016, I came-up with an alternate idea. I double mapped the lowest memory with an alias that was uncached. Accessing the lowest 2Meg area directly was cached but the alias I created up at the top of address space was uncached. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Unfortunately, I could no longer boast of the simplicity of identity mapping everything. Since many of my users are familiar with A0000-BFFFF, it is actually pretty seriously unfortunate that they cannot use the easy-to-understand numbers of A0000-BFFFF, but must access the relocated alias location. See $LK,"text.vga_alias",A="FF:::/Kernel/KEnd.HC,text.vga_alias"$. I also no longer cause a fault when dereferencing NULL.
Then, I switched to 1Gig page sizes. For the lowest 4Gig, I set-up an alias up at the top of address space. See $LK,"UncachedAliasAlloc",A="MN:UncachedAliasAlloc"$(). Not all computers support 1Gig page tables, however, so I also support 2Meg.
My original plan was to allow changing the page tables as needed, so I had code for taking control of 2Meg pages and marking them uncached or whatever. When I did a HDAudio driver, I requested some 32-bit address space as uncached. Today, all of the first 4Gig can be accessed without caching at the $LK,"dev.uncached_alias",A="FF:::/Kernel/KEnd.HC,dev.uncached_alias"$.
+28
View File
@@ -0,0 +1,28 @@
$WW,1$A pull-down menu appears when you move the mouse to the top of the scrn. Menus are created with $LK,"MenuPush",A="MN:MenuPush"$(), $LK,"MenuFilePush",A="MN:MenuFilePush"$(), $LK,"MenuNew",A="MN:MenuNew"$() or $LK,"MenuFile",A="MN:MenuFile"$() and assigned to $FG,4$Fs->cur_menu$FG$. The format is:
$FG,2$
File
{
Open(,'O');
Save(,'S');
Exit(,CH_SHIFT_ESC);
}
Edit {
Cut(,,SC_DELETE|SCF_SHIFT);
Paste(,,SC_INS|SCF_SHIFT);
}
Misc {
Opt1(MSG_CMD,M_OPTION1);
Opt2(MSG_CMD,M_OPTION2);
}
Help
{
Help(,'?');
About(,'/');
}
$FG$
The first arg is the msg code and it is optional with the default being $LK,"MSG_KEY_DOWN_UP",A="MN:MSG_KEY_DOWN_UP"$. The second arg is the msg $FG,2$arg1$FG$ value which is $LK,"ASCII",A="MN:CH_CTRLA"$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$. The third arg is the msg $FG,2$arg2$FG$ value which is the $LK,"scan_code",A="FI:::/Doc/CharOverview.DD"$$FG$ of the key in the case of $LK,"MSG_KEY_DOWN",A="MN:MSG_KEY_DOWN"$.
Press $FG,2$<CTRL-SHIFT-l>$FG$ and "Insert ASCII/ScanCode".
See $LK,"::/Demo/PullDownMenu.HC"$.
+16
View File
@@ -0,0 +1,16 @@
$WW,1$$LK,"ms.pos.x",A="MN:ms"$ and $LK,"ms.pos.y",A="MN:ms"$ can be used to access the x and y coordinates of the mouse. They are relative to the scrn, not window. These can be used if you don't want to use msg passing. $LK,"ms.pos.z",A="MN:ms"$ is the wheel.
$LK,"ms.pos_text.x",A="MN:CMsStateGlbls"$ and $LK,"ms.pos_text.y",A="MN:CMsStateGlbls"$ are the text column and row. See $LK,"::/Demo/Games/Maze.HC"$.
See $LK,"CMsStateGlbls",A="MN:CMsStateGlbls"$ and $LK,"CMsHardStateGlbls",A="MN:CMsHardStateGlbls"$.
The $FG,2$hard$FG$ designation, as in $FG,2$ms_hard$FG$, represents hardware layer items before the application of an abstraction layer.
$HL,1$//****
ms_hard.pos.x=ms_hard.prescale.x*ms_hard.scale.x*ms_grid.x_speed;
ms.presnap.x=ToI64(ms.scale.x*ms_hard.pos.x)+ms.offset.x;
if (ms_grid.snap)
ms.pos.x=Trunc(ms.presnap.x/ms_grid.x)*ms_grid.x+ms_grid.x_offset;
else
ms.pos.x=ms.presnap.x;
//****$HL,0$
+1
View File
@@ -0,0 +1 @@
$WW,1$There are a maximum of 63 message types, so a bitmask can be passed. Messages have two args. See $LK,"Message Codes",A="MN:MSG_NULL"$.
+14
View File
@@ -0,0 +1,14 @@
$WW,1$TempleOS does master-slave multicore instead of SMP. $FG,2$Core0$FG$ is the master. The master core's applications explicitly assign computational jobs to other cores and the TempleOS scheduler does not move tasks between cores.
There are multicore safe locks for file access and heap allocations, however, so TempleOS is symmetrical in some sense. See $LK,"::/Demo/MultiCore/LoadTest.HC"$.
Only tasks on $FG,2$Core0$FG$ can have windows, but other cores can help render them.
Each core has an executive $LK,"Seth Task",A="FF:::/Doc/Glossary.DD,Seth Tasks"$ which is the father of all tasks on that core. $LK,"Adam",A="FF:::/Doc/Glossary.DD,Adam Task"$ is the $LK,"Seth Task",A="FF:::/Doc/Glossary.DD,Seth Tasks"$ on $FG,2$Core0$FG$.
You give a job to a $LK,"Seth Task",A="FF:::/Doc/Glossary.DD,Seth Tasks"$ with $LK,"JobQue",A="MN:JobQue"$() and get the result with $LK,"JobResGet",A="MN:JobResGet"$(). You spawn a task on any core with $LK,"Spawn",A="MN:Spawn"$().
Note: You must use the $FG,2$LOCK$FG$ asm prefix when changing shared structures in a multicore environment. The $LK,"LBts",A="MN:LBts"$(), $LK,"LBtr",A="MN:LBtr"$() and $LK,"LBtc",A="MN:LBtc"$() insts have $FG,2$LOCK$FG$ prefixes. The compiler has a $FG,2$lock{}$FG$ feature but it doesn't work well. See $LK,"::/Demo/MultiCore/Lock.HC"$.
See $LK,"::/Demo/Graphics/Transform.HC"$.
See $LK,"::/Kernel/MultiProc.HC"$.
+6
View File
@@ -0,0 +1,6 @@
$WW,1$TempleOS has an advanced algorithm for integrating ordinary differential equations suitable for use in video games. (Not scientific work.) It also has some support for systems of masses and springs, to save you some work.
See $LK,"CMathODE",A="MN:CMathODE"$ and $LK,"ODEsUpdate",A="MN:ODEsUpdate"$ for an overview.
See $LK,"ODECallDerivative",A="MN:ODECallDerivative"$ to see what support there is for masses and springs.
See $LK,"::/Demo/Games/Whap.HC"$, $LK,"::/Demo/Games/Rocket.HC"$, $LK,"::/Demo/Games/MassSpring.HC"$, $LK,"::/Apps/Span/SpanMain.HC"$ or $LK,"::/Apps/X-Caliber/X-Caliber.HC"$.
+14
View File
@@ -0,0 +1,14 @@
$WW,1$$LK,"KMain",A="MN:KMain"$()
includes $LK,"::/StartOS.HC"$
includes $LK,"~/MakeHome.HC"$
includes $LK,"~/HomeSys.HC"$
calls $LK,"StartUpTasks",A="FF:~/HomeSys.HC,StartUpTasks"$()
includes $LK,"~/Once.HC"$
calls $LK,"OnceExe",A="MN:OnceExe"$().
$LK,"AOnce",A="MN:AOnce"$() appends src code to $LK,"~/Registry.HC"$ $FG,2$Once/Adam$FG$ tree, executed at next boot by $FG,2$Adam$FG$.
$LK,"Once",A="MN:Once"$() appends src code to $LK,"~/Registry.HC"$ $FG,2$Once/User$FG$ tree, executed at next boot by first $FG,2$User$FG$ term.
At boot, $LK,"OnceExe",A="MN:OnceExe"$(), executes $FG,2$Once/Adam$FG$ tree, $LK,"AOnceFlush",A="MN:AOnceFlush"$()s it,
executes $FG,2$Once/User$FG$ tree and $LK,"OnceFlush",A="MN:OnceFlush"$()s.
+19
View File
@@ -0,0 +1,19 @@
$WW,1$$FG,5$$TX+CX,"Compiler Options"$$FG$
Use $LK,"Option",A="MN:Option"$(). You might need to do $FG,2$#exe {Option();}$FG$.
$LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$ without this option, global vars are placed in the code heap which is limited to 2Gig. In $FG,2$AOT$FG$ modules, global vars take-up room in the $FG,2$.BIN$FG$ file, so you might want to use this option, instead. You might wish to turn it on and off around specific vars. A disadvantage of data heap global vars in $FG,2$AOT$FG$ modules is they can't be initialized.
$LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE",A="MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need. They're to allow the same header file for $FG,2$Kernel$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by $FG,2$AOT$FG$ modules.
$LK,"OPTf_WARN_UNUSED_VAR",A="MN:OPTf_WARN_UNUSED_VAR"$ warning if unused var. It is applied to functions.
$LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$ warning if parenthesis are not needed.
$LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$ warning if dup local var type stmts.
$LK,"OPTf_WARN_HEADER_MISMATCH",A="MN:OPTf_WARN_HEADER_MISMATCH"$ warning if fun header does not match.
$LK,"OPTf_NO_REG_VAR",A="MN:OPTf_NO_REG_VAR"$ forces all function local vars to the stk not regs. Applied to functions.
$LK,"OPTf_NO_BUILTIN_CONST",A="MN:OPTf_NO_BUILTIN_CONST"$ Disable 10-byte float consts for ã, log2_10, log10_2, loge_2. Applied to functions.
+1
View File
@@ -0,0 +1 @@
$WW,1$The word $FG,2$Pag$FG$ refers to an arbitrilly created $LK,"MEM_PAG_SIZE",A="MN:MEM_PAG_SIZE"$ unit of heap allocation. TempleOS does not alter the CPU page tables after setting them up at boot in $LK,"SYS_INIT_PAGE_TABLES",A="MN:SYS_INIT_PAGE_TABLES"$, so the CPU hardware page size is rarely important.
+19
View File
@@ -0,0 +1,19 @@
$WW,1$$FG,5$$TX+CX,"PreProcessor"$$FG$
There is no separate preprocessor pass. The parser front-end calls $LK,"Lex",A="MN:Lex"$() which has the preprocessor built-in. The compiler looks ahead a token, most of the time, so you might throw an extra semicolon after a directive if it's not taking affect right away.
Put an extra semicolon $FG,2$#exe {Cd("DirName");;}$FG$ in case a $FG,2$#include$FG$ follows.
$FG,2$#include ""$FG$ There is no angle bracket <> form of this directive.
$FG,2$#exe {}$FG$ Will execute code at compile-time and can be used to insert code into the stream being compiled using $LK,"StreamPrint",A="MN:StreamPrint"$().
$FG,2$#define$FG$ Define string const
$FG,2$#assert$FG$ Print a warning during compilation if an expression is not true.
$FG,2$#if$FG$ Include code if an expresion is true.
$FG,2$#else
#endif
#ifdef,#ifndef $FG$Include code if a sym is defined.
$FG,2$#ifaot,#ifjit $FG$Include code if in $FG,2$AOT$FG$ compiler mode.
$FG,2$defined()$FG$ Is a function that can be used in expressions.
$FG,2$#help_index$FG$, $FG,2$#help_file$FG$ See $LK,"Help System",A="FI:::/Doc/HelpSystem.DD"$.
See $LK,"PreProcessor",A="FF:::/Compiler/Lex.HC,KW_DEFINE"$.
+91
View File
@@ -0,0 +1,91 @@
$WW,1$$FG,5$$TX+CX,"Print Fmt Strs"$$FG$
<fmt_arg> := $FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][<width>][$FG,2$.$FG$<decimals>][<flags>][$FG,2$h$FG$<aux_fmt_num>]<fmt_code>
See $LK,"StrPrintJoin",A="MN:StrPrintJoin"$().
<flags>:
$ID,2$$FG,2$'t'$FG$ truncate to <width>.
$FG,2$','$FG$ add commas every three digits or four nibbles.
$FG,2$'$$'$FG$ makes $FG,2$%Q$FG$ convert $FG,2$'$$'$FG$ to $FG,2$"\x24"$FG$.
$FG,2$'/'$FG$ makes $FG,2$%Q$FG$ and $FG,2$%q$FG$ convert $FG,2$'%'$FG$ to $FG,2$"%%"$FG$.
$ID,-2$
<aux_fmt_num>:
$ID,2$For $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the <aux_fmt_num> causes thousands mode. $FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$ will display milli units or $FG,2$"%h6n"$FG$ will display mega units. The $FG,2$'k'$FG$ flag is always on for $FG,2$"%n"$FG$. See $LK,"::/Demo/Print.HC"$.
For $FG,2$"%c"$FG$ or $FG,2$"%C"$FG$, the <aux_fmt_num> repeats the char that many times.$ID,-2$
<fmt_code>:
$ID,2$$FG,2$"%n"$FG$ floating point in engineering notation, exponents being multiples of three. If it has a <aux_fmt> code, it will display scientific units letters.
$FG,2$"%S"$FG$ $LK,"Define",A="MN:Define"$() entry.
$FG,2$"%C"$FG$ $LK,"ToUpper",A="MN:ToUpper"$() character.
$FG,2$"%h25c",'\n';$FG$ 25 new-lines.
$FG,2$"%h*c",25,'\n';$FG$ 25 new-lines.
$FG,2$"%F"$FG$ text file by filename.
$FG,2$"%$$F"$FG$ $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ file in memory.
$FG,2$"%p"$FG$ ptr.
$FG,2$"%P"$FG$ link to ptr.
$FG,2$"%D"$FG$ date. Pass a $LK,"CDate",A="MN:CDate"$.
$FG,2$"%T"$FG$ time. Pass a $LK,"CDate",A="MN:CDate"$.
$FG,2$"%z"$FG$ sub_entry of an enumerated list of text entries. See $LK,"LstSub",A="MN:LstSub"$(). Pass sub_entry_num first, list second.
$FG,2$"%Z"$FG$ $LK,"DefineLstLoad",A="MN:DefineLstLoad"$() subentry. Pass sub_entry_num first, define_name second.
$FG,2$"%Q"$FG$ convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.)
$FG,2$"%q"$FG$ rev a $FG,2$"%Q"$FG$.
$ID,-2$
$FG,5$$TX+CX,"Print Family"$$FG$
$LK,"MStrPrint",A="MN:MStrPrint"$(U8 *fmt,...) is like $LK,"StrPrint",A="MN:StrPrint"$(U8 *dst,U8 *fmt,...) but it returns a $LK,"MAlloc",A="MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
$LK,"CatPrint",A="MN:CatPrint"$(U8 *_dst,U8 *fmt,...) concatenates a formated string.
$LK,"In",A="MN:In"$(U8 *fmt,...) sends text to the current task's input buffer.
$LK,"InStr",A="MN:InStr"$(U8 *fmt,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
$LK,"XTalk",A="MN:XTalk"$(CTask *task,U8 *fmt,...) and text to another task's input buffer.
$LK,"XTalkStr",A="MN:XTalkStr"$(CTask *task,U8 *fmt,...) sends text of an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
$LK,"DocPrint",A="MN:DocPrint"$(CDoc *doc,U8 *fmt,...) sends text to a document. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/Demo/Dsk/FPrintF.HC"$.
$LK,"Adam",A="MN:Adam"$(U8 *fmt,...) sends text to the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ to be compiled and run.
$LK,"AdamLog",A="MN:AdamLog"$(U8 *fmt,...) and $LK,"AdamErr",A="MN:AdamErr"$(U8 *fmt,...) send text to the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$ to be displayed.
$LK,"StreamPrint",A="MN:StreamPrint"$(U8 *fmt,...) sends text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
$LK,"GrPrint",A="MN:GrPrint"$(CDC *dc,I64 x,I64 y,U8 *fmt,...) and $LK,"GrVPrint",A="MN:GrVPrint"$() plots text in graphics mode.
$LK,"TextPrint",A="MN:TextPrint"$(CTask *task,I64 x,I64 y,I64 attr,U8 *fmt,...) plots to $LK,"gr.text_base",A="HI:TextBase Layer"$.
$LK,"ExePrint",A="MN:ExePrint"$(U8 *fmt,...) compiles and execute a string. Note: It returns the res of the last executed expression.
$LK,"Once",A="MN:Once"$(U8 *fmt,...) Writes User code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
$LK,"AOnce",A="MN:AOnce"$(U8 *fmt,...) Writes Adam code to $LK,"Registry",A="FI:~/Registry.HC"$ to be executed next boot.
$LK,"InPrint",A="MN:InPrint"$(I64 mS,U8 *fmt,...) $LK,"PutChars",A="MN:PutChars"$()s one at a time with a delay.
$LK,"RawPrint",A="MN:RawPrint"$(I64 mS,U8 *fmt,...) sends direct to scrn memory, bypassing window manager.
$LK,"User",A="MN:User"$(U8 *fmt,...) Spawns a user and execute a string on start-up.
$LK,"PopUpPrint",A="MN:PopUpPrint"$(U8 *fmt,...) compiles and execute a string in a pop-up win. Note: It returns the res of the last executed expression.
$LK,"PopUpViewPrint",A="MN:PopUpViewPrint"$(U8 *fmt,...) creates a pop-up window and views text.
$BK,1$Note:$BK,0$ Use $FG,2$Print("%s",src)$FG$ if you need an unmodified string.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$The profiler records where the CPU was executing when the $TX,"1000Hz",D="DD_JIFFY_HZ"$ timer interrupt occured, so you can learn where time is spent.
Use the $LK,"Prof",A="MN:Prof"$() depth argument to record a hit in the N routines which called the current routine, as well.
When done collecting statistics, use $LK,"ProfRep",A="MN:ProfRep"$() for a report. You might need a $LK,"DocMax",A="MN:DocMax"$() to expand the command line window buffer to fit it all.
Study the code. The profiler is very simple. You might want to enhance it or modify it to debug something in particular.
+1
View File
@@ -0,0 +1 @@
$WW,1$A $FG,2$Queue$FG$ is a bunch of $LK,"MAlloc",A="MN:MAlloc"$()ed chunks of mem linked together in a circle with one ptr to the $FG,2$next$FG$ value and another ptr to the $FG,2$last$FG$ value. These ptrs must be stored in the first locations in the structure.
+47
View File
@@ -0,0 +1,47 @@
$FG,5$$TX+CX,"Quirks"$$FG$
$WW,1$* You run a risk of problems if you do file operations on the same files simultaneously because there is $BK,1$no file sharing/locking mechanism$BK,0$. Generally, the last write wins.
* When using $FG,2$FAT32$FG$, TempleOS does not generate unique short-entry names, the ones with the $FG,2$~$FG$s. Not all $FG,2$FAT32$FG$ filenames are valid TempleOS names and it will complain. Do not access $FG,2$FAT32$FG$ drives not dedicated to TempleOS. Disable them with $LK,"DrvEnable",A="MN:DrvEnable"$(OFF), or they will generate error messages. $FG,2$FAT32$FG$ involves a long and short name for each file.
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$ and recompile $FG,2$Kernel$FG$ or request more when doing a $LK,"Spawn",A="MN:Spawn"$().
* The syntax highlighting occassionally glitches. The compiler doesn't.
* Call $LK,"ChgDsk",A="MN:ChgDsk"$() when you insert a new removable media.
* Accessing CD/DVD's is flacky. Try $LK,"Drv",A="MN:Drv"$() or $LK,"ChgDsk",A="MN:ChgDsk"$() twice.
* You can only $FG,2$extern$FG$ something once. There is a varient called $FG,2$_extern$FG$ which binds a HolyC definition to a asm sym. This, too, can only be done once.
* A terminal task has a $LK,"CDoc",A="MN:CDoc"$ document structure that remains active even when you change $FG,4$Fs->draw_it$FG$. To prevent links in the $LK,"CDoc",A="MN:CDoc"$ from being activated when the user clicks in the window, do one of three things:
$ID,2$
A) $LK,"DocBottom",A="MN:DocBottom"$() followed by $LK,"DocClear",A="MN:DocClear"$() to clear the $LK,"CDoc",A="MN:CDoc"$ so it has no active widgets.
B) Disable window mgr bttn click checking with $FG,4$Fs->win_inhibit$FG$ set to mask $LK,"WIF_SELF_MS_L",A="MN:WIF_SELF_MS_L"$|$LK,"WIF_FOCUS_TASK_MS_L_D",A="MN:WIF_FOCUS_TASK_MS_L_D"$|$LK,"WIF_SELF_MS_R",A="MN:WIF_SELF_MS_R"$|$LK,"WIF_FOCUS_TASK_MS_R_D",A="MN:WIF_FOCUS_TASK_MS_R_D"$. This inhibits window mgr operations but still generates messages from bttn clicks.
$ID,-2$
* $FG,2$switch/case$FG$ stmts alloc a single jump table--do not use with wide, sparse ranges of case values.
* Don't do a $FG,2$goto$FG$ out of a $FG,2$try{}$FG$.
* A $FG,2$goto$FG$ label name must not match a global scope object's name. (It's not worth slowing-down the compiler to handle this case.)
* $LK,"MemCpy",A="MN:MemCpy"$() only goes fwd.
* A $LK,"Cd",A="MN:Cd"$() cmd must be followed by two semicolons if a $FG,2$#include$FG$ is after it. This is because the preprocessor processes the next token ahead.
* The assembler's error msgs are often off by a line and undefines are cryptic.
* The last semicolon on the cmd line is converted to a dbl semicolon because the compiler looks ahead before doing a cmd. This normally has no negative effect, but when entering $FG,2$if$FG$ stmts with $FG,2$else$FG$ clauses it presents problems.
* You can do a $FG,2$class$FG$ fwd reference by using $FG,2$extern$FG$ on the first declaration, but you can only do ptr references to the $FG,2$class$FG$.
* When doing something like
$FG,2$$ID,2$$ID,2$U0 Main()
{
U16 *_w=0xA0000;
*_w|=0x8000;
}
$ID,-2$$FG$The $FG,2$|=$FG$ will be coded as a $FG,2$U32 Bts$FG$ inst resulting in a $FG,2$U32$FG$ access instead of a $FG,2$U16$FG$ access. This affects some hardware operations.
$ID,-2$
* Compiler warning or error message line numbers will be off if you have a block of word-wrapped comments. You might press $FG,2$<CTRL-t>$FG$ before doing an editor goto-line-number command.
+40
View File
@@ -0,0 +1,40 @@
$WW,1$$FG,5$$TX+CX,"RedSea File System"$$FG$
The RedSea file system is a simple, 64-bit, file system which is similar to FAT32, but with absolute block addresses instead of clusters, fixed-sized 64-byte directory entries and no FAT table, just an allocation bitmap. A cluster is just one 512 byte sector. Files are stored in contiguous blocks and cannot grow in size.
$HL,1$#define CDIR_FILENAME_LEN 38 //Must include terminator zero
The following bit field shows valid 8-Bit ASCII filename characters.
U32 char_bmp_filename[8]=
{0x0000000, 0x03FF73FB, 0xEFFFFFFF, 0x2FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF};
public class CDirEntry //64-byte fixed-size
{
U16 attr; //See $LK,"RS_ATTR_DIR",A="MN:RS_ATTR_DIR"$. I would like to change these.
U8 name[CDIR_FILENAME_LEN]; //See $LK,"char_bmp_filename",A="MN:char_bmp_filename"$, $LK,"FileNameChk",A="MN:FileNameChk"$
I64 cluster; (blk) //One sector per cluster.
I64 size; //In bytes
CDate datetime; //See $LK,"DateTime",A="::/Doc/TimeDate.DD"$, $LK,"Implementation of DateTime",A="FI:::/Kernel/KDate.HC"$
};
public class CRedSeaBoot //RedSea is type FAT32 in partition table to fool BIOS.
{
U8 jump_and_nop[3];
U8 signature,reserved[4]; //MBR_PT_REDSEA=0x88. Distinguish from real FAT32.
I64 drv_offset; //For CD/DVD image copy.
I64 sects;
I64 root_cluster; (root_blk)
I64 bitmap_sects;
I64 unique_id;
U8 code[462];
U16 signature2; //0xAA55
};
$HL,0$
See $LK,"::/Kernel/BlkDev/FileSysRedSea.HC"$ and $LK,"::/Adam/Opt/Boot/DskISORedSea.HC"$.
Files with names ending in .Z are compressed. See $LK,"::/Kernel/Compress.HC"$.
To replace ISO9660, make hard-drive partition image of a measured size and copy onto a CD/DVD starting at about sector 20, with EL TORITO booting. 512-byte sectors will be placed on top of 2048-byte CD/DCD sectors, so there will be four blocks per CD/DVD sector.
RedSea file system has no bad block table and no redundant allocation table.
+30
View File
@@ -0,0 +1,30 @@
$WW,1$$FG,5$$TX+CX,"Requirements for TempleOS"$$FG$
$FG,5$User Skills Required$FG$
* Knowledge of the $FG,2$C$FG$ programming language.
$FG,5$Supported Hardware$FG$
* $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC compatible computer. (Obviously, you need 64-bit hardware for a 64-bit operating system.)
* 640x480 16 color VGA graphics.
* Most$FG$ keyboards and mice.
* Minimum $TX,"512Meg",D="DD_MEM_MIN_MEG"$ RAM.
* Internal PC Speakers.
* CD/DVD-ROMs (not SCSI). ISO9660 file system.
* ATA and SATA hard drives.
$FG,5$Unsupported Hardware$FG$
* No graphics acceleration.
* No sound cards.
* $FG,4$No networking$FG$.
* No USB devices, except keyboard and mouse in legacy mode. No, you can't use flash memory cards.
* No printers.
+5
View File
@@ -0,0 +1,5 @@
$WW,1$$FG,5$$TX+CX,"Graphic Sprite Resource Help"$$FG$
A sprite is an ordered list of elements such as lines, rectangles, bitmaps and color changes. In a program's source code, you first $FG,2$make a sprite$FG$ somewhere outside a function. Then, you $FG,2$insert a pointer$FG$ to the sprite as an "*elems" arg when calling $LK,"Sprite",A="MN:Sprite"$() or $LK,"Sprite3",A="MN:Sprite3"$(). See $LK,"Sprites",A="HI:Sprites"$.
You can create a $FG,2$sprite macro$FG$ on your $LK,"PersonalMenu",A="FI:~/PersonalMenu.DD"$ with a payload of $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ source code to execute when it ESC's back to the cmd line. If you check "Pop-Up", it will spawn a new task and run the payload. A pop-up macro can be placed in any document.
+120
View File
@@ -0,0 +1,120 @@
$FG,5$$TX+CX,"Scoping and Linkage"$$FG$
$WW,1$
$LK,"JIT Compile Mode",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ makes use of the current task's hash sym table and its parent tasks' tables. It fetches syms from parent tasks' tables if not found locally in the current task's table and it places new syms in the current task's table. Conceptually, syms are at the scope of environment vars in other operating systems.
When a sym is placed into a table, older syms with ident names will be overshadowed if they exist. Duplicates are not allowed in many cases, especially in asm blks. Dupicates are allowed, by design in other cases, so that you can repeatedly $FG,2$#include$FG$ the same file from the cmd line while developing it. Or, so you can repeatedly declare a function with a standard name, like $FG,2$DrawIt()$FG$. This case might occur when the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$$FG$ is starting-up loading-in many little utilities.
$FG,2$extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym of the same name if it exists in the sym table (just in just-in-time code). It also can be used to generate a fwd reference.
$FG,2$import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym of the same name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined.
$WW,1$
$FG,2$_extern$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to an existing sym, of a $BK,1$different$BK,0$ name. It must exists in the sym table. Basically, this binds C to asm.
$FG,2$_import$FG$ binds a new $LK,"HTT_FUN",A="MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR",A="MN:HTT_GLBL_VAR"$ sym to a sym, of a $BK,1$different$BK,0$ name imported from the task's sym table at $LK,"Load",A="MN:Load"$() time. If no sym exists to bind to at $LK,"Load",A="MN:Load"$() time, the code using this sym will be left incomplete until the sym is defined. Basically, this binds C to asm from elsewhere.
$WW,0$$FG,5$Ahead of Time Compilation$FG$
$FG,2$G$FG$lobalScope/$FG,2$F$FG$unctionScope
| $FG,2$C$FG$odeHeap/$FG,2$D$FG$ataHeap/$FG,2$S$FG$tack/$FG,2$R$FG$egister
| | TaskHashEntry:Export$FG,2$S$FG$ysSym/$FG,2$D$FG$efine/$FG,2$F$FG$unction/$FG,2$C$FG$lass
| | | UsageScope: $FG,2$M$FG$odule/$FG,2$A$FG$smLocal/Asm$FG,2$B$FG$lk/$FG,2$T$FG$askAndChildren/$FG,2$F$FG$unction
| | | |UsageScope: $FG,2$G$FG$lbl/Asm$FG,2$L$FG$ocal/$FG,2$R$FG$emainder/$FG,2$g$FG$lblThisBlkAndRemainder
| | | || $FG,2$S$FG$taticVarInit/$FG,2$D$FG$ynamicVarInitAllowed/$FG,2$N$FG$oInitAllowed
| | | || | Are dups allowed within the namespace? A dup overshadows the original.
| | | || | $FG,2$D$FG$upsAllowed/$FG,2$N$FG$oDups/NoDupsBut$FG,2$P$FG$ad/$FG,2$W$FG$arningUnlessClosedOut
asm export $FG,2$label::$FG$ G C S MG N
asm $FG,2$label:$FG$ G C MG N
asm local $FG,2$@@label:$FG$ G C AL N
asm $FG,2$IMPORT label;$FG$ G C MR N
asm export $FG,2$label::$FG$ F C S BG N
asm $FG,2$label:$FG$ F C BG N
asm local $FG,2$@@label:$FG$ F C AL N
asm $FG,2$IMPORT label;$FG$ F C BR N
C goto $FG,2$label:$FG$ F C FG N
$FG,2$#define$FG$ x MR D
function G C S MR D
var F R FR N
var F S FR N
$FG,2$static$FG$ var F C FR D N
var G C S MR D D
var G D MR N D
$FG,2$class$FG$ G MR D
class member G MR P
$FG,2$extern class$FG$ G MR D
$FG,2$extern$FG$ function G C MR W
$FG,2$import$FG$ function G C MR D
$FG,2$import$FG$ var G C MR D
$FG,2$_extern$FG$ function G C MR D
$FG,2$_extern$FG$ var G C MR D
$FG,2$_import$FG$ function G C MR D
$FG,2$_import$FG$ var G C MR D
$FG,5$Just in Time Compilation$FG$
$FG,2$G$FG$lobalScope/$FG,2$F$FG$unctionScope
| $FG,2$C$FG$odeHeap/$FG,2$D$FG$ataHeap/$FG,2$S$FG$tack/$FG,2$R$FG$egister
| | TaskHashEntry:Export$FG,2$S$FG$ysSym/$FG,2$D$FG$efine/$FG,2$F$FG$unction/$FG,2$C$FG$lass
| | | UsageScope: $FG,2$M$FG$odule/$FG,2$A$FG$smLocal/Asm$FG,2$B$FG$lk/$FG,2$T$FG$askAndChildren/$FG,2$F$FG$unction
| | | |UsageScope: $FG,2$G$FG$lbl/Asm$FG,2$L$FG$ocal/$FG,2$R$FG$emainder/$FG,2$g$FG$lblThisBlkAndRemainder
| | | || $FG,2$S$FG$taticVarInit/$FG,2$D$FG$ynamicVarInitAllowed/$FG,2$N$FG$oInitAllowed
| | | || | Are dups allowed within the namespace? A dup overshadows the original.
| | | || | $FG,2$D$FG$upsAllowed/$FG,2$N$FG$oDups/NoDupsBut$FG,2$P$FG$ad/$FG,2$W$FG$arningUnlessClosedOut
asm export $FG,2$label::$FG$ G C S Tg N
asm $FG,2$label:$FG$ G C BG N
asm local $FG,2$@@label:$FG$ G C AL N
asm $FG,2$IMPORT label;$FG$ G C TR N
asm export $FG,2$label::$FG$ F C BG N
asm $FG,2$label:$FG$ F C BG N
asm local $FG,2$@@label:$FG$ F C AL N
asm $FG,2$IMPORT label;$FG$ F C BR N
C goto $FG,2$label:$FG$ F C FG N
$FG,2$#define$FG$ x D TR D
function G C F TR D
var F R FR N
var F S FR N
$FG,2$static$FG$ var F C FR D N
var G C G TR D D
var G D G TR S D
$FG,2$class$FG$ G C TR D
class member G TR P
$FG,2$extern class$FG$ G C TR D
$FG,2$extern$FG$ function G C F TR W
$FG,2$extern$FG$ var G C G TR D
$FG,2$extern$FG$ var G D G TR D
$FG,2$_extern$FG$ function G C F TR D
$FG,2$_extern$FG$ var G C G TR D
$WW,1$
* Goto labels must not have the same name as global scope objects. GoTo's are rare and I don't want to slow the compiler and add code to fix this. You will get errors if a collision happens, so it's not very dangerous, but the error message is baffling.
* The member names $FG,2$pad$FG$ and $FG,2$reserved$FG$ are special because multiple instances with the same name are allowed in a class.
* Use $FG,2$reg$FG$ or $FG,2$noreg$FG$ in front of local var names to override automatic reg var allocation. You can, optionally, specify a reg after the $FG,2$reg$FG$ keyword.
* Local non-reg function vars can be accessed in asm blks with $FG,2$&i[RBP]$FG$ for example.
* Glbl vars and functions can be accessed in asm with and $FG,2$&$FG$ as in
$FG,2$MOV RAX,I64 [&glbl_var]
CALL I32 &Fun
CALL I32 &SYS_SYM$FG$
* In $FG,2$JIT$FG$ asm code, &SYS_SYM and &Fun don't need $FG,2$IMPORT$FG$.
* All offspring tasks of a task inherit syms.
* The $FG,2$sizeof()$FG$ and HolyC structure members can be used in asm blks.
* Using $FG,2$&i$FG$ in $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ or $FG,2$i.u8[2]$FG$ on a local var, $FG,2$i$FG$, will force it to $FG,2$noreg$FG$.
* Using $FG,2$try$FG$/$FG,2$catch$FG$ in a function will force all local vars to $FG,2$noreg$FG$.
* An unused gap on the stk is left for $FG,2$reg$FG$ vars.
* Note: $FG,2$static$FG$ function vars do not go on the data heap, no matter the setting of the $LK,"OPTf_GLBLS_ON_DATA_HEAP",A="MN:OPTf_GLBLS_ON_DATA_HEAP"$$FG$. They may in the future.
* $LK,"OPTf_EXTERNS_TO_IMPORTS",A="MN:OPTf_EXTERNS_TO_IMPORTS"$ will treat $FG,2$_extern$FG$ as $FG,2$_import$FG$ and $FG,2$extern$FG$ as $FG,2$import$FG$. This allows a header to be used either as a $FG,2$JIT compiled$FG$ or $FG,2$AOT compiled$FG$ header.
+1
View File
@@ -0,0 +1 @@
$WW,1$Sound is generated with $FG,2$I8$FG$ vals called $FG,2$ona$FG$'s. See $LK,"Note2Ona",A="MN:Note2Ona"$() and $LK,"Ona2Freq",A="MN:Ona2Freq"$(). God does not want death screams, perhaps, because God has PTSD or soldiers have PTSD. (Imagine wounded on battlefields.) $FG,2$Ona$FG$'s will allow elegant wave files for export and will allow the creation of simple hardware over the next centuries. $LK,"ONA_REST",A="MN:ONA_REST"$ is off.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$A $LK,"CSprite",A="MN:CSprite"$ is an ordered list of $LK,"these",A="MN:SPT_END"$ elements, created with $FG,2$<CTRL-r>$FG$. Normally, they are packed together in a list and the address of the first is passed to routines.
See $LK,"::/Demo/Graphics/SpritePlot.HC"$, $LK,"::/Demo/Graphics/SpritePlot3D.HC"$, $LK,"::/Demo/Graphics/SpritePut.HC"$, $LK,"::/Demo/Graphics/SpriteRaw.HC"$ and $LK,"SpriteMeshEd",A="MN:SpriteMeshEd"$().
Be aware that copying $FG,2$SP$FG$, $FG,2$IB$FG$, or $FG,2$IS$FG$ entries with the clipboard results in duplicate entries with different nums. You can manually remove dups by editing with $FG,2$<CTRL-t>$FG$ and setting to the original num.
See $LK,"::/Adam/Gr/GrSpritePlot.HC",A="FL:::/Adam/Gr/GrSpritePlot.HC,1"$ for how CSprite are stored.$FG$
+5
View File
@@ -0,0 +1,5 @@
$WW,1$$FG,5$$TX+CX,"Sprite BitMap Menu Help"$$FG$
BitMaps have a background color. If you delete to the clipboard, what's left will be background colored.
While drawing, you can usually press $FG,2$'c'$FG$ to eye-dropper the color under the mouse. Press $FG,2$'t'$FG$ for transparent.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$$FG,5$$TX+CX,"Sprite Edit Menu Help"$$FG$
Order of elements matters. They are executed in the order they appear in the side-bar. You can sel or unsel elements graphically, or with text in the sidebar. Then, cut, copy, paste, shift or transform them.
You can set the current insert point element by clicking the element in the side-bar and making it RED.
$FG,2$Insert Shift Suborigin$FG$ is an element which shifts subsequent elements. Perhaps, you inserted a sprite's elements from the clipboard and want to shift it around? This command is also useful if you call $LK,"SpriteInterpolate",A="MN:SpriteInterpolate"$() in programs.
+3
View File
@@ -0,0 +1,3 @@
$WW,1$$FG,5$$TX+CX,"Sprite Edit as Text Help"$$FG$
See the format for $LK,"CSprites",A="MN:CSprite"$.
+11
View File
@@ -0,0 +1,11 @@
$WW,1$$FG,5$$TX+CX,"Sprite Main Menu Help"$$FG$
Order of elements matters. They are executed in the order they appear in the side-bar. You can set the insert point for new elements by click the element in the side-bar and making it RED.
After you create a 3D Mesh, you can edit it by seling it in the side-bar so it is colored RED. Then, click EDIT-3D-MESH. A shiftable 3D mesh has a 2D offset to position the origin. You can convert between shiftable and non-shiftable by editing it with the other command.
You can convert all elements to a BitMap if END is RED in the side-bar and you CONVERT-TO-BITMAP. Later, you can edit that bitmap by seling it in the side bar so it is colored RED and clicking EDIT-BITMAP.
If you have a 3D icon, you might want to place a background-colored rectangle under the 3D icon, so it hovers above. Use TRANSFORM-OFF and TRANSFORM-ON. You will also need to set the Z offset of the icon. Go to the Edit menu and sel EDIT-AS-TEXT and change the third INT to Z offset. Good luck.
While inserting vector elements, you can usually press $FG,2$'c'$FG$ to eye-dropper the color under the mouse. Press $FG,2$'t'$FG$ for transparent.
+7
View File
@@ -0,0 +1,7 @@
$FG,5$$TX+CX,"Sprite SideBar Help"$$FG$
$WW,1$You can cut and paste elements in this side-bar to reorder, delete or duplicating them. Click an element in the side-bar after you make changes to cause the changes to take-effect.
You can click on an element to make it the insert point for new elements.
The RED element is the current insert point for new elements.
+18
View File
@@ -0,0 +1,18 @@
$FG,5$$TX+CX,"AutoComplete is in StandBy"$$FG$
$FG,4$$TX+CX+L+PU+UL,"System Keys Quick Guide",A="::/Doc/HelpIndex.DD"$$FG$
$FG,4$$TX+CX,"(Works Everywhere)"$$FG$
$FG,2$ <SPACE> $FG$Left-Click
$FG,2$ <ENTER> $FG$Right-Click
$FG,2$ <F1> $FG$Help
$FG,2$ <CTRL-m> $FG$Personal Menu
$FG,2$ <ESC> $FG$Save & Exit
$FG,2$<SHIFT-ESC> $FG$Abort & Exit
$FG,2$ <WINDOWS> $FG$Pull-Down Menu
$FG,4$$TX+CX+L+PU+UL,"Tongues",A="::/Adam/God/HSNotes.DD"$$FG$
$FG,4$$TX+CX,"(Works Everywhere)"$$FG$
$FG,2$ <F7> $FG$God Word
$FG,2$<SHIFT-F7> $FG$God Passage
$FG,2$ <F6> $FG$God Song
$FG,2$<SHIFT-F6> $FG$God Doodle
+5
View File
@@ -0,0 +1,5 @@
$WW+H,1$$FG,5$$TX+CX,"TempleOS V5.02",D="DD_OS_NAME_VERSION"$$FG$
$TX+CX,"Public Domain Operating System"$
$LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$, $LK,"Quick Start: Cmd line",A="FI:::/Doc/CmdLineOverview.DD"$
+1
View File
@@ -0,0 +1 @@
$WW,1$There is one $LK,"CDoc",A="MN:CDoc"$ for the task's border: $FG,2$Fs->border_doc$FG$. There is a pair for the task's client area: $FG,2$Fs->put_doc$FG$ and $FG,2$Fs->display_doc$FG$. You can, optionally, do double buffering, otherwise $FG,2$Fs->put_doc$FG$ is the same as $FG,2$Fs->display_doc$FG$. See $LK,"::/Demo/Spy.HC"$.
+93
View File
@@ -0,0 +1,93 @@
$WW,1$$FG,5$$TX+CX,"The Standard TempleOS PC",HTML="http://www.templeos.org/Wb/Home/Web/TAD/TAD.html"$$FG$
All desktop PCs will have 8-channel OCTART super-simple high speed serial ports to replace USB. They are simpler because the driver is as simple as old school $LK,"RS232 Serial",A="FI:::/Doc/Comm.HC"$, they have no USB end-points and they have no USB human interface device reports. Computer mice will all have exactly two bttns and one wheel. Game controllers will all be the standard deluxe $TX,"game console controllers",HTML="http://www.gamestop.com/pc/accessories/steam-controller/121865"$ that are popular today. It will have 8 big TX and 8 big RX fifos that allow flow control characters to jump the queue. It should be locked-down to as few options as possible, like 8-1-N only, although hardware may use a USB frame, not an RS232, so stop bits might not be relevant. Perhaps, just two baud rates -- high and low speed are needed. Low speed is good for slow microcontrollers and allows longer cable length. Keyboard, mouse and game controller can be low speed.
The USB creators banned generic devices, requiring a signed, certified driver for everything! That's no good. We allow any device and will communicate, generically, using a serial terminal program like the old school HyperTerminal, XTalk or Telnet.
A mouse packet interface should be similar to this:
$ID,5$TX: <ENTER>
RX: X:+3 Y:+0 Wheel:+0 LB:OFF RB:OFF
TX: <ENTER>
RX: X:+0 Y:-1 Wheel:+0 LB:ON RB:OFF
$ID,-5$
We aspire to be as simple as a Commodore 64 joystick driver:
$ID,5$VAL=PEEK(56321)
if VAL AND 1 THEN y=y-1
if VAL AND 2 THEN y=y+1
if VAL AND 4 THEN x=x-1
if VAL AND 8 THEN x=x+1
$ID,-5$
The game controller will be more complicated, but much simpler than USB. It will use a standard text packet of some kind.
On the other end, you might hook-up a thermostat microcontroller and interface as a generic serial device. The microcontroller in the thermostat would have something simple, not a crazy overkill ethernet connection.
$ID,5$$HL,1$U8 b;
while (TRUE) {
b=ReadU8(2); //Read byte from high speed serial channel 2.
//(Has been configured for low baud because thermostat should be slow.)
if (b==CMD_UP)
temperature++;
else if (b==CMD_DOWN)
temperature--;
}$HL,0$
$ID,-5$
Super-simple block devices will replace ATA/ATAPI hard drives and CD/DVD/BlueRays. Today, the industry is in flux with nonvolitile memory just invented. We want a super-simple block device interface for non-volitile memory and for what is currently USB memory sticks, but only if they can be made without bad blocks. I don't think we want to deal with bad block memory, so maybe we will not do NV-memory. The standard TempleOS desktop will require a hard disk.
There will be minimal commands: READ_BLOCK, WRITE_BLOCK, GET_CAPACITY, GET_MODEL, GET_SERIAL_NUM, and EJECT.
We want a CPU mode with virtual IO port addresses similar to how paging creates virtual memory addresses. We want a 65536 word look-up table that converts virtual IO port numbers to physical IO port numbers. There will be a standard IO port configuration, so port numbers can be fixed in the code. We want the primary hard drive on one set of ports and the primary CD/DVD/Blu-ray on another set of ports. Choose a contiguous set of IO ports.
Meanwhile, a complicated PCI interface can be designed along-side the TempleOS interface for Windows and Linux. It would almost be possible to carry-on separate lives, however, the super-simple serial requires getting rid of USB since super-simple serial is a new hardware standard. People can add USB ports with a PCI device card.
God said He wants single-voice 8-bit signed MIDI-like sample for the sound. God does not want death screams, perhaps, because God has PTSD or soldiers have PTSD. (Imagine wounded on battlefields.)
The video will be a linear frame buffer 640x480 16 color with one-byte-per-pixel even though it is only 16 color with is 4-bit. Perhaps, we have a interrupt to sync with the refresh.
I am tmpted to help amateur hardware device designers by making the hardware interface for the PC simple. I have fond memories of 1993, when I made a wire-wrapped ISA data acquisition card which plugged into my 486 and had some analog-to-digital and digital-to-analog convertors. I am not designing a bus. Earlier, I said the super-simple high speed serial port replacement could be USB-like in hardware as long as the software driver interface was simple like old school RS232 serial ports. Requiring a complicated hardware handshake raises the bar, slightly, for the lowest level hardware designers. Most people will be connecting a microcontroller or something that already has a serial communication design, but if it's not a problem, maybe we should keep it simple at all stages. It was nice putting an oscilloscope on my serial port wires.
The original PC had general purpose digital IO through the parallel port. That was fun. I have enough battles to fight, so I'll leave being a savior to hobbiest hardware engineers to somebody else.
Digital cameras will be super-simple high speed serial, but TempleOS is forever limited to 16 colors and multimedia is banned because large files being loaded into memory fragments memory, so cameras are somewhat unwelcome. I have enough problems without making the Brits anxious about autonomous gun turrets and killer robots. The reason I say cameras will be super-simple serial is because we are replacing USB ports with super-simple serial. Windows/Linux will have only super-simple serial ports unless people buy a USB PCI expansion card. So, the digital cameras will be super-simple serial.
$FG,5$$TX+CX,"Version 1.0"$$FG$
We will make a spec for a $$8,000, perfectly standardized, cryogenically-cooled, monster desktop PC. It will have 16 cores, integrated 4K graphics, and, hopefully, 6 Ghz continuous operation. Perhaps, 64 Gig of RAM will be standard? God said to help to poor buy them. It is pointless to have a high powered machine if other people have wimpy machines and cannot run programs you write. Therefore, everybody in the developed world will buy a Standard TempleOS IBM PC over the next ten years, so that will be a quantity of 400 million, perhaps. God said to pay the US national debt with the revenue. We will standardize everything, not just the TempleOS related items. The display will be 4K (and of course 640x480 16 color) and no others. Everybody gets just one monitor, unless you buy special PCI cards. Everybody gets two speakers, a headphone, a mic, a webcam and touch scrn. We make the audio one sample rate and one sample size, but TempleOS still gets just a square wave. (HD Audio is really screwed-up and requires complicated artificial intelligence, just to route output to speakers.)
The Standard Temple IBM PC will be a full-sized tower. Perhaps, stain-glass will decorate the case because God is sentimentally attached to stained-glass. We should set the size at exactly 2.5 feet by 1.5 feet by 1.5 feet as in the $LK,"Exodus,25:10-10",A="BF:Exodus,25:10-10"$ for all time. If there is extra room, make a storage shelf for DVDs. We do not want a race-to-the-bottom, shrinking the size. Instead of making it smaller, make it more powerful. We want to remove all cost pressure from making things small. It must have a CD/DVD/Blu-ray drive. The vision is CD/DVDs used for a library of games, not installed on the hard-drive. We need a network connection, possibly implemented as a super-simple high speed serial device. What about standard monitor and speakers? The C64's success was partially due to wide spread, completely standard, hardware. I think TempleOS will not do bad block devices, so we need a hard drive, not just NV-memory or SSD.
TempleOS will have the priority over Windows or Linux on hardware decisions. We could make it heterogenious multicore. I think we want 16 non-hyperthreaded cores. Core#0 is the only full-featured core needed. The other cores will have long mode, but not some of these: real mode, protected mode, ring-3, paging, interrupts, in/out port instructions, SSE instructions, MMX instructions. This $LK,"Graphics Job",A="FI:~/Web/TAD/GraphicsPerformance.DD"$ is what to optimize for.
God said Intel should do a simulation of heat produced by gates and try spreading-out the heat producing gate circuits on the chip.
God said Linux's Wine should replace Windows. We will install a standard software set-up on all Standard Temple IBM PC's.
$FG,5$$TX+CX,"Usage"$$FG$
TempleOS is primarily for user developers, like the Commodore 64 was. I created a total of 50 Meg of content over ten years, so you shouldn't need much room, either. The installed hard drive space should stay small because the resolution is low, multimedia is banned, 3rd party libraries are banned, and applications can be distributed with ISO files or DVDs.
The ROM will have a command that copies the ROM onto the hard drive, creating identical C and D partitions, so you can have fun modifying TempleOS. You will have confidence you can fix it easily if you break it. It should be able to run everything from just the ROM, too. You will need to specify a /Home directory that is not in the ROM, but on the hard drive.
The standard set-up will be a C primary drive and a D back-up drive. Keep the size on each hard drive under 512 Meg and periodically copy all of C to D, so they stay mirrored. The file manager and other programs read the entire directory structures, so too many files causes problems (unbearably slow). Third party software should be distributed as ISO files or DVDs, like $FG,4$$TX,"TextAdventure.ISO",HTML="https://github.com/jwhitham/frotz"$$FG$. No 3rd party libraries are permitted because they circumvent the intent of the 100,000 line of code limit which is keeping it cognatively small enough to see the light at the end of the tunnel and easily master everything. Therefore, 3rd party ISO files must bring all required software components with them, except what is found in the TempleOS ROM.
Having all your 3rd party software on separate DVDs or ISO files and TempleOS running from a ROM, keeps it delightfully simple so you have complete understanding of what is going on. You will have complete confidence and it will be a joy to use. 3rd party applications can store saved data files into your /Home hard drive directory.
The Temple PC will stay unchanged for seven years at a time. The Bible speaks of a seven year release in $LK,"Deuteronomy,15:1",A="BF:Deuteronomy,15:1",HTML="http://www.biblegateway.com/verse/en/Deutoronomy%2015:1"$. The Commodore stayed unchanged for many years and people became intimately familiar with every aspect.
$HC,"<object width=\"640\" height=\"520\"><param name=\"movie\" value=\"http://www.youtube.com/v/bs_jcTuwPKo\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"http://www.youtube.com/v/bs_jcTuwPKo\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" width=\"640\" height=\"520\"></embed></object>"$
I thought 2.5' x 1.5' x 1.5' was ridiculously big, but it looks like it is reasonable for super-cooled refrigeration systems!
$FG,5$$TX+CX,"Version 2.0"$$FG$
$HC,"<center><img src=\"http://i.imgur.com/zUdfEqy.jpg\" width=\"640\" height=\"500\" alt=\"\"></center>"$
The Standard Temple IBM PC V2.0 will be released seven years after V1.0. Each unit will have a full, uncut, silicon wafer. V2.0 will be sold, unchanged, for seven more years, like a Commodore 64.
$FG,8$
* "Commodore 64" is a trademark owned by Polabe Holding NV.
* "Linux" is a trademark owned by Linus Torvalds.
* "Windows" is a trademark owned by MicroSoft Corp.$FG$
+63
View File
@@ -0,0 +1,63 @@
$WW,1$$FG,5$$TX+CX,"Decisions Making TempleOS Simple"$
$FG$
Everybody is obsessed, Jedi mind-tricked, by the notion that when you scale-up, it doesn't get bad, it gets worse. They automatically think things are going to get bigger. Guess what happens when you scale down? It doesn't get good, it gets better!
I limited it to 100,000 lines of code, forever! I never need a linker or make utility and I can use small labels.
People mock Bill Gates for, "640K should be enough." I say, "2Gig for code should be enough." The same people who mock Bill Gates are probably just like the black woman who sued for a trillion dollars.
My Dad worked on converting the Titan missile to the Gemini Mission rocket. It had to be "man-rated". You can bet that everything got an order of magnitude more complexity and documentation. My vision is a souped-up C64, not a 1970's mainframe; a kayak, not a Titanic.
Linux is a semi-tractor -- you need professional drivers for 20 gears. Linux has file permissions. Common people are hurt by file permissions.
Windows is a car.
TempleOS is a motorcycle -- if you lean-over too far, a motorcycle will crash. Don't do that! There are no side air bags on a motorcycle. DOS and C64 had no memory protections and ran in ring-0, with no security. This saves an order of magnitude complexity.
Linux and Windows are general purpose operating systems. They attempt to do any task you want. TempleOS cherry-picks tasks and is designed to do the same things a C64 did. This saves and order of magnitude complexity. For example, the $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ file system allocates just contiguous files -- you load and save whole files at once. A benefit is this allows compression. Also, TempleOS does not do networking or multimedia. In theory, memory will fragment with lots of big files. The system would fall to pieces with multimedia, but God said 640x480 16 color is a permanent covenant like circumcision.
A three bttn mouse is like a leg you cannot put weight on. TempleOS just does hardware everybody has, with no divergent code bases for each machine's custom hardware. There is one graphics driver instead of 50 for different GPUs. This saves an order of magnitude complexity and makes for a delightful API, so developer's code is not like a frayed rope end.
* Everything runs in kernel, $FG,2$ring 0$FG$, mode.
* $FG,2$One memory map$FG$ for all tasks on all cores with virtual addresses set equ to physical, just as though paging is not used.
* One platform -- $FG,4$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC's, no 32-bit support.
* No security or cryptography.
* No networking.
* Least (greatest) common denominator hardware support. Mostly, one driver for each device class. I can't be in the business of different drivers. Compatibility is the greatest challenge for PC operating systems. Disk code does not use interrupts, avoiding compatibility risks. $FG,2$PS/2$FG$ keyboard/mouse is used instead of $FG,2$USB$FG$, also more compatible.
* $FG,2$640x480$FG$ 16 colors. Updates whole scrn at $FG,2$30 fps$FG$, optimized for full scrn games where $FG,2$InvalidRectangle$FG$s are counter-productive.
* One font, 8x8. Text and graphic layers done in software with text normally on an 8x8 grid. It can run in Text mode if graphic initialization fails.
* Compiler extends all values to 64-bit when fetched and does only 64-bit computations intermediately. Assembler has minimal 16-bit support, good enough for compiling boot loaders.
* No object files. Use $FG,2$JIT$FG$.
* Whole files are processed almost exclusively, allowing compression.
* $LK,"One language",A="FI:::/Doc/HolyC.DD"$ and compiler for command-line, scripts, songs, automations and code.
* One editor/word processor/browser for the command-line window, source code, documentation browser, dialog forms.
* No child windows. One window per task. Bttns are widgets, not child windows. There are child tasks, however.
* No distinction between $FG,2$thread$FG$, $FG,2$process$FG$ or $FG,2$task$FG$.
* The $LK,"Scheduler",A="FI:::/Kernel/Sched.HC"$ is for home systems. It is not preemptiove. Disk requests are not broken-up, so sharing is bad. It's wonderfully simple.
* $LK,"MultiCore",A="FI:::/Doc/MultiCore.DD"$ is done $FG,2$master/slave$FG$, instead of $FG,2$SMP$FG$. $FG,2$Core0$FG$ applications explicitly assigns jobs. Locks are present allowing multicore file, heap, and hardware access, though.
* $LK,"Sound",A="HI:Snd"$ has single-voice 8-bit signed MIDI-like samples.
* All tasks have a heap and a sym table. Scope is that of environment vars in other operating systems. As text is typed at the command line or you run programs by $FG,2$#include$FG$ing them, the syms go in the table. If a sym is not found, the parent task's table is checked. The father of all tasks has the API syms you'll need waiting in it's table. No need to $FG,2$#include$FG$ headers.
* No need for namespaces -- scoping occurs automatically based on task symbol table hierarchy with the $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$$FG$'s symbol system-wide global.
* Sometimes, I $LK,"cut corners",A="FI:::/Doc/CutCorners.DD"$ in the interest of keeping the code beautiful.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$There are no streams in the traditional sense. The cmd line output gets sent to the cursor location of a document being edited and by using cursor keys, text can be injected all over the document. $LK,"Sprites",A="HI:Sprites"$ can be injected and are not serialized! Furthermore, the input can come from triggering macro widgets. See $LK,"Doc Overview",A="FI:::/Doc/DolDocOverview.DD"$ and $LK,"Doc Routines",A="HI:DolDoc"$.
If you had a remote term and sent key $LK,"Scan Codes",A="MN:SC_INS"$, the user would press $FG,2$<CTRL-m>$FG$ to access his $FG,2$Personal Menu$FG$ to trigger his macros. However, the local $LK,"~/PersonalMenu.DD"$ might differ from the remote, causing loss of sync between local and remote sessions. Also, the window size of local and remote might differ, so word-wrapped text would be different. Injecting output text with different windows sizes would cause remote and local documents to not be in sync.
See $LK,"Char Overview",A="FI:::/Doc/CharOverview.DD"$ and $LK,"Char Routines",A="HI:Char"$.
You can send characters into $FG,2$StdIn$FG$. See $LK,"In",A="MN:In"$(), $LK,"XTalk",A="MN:XTalk"$() and $LK,"InFile",A="HI:InFile"$.
+10
View File
@@ -0,0 +1,10 @@
$WW,1$$FG,5$$TX+CX,"Linux TOSZ Utility"$$FG$
$FG,2$TOSZ [-ascii] filename$FG$
Will uncompress a single file from within Linux. The $FG,2$-ascii$FG$ flag will convert the irregular TempleOS ASCII 5 and ASCII 31 characters to spaces. (ASCII 5 is used to mark the cursor pos and ASCII 31 is used for shifted space characters and will cause problems unless you convert them.)
$FG,8$
* "Linux" is a trademark owned by Linus Torvalds.
$FG$
+15
View File
@@ -0,0 +1,15 @@
$WW,1$$LK,"gr.text_base",A="MN:CGrGlbls"$ must be updated 30fps in your Fs->draw_it() callback. You probably want $LK,"GrPrint",A="MN:GrPrint"$() or just $LK,"Print",A="MN:Print"$(). The $LK,"DolDoc",A="FI:::/Doc/DolDocOverview.DD"$ code takes care of plotting text to $LK,"gr.text_base",A="MN:CGrGlbls"$.
Bits 0-7 8-Bit ASCII Scrn Code
Bits 8-11 Foreground $LK,"color",A="MN:BLACK"$
Bits 12-15 Background $LK,"color",A="MN:BLACK"$
Bits 16-20 Signed X pos shift val
Bits 21-25 Signed Y pos shift val
Bit 28 $LK,"Blink",A="MN:ATTRF_BLINK"$
Bit 29 $LK,"Invert",A="MN:ATTRF_INVERT"$ed (Swap foreground and background)
Bit 30 $LK,"Sel",A="MN:ATTRF_SEL"$ (XOR colors with FF)
Bit 31 $LK,"Underline",A="MN:ATTRF_UNDERLINE"$
$LK,"GrUpdateTaskWin",A="MN:GrUpdateTaskWin"$() calls $LK,"DocUpdateTaskDocs",A="MN:DocUpdateTaskDocs"$() which calls $LK,"DocRecalc",A="MN:DocRecalc"$() where the document text is plotted into $LK,"gr.text_base",A="MN:CGrGlbls"$. Then, $LK,"GrUpdateTextBG",A="MN:GrUpdateTextBG"$() and $LK,"GrUpdateTextFG",A="MN:GrUpdateTextFG"$() render the $LK,"gr.text_base",A="MN:CGrGlbls"$ onto $LK,"gr.dc2",A="MN:CGrGlbls"$, a raw graphic bitmap.
See $LK,"::/Demo/Games/Maze.HC"$.
+1
View File
@@ -0,0 +1 @@
$WW,1$Intel/AMD have an inst that returns the num of CPU cycles since boot. This is not a steady, calibrated real time value. TempleOS measures it and you can convert with $LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$, a value continuously calibrated from other cnts.
+3
View File
@@ -0,0 +1,3 @@
$WW,1$TempleOS uses a 64-bit value, $LK,"CDate",A="MN:CDate"$, for date/time. The upper 32-bits are the days since Christ. The lower 32-bits store time of day divided by 4 billion which works out to 49710ths of a second. You can subtract two $LK,"CDate",A="MN:CDate"$'s to get a time span.
Use $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$ to convert.
+1
View File
@@ -0,0 +1 @@
$WW,1$The HPET, high precision event timer, is read with $LK,"HPET",A="MN:HPET"$() and has a frequency of $LK,"cnts.HPET_freq",A="MN:CCntsGlbls"$. A typical freq value is 14.3 Mhz It might not be available on all systems.
+7
View File
@@ -0,0 +1,7 @@
$WW,1$One jiffy is one time slice. $LK,"cnts.jiffies",A="MN:CCntsGlbls"$ returns time slices since boot.
$LK,"SysTimerRead",A="MN:SysTimerRead"$ reads the timer ticks since boot. It's not as fast as $LK,"GetTSC",A="MN:GetTSC"$.
Use $LK,"JIFFY_FREQ",A="MN:JIFFY_FREQ"$ to convert $LK,"cnts.jiffies",A="MN:CCntsGlbls"$.
Use $LK,"SYS_TIMER_FREQ",A="MN:SYS_TIMER_FREQ"$ to convert $LK,"SysTimerRead",A="MN:SysTimerRead"$.
+152
View File
@@ -0,0 +1,152 @@
$WW,1$$FG,5$$TX+CX,"Tips"$$FG$
* Turn-off or reboot ($FG,2$<CTRL-ALT-DEL>$FG$) at any time, except during disk writes. Writes are not cached.
* Use $LK,"Seed",A="MN:Seed"$() and the cmd line to switch $LK,"Rand",A="MN:Rand"$() to non-timer mode and replay games you like.
* 64-bit values are most efficient for the compiler.
* See $MA-X+PU,"Key Map",LM="KeyMap;View;\n"$ for a list of defined keys. Define your own keys in $LK,"MyPutKey",A="MN:MyPutKey"$(). See $LK,"Keyboard Devices",A="HI:Keyboard Devices/System"$.
* $FG,2$<ALT-m>$FG$ maximizes a window. $FG,2$<ALT-SHIFT-w>$FG$ closes AutoComplete. $FG,2$<ALT-w>$FG$ brings back AutoComplete. $FG,2$<ALT-v>$FG$ vertically tiles windows. $FG,2$<ALT-h>$FG$ horizontally tiles windows. The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.HC"$. You can customize them.
* If you make changes to TempleOS files in your $FG,2$/Home$FG$ directory, generally you reboot to make them take effect. (You don't compile anything.) You should have two TempleOS partitions on your hard drive because a syntax error in a start-up file will make the partition unbootable. Boot to the second partition or boot to a standard TempleOS CD/DVD and use $LK,"Mount",A="MN:Mount"$() to mount your hard drive.
* I copy my files to a mirrored ident partition, periodically with $LK,"CopyTree",A="MN:CopyTree"$() commands in scripts. I do merge commands with a menu entry like this:
$FG,2$Merge(\"C:/*\",\"D:/*\",\"+r+d\");$FG$ to check my changes.
* $FG,2$<CTRL-m>$FG$ at the cmd line to access your PersonalMenu. Place macros there with $FG,2$<CTRL-l>$FG$, or icon-like sprites with $FG,2$<CTRL-r>$FG$. Use the $FG,2$Pop-Up$FG$ option on macros to $LK,"Spawn",A="MN:Spawn"$() a task to run a file. It dies when it is finished. This returns mem to the system. Be sure to press $FG,2$<CTRL-s>$FG$ to save your macro/menu area after making changes.
* You can use $FG,2$ans$FG$ in cmd line expressions. It holds the res the last cmd line operation. You can use the cmd prompt as a calculator by just entering expressions like $FG,2$1+2*3;$FG$. $FG,2$F64$FG$ ress can be accessed with $FG,2$ansf$FG$.
* Use the PullDown menu at the top of the scrn to learn commands, or for finding the keyboard controls to games.
* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale",A="FF:~/HomeLocalize.HC,ms_hard.scale"$.
* You can set your local time zone by setting the $LK,"local_time_offset",A="MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ",A="MN:CDATE_FREQ"$. See $LK,"local time",A="FF:~/HomeLocalize.HC,local_time"$.
* $FG,2$<CTRL-SHIFT-L>$FG$ in the editor to reindent a $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ function or renumber an asm routine's local labels.
* You can use $FG,2$filter_lines$FG$ in the editor text search form ($FG,2$<CTRL-f>$FG$) to temporarily display just lines near each match. A value of $FG,2$filter lines$FG$ set to $FG,2$5$FG$ will display lines within 5 lines of matches. Then, you can do another find to a different string and achieve a $FG,2$AND$FG$ search. When finished, press $FG,2$<ESC>$FG$.
* You can recompile and reinstall the kernel with $LK,"BootHDIns",A="MN:BootHDIns"$(). You'll probably want to make a function for recompiling that uses the $LK,"In",A="MN:In"$() function to answer the cfg questions. See my technique $LK,"Cfg Strs",A="FL:::/Demo/AcctExample/TOS/TOSCfg.HC,1"$, $LK,"Update Funs",A="FL:::/Demo/AcctExample/TOS/TOSDistro.HC,1"$.
* $LK,"Scale2Mem",A="MN:Scale2Mem"$(min,max,limit=2*1024*1024*1024) can be used for cfg questions when recompiling. The $LK,"BootHDIns",A="MN:BootHDIns"$() cfg prompts accept expressions, not just numbers. The dft disk cache is $FG,2$Scale2Mem(0x80000,0x8000000)$FG$.
* You can permanently disable $FG,2$AutoComplete$FG$ commenting-out $LK,"ACInit",A="FF:/Home/HomeSys.HC,ACInit"$() in $LK,"~/HomeSys.HC",A="FF:/Home/HomeSys.HC,ACInit"$.
* Boolean expressions $BK,1$not$BK,0$ in $FG,2$if$FG$ stmts don't have short circuit logic and are compiled inefficiently.
* You can use $LK,"progress1",A="MN:progress1"$-$LK,"progress4",A="MN:progress4"$ in your programs for whatever you like. They're just global vars that are shown on the wallpaper. The original intent was to indicate how far along operations were. There's no coordination, so different apps might interfere. I use them most for debugging--just values easily viewed. See $LK,"::/Demo/Progress.HC"$.
* Use $LK,"DocMax",A="MN:DocMax"$() to adjust the size of the cmd line buf. It counts $LK,"CDoc",A="MN:CDoc"$ entries, not lines.
* Many data structures have a $FG,2$user_data$FG$ member. Those are available for you to store a data item, for convenience. $LK,"CTask",A="MN:CTask"$, $LK,"CDocEntry",A="MN:CDocEntry"$ and $LK,"CDirEntry",A="MN:CDirEntry"$ have them. You shouldn't encounter conflicts with TempleOS using them.
* If, for some strange reason, you wanted to reduce mem usage, make a smaller disk cache when you recompile the kernel; disabling $FG,2$AutoComplete$FG$; Specify smaller stk sizes when doing $LK,"Spawn",A="MN:Spawn"$(), chang $LK,"MEM_DFT_STK",A="MN:MEM_DFT_STK"$, and using $LK,"DocMax",A="MN:DocMax"$() to reduce the cmd line buffer size.
* Filenames ending in "$FG,2$.Z$FG$" will be automatically compressed and uncompressed when read or written. The compression method is not supported by other operating systems. You can store files uncompressed by $LK,"Move",A="MN:Move"$()ing them to a filename not ending in "$FG,2$.Z$FG$". See $LK,"::/Doc/TOSZ.DD"$ if you want to uncompress while in $FG,2$Linux$FG$.
* $LK,"Merge",A="MN:Merge"$() can be used to see what's changed. The $FG,2$+d$FG$ flag will show differences of files which have changed and allow you to merge code. (The $FG,2$+r$FG$ flag will recurse.)
* There is a utility $LK,"LinkChk",A="MN:LinkChk"$() which will check for broken links in documentation.
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_PAREN",A="MN:OPTf_WARN_PAREN"$,ON) to find unnecessary parentheses in code.
* You can use $LK,"Option",A="MN:Option"$($LK,"OPTf_WARN_DUP_TYPES",A="MN:OPTf_WARN_DUP_TYPES"$,ON) to find unnecessary local var type stmts.
* $LK,"Option",A="MN:Option"$($LK,"OPTf_ECHO",A="MN:OPTf_ECHO"$,ON) can be placed in $LK,"StartOS.HC",A="FI:::/StartOS.HC"$ to echo start-up scripts.
* Use $LK,"Plain",A="MN:Plain"$() to edit a plain text file. You'll need this if your file has $FG,2$$$$FG$'s. Use the $LK,"ToDolDoc",A="MN:ToDolDoc"$() utility to convert plain text to DolDoc's by doubling $FG,2$$$$FG$'s.
* Use $LK,"Silent",A="MN:Silent"$() to disable scrn text output.
* Grab-scroll any window at any time with $FG,2${CTRL-LEFT-MOUSE-DRAG}$FG$. Null grab-scrolling with $FG,2${CTRL-RIGHT-MOUSE}$FG$.
* Use $FG,2$<CTRL-ALT-z>$FG$ to zoom-in and $FG,2$<CTRL-ALT-SHIFT-Z>$FG$ to zoom-out. You can scroll by moving to the edge of the window. Set $LK,"gr.continuous_scroll",A="MN:CGrGlbls"$ to $FG,2$TRUE$FG$ if you want.
* Use $FG,2$<CTRL-ALT-g>$FG$ and $FG,2$<CTRL-ALT-SHIFT-G>$FG$ to display a grid on the scrn.
* Use $FG,2$<CTRL-ALT-a>$FG$ to enter an extended ASCII char.
* Use $FG,2$<CTRL-ALT-f>$FG$ to toggle between $LK,"Std Font",A="FI:::/Kernel/FontStd.HC"$ and $LK,"Cyrillic Font",A="FI:::/Kernel/FontCyrillic.HC"$.
* Use $FG,2$<CTRL-ALT-s>$FG$ will capture the scrn as a sprite on the clipboard. You can save the cmd line doc as text with $FG,2$<CTRL-a>$FG$.
* You can save a sprite as a $FG,2$.BMP$FG$ file in $FG,2$<CTRL-r>$FG$ on the Sprite BitMap Menu.
* You can eye-dropper colors in the $FG,2$<CTRL-r>$FG$ sprite editor by pressing $FG,2$'c'$FG$. Press $FG,2$'t'$FG$ for transparent.
* There are handy functions--$FG,2$F(),R(),FD()$FG$ and $FG,2$RD()$FG$ which are defined in $LK,"~/HomeWrappers.HC"$. You are encouraged to change them and add more. They will perform find-and-replace operations accross multiple files. The $FG,2$+l$FG$ flag is particularly useful since it limits to whole labels. The $FG,2$+lb$FG$ and $FG,2$+la$FG$ flags limit to whole labels just before or after. You are encouraged to add or modify handy wrapper functions to make cmd line operations easier.
* When using $LK,"Find",A="MN:Find"$() while modifying code, work from the bottom-up so that line numbers are correct. If you work top-down, then inserting or deleting lines causes the lower file links will be incorrect.
* You can save files after making changes, anytime you are within the editor, like when viewing help/macro files. $FG,2$<CTRL-a>$FG$ saves as, $FG,2$<CTRL-s>$FG$ saves with the same name in the scrolling title bar. Hitting $FG,2$<ESC>$FG$ will exit and save. ($FG,2$<SHIFT-ESC>$FG$ will abort). You can save the cmd line window to a file, too, since you're actually in the editor when you're at the cmd line.
* When using $FG,2$<CTRL-l>$FG$ to insert links in documents, you can usually leave the $FG,2$Tag Text$FG$ blank and it will be filled-in automatically based on other entries.
* There is a feature of the precompiler that allows code to be executed in the middle of compilation and data inserted into the compilation stream. Click here for an example: $LK,"#exe {",A="FF:::/Kernel/KEnd.HC,#exe {"$.
* If you output to the cmd line and wish to allow users to scroll around and view data, you can use $LK,"View",A="MN:View"$().
* Use $LK,"View",A="MN:View"$() in Pop-up macros to linger until the user presses $FG,2$<ESC>$FG$ or $FG,2$<SHIFT-ESC>$FG$.
* You can access the word under the cursor at $LK,"ac.cur_word",A="MN:CAutoCompleteGlbls"$.
* You can reactivate $FG,2$AutoComplete$FG$ after closing it by pressing $FG,2$<CTRL-Fun Key>$FG$ or $FG,2$<ALT-w>$FG$ if you have it defined.
* $FG,2$<CTRL-SHIFT-T>$FG$ to toggle to/from plain text just the $LK,"CDoc",A="MN:CDoc"$ cmd under the cursor. See $LK,"::/Demo/DolDoc/TextDemo.HC"$.
* If you toggle to plain text when you are working with graphics in a document, you can add duplicate entries for sprites by entering a $FG,2$$$SP...$$$FG$ cmd with the same num.
* If you toggle to plain text when working with graphics, you can add a str to the $FG,2$$$SP...$$$FG$ entry to keep track of it. Try $FG,2$$$SP,"<2>",BI=2$$$FG$ where '2' is the sprite num.
* I use spaces-to-tab operations on all my src files to keep them small. You have to be careful, though, because spaces in strings will be converted. I use $FG,2$<SHIFT-SPACE>$FG$ ' ' in such cases. See $LK,"S2T",A="MN:S2T"$() for spaces-to-tabs.
* You can edit an existing sprite by putting the cursor on it and pressing $FG,2$<CTRL-r>$FG$.
* When editing a sprite, you can cut and paste the elements in the sidebar text list window.
* I recommend keeping CSprite in vect format until you are done creating them, so you can edit the ctrl points. Then, convert them to bitmaps, so the flood fills work well. If you are doing interpolation, however, they must be vect.
* $LK,"GrFloodFill",A="MN:GrFloodFill"$() is slow. $LK,"GrRect",A="MN:GrRect"$() is fast.
* You can customize the $FG,2$wallpaper$FG$. See $LK,"::/Demo/Graphics/WallPaperFish.HC"$.
* Your RAM disks will not be reformated when you reboot if the memory location has not changed and it finds the disk intacted.
* $FG,2$try{} catch{}$FG$ in a function will cause all vars to be non-reg.
* Using a sub-int array, $FG,2$i.u8[3]$FG$, for example, will force a local var to non-reg.
* You can delete the $FG,4$~/Registry.HC.Z$FG$ file. The policy is that deleting it will restore defaults. It is a text doc, if you want to edit it. Be careful of tree indentations.
* Study $LK,"::/Adam/Opt/Utils/MemRep.HC"$ and $LK,"WallPaper",A="MN:WallPaper"$() to learn how the system resources are put together.
* The editor's sel-text mechanism allows for disjoint portions of sel text. This is a feature, not a bug -- you can cut-and-paste disjoint text.
* $LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ is continuously calibrated. Be careful because expressions might decrease. Take a snap-shot, like this: $FG,2$timeout=$LK,"GetTSC",A="MN:GetTSC"$+$LK,"cnts.time_stamp_freq",A="MN:CCntsGlbls"$ x seconds;$FG$ and compare against $LK,"GetTSC",A="MN:GetTSC"$(). I recommend just using $LK,"tS",A="MN:tS"$ or $LK,"cnts.jiffies",A="MN:CCntsGlbls"$.
* Use $LK,"HeapLog",A="MN:HeapLog"$(), $LK,"HeapLogAddrRep",A="MN:HeapLogAddrRep"$() and $LK,"HeapLogSizeRep",A="MN:HeapLogSizeRep"$() to find leaks. Don't be confused by $LK,"CDoc",A="MN:CDoc"$ allocations. Those are generated when text is written to the cmd line buffer.
* For advanced heap debugging, play with $LK,"_CFG_HEAP_DBG",A="MN:_CFG_HEAP_DBG"$. You're on your own.
* You can use $LK,"Type",A="MN:Type"$() to display $FG,2$.BMP$FG$ or $FG,2$.GR$FG$ files.
* Use $LK,"Man",A="MN:Man"$() to jump to short sym name src code.
* Use $LK,"Fix",A="MN:Fix"$() to edit and fix the last compiler err.
* You can use $FG,2$<CTRL-SHIFT-L>$FG$ to do a check for compile errors.
* You can use $LK,"DocOpt",A="MN:DocOpt"$() to optimize links. (Mostly just removes .Z)
* $LK,"ZipRep",A="MN:ZipRep"$() can highlight src files with lots of redundancy.
* With $FG,2$start$FG$/$FG,2$end$FG$, common trailing code is fast. Common leading code is slow.$FG$
* The first line of the $MA-X+PU,"Psalmody",LM="#include \"::/Apps/Psalmody/Run\"\n"$ $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ song files is a comment with a category recognized by $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). The categories are $FG,2$"no nothing"$FG$, $FG,2$"has words"$FG$, $FG,2$"has graphics"$FG$, or $FG,2$"special"$FG$. The third character in the song comment is a digit rating number, shown in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$(). You can set the song rating in $LK,"JukeBox",A="FF:::/Apps/Psalmody/JukeBox.HC,JukeBox"$() by pressing $FG,2$0$FG$-$FG,2$9$FG$. You can press $FG,2$<DELETE>$FG$ to delete songs.
$FG,8$
* "Linux" is a trademark owned by Linus Torvalds.
$FG$
+13
View File
@@ -0,0 +1,13 @@
$WW,1$$LK,"CDC",A="MN:CDC"$'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines use the transform, you must set the $LK,"DCF_TRANSFORMATION",A="MN:DCF_TRANSFORMATION"$ flag.
The matrix consists of ints that have been scaled 32 bits ($LK,"GR_SCALE",A="MN:GR_SCALE"$). See $LK,"::/Demo/Lectures/FixedPoint.HC"$ to learn why.
See $LK,"Mat4x4IdentEqu",A="MN:Mat4x4IdentEqu"$(), $LK,"Mat4x4IdentNew",A="MN:Mat4x4IdentNew"$(), $LK,"Mat4x4Equ",A="MN:Mat4x4Equ"$() and $LK,"Mat4x4New",A="MN:Mat4x4New"$(). See $LK,"Mat4x4RotX",A="MN:Mat4x4RotX"$(), $LK,"Mat4x4RotY",A="MN:Mat4x4RotY"$(), $LK,"Mat4x4RotZ",A="MN:Mat4x4RotZ"$() and $LK,"Mat4x4Scale",A="MN:Mat4x4Scale"$() to rotate about axes and scale. Combine them with $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$()/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$() and assign them to the $LK,"CDC",A="MN:CDC"$.$FG,2$dc$FG$ with $LK,"DCMat4x4Set",A="MN:DCMat4x4Set"$(). See $LK,"::/Demo/Graphics/Box.HC"$.
You can rotate single points using $LK,"Mat4x4MulXYZ",A="MN:Mat4x4MulXYZ"$().
The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and $LK,"Mat4x4MulMat4x4Equ",A="MN:Mat4x4MulMat4x4Equ"$/$LK,"Mat4x4MulMat4x4New",A="MN:Mat4x4MulMat4x4New"$ them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See $LK,"Mat4x4TranslationEqu",A="MN:Mat4x4TranslationEqu"$() and $LK,"::/Demo/Graphics/Transform.HC"$.
Finally, $LK,"CDC",A="MN:CDC"$'s have an $FG,2$x$FG$, $FG,2$y$FG$ and $FG,2$z$FG$ which is an additional shift (translation).
The transformation is implemented as a callback on the $LK,"CDC",A="MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transform()$FG$ callback is $LK,"DCTransform",A="MN:DCTransform"$(). See $LK,"::/Demo/Games/Talons.HC"$ or $LK,"::/Demo/Games/CastleFrankenstein.HC"$ to see how to change the $FG,2$transform()$FG$ callback for foreshortening.
+5
View File
@@ -0,0 +1,5 @@
$WW,1$$FG,5$$TX+CX,"Upgrading TempleOS"$$FG$
To upgrade, you generally boot the new TempleOS CD/DVD, install on top of your drive, modify your files and set it to boot your new $FG,2$/Kernel.BIN.C$FG$ by executing $LK,"BootHDIns",A="MN:BootHDIns"$(). Often, your code will have to be modified to work with the new version. See $LK,"Change Log",A="FI:::/Doc/ChgLog.DD"$. You might have to boot an alternate drive or the CD and modify your code until it boots okay.
See the $LK,"Installing",A="FI:::/Doc/Install.DD"$ documentation.
+136
View File
@@ -0,0 +1,136 @@
$WW,1$$FG,5$$TX+CX,"Welcome to TempleOS"$$FG$
TempleOS 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:
$ID,2$* Professionals doing hobby projects
* Teenagers doing projects
* Non-professional, older-persons projects
$ID,-2$
Simplicity is a goal to $LK,"keep the line count down",A="FI:::/Doc/Strategy.DD"$, 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 $TX,"81,223",D="DD_TEMPLEOS_LOC_OFFICIAL"$ 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 $LK,"Hello World",A="FI:::/Doc/HelloWorld.DD"$ application in one line of code and can put graphics on the scrn 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 TempleOS has value. In facts, that's the point of TempleOS. See the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.DD"$.
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. I 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 TempleOS is intended for:
$LK,"/Demo/Games/BattleLines.HC",A="FI:::/Demo/Games/BattleLines.HC"$
$LK,"/Demo/Games/BigGuns.HC",A="FI:::/Demo/Games/BigGuns.HC"$
$LK,"/Demo/Games/BlackDiamond.HC",A="FI:::/Demo/Games/BlackDiamond.HC"$
$LK,"/Demo/Games/BomberGolf.HC",A="FI:::/Demo/Games/BomberGolf.HC"$
$LK,"/Demo/Games/CastleFrankenstein.HC",A="FI:::/Demo/Games/CastleFrankenstein.HC"$
$LK,"/Demo/Games/CharDemo.HC",A="FI:::/Demo/Games/CharDemo.HC"$
$LK,"/Demo/Games/CircleTrace.HC",A="FI:::/Demo/Games/CircleTrace.HC"$
$LK,"/Demo/Games/Collision.HC",A="FI:::/Demo/Games/Collision.HC"$
$LK,"/Demo/Games/Digits.HC",A="FI:::/Demo/Games/Digits.HC"$
$LK,"/Demo/Games/DunGen.HC",A="FI:::/Demo/Games/DunGen.HC"$
$LK,"/Demo/Games/Talons.HC",A="FI:::/Demo/Games/Talons.HC"$
$LK,"/Demo/Games/ElephantWalk.HC",A="FI:::/Demo/Games/ElephantWalk.HC"$
$LK,"/Demo/Games/FlapBat.HC",A="FI:::/Demo/Games/FlapBat.HC"$
$LK,"/Demo/Games/FlatTops.HC",A="FI:::/Demo/Games/FlatTops.HC"$
$LK,"/Demo/Games/Halogen.HC",A="FI:::/Demo/Games/Halogen.HC"$
$LK,"/Demo/Games/MassSpring.HC",A="FI:::/Demo/Games/MassSpring.HC"$
$LK,"/Demo/Games/Maze.HC",A="FI:::/Demo/Games/Maze.HC"$
$LK,"/Demo/Games/RainDrops.HC",A="FI:::/Demo/Games/RainDrops.HC"$
$LK,"/Demo/Games/RawHide.HC",A="FI:::/Demo/Games/RawHide.HC"$
$LK,"/Demo/Games/Rocket.HC",A="FI:::/Demo/Games/Rocket.HC"$
$LK,"/Demo/Games/RocketScience.HC",A="FI:::/Demo/Games/RocketScience.HC"$
$LK,"/Demo/Games/Squirt.HC",A="FI:::/Demo/Games/Squirt.HC"$
$LK,"/Demo/Games/TheDead.HC",A="FI:::/Demo/Games/TheDead.HC"$
$LK,"/Demo/Games/TicTacToe.HC",A="FI:::/Demo/Games/TicTacToe.HC"$
$LK,"/Demo/Games/TreeCheckers.HC",A="FI:::/Demo/Games/TreeCheckers.HC"$
$LK,"/Demo/Games/Varoom.HC",A="FI:::/Demo/Games/Varoom.HC"$
$LK,"/Demo/Games/Wenceslas.HC",A="FI:::/Demo/Games/Wenceslas.HC"$
$LK,"/Demo/Games/Whap.HC",A="FI:::/Demo/Games/Whap.HC"$
$LK,"/Demo/Games/Zing.HC",A="FI:::/Demo/Games/Zing.HC"$
$LK,"/Demo/Games/ZoneOut.HC",A="FI:::/Demo/Games/ZoneOut.HC"$
$LK,"/Apps/Psalmody/Examples/childish.HC",A="FI:::/Apps/Psalmody/Examples/childish.HC"$
$LK,"/Apps/Psalmody/Examples/night.HC",A="FI:::/Apps/Psalmody/Examples/night.HC"$
$LK,"/Apps/Psalmody/Examples/prosper.HC",A="FI:::/Apps/Psalmody/Examples/prosper.HC"$
Two things to know about TempleOS are that $UL,1$tasks$UL,0$ have $LK,"MAlloc",A="MN:MAlloc"$/$LK,"Free",A="MN: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.
For other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$TempleOS$FG$, the command line feeds right into the $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$ compiler, line by line, and it places code into memory it $LK,"MAlloc",A="MN:MAlloc"$()s. The compiler is paused at the command line, waiting for input. Naturally, you $FG,2$#include$FG$ a program to load it into memory and, usually, start it.
During the boot process, many files get $LK,"compiled",A="FI:::/StartOS.HC"$ 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 $FG,2$#include $FG$them. Everything is truly compiled to native $FG,2$$TX,"x86_64",HTML="http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ machine code, nothing is $FG,2$interpreted$FG$ and there is no $FG,2$byte code$FG$.
Statements at the global scope -- outside the scope of functions -- execute immediately. There is no $FG,2$main()$FG$ function. Instead, you give meaningful names to what would be $FG,2$main()$FG$ functions and you invoke them by calling them with a statement in the global scope, usually at the bottom of your file.
I started with $FG,2$C$FG$ syntax, but didn't like the command line for a directory listing looking like this:
>$FG,2$Dir("*.*",FALSE);
$FG$So, I added default args from $FG,2$C++$FG$ and it looked like this:
>$FG,2$Dir();
$FG$I didn't like that, so I made parentheses optional on calls with no args and it, now, looks like this:
>$FG,2$Dir;$FG$
The syntax change created an ambiguity when specifying function addresses, like for calling $LK,"QSort",A="MN:QSort"$(). To resolve it, I made a '$FG,2$&$FG$' required in front of function names when specifying an address of a function, which is better anyway.
Once I was no longer using standard C/C++ syntax, I decided to change everything I didn't like and call it $LK,"HolyC",A="FI:::/Doc/HolyC.DD"$. Here are the new $LK,"operator precedence",A="FF:::/Doc/HolyC.DD,operator precedence"$ rules. It's Biblical! See $LK,"Luke,5:37",A="BF:Luke,5:37"$.
There are no object files in TempleOS and, normally, you don't make executable files either, but you can. That's known as $LK,"Ahead-of-Time",A="FF:::/Doc/Glossary.DD,AOT Compile Mode"$ compilation. Instead, you $LK,"Just in Time",A="FF:::/Doc/Glossary.DD,JIT Compile Mode"$ 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 $LK,"Scheduler",A="FL:::/Kernel/Sched.HC,1"$. Polling 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 $FG,2$FAT32$FG$ filesystem is supported to makes exchanging files with a dual booted other operating system easy and there is the simple, 64-bit TempleOS $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ filesystem. The $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ has allocation bitmap for clusters and all files are stored contiguously. You can't grow files.
TempleOS is geared toward reading and writing whole files. Since whole files are processed, compression is possible. Filenames ending in "$FG,2$.Z$FG$" are automatically compressed or uncompressed when stored and fetched. TempleOS does support direct block random access into files, however -- $LK,"FRBlks",A="MN:FRBlks"$() and $LK,"FWBlks",A="MN:FWBlks"$().
If a file is not found, "$FG,2$.Z$FG$" is added or removed and a search is done, again. There is no $FG,2$PATH$FG$, but parent directories are searched when a file is not found. This feature is especially useful for default account files.
The graphic resolution is poor, $FG,2$640x480 16 color$FG$, but God said it was a covenant like circumcision. Also, that's all I feel comfortable with without GPU acceleration supported. A $FG,2$1600x1200x24$FG$ bit scrn takes 37 times more memory, implying 37 times the CPU power. Also, a fixed size keeps it simple with everybody machine having the same appearance. Look on the bright-side -- you won't spend as much time twiddling pixels for your game art and you'll have tons of CPU power available, especially with multicore systems.
TempleOS 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 TempleOS does master/slave multiprocessing. The anticipated use for multicore is primarily putting graphics on the scrn. Hardware graphics acceleration is not used, so this is possible. See $LK,"TempleOS MultiCore",A="FI:::/Doc/MultiCore.DD"$.
There is no distinction between the terms $FG,2$task$FG$, $FG,2$process$FG$ or $FG,2$thread$FG$. All have a task record, $LK,"CTask",A="MN:CTask"$, pointed to by the $FG,2$FS$FG$ segment reg and are accessed with $FG,4$Fs->$FG$ while $FG,4$Gs->$FG$ points to a $LK,"CCPU",A="MN:CCPU"$ for the current CPU core. Each task can have just one window, but a task can have children with windows. (The segment regs are just used as extra regs -- there is nothing segmented about TempleOS' memory.) It is approximately the case that $FG,2$TempleOS$FG$ is multi-threading, single-processing.
In $FG,2$TempleOS$FG$, $LK,"Adam Task",A="FF:::/Doc/Glossary.DD,Adam Task"$$FG$ refers to the father of all tasks. He's never supposed to die. Since tasks inherit the symbols of parents, system-wide stuff is associated with $FG,2$Adam$FG$. His heap is like kernel memory in other operating systems. Since $FG,2$Adam$FG$ is immortal, it's safe to alloc objects, not tied to any mortal task, from $FG,2$Adam$FG$'s heap. He stays in a server mode, taking requests, so you can ask him to $FG,2$#include$FG$ something, placing that code system-wide. A funny story is that originally I called it the $FG,2$root$FG$ task and even had a $FG,2$/Root$FG$ directory :-) $FG,2$Adam$FG$ executes $LK,"::/StartOS.HC"$ at boot time.
For easy back-ups, place everything you author in your $FG,2$/Home$FG$ directory and subdirectories. Then, use $LK,"CopyTree",A="MN:CopyTree"$(). That should make upgrading easy, too. Customizable start-up scripts go in your $FG,2$/Home$FG$ directory. The default start-up scripts are in the root directory. Copy the start-up files you wish to customize into $FG,2$/Home$FG$ and modify them. See $LK,"Home Files",A="FF:::/Doc/GuideLines.DD,/Home Files"$. You can make your own distro that includes everything and is a bootable live CD with $LK,"::/Misc/DoDistro.HC"$.
Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a cmd line $LK,"Dir",A="MN:Dir"$() listing. You left-click files to edit them and right-click to $FG,2$#include$FG$ them. To begin a project, type $LK,"Ed",A="MN:Ed"$("filename");, supplying a filename. You can also run programs with $FG,2$<F5>$FG$ when in the editor. $FG,2$<ESC>$FG$ to save and exit the file. You'll need to do a new $LK,"Dir",A="MN:Dir"$() cmd, periodically, so make a macro on your PersonalMenu. Access your PersonalMenu by pressing $FG,2$<CTRL-m>$FG$, cursoring until you are on top of it and pressing $FG,2$<SPACE>$FG$.
$FG,2$<CTRL-t>$FG$ toggles plain text mode, showing format commands, a little like viewing html code.
$FG,2$<CTRL-l>$FG$ inserts a text widgets.
$FG,2$<CTRL-r>$FG$ inserts or edit a graphic sprite resource at cursor location.
$FG,2$<CTRL-d>$FG$ brings-up the file manager. It's pretty crappy. I find I don't need it very often, believe it or not.
$FG,2$<CTRL-b>$FG$ toggles window border.
$FG,2$<ALT-m>$FG$ maximizes a window.
$FG,2$<ALT-SHIFT-a>$FG$ closes AutoComplete.
$FG,2$<ALT-a>$FG$ brings back AutoComplete.
$FG,2$<ALT-v>$FG$ vertically tiles windows.
$FG,2$<ALT-h>$FG$ horizontally tiles windows.
The $FG,2$ALT$FG$ keys are defined in $LK,"~/HomeKeyPlugIns.HC"$. You can customize them.
$FG,2$<CTRL-ALT-t>$FG$ new terminal window.
$FG,2$<CTRL-ALT-n>$FG$ switches to the next window.
$FG,2$<CTRL-ALT-x>$FG$ kills a window.
$LK,"Find",A="MN:Find"$() is your best friend. There's a wrapper function called $LK,"F",A="MN:F"$() in your $FG,2$~/HomeWrappers.HC.Z$FG$ file. Feel free to make wrapper functions for functions you use often and customize the args. By the way, $LK,"Find",A="MN:Find"$() or $LK,"R",A="MN:R"$() can be used to replace strings across multiple files. You can access $LK,"Find",A="MN:Find"$() using $FG,2$<CTRL-SHIFT-f>$FG$.
As you browse code, use the $FG,2$AutoComplete$FG$ window to look-up functions, etc. $FG,2$<CTRL-SHIFT-F1>$FG$ (or whatever number) to follow a sym to it's source. You can browse deeper and deeper. You go back with $FG,2$<SHIFT-ESC>$FG$.
Use the $LK,"Help & Index",A="FI:::/Doc/HelpIndex.DD"$ or $LK,"Demo Index",A="FI:::/Doc/DemoIndex.DD"$ to find-out what exists. Press $FG,2$<F1>$FG$ for help or use the links on your menu ($FG,2$<CTRL-m>$FG$). Also, look in the $FG,2$/Demo$FG$ or $FG,2$/Apps$FG$ directories for inspiration.
Software is distributed as $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ ISO files. Burn a CD/DVD, or set your CD/DVD in $FG,2$QEMU$FG$, $FG,2$VMware$FG$ or $FG,2$VirtualBox$FG$ to the ISO file. Then, access the $FG,2$'T'$FG$ drive. Or, $LK,"Mount",A="MN:Mount"$() the ISO.C file and access the $FG,2$'M'$FG$ drive in TempleOS. It must be a contiguous ISO.C file, so rename it under TempleOS 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 $FG,2$'C'$FG$ drive can be copied quickly to $FG,2$'D'$FG$. Also, the $LK,"FileMgr",A="MN:FileMgr"$() $FG,2$<CTRL-d>$FG$ starts too slowly when there are lots of hard drive files, but that is how we want it.
3rd party libraries are banned, since they circumvent the 100,000 line of code limit in the $LK,"TempleOS Charter",A="FI:::/Doc/Charter.DD"$. All applications must only depend on the core TempleOS files and whatever they bring along in the ISO. This is similar to how Commodore 64 applications only depended on the ROM.
Create a $LK,"RedSea",A="FI:::/Doc/RedSea.DD"$ ISO file with $LK,"RedSeaISO",A="MN:RedSeaISO"$(). Send an email to $TX,"tdavis@templeos.org",HTML="mailto:tdavis@templeos.org"$ if you want me to post a link to your TempleOS code in the App Store.
$MA-X+PU,"Take Tour",LM="User(\"Cd(\\\"::/Misc/Tour\\\");;InFile(\\\"Tour\\\");\n\");"$
$FG,8$
* "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.
$FG$
+32
View File
@@ -0,0 +1,32 @@
$WW,1$$FG,5$$TX+CX,"Why Not More?"$$FG$
If a feature cannot be made to work correctly and consistently, professional companies usually remove the feature. Because PC hardware is so diverse, getting things to work on all people's computers is really difficult. For one thing, you practically have to own all the different hardware to write drivers for it. If a company wanted to sell a PC operating system, they would offer a warranty and, therefore, could not get away with amateur behavior. TempleOS absolutely requires 64-bit computers, so we leave behind much trouble, but plenty remains.
The PCI bus interface is what modern hardware uses. Before PCI, life was simple and devices used I/O ports. After studying $LK,"PCI Interrupts",A="FI:::/Demo/Lectures/PCIInterrupts.HC"$ and attempting to do a HDAudio driver, I came to realize that modern PCI devices require ten times more code and I cannot even come close to making them work on everyone's machine because with PCI devices there are several models to worry about, unlike with the older ISA bus devices which can be done with one driver.
Currently, I have no PCI drivers. My drivers use I/O ports and operate in ISA bus mode. At this point, I only have one driver for each type of device and it is delightfully simple that way. I have one $LK,"keyboard",A="FI:::/Kernel/SerialDev/Keyboard.HC"$ driver, one $LK,"mouse",A="FI:::/Kernel/SerialDev/Mouse.HC"$ driver, one $LK,"ATA hard drive",A="FI:::/Kernel/BlkDev/DskATA.HC"$ driver, one $LK,"ATAPI CD/DVD",A="FI:::/Kernel/BlkDev/DskATA.HC"$ driver, one $LK,"VGA 640x480 16 color",A="FI:::/Adam/Gr/GrScrn.HC"$ video driver and one $LK,"PC Speaker",A="MN:Snd"$ driver. I use the $LK,"PIT and HPET timers",A="MN:TimersInit"$ and $LK,"PIC Interrupt Controller",A="MN:IntsInit"$. I use IRQ0 for timer, IRQ1 for keyboard, and IRQ12 for mouse. If IRQ12 is not firing, I am able to poll the mouse.
In the CPU department, I have state of the art 64-bit $LK,"long mode",A="FI:::/Kernel/KStart64.HC"$ with $LK,"multicore",A="FI:::/Kernel/MultiProc.HC"$ support. I use the $LK,"APIC",A="MN:MPAPICInit"$ and start-up $LK,"multicore",A="MN:Core0StartMP"$ operation.
I have made an incredible accomplishment by getting it to work on practically everyone's computer as long as it is 64-bit and they run inside VMware, QEMU or VirtualBox.
Adding a USB driver would be really ugly with UHCI, EHCI, OHCI, USB1, USB2, USB3, ICH6, ICH7, ICH8, ICH9, ICH10, ICH11, ICH12, boot mode and regular mode for keyboard/mouse and a diversity of HID reports. It's hopeless. I could never offer anything but crappy, limited support and it would just add a ton of crappy code that mostly didn't work. What would I gain? Nothing. A keyboard or mouse would not be improved. Solid State USB drives would be really nice, but it's not going to happen.
The same story is basically true for GPUs, audio, networking and AHCI hard drive drivers. God said 640x480 16 color was a covenant like circumcision, so the video will never change, even if a $LK,"Standard PC",A="FI:::/Doc/StdTempleOSPC.DD"$ was made. If you attempt multimedia, everything will break because memory will get fragmented with huge multimedia files. Some day, if super-simple high speed serial allows networking, there will be no browser within the 100,000 line limit and, with only 16 colors, the world wide web is not tolerable. FTP and telnet might be possible, in the far distant future, if they could fit within the 100,000 line limit. Currently, there are $TX,"81,223",D="DD_TEMPLEOS_LOC_OFFICIAL"$ lines of code.
I don't stand a chance working on native hardware, anymore. I could install and run natively on hardware from about 2005-2010. It requires BIOS's being nice enough to write USB mode PS/2 legacy keyboard/mouse support. As it turns-out, sometimes the BIOS has PS/2 drivers but purposely disables them, just to be mean. The CIA and whole industry is trying to mess everything up, on purpose. Perhaps, at a point of sale in a store, a thief could hack a credit card machine. Therefore, the BIOS companies actually want it difficult to make drivers and purposely make it broken.
The ATA/ATAPI hard drives often can be run with I/O ports if you can $LK,"find them",A="FI:::/Kernel/BlkDev/DskATAId.HC"$. $FG,2$lspci -v$FG$ on Linux or system information on Windows can help you locate the SATA IO ports the hard drive and CD/DVD have. They no longer are enabled by the BIOS. It's hopeless. I'm stuck with very slow drive performance, but it works for everybody.
UEFI is pointless. If I am forced to run in VMware, QEMU or VirtualBox, they will always support non-UEFI mode. Without working, native hard drive and CD/DVD drivers, you can't get very far with UEFI on a native install, not to mention SecureBoot. UEFI is, first of all, redundant. If non-UEFI works in a virtual machine, supporting UEFI would only be redundant, ugly nasty code. My compiler does not create an ELF or PE format. I would have to ruin the beauty of my compiler, which would make me cry many tears.
God talks. It seems reasonable that I will get to make the rules for the whole industry, in the future when God is announced publically to the World.
I made $LK,"::/Doc/Demands.DD"$.
When the PC was created, they wanted flexibility because they did not know the future. Now, the industry is mature and it is time to make a 100% standard PC that everybody uses. $LK,"::/Doc/StdTempleOSPC.DD"$
$FG,8$
* "QEMU" is a trademark owned by Fabrice Bellard.
* "VMware" is a trademark owned by VMware, Inc.
* "VirtualBox" is a trademark owned by Oracle.
+42
View File
@@ -0,0 +1,42 @@
$WW,1$$FG,5$$TX+CX,"DolDoc Widget Help"$$FG$
$LK,"DolDoc",A="::/Doc/DolDocOverview.DD"$ is a TempleOS document type.
$FG,2$"Expression"$FG$ a num or HolyC algebraic term with operators and HolyC syms can be entered.
$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs.
$FG,2$"InStr"$FG$ Like a macro except it is an $LK,"InFile",A="FF:::/Doc/Glossary.DD,InFile"$. You can't have both an in_str and macro text defined.
$FG,5$Tag Text$FG$ is the text that will be displayed for the item. For links, you can leave it blank and the details of the link will be shown.
$FG,5$Hide$FG$ means display nothing, making an entry invis.
$FG,5$Left X$FG$ relative to the left margin.
$FG,5$Center X$FG$ relative to the horizontal center of the window.
$FG,5$Right X$FG$ relative to the right margin.
$FG,5$Top Y$FG$ relative to the top of the window.
$FG,5$Center Y$FG$ relative to the vertical center of the window.
$FG$$FG,5$Bottom Y$FG$ relative to the bottom of the window.
$FG,5$Blink$FG$ make the text blink.
$FG,5$Invert$FG$ make the text inverted.
$FG,5$Underline$FG$ make the text underlined.
$FG,5$Scroll X Length Expression$FG$ if a value is entered, the text will scroll in an area of this width.
$FG,5$Y Offset Expression$FG$ if a value is entered, the text will be shifted vertically by this many pixs, so you can make superscripts or subscripts.
$FG,5$X Offset Expression$FG$ if a value is entered, the text will be shifted horizontally by this many pixs.
$FG,5$Tree$FG$ The item will behave like a tree widget, with this as the root.
$FG,5$Collapsed$FG$ The tree or hidden widget will begin collapsed.
$FG,5$Define Str$FG$ will substitute a $FG,2$#define$FG$ or $LK,"DefineLoad",A="MN:DefineLoad"$() string for the tag.
$FG,5$Quote$FG$ Make the res suitable for including in a program, in quotes, especially $FG,2$fmtstr$FG$ entries in class definitions.
$FG,5$X Expression$FG$ For cursor movements, the horizontal value.
$FG,5$Y Expression$FG$ For cursor movements, the vertical value.
$FG,5$PopUp$FG$ For macro's, run the macro in a PopUp window. Do this when making a macro to run a program, so it doesn't tie-up memory.
$FG,5$Escape$FG$ For macro's, send an $FG,2$<ESC>$FG$ char to exit before running the macro. Without this, the macro runs in the wrong window, usually.
$FG,5$Refresh Data$FG$ updates $FG,2$$$DA...$$$FG$ entry continuously.
$FG,5$Html Link$FG$ stores a link which will be embedded if you generate a html version of a document with $LK,"::/Demo/ToHtmlToTXTDemo/ToHtml.HC"$.
+1
View File
@@ -0,0 +1 @@
$WW,1$Only tasks on $FG,2$Core0$FG$ can have a window and there can be only one window per task. The window Z-buffer, top-to-bottom order is determined by the order in the task queue, with the $FG,2$WinMgr$FG$ on the bottom. A task can have child task popup windows.