SparrowOSTS_121127.ISO

This commit is contained in:
Terry A. Davis authored and minexew committed 2018-09-08 21:45:28 +02:00
1 parent 0e9364ff4c
commit e57428affb
1218 files changed
+247142 -165507

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
$WW,1$$FG,5$$TX+CX,"Acknowledgements"$$FG$
I am a for profit company, not an academic. I have never seen a commercial product with acknowledgements like an academic paper. Never-the-less, here are references. (I don't know the original sources on many of these.)
1) The font, $LK,"::/SparrowOS/OSMain/Font8x8.CPP.Z","FI:::/SparrowOS/OSMain/Font8x8.CPP.Z"$, is taken from $FG,4$$TX+HTML,"FreeDOS","http://www.freedos.org"$$FG$.
2) $LK,"::/SparrowOS/OSMain/Dsk/ATADef.HPP.Z","FI:::/SparrowOS/OSMain/Dsk/ATADef.HPP.Z"$ originally
from Linux. I later got the spec.
3) The heap algorithm, $LK,"::/SparrowOS/OSMain/Memory.CPP.Z","FI:::/SparrowOS/OSMain/Memory.CPP.Z"$, is adapted from one I saw at Ticketmaster when I worked on their VAX operating system.
4) The LZW compression algorithm, $LK,"::/SparrowOS/OSMain/Compress.CPP.Z","FI:::/SparrowOS/OSMain/Compress.CPP.Z"$, came from a magazine and I implemented it when I worked for Ticketmaster.
5) The adaptive-step-size-Runge-Kutta algorithm, $LK,"::/SparrowOS/Adam/MathODE.CPP.Z","FI:::/SparrowOS/Adam/MathODE.CPP.Z"$, is adapted from the book, $UL,1$Numeric Recipies in C$UL,0$.
6) The random number generator is from the book, $UL,1$Numeric Recipies in C$UL,0$.
7) The pilgrim game map is from $FG,4$$TX+HTML,"US Geological Survey","http://nationalatlas.gov/mapmaker"$$FG$. (Screen captured and edited with MS Paint and saved as $FG,2$.BMP$FG$ and imported into SparrowOS and converted with a program I wrote.)
8) Tne sheep in AfterEgypt is from $FG,4$$TX+HTML,"http://www.public-domain-photos.com","http://www.public-domain-photos.com"$$FG$.
9) The $FG,2$FAT32$FG$ file system is owned by MicroSoft.
10) 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.
11) I included $LK+HTML,"PCIDevice List File","FI:::/SparrowOS/Misc/PCIDevices.TXT.Z","http://www.pcidatabase.com/reports.php?type=tab-delimeted"$.
12) Thanks to whoever wrote this $FG,4$$TX+HTML,"CppHtml.CPP.Z","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,"ToHtml","FI:::/SparrowOS/Adam/ToHtml.CPP.Z"$.
13) Yahoo Sitebuilder helped with some html code items.
14) I used $FG,4$$TX+HTML,"MagicISO","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+HTML,"ISO9660","http://users.telenet.be/it3.consultants.bvba/handouts/ISO9960.html"$$FG$ spec.
15) I looked at bootable CD boot sects, but didn't learn anything, finding it easier to make my own.
16) I think I got my original PC speaker code from $FG,2$Borland C$FG$.
17) I found PS/2 keyboard and mouse code on the net and documentation. My code is very different. I found VGA register info on the net.
18) Thanks to $FG,4$$TX+HTML,"http://www.osdev.org","http://www.osdev.org"$$FG$ for a couple tips.
19) God told me to stick with 640x480x16 color and kept me from blindly 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.
20) I got $FG,4$$TX+HTML,"Webster's Dictionary","http://www.sparrowos.com/files/DICTIONARY.TXT"$$FG$ and $FG,4$$TX+HTML,"The King James Bible","http://www.sparrowos.com/files/BIBLE.TXT"$$FG$ from $FG,4$$TX+HTML,"Project Gutenberg","http://promo.net/pg/"$$FG$.
In short, I wrote every one of the $TX+D,"135,616","DD_SPARROWOS_LOC"$ lines myself, no $FG,2$GPL$FG$ code, no linkage or dependence on other code. Anyone who says otherwise is being an ass.
$FG,8$
* "MSDOS", "Windows", "MovieMaker" "MS Paint" and "FAT32" are trademarks of MicroSoft Corp.
* "SiteBuilder" is a trademark of Yahoo! Inc.
* "MagicISO" is a trademark of MagicISO Corp.
* "MATLAB" is a trademark of The Math Works, Inc.
* "$TX+HTML,"FreeDOS","http://www.freedos.org"$" is a trademark of Jim Hall.
* "VAX" is a trademark of Digital Equipment Corp.
* "Linux" is probably a trademark owned by Linus Torvalds.
* "VAXTMOS" is a trademark of Ticketmaster.
+8
View File
@@ -0,0 +1,8 @@
$WW,1$$FG,2$AutoFiles$FG$ are used to generate user input to automate operations. The SparrowOS tour is done with an $FG,2$AutoFile$FG$.
When an $FG,2$AutoFile$FG$ runs, a child task is $LK,"Spawn","MN:Spawn"$()ed which intercepts real user input and generates fake input. AutoFiles are $FG,2$C+$FG$ programs run by the child who's stdout goes to the parent's input buffer. $LK,"Msg","MN:Msg"$() can be included in an $FG,2$AutoFile$FG$ to send special keys or mouse cmds to the parent. While an $FG,2$AutoFile$FG$ is running, the normal input gets diverted to the AutoFile 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$AutoFile$FG$.
See $LK,"::/SparrowOS/Demo/AutoFile/AFDir.AUT.Z","FI:::/SparrowOS/Demo/AutoFile/AFDir.AUT.Z"$.
Note: $LK,"Auto","MN:Auto"$("") can be used if all you need is to send ASCII characters. It differs from $LK,"AutoStr","MN:AutoStr"$(). You'll probably use $LK,"Auto","MN:Auto"$() a lot and not $LK,"AutoStr","MN:AutoStr"$(). With $LK,"Auto","MN:Auto"$(), for example, you can place answers to the prompts for recompiling the $FG,2$OSMain$FG$ module during $LK,"InstallBoot","MN:InstallBoot"$().
+16
View File
@@ -0,0 +1,16 @@
$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$$FG,5$Bit operations are "atomic" meaning they won't be interrupted between the testing of the bit and the alteration. This is important when multitasking. With multiprocessing, you should "Lock" these operations.$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 Reverse (Pos of first high one bit or -1)
$FG,2$BCnt$FG$: Bit Cnt (Cnt of set bits)
Binary file not shown.
+81
View File
@@ -0,0 +1,81 @@
$WW,1$$FG,2$Use $LK,"R","MN:R"$() to rename if I change a label.$FG$
$IV,1$----11/26/12 23:05:27----$IV,0$
* Added graphics to $LK,"::/SparrowOS/Apps/MusicOrgan/Examples/mightest.CPP.Z","FI:::/SparrowOS/Apps/MusicOrgan/Examples/mightest.CPP.Z"$.
$IV,1$----11/25/12 13:04:05----$IV,0$
* $BK,1$SparrowOS version 1.02 Released$BK,0$
* Added $LK,"OPTf_WARN_DUP_TYPES","MN:OPTf_WARN_DUP_TYPES"$.
* Converted $FG,2$U64$FG$ to $FG,2$I64$FG$ except where required.
* Got rid of $FG,2$typedef$FG$.
* Got rid of $FG,2$pass-by-ref$FG$ fun args.
* Got rid of $FG,2$result$FG$ special variable.
* $LK,"R","MN:R"$("BoolI8","Bool");
* $LK,"R","MN:R"$("BoolI64","Bool");
$IV,1$----11/21/12 12:09:36----$IV,0$
* Added $FG,2$VMWare$FG$ install.
$IV,1$----11/15/12 12:00:17----$IV,0$
* Added $LK,"::/SparrowOS/Demo/Asm/BuzzFizz.CPP.Z","FI:::/SparrowOS/Demo/Asm/BuzzFizz.CPP.Z"$
* $LK,"R","MN:R"$("CDirDel","CDirEntryDel");
$IV,1$----11/09/12 02:20:37----$IV,0$
* Added $LK,"Suspend","MN:Suspend"$() and $LK,"IsSuspended","MN:IsSuspended"$().
$IV,1$----11/03/12 11:52:45----$IV,0$
* Made $LK,"Sqr","MN:Sqr"$(), $LK,"Abs","MN:Abs"$(), $LK,"Sqrt","MN:Sqrt"$(), $LK,"Sin","MN:Sin"$(), $LK,"Cos","MN:Cos"$(), $LK,"Tan","MN:Tan"$() and $LK,"ATan","MN:ATan"$() in-line.
$IV,1$----11/02/12 11:28:40----$IV,0$
* Added graphics to $LK,"::/SparrowOS/Apps/MusicOrgan/Examples/furnishing.CPP.Z","FI:::/SparrowOS/Apps/MusicOrgan/Examples/furnishing.CPP.Z"$.
$IV,1$----10/31/12 08:45:21----$IV,0$
* $LK,"R","MN:R"$("Unwrap","Wrap");
* Worked on $LK,"::/SparrowOS/Apps/Pilgrims/Pilgrims.CPP.Z","FI:::/SparrowOS/Apps/Pilgrims/Pilgrims.CPP.Z"$.
$IV,1$----10/29/12 17:20:23----$IV,0$
* Added .BMP and .GRA to $LK,"Type","MN:Type"$().
* Added $LK,"Type","MN:Type"$() to $LK,"TermRightClickLink","MN:TermRightClickLink"$().
* Added $LK,"DocPutBMPFile","MN:DocPutBMPFile"$() and $LK,"DocPutGRAFile","MN:DocPutGRAFile"$().
* Added $LK,"::/SparrowOS/Adam/Ctrls/CtrlsButton.CPP.Z","FI:::/SparrowOS/Adam/Ctrls/CtrlsButton.CPP.Z"$ to the API.
$IV,1$----10/27/12 11:09:21----$IV,0$
* Added $LK,"::/SparrowOS/Demo/Graphics/CommonAncestor.CPP.Z","FI:::/SparrowOS/Demo/Graphics/CommonAncestor.CPP.Z"$.
$IV,1$----10/26/12 05:06:53----$IV,0$
* Changed to $FG,2$/0000Boot/0000OSMain.BIN.C$FG$.
* Added $LK,"DOF_WIN_MAX","MN:DOF_WIN_MAX"$.
$IV,1$----10/22/12 21:10:06----$IV,0$
* Worked on $LK,"risen","FI:::/SparrowOS/Apps/MusicOrgan/Examples/risen.CPP.Z"$, $LK,"cosam","FI:::/SparrowOS/Apps/MusicOrgan/Examples/cosam.CPP.Z"$, $LK,"night","FI:::/SparrowOS/Apps/MusicOrgan/Examples/night.CPP.Z"$, $LK,"abiding","FI:::/SparrowOS/Apps/MusicOrgan/Examples/abiding.CPP.Z"$ and $LK,"thereupon","FI:::/SparrowOS/Apps/MusicOrgan/Examples/thereupon.CPP.Z"$.
$IV,1$----10/16/12 10:22:14----$IV,0$
* $BK,1$SparrowOS version 1.01 Released$BK,0$
* $LK,"R","MN:R"$("BigEndian","Endian");
* Added $FG,2$result$FG$ as a built-in local variable like $FG,2$this$FG$ in C++.
$IV,1$----10/13/12 19:52:59----$IV,0$
* Fixed bug in comma'ed leading zeros in $LK,"PrintF","MN:PrintF"$().
* Added octal to $LK,"PrintF","MN:PrintF"$().
* Added comma flag to hex, octal and binary in $LK,"PrintF","MN:PrintF"$().
$IV,1$----10/12/12 05:16:20----$IV,0$
* Changed Binary File Format. $LK,"EIE_END","MN:EIE_END"$
$IV,1$----10/06/12 12:37:05----$IV,0$
* Made $LK,"WinFocus","MN:WinFocus"$(), $LK,"Go1","MN:Go1"$(), $LK,"Go2","MN:Go2"$() and $LK,"Go3","MN:Go3"$().
* Added $LK,"Help","MN:Help"$(), $LK,"VGAFlush","MN:VGAFlush"$() and $FG,2$<CTRL-ALT-F>$FG$.
* Added $LK,"::/SparrowOS/Demo/DbgDemo.CPP.Z","FI:::/SparrowOS/Demo/DbgDemo.CPP.Z"$.
$IV,1$----10/05/12 21:15:13----$IV,0$
* Made so arrays with dimensions in functions args are pass-by-ref. They were not implemented.
* Fixed compiler bug with extern zero length arrays[].
* Added $LK,"::/SparrowOS/Demo/Graphics/SpritePutExt.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePutExt.CPP.Z"$.
$IV,1$----10/03/12 07:59:33----$IV,0$
* Expanded $FG,2$CDocEntry.flags$FG$ to $FG,2$CDocEntry.flags1$FG$ and $FG,2$CDocEntry.flags2$FG$.
* Added $FG,2$+BP$FG$ $LK,"DOCEF2_BIN_PTR_LINK","MN:DOCEF2_BIN_PTR_LINK"$ flag to allow importing sprites from other files.
$IV,1$----10/02/12 20:55:02----$IV,0$
* $BK,1$SparrowOS version 1.00 Released$BK,0$
* Change "$FG,2$$$PI$FG$" to "$FG,2$$$SP$FG$". I made an alias in $LK,"ST_DOC_CMDS","MN:ST_DOC_CMDS"$, for now.
+16
View File
@@ -0,0 +1,16 @@
$WW,1$A $FG,2$Char$FG$acter is a single byte holding an ASCII code for a letter, num or sym. The $FG,2$SparrowOS$FG$ term is a $FG,2$U8$FG$.
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$. SparrowOS uses a few nonstandard values. In SparrowOS ASCII #5 is the cursor location, ASCII 28 is $FG,2$<SHIFT-ESC>$FG$ and ASCII #31 is a $FG,2$<SHIFT-SPACE>$FG$. See $LK,"Char Definitions","MN:CH_SHIFT_SPACE"$.
A $FG,2$Key$FG$ is typically specified with a scan code. SparrowOS scan codes contain the key value in the lowest $FG,2$U8$FG$, and flags in the upper bytes. See $LK,"Scan Code Flags","MN:SCF_CTRL"$ and $LK,"Scan Codes","MN:SC_INS"$.
SparrowOS stores scan codes in 8 bytes.
$FG,2$Byte 0$FG$ is the code with left and right keys combined.
$FG,2$Byte 1-3$FG$ are flags
$FG,2$Byte 4$FG$ is the code with left and right distinct.
$FG,2$Byte 5-7$FG$ are flags
Run the program $LK,"::/SparrowOS/Demo/MsgLoop.CPP.Z","FI:::/SparrowOS/Demo/MsgLoop.CPP.Z"$ to examine scan code.
A $FG,2$String$FG$ is a bunch of ASCII characters terminated with a zero.
+32
View File
@@ -0,0 +1,32 @@
$WW,1$The cmd line feeds into a $FG,2$C+$FG$ compiler as you type. A statement outside a function executes immediately. Remember to add a semicolon.$WW,1$
Look-up the function headers with $FG,2$WordStat$FG$ by hitting $FG,2$<CTRL-SHIFT-F1>$FG$ after typing the first few letters.
$LK,"Click Here","MN:Dir"$ to see the directory cmd header. It accepts default args from $FG,2$C++$FG$.
$FG,4$Dir("*.TXT.Z");$FG$
If you don't have args, you don't need parenthesis.
$FG,4$Dir;$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 enter on a directory listing or press $FG,2$F5$FG$ while editing.
$FG,4$Ed("NewFile.CPP.Z");$FG$
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$'.
$FG,4$Drv('B'); $FG,2$B$FG$ drive
The drive can be specified in a $LK,"Cd","MN:Cd"$() command as in:
$FG,4$Cd("B:/Temp"); $FG,2$B$FG$ drive
$FG,4$Cd("::/SparrowOS/Demo");$FG$ Boot drive
$FG,4$$FG,4$Cd("HOME/MusicOrgan"); $FG,2$HOME$FG$ is a dir
You can place macros in your personal menu for $LK,"Cd","MN:Cd"$() commands. $FG,2$<CTRL-M>$FG$ to access your menu.
$MA+A-X+PU,"Take Tour","SpawnUser(\"Cd(\\\"::/SparrowOS/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$
+49
View File
@@ -0,0 +1,49 @@
$WW,1$$FG,5$$TX+CX,"Clearing-up Confusions"$$FG$
* I, Terry A. Davis, wrote every one of the $TX+D,"134,203","DD_SPARROWOS_LOC"$ lines of SparrowOS over the past $TX+D,"9.1","DD_SPARROWOS_AGE"$ years (full-time). It runs on bare hardware with no layering, libraries, tools, modules or anything from other sources. It's 100% independent and stands alone. It has no networking and certainly doesn't call home. Every line of SparrowOS src code is including in all distributions, from the kernel to the compiler to the boot loaders.
* SparrowOS does not execute code not written by me and any time except for a few BIOS calles for cfguration.
* SparrowOS is 100% independent -- it does not access the files of your primary operating system. It will work as the only operating system on your computer.
* SparrowOS is 100% written from scratch. There is no Linux or GNU or any other code in SparrowOS. Yes, I wrote the compiler from scratch. (I probably need to repeat this a few times.)
* SparrowOS is an operating system, not a browser. The cmd line has active links. They link to local files.
* SparrowOS compiles, not "interprets", and uses no "byte code" anywhere. I use the word "script" sometimes for stuff, but it's actually compiled.
* I am an evolutionist. "$FG,2$Adam$FG$" is a better term for the father of all tasks than "$FG,2$root$FG$" was! $FG,2$OSMain$FG$ is the closest thing to a kernel, but everybody has kernel privilege, so "$FG,2$Kernel$FG$" is deceptive!
* $LK,"Bt","MN:Bt"$() is "bit test", like the x86 instruction, not "bit torrent".
* $LK,"Fs","MN:Fs"$ is a segment register, not "file system". (It is kept pointing to the current task's record.) There is no memory segmentation -- FS and GS are used as general purpose registers, more or less.
* SparrowOS uses a flavor of C/C++. It is not PASCAL. I altered the syntax making parenthesis optional on function calls with no paramaters.
* $LK,"Sleep","MN:Sleep"$() makes a program pause. It is not hybernation for a laptop.
* $LK,"Yield","MN:Yield"$() saves the current task's registers (context) and loads in the next task. When waiting, it's better to do this than check a condition in a loop until you get preempted. Checking a condition until you get preempted wastes CPU. SparrowOS does not use virtual memory, so $LK,"Yield","MN:Yield"$() involves no disk activity. A swap takes half a microsecond. See $LK,"::/SparrowOS/Demo/Lectures/Spinning.CPP.Z","FI:::/SparrowOS/Demo/Lectures/Spinning.CPP.Z"$.
* I use the term "JIT compilation". This means it is compiled and executable code placed into mem, ready to be called.
* Files with names ending in "Z" are compressed, not encrypted. $LK,"Copy","MN:Copy"$() or rename them with $LK,"Move","MN:Move"$() to store them uncompressed.
* SparrowOS is open src and every bit of the src code is included in the distribution. Use $LK,"InstallBoot","MN:InstallBoot"$() to compile the kernel and compiler.
* SparrowOS does not use object files or a linker. You can link $FG,4$.BIN.Z$FG$ modules at $LK,"Load","MN:Load"$() time, though.
* The swap rate is high because tasks stay in the queue and poll conditions and swap-out voluntarily. Swaps also occur at $TX+D,"1000 ","JIFFY_FREQ"$Hz due to the timer interrupt. See $LK,"JIFFY_FREQ","MN:JIFFY_FREQ"$.
* Refresh rate is how often SparrowOS updates screen mem. It is not syncronized to the hardware rate, having nothing to do with it.
* No application has a lock on the speaker so apps can interfere with each other and SparrowOS makes speaker noise during disk access on purpose.
* During boot, SparrowOS reads-in all text files in the $FG,2$/SparrowOS$FG$ directory tree and collects statistic on them. It makes a sparse matrix containing the frequency each word was followed by each other word. This makes it able to predict the next word while you type. This feature is called $FG,2$WordStat$FG$.
* There are no mem leaks. SparrowOS allocates mem as more items are displayed on the screen. SparrowOS allocates mem for code as it is compiled at the cmd line. If you $FG,2$#include$FG$ a file twice, it allocates 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. Code entered at the cmd line gets allocated and persists. I don't want to hear any bullshit about leaks unless you actually run-out. If it bothers you, hit $FG,2$<CTRL-ALT-X>$FG$ and $FG,2$<CTRL-ALT-E>, $FG$periodically$FG$. Use the pop-up flag on macros in your menu to spawn new tasks, run applications and free the applications when they are finished and everything will be fine. Small mem chunks stick to the task when they are freed until it is killed. The only way to get in trouble involves allocating multiple Meg chunks and freeing them. These can only be reused if the same size gets allocated again. Use $LK,"HeapLog","MN:HeapLog"$() and $LK,"HeapLogRep","MN:HeapLogRep"$() to see who allocated mem and didn't free it.
* The editor periodically takes a snap-shot for $FG,2$UNDO$FG$ and this looks like a memory leak.
$FG,8$
* "Linux" is probably a trademark owned by Linus Torvalds.
+34
View File
@@ -0,0 +1,34 @@
$FG,5$$WW,1$$TX+CX,"SparrowOS Constitution"$$FG$
The goal of SparrowOS is to provide an ideal environment for recreational programming and not imitate $FG,2$Linux$FG$. SparrowOS is orders of magnitude simpler than $FG,2$Linux$FG$ to better fulfill the promise of $FG,2$open source$FG$. The vision for SparrowOS is a 64-bit, souped-up, multitasking, multicore $FG,2$Commodore 64$FG$ with a $FG,2$C+$FG$ shell instead of $FG,2$BASIC$FG$ that runs $FG,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ code.
SparrowOS holds no standards sacred -- everything is freshly designed from scratch. This is not a 1970's main frame operating system and, no, it has nothing to do with $FG,2$Commodore 64$FG$ emulation -- it's $FG,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$.
1) SparrowOS is $FG,2$ring-0-only$FG$, running everything in kernel mode including applications. You have full access to memory, I/O ports, instructions, etc. at all times, because that's fun.
2) SparrowOS will always $FG,2$identity-map$FG$ memory in a $FG,2$single-address-map$FG$ configuration. (Virtual addresses are always kept equal to physical addresses with a single map for all tasks on all cores.) It's as though paging is not used.
3) SparrowOS will always be for one platform -- $FG,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC compatibles.
4) SparrowOS will never have networking, so malware is less of an issue.
5) SparrowOS will always have one video mode, $FG,2$640x480$FG$ by 16 colors, unless that mode becomes unavailable on computers in the future.
6) SparrowOS will always be $FG,2$free$FG$. I might sell applications, support, or, possibly, do adware.
7) SparrowOS will always be $FG,2$100% open source$FG$ with all source included, unless device drivers or something can only be included with non-disclosure agreements.
8) All function args and returns will be 64-bit. No plans for C++.
9) SparrowOS documents are not for printing. They're dynamic and intended for the screen. There will always be just one font, a fixed-width font. No Unicode, just ASCII.
10) SparrowOS is not for multimedia. Games will be created by programmers, not artists. Sounds and images will be, primarily, calculated in real-time, not fetched.
11) 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.
12) $FG,4$$BK,1$Backward compatibility is NOT guaranteed.$FG$$BK,0$ You are safest working with $FG,2$JIT$FG$ compilation instead of $FG,2$AOT$FG$ static binaries because I can add members to classes, reorder members in classes, add default args to existing functions, change $FG,2$#define$FG$ values, etc. all without breaking compatibility.
$FG,8$
* "Commodore 64" was a trademark of Commodore Business Machines.
* "Linux" is probably a trademark owned by Linus Torvalds.
+41
View File
@@ -0,0 +1,41 @@
$WW,1$See $LK,"::/SparrowOS/Doc/Dollar.TXT.Z","FI:::/SparrowOS/Doc/Dollar.TXT.Z"$ for details on dollar sign cmds.
$FG,2$"Expression"$FG$ a num or C+ algebraic term with operators and C+ syms can be entered.
$FG,2$"Macro"$FG$ Most entries can behave like macro entries if you assign them macro strs.
$FG,2$"AutoStr"$FG$ Like a macro except it is an $LK,"AutoFile","FF:::/SparrowOS/Doc/Glossary.TXT.Z,AutoFile"$. You can't have both an autostr 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 invisible.
$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 pixels, 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 pixels.
$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$Alias$FG$ For tree entries, the text of the subentry the cursor is on will appear here. This is for drop-down lists.
$FG,5$Define Str$FG$ will substitute a $FG,2$#define$FG$ or $LK,"DefineLoad","MN:DefineLoad"$() string for the tag.
$FG,5$Quote$FG$ Make the result suitable for including in a program, in quotes, especially $FG,4$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$$BK,1$PopUp$BK,0$$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,4$$$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,"ToHtml","MN:ToHtml"$() or $LK,"Doc2Html","MN:Doc2Html"$().
+3
View File
@@ -0,0 +1,3 @@
$WW,1$To create a SparrowOS graphic ctrl, you define call-back functions and insert a $LK,"CCtrl","MN:CCtrl"$ structure in the $LK,"CTask","MN:CTask"$ queue. See $LK,"::/SparrowOS/Demo/Graphics/SliderCtrl.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SliderCtrl.CPP.Z"$, $LK,"::/SparrowOS/Demo/Graphics/ScrollBars.CPP.Z","FI:::/SparrowOS/Demo/Graphics/ScrollBars.CPP.Z"$ and $LK,"TermButtonNew","FF:::/SparrowOS/Adam/WallPaper.CPP.Z,TermButtonNew"$. There is a managed-code ctrl generator, if you press $FG,2$<CTRL-SHIFT-L>$FG$.
+9
View File
@@ -0,0 +1,9 @@
$WW,1$* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale","FF:HOME/Adam3aLocalize.CPP.Z,mxx_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","MN:CDATE_FREQ"$. See $LK,"local time","FF:HOME/Adam3aLocalize.CPP.Z,local_time"$. See $LK,"DateTime.CPP.Z","FI:::/SparrowOS/Demo/DateTime.CPP.Z"$ for changing date/time format maps.
* If sound doesn't work, run $LK,"::/SparrowOS/Adam/Snd/HDCfg.CPP.Z","FI:::/SparrowOS/Adam/Snd/HDCfg.CPP.Z"$ or, comment-out $LK,"#include \"HDAudio\"","FF:HOME/Adam3cSnd.CPP.Z,HDAudio"$ to revert to PC Speaker.
* Get rid of this msg $LK,"here","FF:HOME/DoItOnce.CPP.Z,Customize.TXT.Z"$.
+11
View File
@@ -0,0 +1,11 @@
$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 SparrowOS mentality. I try not to let, often stupid, legacy compatibility issues enter and junk-up SparrowOS.
* I made my type-casting operator post-fix because it makes the compiler way cleaner.
* SparrowOS does not figure-out $FG,2$FAT32$FG$ short name alias numbers. $LK,"FAT32DirNew","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 SparrowOS 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 SparrowOS. There is a SparrowOS native, 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","FI:::/SparrowOS/Compiler/OpCodes.TXT.Z"$ names to remove the ambiguity between instructions with different numbers of arguments, making my $LK,"assembler","FI:::/SparrowOS/Compiler/Assembler.CPP.Z"$ 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","FI:::/SparrowOS/Adam/Boot/BootCD.CPP.Z"$.
* There are no file-sharing locks of any kind. You're on your own.
+4
View File
@@ -0,0 +1,4 @@
$WW,1$SparrowOS has a class for 3 dimensional points consisting of F64s. SparrowOS's compiler is not C++, so 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 SparrowOS.
As a courtesy, most of the CD3 functions return the addr of the destination vect, so you can nestle calls. They do not allocate new space for the destination vect.
+46
View File
@@ -0,0 +1,46 @@
$WW,1$* You can enter the debugger with $FG,2$<CTRL-ALT-D>$FG$. Enter $LK,"BptsR","MN:BptsR"$() follwed by $LK,"Go2","MN:Go2"$() to continue execution. $LK,"Dbg","MN:Dbg"$() will enter debugger or you might enter the debugger through a fault. You might place a call 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","MN:U"$(), possibly when not in the debugger, find the offset and follow the link to source code. $LK,"Go1","MN:Go1"$() might exit the debugger and retain the task or $LK,"Exit","MN:Exit"$() might exit debugger, but you will lose the task.
* I use $LK,"progress1","MN:progress1"$-$LK,"progress4","MN:progress4"$ for debugging because they show on the wallpaper. They're just global integer vars.
* While debugging, you specify addresses of assembly routines with just the label, as in $FG,2$_MALLOC+0x20$FG$. You specify $FG,2$C+$FG$ function names with $FG,2$&$FG$ before functions as in $FG,2$&PrintF+0x10$FG$.
* You can use $LK,"AdamLog","MN:AdamLog"$() to send text to the Adam task window. It works like $LK,"PrintF","MN:PrintF"$(). I never use this. Instead I use $LK,"DbgNum","MN:DbgNum"$().
* $LK,"D","MN:D"$() $LK,"DocD","MN:DocD"$() to do 16 column hex dump mem with numbering from zero. With $LK,"DocD","MN:DocD"$ the values are updated continually and you can alter mem by editing.
* $LK,"Dm","MN:Dm"$() $LK,"DocDm","MN:DocDm"$() to do 16 column hex dump mem with addresses showing.
* $LK,"Da","MN:Da"$() to do one column address dump (for stk, etc.) with symbolic addresses.
* $LK,"Dr","MN:Dr"$() dumps registers. You can display and modify registers in the debugger with var-like labels, $FG,4$RAX$FG$, $FG,4$RBX$FG$, etc. See $LK,"DefineRegs","MN:DefineRegs"$().
* $LK,"U","MN:U"$(&FunName+offset) to unassemble mem or $LK,"Uf","MN:Uf"$("FunName") to unassemble a function.
* $LK,"ProfBin","MN:ProfBin"$(),$LK,"ProfAll","MN:ProfAll"$() and $LK,"ProfRep","MN:ProfRep"$() provide code profiling. See $LK,"::/SparrowOS/Demo/AutoFile/AFProfile.AUT.Z","FI:::/SparrowOS/Demo/AutoFile/AFProfile.AUT.Z"$ (This is an $LK,"AutoFile","FF:::/SparrowOS/Doc/Glossary.TXT.Z,AutoFile"$.)
* If you recompile $FG,2$OSMain$FG$ with $LK,"InstallBoot","MN:InstallBoot"$(), you can modify the handler for faults here: $LK,"Fault2","MN:Fault2"$().
* Use $LK,"DbgNum","MN:DbgNum"$(), $LK,"DbgStr","MN:DbgStr"$() and $LK,"DbgAdd","MN:DbgAdd"$() 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","MN:Raw"$($FG,2$TRUE$FG$) to make all output bypass the window framework. The WinMgr runs on core0 and will overwrite raw text from other cores when it updates the screen.
* Use $LK,"SysDbg","MN:SysDbg"$() to set a flag which you can read with $LK,"IsSysDbg","MN:IsSysDbg"$() when you wish to trigger some debug activity. It's just a handy simple flag, nothing fancy.
* Use $LK,"SysDeterministic","MN:SysDeterministic"$() to set a flag which tries to keep the system deterministic for debugging. $LK,"IsSysDeterministic","MN:IsSysDeterministic"$(). There is a $FG,2$Deterministic$FG$ OSMain config flag.
* 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","MN:Echo"$() turns on or off raw data going into the lexical analyzer.
$LK,"LTrace","MN:LTrace"$() shows the tokens coming out of the lexical analyzer.
$LK,"CTrace","MN:CTrace"$() unassembles code generated from the C+ compiler.
$LK,"PTrace","MN:PTrace"$() shows $FG,2$intermediate code$FG$ comming out of the first stage of the compiler (it's not 100% valid because it hasn't been fixed-up).
$LK,"OTrace","MN:OTrace"$() shows intermediate code coming-out after optimization. $LK,"OPassTraceMask","MN:OPassTraceMask"$() ctrls which passes are displayed.
$ID,-2$
* There is a heap check utility which can find leaks. Use $LK,"HeapLog","MN:HeapLog"$(), and $LK,"HeapLogRep","MN:HeapLogRep"$(). It's a really simple program which intercepts $LK,"MAlloc","MN:MAlloc"$() and $LK,"Free","MN:Free"$(). You can customize the code to find other heap issues.
* You can define functions for $FG,2$<CTRL-ALT-letter>$FG$ keys, but they must operate in a interrupt environment or in the window mgr when in ques kbd msgs. You can do $LK,"Raw","MN:Raw"$() output. Search for $LK,"fp_ctrl_alt_let_cbs","MN:fp_ctrl_alt_let_cbs"$[] and look at the code. They take scancode as an arg.
* If you recompile $FG,2$OSMain$FG,2$$FG$ with $LK,"InstallBoot","MN:InstallBoot"$(), 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 allocated off the heap to be initialized or $FG,4$VarInit$FG$ option so both global and local vars will be initialized to a value. Pick a non-zero value to discover uninitialized var bugs. You can set $LK,"sys_var_init_flag","MN:sys_var_init_flag"$, and $LK,"sys_heap_init_flag","MN:sys_heap_init_flag"$ directly after booting. You can also use the $FG,4$ProtectLow$FG$ option to discover $FG,2$NULL$FG$ dereferences.
+6
View File
@@ -0,0 +1,6 @@
$WW,1$To allow different languages and customization, SparrowOS uses strings to identify actual strings to be displayed. This is basically a level of indirection. Support for lists of strings is also provided, but it's not especially efficient.
Each task can load it's own Define strings. If a string is not found, the parent task's table is searched.
See $LK,"::/SparrowOS/Demo/Define.CPP.Z","FI:::/SparrowOS/Demo/Define.CPP.Z"$.
+198
View File
@@ -0,0 +1,198 @@
$FG,5$$TX+CX,"SparrowOS 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 BAR>$FG$ to edit a file and $FG,2$F5$FG$ to run it.
$WW,0$$TR,"Game Making Skills"$
$ID,2$$TR,"Beginner"$
$ID,2$$LK,"::/SparrowOS/Demo/Graphics/DotNet.CPP.Z","FI:::/SparrowOS/Demo/Graphics/DotNet.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/LowPassFilter.CPP.Z","FI:::/SparrowOS/Demo/Graphics/LowPassFilter.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/MathAudioDemo.CPP.Z","FI:::/SparrowOS/Demo/Graphics/MathAudioDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Lines.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Lines.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/TicTacToe.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/TicTacToe.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z"$
$LK,"::/SparrowOS/Demo/MsgLoop.CPP.Z","FI:::/SparrowOS/Demo/MsgLoop.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/ASCIIOrgan.CPP.Z","FI:::/SparrowOS/Demo/Snd/ASCIIOrgan.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Doodle.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Doodle.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Speedline.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Speedline.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Bounce.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Bounce.CPP.Z"$
$LK,"::/SparrowOS/Demo/KeyBitMap.CPP.Z","FI:::/SparrowOS/Demo/KeyBitMap.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Blink.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Blink.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/WinZBuf.CPP.Z","FI:::/SparrowOS/Demo/Graphics/WinZBuf.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Golf.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Golf.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Mountain.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Mountain.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Coach.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Coach.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/MyWallPaper.CPP.Z","FI:::/SparrowOS/Demo/Graphics/MyWallPaper.CPP.Z"$
$LK,"::/SparrowOS/Demo/Digits.CPP.Z","FI:::/SparrowOS/Demo/Digits.CPP.Z"$
$LK,"::/SparrowOS/Demo/Progress.CPP.Z","FI:::/SparrowOS/Demo/Progress.CPP.Z"$ //has some ASM, just ignore
$LK,"::/SparrowOS/Demo/Graphics/CPUPlot.CPP.Z","FI:::/SparrowOS/Demo/Graphics/CPUPlot.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Dither.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Dither.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Symmetry.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Symmetry.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/SpritePut.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePut.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/SpritePutExt.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePutExt.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Blot.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Blot.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/CaptureScreen.CPP.Z","FI:::/SparrowOS/Demo/Graphics/CaptureScreen.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/EdCSprite.CPP.Z","FI:::/SparrowOS/Demo/Graphics/EdCSprite.CPP.Z"$
$LK,"::/SparrowOS/Demo/PullDownMenu.CPP.Z","FI:::/SparrowOS/Demo/PullDownMenu.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Demo/GameStarters/Stadium","Cd(\"::/SparrowOS/Demo/GameStarters/Stadium\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/Graphics/Palette.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Palette.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/CircleTrace.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/CircleTrace.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Halogen.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Halogen.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/TheDead.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/TheDead.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Bomber.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Bomber.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/RainDrops.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/RainDrops.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/MorseCode.CPP.Z","FI:::/SparrowOS/Demo/Snd/MorseCode.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/PixelCollision.CPP.Z","FI:::/SparrowOS/Demo/Graphics/PixelCollision.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/BlackDiamond.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/BlackDiamond.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/SpaceShip.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/SpaceShip.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Wenceslas.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Wenceslas.CPP.Z"$
$ID,-2$$TR,"Intermediate"$
$ID,2$$LK,"::/SparrowOS/Demo/Graphics/Box.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Box.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Pick.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Pick.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/3DPoly.CPP.Z","FI:::/SparrowOS/Demo/Graphics/3DPoly.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/BSpline.CPP.Z","FI:::/SparrowOS/Demo/Graphics/BSpline.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Extents.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Extents.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/SpritePlot3D.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePlot3D.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Logo.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Logo.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/RotateTank.CPP.Z","FI:::/SparrowOS/Demo/Graphics/RotateTank.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Pic2ASCII.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Pic2ASCII.CPP.Z"$
$LK,"::/SparrowOS/Demo/ScreenCodes.CPP.Z","FI:::/SparrowOS/Demo/ScreenCodes.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/NeatTrick.CPP.Z","FI:::/SparrowOS/Demo/Graphics/NeatTrick.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/CharGraphics.CPP.Z","FI:::/SparrowOS/Demo/Graphics/CharGraphics.CPP.Z"$
$LK,"::/SparrowOS/Demo/Maze.CPP.Z","FI:::/SparrowOS/Demo/Maze.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/FontEd.CPP.Z","FI:::/SparrowOS/Demo/Graphics/FontEd.CPP.Z"$
$LK,"::/SparrowOS/Demo/ExtendedChars.CPP.Z","FI:::/SparrowOS/Demo/ExtendedChars.CPP.Z"$
$LK,"::/SparrowOS/Demo/TimeIns.CPP.Z","FI:::/SparrowOS/Demo/TimeIns.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/WaterFowl.CPP.Z","FI:::/SparrowOS/Demo/Snd/WaterFowl.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/MusicOrgan/Examples","Cd(\"::/SparrowOS/Apps/MusicOrgan/Examples\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/MultiCore/MPPrintF.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/MPPrintF.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Layers3DJob.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Layers3DJob.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/PredatorPrey.CPP.Z","FI:::/SparrowOS/Demo/Graphics/PredatorPrey.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Cartesian.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Cartesian.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Hanoi.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Hanoi.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Life.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Life.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Zing.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Zing.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/ChessNet.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/ChessNet.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Chess.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Chess.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Flowers.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Flowers.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Palindrome.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Palindrome.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/MPAdd.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/MPAdd.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Lock.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Lock.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/LayersSpawn.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/LayersSpawn.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Clouds.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Clouds.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Noise.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Noise.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/SliderCtrl.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SliderCtrl.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Bling.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Bling.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/ScrollBars.CPP.Z","FI:::/SparrowOS/Demo/Graphics/ScrollBars.CPP.Z"$
$LK,"::/SparrowOS/Demo/RegistryDemo.CPP.Z","FI:::/SparrowOS/Demo/RegistryDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/BirdLand.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/BirdLand.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/MissileDefense.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/MissileDefense.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/WarGame.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/WarGame.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/BigGuns.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/BigGuns.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Navy.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Navy.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/RawHide.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/RawHide.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/DunGen.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/DunGen.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/Timeout","Cd(\"::/SparrowOS/Apps/Timeout\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/GameStarters/Collision.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Collision.CPP.Z"$
$ID,-2$$TR,"Advanced"$
$ID,2$$LK,"::/SparrowOS/Demo/MultiCore/LoadTest.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/LoadTest.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Primes.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Primes.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Sort.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Sort.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/RadixSort.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/RadixSort.CPP.Z"$
$LK,"::/SparrowOS/Demo/MultiCore/Interrupts.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Interrupts.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/Pilgrims","Cd(\"::/SparrowOS/Apps/Pilgrims\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Apps/AfterEgypt","Cd(\"::/SparrowOS/Apps/AfterEgypt\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/GameStarters/Varoom.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Varoom.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Shading.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Shading.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Transform.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Transform.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Shadow.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Shadow.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Pick3D.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Pick3D.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/Tanks","Cd(\"::/SparrowOS/Apps/Tanks\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/Graphics/SpriteText.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpriteText.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/GrModels","Cd(\"::/SparrowOS/Apps/GrModels\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Apps/KeepAway","Cd(\"::/SparrowOS/Apps/KeepAway\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/Graphics/Camp.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Camp.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Rocket.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Rocket.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/RocketScience.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/RocketScience.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/MassSpring.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/MassSpring.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Whap.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Whap.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Rocks.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Rocks.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/Squirt.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Squirt.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/X-Caliber","Cd(\"::/SparrowOS/Apps/X-Caliber\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/GameStarters/ZoneOut.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/ZoneOut.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/FPS.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/FPS.CPP.Z"$
$LK,"::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/Span","Cd(\"::/SparrowOS/Apps/Span\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Apps/MusicOrgan","Cd(\"::/SparrowOS/Apps/MusicOrgan\");Dir;View;\n"$
$ID,-2$
$ID,-2$$TR,"Non-Game Skills"$
$ID,2$$LK,"::/SparrowOS/Demo/DbgDemo.CPP.Z","FI:::/SparrowOS/Demo/DbgDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/PhoneNumWords.CPP.Z","FI:::/SparrowOS/Demo/PhoneNumWords.CPP.Z"$
$LK,"::/SparrowOS/Demo/SuggestSpelling.CPP.Z","FI:::/SparrowOS/Demo/SuggestSpelling.CPP.Z"$
$LK,"::/SparrowOS/Demo/WordSearch.CPP.Z","FI:::/SparrowOS/Demo/WordSearch.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/CommonAncestor.CPP.Z","FI:::/SparrowOS/Demo/Graphics/CommonAncestor.CPP.Z"$
$LK,"::/SparrowOS/Demo/Dsk/DataBase.CPP.Z","FI:::/SparrowOS/Demo/Dsk/DataBase.CPP.Z"$
$LK,"::/SparrowOS/Demo/Dsk/OrderedIO.CPP.Z","FI:::/SparrowOS/Demo/Dsk/OrderedIO.CPP.Z"$
$LK,"::/SparrowOS/Demo/Dsk/FPrintF.CPP.Z","FI:::/SparrowOS/Demo/Dsk/FPrintF.CPP.Z"$
$LK,"::/SparrowOS/Demo/Dsk/Raw.CPP.Z","FI:::/SparrowOS/Demo/Dsk/Raw.CPP.Z"$
$LK,"::/SparrowOS/Demo/Dsk/UnusedSpaceRep.CPP.Z","FI:::/SparrowOS/Demo/Dsk/UnusedSpaceRep.CPP.Z"$
$LK,"::/SparrowOS/Demo/Lectures/MiniGrLib.CPP.Z","FI:::/SparrowOS/Demo/Lectures/MiniGrLib.CPP.Z"$
$LK,"::/SparrowOS/Demo/Lectures/MiniCompiler.CPP.Z","FI:::/SparrowOS/Demo/Lectures/MiniCompiler.CPP.Z"$
$LK,"::/SparrowOS/Demo/MagicPairs.CPP.Z","FI:::/SparrowOS/Demo/MagicPairs.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/Circuit.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Circuit.CPP.Z"$
$LK,"::/SparrowOS/Demo/Graphics/PoleZeros.CPP.Z","FI:::/SparrowOS/Demo/Graphics/PoleZeros.CPP.Z"$
$LK,"::/SparrowOS/Demo/WebLogExample/WebLogRep.CPP.Z","FI:::/SparrowOS/Demo/WebLogExample/WebLogRep.CPP.Z"$
$LK,"::/SparrowOS/Demo/WebLogExample/WebLogScramble.CPP.Z","FI:::/SparrowOS/Demo/WebLogExample/WebLogScramble.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Apps/TimeClock","Cd(\"::/SparrowOS/Apps/TimeClock\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Apps/Logic","Cd(\"::/SparrowOS/Apps/Logic\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Demo/Lectures","Cd(\"::/SparrowOS/Demo/Lectures\");Dir;View;\n"$
$ID,-2$$TR,"SparrowOS Specific"$
$ID,2$$MA+A-X+PU,"::/SparrowOS/Demo/OldSchool","Cd(\"::/SparrowOS/Demo/OldSchool\");Dir;View;\n"$
$MA+A-X+PU,"::/SparrowOS/Demo/AutoFile","Cd(\"::/SparrowOS/Demo/AutoFile\");Dir;View;\n"$
$LK,"::/SparrowOS/Demo/PrintF.CPP.Z","FI:::/SparrowOS/Demo/PrintF.CPP.Z"$
$LK,"::/SparrowOS/Demo/DateTime.CPP.Z","FI:::/SparrowOS/Demo/DateTime.CPP.Z"$
$LK,"::/SparrowOS/Demo/SubIntAccess.CPP.Z","FI:::/SparrowOS/Demo/SubIntAccess.CPP.Z"$
$LK,"::/SparrowOS/Demo/ParenWarn.CPP.Z","FI:::/SparrowOS/Demo/ParenWarn.CPP.Z"$
$LK,"::/SparrowOS/Demo/CompileDemo.CPP.Z","FI:::/SparrowOS/Demo/CompileDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/Prompt.CPP.Z","FI:::/SparrowOS/Demo/Prompt.CPP.Z"$
$LK,"::/SparrowOS/Demo/ClassMeta.CPP.Z","FI:::/SparrowOS/Demo/ClassMeta.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/Form.CPP.Z","FI:::/SparrowOS/Demo/Doc/Form.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/MenuButton.CPP.Z","FI:::/SparrowOS/Demo/Doc/MenuButton.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/MenuSprite.CPP.Z","FI:::/SparrowOS/Demo/Doc/MenuSprite.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/TreeDemo.CPP.Z","FI:::/SparrowOS/Demo/Doc/TreeDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/Exceptions.CPP.Z","FI:::/SparrowOS/Demo/Exceptions.CPP.Z"$
$LK,"::/SparrowOS/Demo/StkGrow.CPP.Z","FI:::/SparrowOS/Demo/StkGrow.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/TextDemo.CPP.Z","FI:::/SparrowOS/Demo/Doc/TextDemo.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/CursorMove.CPP.Z","FI:::/SparrowOS/Demo/Doc/CursorMove.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/DemoDoc.TXT.Z","FI:::/SparrowOS/Demo/Doc/DemoDoc.TXT.Z"$
$LK,"::/SparrowOS/Demo/Spy.CPP.Z","FI:::/SparrowOS/Demo/Spy.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/FileRead.CPP.Z","FI:::/SparrowOS/Demo/Doc/FileRead.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/Data.CPP.Z","FI:::/SparrowOS/Demo/Doc/Data.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/DefineStr.CPP.Z","FI:::/SparrowOS/Demo/Doc/DefineStr.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/CallBack.CPP.Z","FI:::/SparrowOS/Demo/Doc/CallBack.CPP.Z"$
$LK,"::/SparrowOS/Demo/Doc/CallBackAux2.CPP.Z","FI:::/SparrowOS/Demo/Doc/CallBackAux2.CPP.Z"$
$LK,"::/SparrowOS/Demo/Define.CPP.Z","FI:::/SparrowOS/Demo/Define.CPP.Z"$
$LK,"EdRenumAsm","MN:EdRenumAsm"$
$LK,"::/SparrowOS/Demo/Doc/UnusedDefine.CPP.Z","FI:::/SparrowOS/Demo/Doc/UnusedDefine.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/AsmHelloWorld.CPP.Z","FI:::/SparrowOS/Demo/Asm/AsmHelloWorld.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/BuzzFizz.CPP.Z","FI:::/SparrowOS/Demo/Asm/BuzzFizz.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/PutDec.CPP.Z","FI:::/SparrowOS/Demo/Asm/PutDec.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/MulByHand.CPP.Z","FI:::/SparrowOS/Demo/Asm/MulByHand.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/DivByHand.CPP.Z","FI:::/SparrowOS/Demo/Asm/DivByHand.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/AsmAndC.CPP.Z","FI:::/SparrowOS/Demo/Asm/AsmAndC.CPP.Z"$
$LK,"::/SparrowOS/Demo/Asm/AsmAndC2.CPP.Z","FI:::/SparrowOS/Demo/Asm/AsmAndC2.CPP.Z"$
$LK,"::/SparrowOS/Demo/GlblVars.CPP.Z","FI:::/SparrowOS/Demo/GlblVars.CPP.Z"$
$LK,"::/SparrowOS/Demo/WinMgr2.CPP.Z","FI:::/SparrowOS/Demo/WinMgr2.CPP.Z"$
$LK,"::/SparrowOS/Misc/OSTestSuite.CPP.Z","FI:::/SparrowOS/Misc/OSTestSuite.CPP.Z"$
$MA+A-X+PU,"::/SparrowOS/Adam","Cd(\"::/SparrowOS/Adam\");Dir;View;\n"$
$ID,-2$$TR,"HD Audio"$
$ID,2$$LK,"::/SparrowOS/Demo/Snd/BeatFreq.CPP.Z","FI:::/SparrowOS/Demo/Snd/BeatFreq.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/PolyPhonic.CPP.Z","FI:::/SparrowOS/Demo/Snd/PolyPhonic.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/SndScope.CPP.Z","FI:::/SparrowOS/Demo/Snd/SndScope.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/Synth.CPP.Z","FI:::/SparrowOS/Demo/Snd/Synth.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/Record.CPP.Z","FI:::/SparrowOS/Demo/Snd/Record.CPP.Z"$
$LK,"::/SparrowOS/Demo/Snd/Echo.CPP.Z","FI:::/SparrowOS/Demo/Snd/Echo.CPP.Z"$
$ID,-2$
+226
View File
@@ -0,0 +1,226 @@
$WW,1$$FG,5$$TX+CX,"SparrowOS C+"$$FG$
* See $LK,"Scoping and Linkages","FI:::/SparrowOS/Doc/ImportExports.TXT.Z"$ for details on $FG,2$extern$FG$, $FG,2$import$FG$, $FG,2$_extern$FG$, $FG,2$_import$FG$, etc.
* See $LK,"::/SparrowOS/Doc/Directives.TXT.Z","FI:::/SparrowOS/Doc/Directives.TXT.Z"$.
* 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,I64$FG$ for unsigned 0-8 byte ints and $FG,2$F64$FG$ for 8 byte floats.
$FG,2$ U0 void
I8 char
U8 unsigned char
I16 short
U16 unsigned short
I32 int
U32 unsigned int
I64 long (64-bit)
I64 unsigned long (64-bit)
F64 double$FG$
$FG,4$no F32 float.$FG$
* Function with no, or just default args can be called without parentheses.
* 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)
{
PrintF("%X %X %X\n",i,j,k);
}
Test(,3);$FG$
$ID,-2$
* A string or char constant all alone is sent to $LK,"PutS","MN:PutS"$() or $LK,"PutChar","MN:PutChar"$(). A string with args is sent to $LK,"PrintF","MN:PrintF"$(). An empty string literal signals a variable fmt_str follows.
$ID,2$$FG,2$U0 Demo1(U8 drv,U8 *fmt,U8 *name,I64 age)
{
PutS("Hello World!\n");
PrintF("%s age %d\n",name,age);
PrintF(fmt,name,age);
PutChar(drv);
PutChar('*');
}
U0 Demo2(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, precede the name with "$FG,2$&$FG$".
* There is no $FG,2$main()$FG$ function. Any code outside of functions gets executed on start-up, in order.
* You can access bytes or words within any int. $FG,2$i.u8[2]$FG$ returns bits 24-27 in the variable, $FG,2$i$FG$. See $LK,"I64 declaration","MN:I64"$. The real feature is that a class can be accessed as a whole, if you put a type in front of the $FG,2$class$FG$ declaration.
* 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$U0 GrPrintF(CDC *dc,I64 x,I64 y,U8 *fmt,...)
{
U8 *buf=SPrintFJoin(NULL,fmt,argc,argv);
GrPutS(dc,x,y,buf);
Free(buf);
}
$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$
* $FG,2$switch$FG$ statements 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$ statements.
* $FG,2$nobound_switch$FG$ can be used if you know a switch statement will not exceed the lowest or highest case values. It's a little faster because it doesn't check.
* $FG,2$noreg$FG$ or $FG,2$reg$FG$ can be placed before a function local var name. You can, optionally, specify a register after the $FG,2$reg$FG$ keyword.
* $FG,2$interrupt$FG$, $FG,2$public$FG$, $FG,2$argpop$FG$ or $FG,2$noargpop$FG$ are function flags.
* A $FG,2$nounusedwarn$FG$ statement 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.
* Type casting is postfix. To typecast int or F64, use $LK,"ToI64","MN:ToI64"$(), $LK,"ToBool","MN:ToBool"$() or $LK,"ToF64","MN:ToF64"$(). (SparrowOS 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.)
* The "$FG,2$`$FG$" operator raises a base to a power.
* A single quote can encompass multiple characters. $FG,2$'ABC'$FG$ is equal to $FG,2$0x434241$FG$.
* $AN,"","OP_precedence"$SparrowOS $LK,"operator precedence","FA:::/SparrowOS/Compiler/CmpInit.CPP.Z,OP_precedence"$
$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,2$<$FG$,$FG,2$>$FG$,$FG,2$<=$FG$,$FG,2$>=$FG$
$FG,2$==$FG$,$FG,2$!=$FG$
$FG,2$&&$FG$
$FG,2$$FG,2$^^$FG$
$FG,2$||$FG$$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,"OptOn","MN:OptOn"$($LK,"OPTf_WARN_PAREN","MN:OPTf_WARN_PAREN"$) to find unnecessary parentheses in code.
* You can use $LK,"OptOn","MN:OptOn"$($LK,"OPTf_WARN_DUP_TYPES","MN:OPTf_WARN_DUP_TYPES"$) to find dup local var type statements.
* 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 {}","FF:::/SparrowOS/OSMain/OSEnd.CPP.Z,#exe {"$ for an example where the date/time and compile-time prompting for cfguration data is placed into a program. The $LK,"StreamPrintF","MN:StreamPrintF"$() and $LK,"StreamPutS","MN:StreamPutS"$() place 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,"::/SparrowOS/Doc/Dollar.TXT.Z","FI:::/SparrowOS/Doc/Dollar.TXT.Z"$. In $FG,2$asm$FG$ or $FG,2$C+$FG$ code, it also refers to the instruction's addr.
* $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,"Adam1a.HPP.Z","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,"::/SparrowOS/Demo/SubIntAccess.CPP.Z","FI:::/SparrowOS/Demo/SubIntAccess.CPP.Z"$.
* $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,"::/SparrowOS/Demo/ClassMeta.CPP.Z","FI:::/SparrowOS/Demo/ClassMeta.CPP.Z"$ and $LK,"DocFormDo","MN:DocFormDo"$().
* See $LK,"::/SparrowOS/Demo/Exceptions.CPP.Z","FI:::/SparrowOS/Demo/Exceptions.CPP.Z"$. $FG,2$try{} catch{}$FG$ and $FG,2$throw$FG$ are different from C++. $FG,2$throw$FG$ is a function with var ("$FG,2$...$FG$") args. The values passed in $FG,2$throw()$FG$ can be accessed from within a $FG,2$catch{}$FG$ using the $FG,2$Fs->except_argc$FG$ and $FG,2$Fs->except_argv[]$FG$ vars. 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 handler. By convention, the first arg of $FG,2$except_argv[]$FG$ specifies the exception type num. A list of assigned exception types can be found at $LK,"EXCEPT_LOCAL","MN:EXCEPT_LOCAL"$. For a handler that will catch all excepts, you can use $LK,"CatchAll","MN:CatchAll"$().
* 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$ statement. Use $FG,2$goto$FG$.
* No bit field support, but there are bit access $LK,"library routines","HI:Bit"$.
* $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 instructions within. It's a little shoddy. See $LK,"::/SparrowOS/Demo/MultiCore/Lock.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Lock.CPP.Z"$.
* There is a function called $LK,"MSize","MN:MSize"$() which gives the size of an object allocated 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","MN:Free"$() a $FG,2$NULL$FG$ ptr. Useful variants of $LK,"MAlloc","MN:MAlloc"$() can be found $LK,"Here","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,"HeapCtrlIndependentInit","MN:HeapCtrlIndependentInit"$().
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"DFT_STK","MN:DFT_STK"$ and recompile $FG,2$OSMain$FG$ or request more when doing a $LK,"Spawn","MN:Spawn"$(). You can use $LK,"CallStkGrow","MN:CallStkGrow"$(), but it's odd. See $LK,"::/SparrowOS/Demo/StkGrow.CPP.Z","FI:::/SparrowOS/Demo/StkGrow.CPP.Z"$.
* Only one base class is allowed.
* All values are extended to 64-bit when accessed. Intermediate calculations are done with 64-bit values.
$ID,2$The follow examples should be inserted in a function, so that register variables are used. (Global vars are never register.)
$FG,2$I16 i;
I32 j;
j=i=0x12345678; //Resulting i is 0x5678 but j is 0x12345678
I64 i=0x8000000000000000;
PrintF("%X\n",i>>1); //Result is 0xC000000000000000 as expected
I64 u=0x8000000000000000;
PrintF("%X\n",u>>1); //Result is 0x4000000000000000 as expected
I32 i=0x80000000; //constant is loaded into a 64-bit register var.
PrintF("%X\n",i>>1); //Result is 0x40000000
I32 i=-0x80000000;
PrintF("%X\n",i>>1); //Result is 0xC0000000 as expected
$ID,-2$$FG$
$FG,5$$TX+CX,"PrintF Family"$$FG$
$LK,"MSPrintF","MN:MSPrintF"$() is like $LK,"SPrintF","MN:SPrintF"$() but it returns a $LK+S,"MAlloc","MN:MAlloc"$ated str. It is vary handy because you don't have to worry about overflow.
$LK,"PutS","MN:PutS"$() doesn't print a new line.
$LK,"Auto","MN:Auto"$(U8 *fmtstr,...) sends text to the current task's input buffer.
$LK,"AutoStr","MN:AutoStr"$(U8 *fmtstr,...) sends text of an $LK,"AutoFile","FF:::/SparrowOS/Doc/Glossary.TXT.Z,AutoFile"$ to the keyboard stream of the current TASK but can also do mouse cmds.
$LK,"XTalk","MN:XTalk"$(CTask *task,U8 *fmtstr,...) and text to another task's input buffer.
$LK,"XTalkStr","MN:XTalkStr"$(CTask *task,U8 *fmtstr,...) sends text of an $LK,"AutoFile","FF:::/SparrowOS/Doc/Glossary.TXT.Z,AutoFile"$ to the keyboard stream of another TASK but can also do mouse cmds.
$LK,"DocPutS","MN:DocPutS"$(CDoc *doc,U8 *src) and $LK,"DocPrintF","MN:DocPrintF"$(CDoc *doc,U8 *fmtstr,...) send text to a linked text file. You can buffer to a Doc and save it, providing the functionality of $FG,2$fprintf$FG$. See $LK,"::/SparrowOS/Demo/Dsk/FPrintF.CPP.Z","FI:::/SparrowOS/Demo/Dsk/FPrintF.CPP.Z"$.
$LK,"Adam","MN:Adam"$(U8 *fmtstr,...) send text to the adam task to be compiled and run.
$LK,"AdamLog","MN:AdamLog"$(U8 *fmtstr,...) and $LK,"AdamErr","MN:AdamErr"$(U8 *fmtstr,...) send text to the adam task to be displayed.
$LK,"StreamPrintF","MN:StreamPrintF"$(U8 *fmtstr,...) and $LK,"StreamPutS","MN:StreamPutS"$(U8 *src) send text to the stream of code being compiled and must reside in a $FG,2$#exe{}$FG$ blk.
$LK,"GrPrintF","MN:GrPrintF"$(CDC *dc,I64 x,I64 y,U8 *fmtstr,...) and $LK,"GrPutS","MN:GrPutS"$(CDC *dc,I64 x,I64 y,U8 *src) plots text in graphics mode. $LK,"GrVPrintF","MN:GrVPrintF"$() and $LK,"GrVPutS","MN:GrVPutS"$() will print vertically.
$LK,"ExePrintF","MN:ExePrintF"$(U8 *fmtstr,...) and $LK,"ExePutS","MN:ExePutS"$(U8 *src) compile and execute a string. Note: It returns the result of the last executed expression.
$BK,1$Note:$BK,0$ If no $FG,2$PutS$FG$ variant is available, you can use $FG,2$PrintF("%s",src)$FG$.
$AN,"","PrintF_Codes"$The $LK,"PrintF","MN:PrintF"$() family supports extended format codes. See $LK,"SPrintFJoin","MN:SPrintFJoin"$().
$ID,2$$FG,2$%$FG$[$FG,2$-$FG$][$FG,2$0$FG$][$FG,5$width$FG$][$FG,2$.$FG,5$decimals$FG$][$FG,5$flags$FG$][$FG,2$h$FG,5$sub_fmt$FG$][$FG,5$main_fmt$FG$]
$FG,5$flags:$FG$
$ID,2$* $FG,2$'t'$FG$ is a flag which will truncate to field width.
* $FG,2$','$FG$ is a flag which will add commas every three digits in a $FG,2$%d$FG$, $FG,2$%f$FG$,$FG,2$ %g$FG$,$FG,2$ %e$FG$ and $FG,2$%n$FG$ entries.
* $FG,2$'$$'$FG$ is a flag which affects the $FG,2$%Q$FG$ entry, converting $FG,2$'$$'$FG$ to $FG,2$"\044"$FG$.
* $FG,2$'k'$FG$ is a flag which forces 1000 instead of 1024 on integer with $FG,5$sub_fmts$FG$.
$ID,-2$
$FG,5$sub_fmt:$FG$
$ID,2$On date or time entries, the sub_format specifies the format. See $LK,"::/SparrowOS/Demo/DateTime.CPP.Z","FI:::/SparrowOS/Demo/DateTime.CPP.Z"$.
$AN,"","sub_fmt"$On $FG,2$"%n"$FG$, $FG,2$"%d"$FG$ or $FG,2$"%u"$FG$, the sub_fmt causes thousands mode.
$FG,2$"%h?n"$FG$ will pick a var exponent multiples of three unit, while $FG,2$"%h-3n"$FG$, for example, 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,"::/SparrowOS/Demo/PrintF.CPP.Z","FI:::/SparrowOS/Demo/PrintF.CPP.Z"$.
$ID,-2$
* $FG,2$"%n"$FG$ will print a floating point in engineering notation, exponents being multiples of three. If it has a $FG,5$sub_fmt$FG$ code, it will display scientific units letters.
* $FG,2$"%S"$FG$ will print a Define entry.
* $FG,2$"%C"$FG$ will print a ToUpper character.
* $FG,2$"%F"$FG$ will print a text file.
* $FG,2$"%P"$FG$ will display a PSECT expression which is good for ptrs or addresses.
* $FG,2$"%T"$FG$ and $FG,2$"%D"$FG$ will display a date or time and the format is selected with a subcode, entered after a "$FG,2$h$FG$". Example: "$FG,2$%20h1D$FG$" uses date format code "1". See $LK,"::/SparrowOS/Demo/DateTime.CPP.Z","FI:::/SparrowOS/Demo/DateTime.CPP.Z"$, $LK,"MSPrintFDate","MN:MSPrintFDate"$() and $LK,"MSPrintFTime","MN:MSPrintFTime"$() for subcodes.
* $FG,2$"%z"$FG$ will display a subentry of an enumerated list of text entries. It calls $LK+S,"ListEntryPt","MN:ListEntryPt"$(). Pass entry_num first, list second.
* $FG,2$"%Z"$FG$ will display a Define subentry. Pass entry_num first, list_systext second.
* $FG,2$"%Q"$FG$ will convert "\" to "\\" and quote to backslash quote. (For use in creating strs in strs.)
* $FG,2$"%q"$FG$ will reverse a $FG,2$"%Q"$FG$.
$ID,-2$
+59
View File
@@ -0,0 +1,59 @@
$WW,1$The compiler looks-ahead a token most of the time, so you might throw an extra semicolon after the directive if it's not taking affect right away.
$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,"StreamPrintF","MN:StreamPrintF"$().
$FG,2$#define$FG$ Define string constant
$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$#ifstatic,#ifnstatic $FG$Include code if in static 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","FI:::/SparrowOS/Doc/HelpSystem.TXT.Z"$.
See $LK,"Scoping and Linkages","FI:::/SparrowOS/Doc/ImportExports.TXT.Z"$, $LK,"preprocessor","FF:::/SparrowOS/Compiler/Lex.CPP.Z,KW_DEFINE"$ and $LK,"Compiler Options","FI:::/SparrowOS/Doc/Options.TXT.Z"$.
$FG,5$Assembler Directives$FG$
See $LK,"::/SparrowOS/Compiler/OpCodes.TXT.Z","FI:::/SparrowOS/Compiler/OpCodes.TXT.Z"$ for opcodes. They're not standard. Some invalid instructions are not flagged and some valid instructions are not implemented. 16-bit asm support is limited.
Here are example instruction 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 (instruction ptr). Even works in C+ 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$.
See $LK,"::/SparrowOS/Demo/Asm/AsmAndC.CPP.Z","FI:::/SparrowOS/Demo/Asm/AsmAndC.CPP.Z"$ and $LK,"::/SparrowOS/Demo/Asm/AsmAndC2.CPP.Z","FI:::/SparrowOS/Demo/Asm/AsmAndC2.CPP.Z"$.
+8
View File
@@ -0,0 +1,8 @@
$WW,1$A SparrowOS document is a $LK,"Circular Queue","HI:Circular Queue"$ of cmds and graphics. See $LK,"CDocEntry","MN:CDocEntry"$ for the entry structure. See $LK,"TipOfDay","MN:TipOfDay"$() for a nice example.
There is one document format for the editor/ viewer/ browser/ cmd line.
Each task has a $LK,"CDoc","MN:CDoc"$ queue. There is one $LK,"CDoc","MN:CDoc"$ for the border, called "auxiliary" and one for the main window. The aux is at $FG,4$Fs->next_doc$FG$ and the main at $FG,4$Fs->last_doc$FG$. When dbl buffering, there are two main's. See $LK,"::/SparrowOS/Demo/Spy.CPP.Z","FI:::/SparrowOS/Demo/Spy.CPP.Z"$. It is possible to define multiple aux's. To insert a additional aux, use $LK,"DocQueInsRev","MN:DocQueInsRev"$(doc,Fs->next_doc).
See$LK,"::/SparrowOS/Demo/Doc/CallBack.CPP.Z","FI:::/SparrowOS/Demo/Doc/CallBack.CPP.Z"$ and $LK,"::/SparrowOS/Demo/Doc/CallBackAux2.CPP.Z","FI:::/SparrowOS/Demo/Doc/CallBackAux2.CPP.Z"$.
+170
View File
@@ -0,0 +1,170 @@
$WW,1$$FG,5$$TX+CX,"Dollar Sign Cmds"$$FG$
SparrowOS supports rich-text type cmds which are bracketed with '$$'. Use $FG,2$<CTRL-L>$FG$ to experiment with them. Use $FG,2$CTRL-T$FG$ to toggle between plain text and rich text.
The format of '$$' cmds includes a two character code, +/-flags, a comma and args separated by commas. The flags often determine how many and what args the cmd takes.
See $LK,"::/SparrowOS/Doc/CtrlL.TXT.Z","FI:::/SparrowOS/Doc/CtrlL.TXT.Z"$ and $LK,"::/SparrowOS/Demo/Doc/DemoDoc.TXT.Z","FI:::/SparrowOS/Demo/Doc/DemoDoc.TXT.Z"$.
See $LK,"Doc Type Defines","MN:DOCT_TEXT"$ and $LK,"Doc Type Codes","FF:::/SparrowOS/Adam/Doc/Doc.CPP.Z,ST_DOC_CMDS"$
$TR,"TX Text"$
$ID,2$Normally, text is not bracketed with "$$", but if you wish to specify flag attr to center text, you can bracket them with "$$" and enter flags such as "$FG,4$+CX$FG$". You can't edit them if they are bracketed by "$$" unless you toggle to plain text mode with <CTRL-T>.
$ID,-2$$TR,"CR Hard Carriage Return"$
$ID,2$Carriage returns are normally specified without being bracketed with "$$".
$ID,-2$$TR,"SR Soft Carriage Return"$
$ID,2$Word wrap uses soft carriage returns which are not saved. You never place soft carriage returns by yourself.
$ID,-2$$TR,"TB Tab"$
$ID,2$Tabs are normally not bracketed with "$$", but are stored as ASCII#9.
$ID,-2$$TR,"CU Cursor pos"$
$ID,2$The cursor pos is usually stored as a ASCII#5 character and is not bracketed with "$$". You do not normally enter cursor pos cmds yourself.
$ID,-2$$TR,"ID Indent +/- num"$
$ID,2$This changes the indention deeper if positive or shallower if negative. It effects the behavior of trees.
$ID,-2$$TR,"DA Data"$
$ID,2$primarily used for forms that prompt for data. Use $FG,2$<CTRL-L>$FG$ as a resource editor-type thing to generate the text you'll need in your "$FG,2$fmtstr$FG$" cmd in a $FG,2$class$FG$. If you add it directly with $LK,"DocPutS","MN:DocPutS"$(), you'll need to fill-in the data addr. See $LK,"DocFormDo","MN:DocFormDo"$(),$LK,"::/SparrowOS/Demo/Doc/Form.CPP.Z","FI:::/SparrowOS/Demo/Doc/Form.CPP.Z"$.
If there is a ':', the space after the first ':' in the format string marks the first valid cursor pos.
$ID,-2$$TR,"Text Colors"$
$ID,2$You place an expression(usually a color define--see $LK,"color defines","MN:BLACK"$) to indicate which of the 16 colors to use. If you enter no num, color returns to the default.
$FG,5$FD$FG$ Default Foreground Color
$FG,5$BD$FG$ Default Background Color
$FG,5$FG$FG$ Foreground Color
$FG,5$BG$FG$ Background Color
$FG,5$F2$FG$ Alt Foreground Color (Paren & Brace coloring)
$FG,5$FL$FG$ Foreground of Links
$FG,5$FM$FG$ Foreground of Macros/Menu-Values
$FG,5$FA$FG$ Foreground of Anchors
$FG,5$FH$FG$ Foreground of Hidden widgets
$FG,5$FE$FG$ Foreground of Trees
$FG,5$FU$FG$ Foreground of User Text
$FG,5$FB$FG$ Foreground of Binary Tags
$FG,5$FY$FG$ Foreground of Keywords
$FG,5$FR$FG$ Foreground of Keywords2
$FG,5$FC$FG$ Foreground of Comments
$FG,5$FQ$FG$ Foreground of Quotes
$ID,-2$$TR,"FU,BU User Prompts"$
$ID,2$special color changing cmds. They are used when the user is prompted for text at the cmd line. They rst the cursor pos if the cursor is posed before them on the line. They are also used to indicate the start of a prompted str.
$ID,-2$$TR,"CL clear"$
$ID,2$Clear all previous entries except ones with hold($FG,4$+H$FG$) flags. You might want $FG,4$+H$FG$ on word wrap entries. Alternatively, you can use $LK,"DocClear","MN:DocClear"$().
$ID,-2$$TR,"WW Word Wrap"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"HL Highlighting"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"UL Underline"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"IV Invert"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"BK Blink"$
$ID,2$Include a 1 or 0.
$ID,-2$$TR,"SX Shift X pos"$
$ID,2$* Include a num from -16 to 15.
* Only foreground is shifted.
* Positive right.
$ID,-2$$TR,"SY Shift Y pos"$
$ID,2$* Include a num from -16 to 15.
* Only foreground is shifted.
* Positive down.
$ID,-2$$TR,"CM Cursor Movement"$
$ID,2$See $LK,"::/SparrowOS/Demo/Doc/CursorMove.CPP.Z","FI:::/SparrowOS/Demo/Doc/CursorMove.CPP.Z"$.
$ID,-2$$TR,"AN Anchor"$
$ID,2$
$ID,-2$$TR,"LK Link"$
$ID,2$By default, links have a separate tag text from link text, but with the $FG,4$-A$FG$ flag you can make the link displayed as in example 3.
$LK,"Link Types","MN:LK_FILE"$
Examples: <CTRL-T> to see
1)$LK,"File link to HelpIndex.TXT.Z","::/SparrowOS/Doc/HelpIndex.TXT.Z"$
2)$LK,"File link to HelpIndex.TXT.Z with link type file","FI:::/SparrowOS/Doc/HelpIndex.TXT.Z"$
3)File link without different tag str.$LK-A,"::/SparrowOS/Doc/HelpIndex.TXT.Z"$
4)$LK,"File find link searching for 'Admin'","FF:::/SparrowOS/Doc/HelpIndex.TXT.Z,Admin"$
5)$LK,"File find link searching for 5th 'CTRL'","FF:::/SparrowOS/OSMain/Adam1a.HPP.Z,CTRL:5"$
6)$LK,"Manual page link","MN:PrintF"$
7)$LK,"File line num link","FL:::/SparrowOS/OSMain/Adam1a.HPP.Z,200"$
8)$LK,"File anchor link -- <CTRL-T> to see anchor after you click","FA:::/SparrowOS/OSMain/Define1a.CPP.Z,OS_DEFINE"$
9)$LK,"Bible Link","BF:Acts,2:3"$ The chapter:verse actually just does a text search.
10) $LK,"Help Index Link","HI:Doc"$.
$ID,-2$$TR,"BT Button"$
$ID,2$See $LK,"::/SparrowOS/Demo/Doc/MenuButton.CPP.Z","FI:::/SparrowOS/Demo/Doc/MenuButton.CPP.Z"$.
$ID,-2$$TR,"CB Check Box"$
$ID,2$
$ID,-2$$TR,"MA Macro"$
$ID,2$Macro's are usually placed into menu/help areas and they have the '$FG,4$+X$FG$' flag set by default. Adding '$FG,4$-X$FG$' prevents the usual $FG,2$<ESC>$FG$ from being sent (which exits the macro screen). Note that when you output a macro to the cmd line, when the user clicks on it, it will go to the bottom and execute it unless you cancel the $FG,2$<ESC>$FG$ with a '$FG,4$-X$FG$'.
$ID,-2$$TR,"MU Menu Value"$
$ID,2$See $LK,"PopUpRangeI64","MN:PopUpRangeI64"$().
$ID,-2$$TR,"HX Hex Edit"$
$ID,2$See $LK,"DocD","MN:DocD"$().
$ID,-2$$TR,"Hidden Text Widget"$
$ID,2$$FG,5$HS Start of hidden text$FG$
$FG,5$HE End of hidden text$FG$
$FG,5$$FG$Hidden text widgets allow text to be placed in collapsable brackets like this $HS$$FG$This is hidden.$HE$ which can be expanded by clicking them. If you place a '$FG,4$-C$FG$' flag to uncollapse it, it will start expanded like this $HS$$FG$Click to hide$HE$. They can be nestled like this $HS$Click here:$HS$This is nestled.$HE$ okay?$HE$.
$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,4$-C$FG$ flag is present.
$ID,-2$$TR,"SP Sprite"$
$ID,2$You can insert a sprite into text with $FG,2$<CTRL-R>$FG$. It is critical where the cursor is at the time you enter $FG,2$<CTRL-R>$FG$ because the sprite will be offset from that location. This is especially 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,4$$$SP$$$FG$ entry with the same num. You can cause the $FG,4$$$SP$$$FG$ cmd to appear with some text associated with it by manually adding text into the $FG,4$$$SP$$$FG$ cmd, as in $FG,4$$$SP,"pic 2",2$$$FG$.
$ID,-2$$TR,"IB Insert Binary"$
$ID,2$This cmd is used to tell the compiler to fetch the binary data stored after the end of text. There is basically 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,4$$$IB$$$FG$ cmd, toggle to plain text ($FG,2$<CTRL-T>$FG$) after inserting a sprite and check the number in the $FG,4$$$SP$$$FG$ cmd. Create a $FG,4$$$IB$$$FG$ cmd with the same number and the sprite will be inserted into the compiled stream like a string constant. You can optionally include tag text to be displayed for the $FG,4$$$IB$$$FG$ cmd.
The main reason for the $FG,4$$$IB$$$FG$ cmd at this point is to pass a arg to the $LK,"CSpritePlot3","MN:CSpritePlot3"$() function. See $LK,"::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z"$.
$ID,-2$$TR,"IT Insert Binary Type"$
$ID,2$See $FG,4$$$IB$$$FG$. This cmd inserts a number into the compiled stream describing the type of binary data associated with a num. See $LK,"DOCBT_CSPRITE","MN:DOCBT_CSPRITE"$ for the types of binary data in DOC's.
$ID,-2$$TR,"IS Insert Binary Size"$
$ID,2$See $FG,4$$$IB$$$FG$. This cmd inserts a number into the compiled stream describing the size of binary data associated with a number.
$ID,-2$$TR,"BP Break Point"$
$ID,2$This is used by the debugger to mark a break point.
$ID,-2$$TR,"HC,HI,HV html"$
$ID,2$The $LK,"ToHtml","MN:ToHtml"$() or $LK,"Doc2Html","MN:Doc2Html"$() routines will generate a html version of a document. You can cause html code to be injected with $FG,5$HC$FG$. If you happen to have a 640x480 image, you can inject it with $FG,5$HI$FG$. If you happen to have a 640x480 $FG,2$.wmv$FG$ video, you can inject it with $FG,5$HV$FG$. Use the $FG,4$+HTML$FG$ flag to inject a html link.
$ID,-2$$TR,"ER Error"$
$ID,2$When errors are detected in dollar cmds, an $FG,5$ER$FG$ entry is generated to hold the garbage so it is not lost.
$ID,-2$
See $LK,"Doc Flag Defines","MN:DOCEf1_AUX_STR"$ and $LK,"Doc Flag Codes","FF:::/SparrowOS/Adam/Doc/Doc.CPP.Z,ST_DOC_FLAGS"$
$FE,4$See $LK+S,"dft_flags","FF:::/SparrowOS/Adam/Doc/DocPlain.CPP.Z,doc_dft_flags1"$.
$TR,"FLAGS"$
$ID,2$$TR,"+H Hold"$
$ID,2$Tells it to not delete it when cleared with $FG,5$CL$FG$ or when the doc->max_entries is exceeded. Word wrap is a good one to hold.
$ID,-2$$TR,"+A Auxilliary Str"$
$ID,2$Some cmds need other strs. A $FG,4$+A$FG$ means an auxiliary str is present. Links have $FG,4$+A$FG$ by default, so use a $FG,4$-A$FG$ if you wish the tag str and the link str to be the same.
$ID,-2$$TR,"+D Define Str"$
$ID,2$A $FG,4$+D$FG$ means a define str is present. The tag will be regenerated by substituting the value of a system $FG,2$#define$FG$ or $LK,"DefineLoad","MN:DefineLoad"$() string. See $LK,"::/SparrowOS/Demo/Doc/DefineStr.CPP.Z","FI:::/SparrowOS/Demo/Doc/DefineStr.CPP.Z"$.
$ID,-2$$TR,"+TR Tree"$
$ID,2$* Make a tree branch. Usually, this is placed on a text($FG,5$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,4$+C$FG$ flag on a tree will start it collapsed.
$ID,-2$$TR,"+PU PopUp"$
$ID,2$A PopUp flag on a macro ($FG,5$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 tree $FG,5$TR$FG$ entry or a hide start $FG,5$HS$FG$ will cause it to start collapsed. A $FG,4$-C$FG$ flag will make it start open.
$ID,-2$$TR,"+X <ESC> (Exit)"$
$ID,2$* A exit flag will cause a macro to send an $FG,2$<ESC>$FG$ before running(to exit the personal menu screen and return to the cmd prompt). Actually, the default has an exit flag set so you might add a $FG,4$-X$FG$ to turn-off $FG,2$ESC$FG$.
* If an entry is already at the cmd prompt, the $FG,4$+X$FG$ will cause a 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,4$+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 hex edit($FG,5$HX$FG$) entry will cause the offset from zero. A $FG,4$-X$FG$ will show the actual memory addr. By default, $FG,5$HX$FG$ has the zero flag set.
$ID,-2$$TR,"+HTML"$
$ID,2$The $LK,"ToHtml","MN:ToHtml"$() or $LK,"Doc2Html","MN:Doc2Html"$() routines will generate a html version of a document. You can cause html link on an item with $FG,4$+HTML$FG$.
$ID,-2$$TR,"+BP"$
$ID,2$The Bin Ptr Link flags lets you specify a file name and bin num to import a bin$FG$. $FG,2$$$SP+BP,"<tag>",1,"filename,1"$$$FG$ will import bin num "1" from filename.
$ID,-2$$TR,"+AL Alias"$
$ID,2$An alias flag on a tree entry ($FG,4$+TR$FG$) will cause the text of the current entry the cursor is on to be copied to this entry. This creates something similar to a drop-down window, but it doesn't work well yet.
$ID,-2$$TR,"+RD Refresh Data"$
$ID,2$The Refresh Data flag on a $FG,5$DA$FG$ or a $FG,5$CB$FG$ makes the value updated continuously.
$ID,-2$$ID,-2$$FE,5$
$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+SCX,"This is a big long scrolling msg.",10$
$FG,5$Cursor Movements:$FG$
$CM+LX,3,3$Cursor moved 3 rows down and to 3rd column from left.
$CM+RX,-40,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"$
+78
View File
@@ -0,0 +1,78 @@
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
{
Widget(,CH_CTRLL,0x42600000426);
Resource(,CH_CTRLR,0x41300000413);
FileName(,,0x3E0000003E);
DirName(,,0x23E0000023E);
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);
Go(,0,0x3F0000003F);
StepOver(,,0x4400000044);
StepInto(,,0x5700000057);
SetBpt(,,0x4300000043);
ClearBpts(,,0x24300000243);
}
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);
}
+43
View File
@@ -0,0 +1,43 @@
$WW,1$$FG,5$$TX+CX,"SparrowOS' Features"$$FG$
* $FG,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$, ring-0-only, single-address-map (identity), multitasking kernel with multicore support.
* Free, $FG,2$public domain$FG$, and $FG,2$100% open source$FG$.
* 64-bit $FG,2$compiler/assembler$FG$ that truly compiles, no interpreter.
* No 32-bit krufty code.
* 640x480 16 color $FG,2$VGA$FG$ graphics.
* Keyboard & mouse support.
* Hard drives, support for $FG,2$FAT32$FG$ and SparrowOS native file systems with file compression.
* $LK,"Partitionming","MN:PrtDsk"$ tool.
* $FG,2$Boot loaders$FG$ for CD-ROM and hard disk.
* $FG,2$CD/DVD$FG$ reading and writing, $FG,2$ISO9660$FG$ file system. Can make bootable $FG,2$ISO9660$FG$ ISO files so you can roll-your-own distributions.
* 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.
* $FG,2$Just-in-time$FG$ compilation. No need for object or exe files.
* $FG,2$Graphics in source code$FG$. No need for resource files.
* $FG,2$64-bit pointers$FG$. All memory, even more than 4 Gig, 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 instructions. No time lost changing modes or address maps. Switches tasks in half a microsecond.
* $FG,2$2D/3D$FG$ graphics library
* Real-time fancy differential-equation solver (physics engine) for use in games. (Adaptive step-size Runge-Kutta, interpolated for real-time.)
* Code $LK,"profiler","MN:ProfAll"$, $LK,"merge","MN:MergeChk"$, $LK,"diff","MN:Diff"$ utils.
* $FG,2$HD Audio$FG$ and many songs.
* $LK,"Demos","FI:::/SparrowOS/Doc/DemoIndex.TXT.Z"$ and $LK,"documentation","FI:::/SparrowOS/Doc/HelpIndex.TXT.Z"$.
* $FG,2$All source code$FG$ included. Only compiles with the included SparrowOS compiler and assembler.
+110
View File
@@ -0,0 +1,110 @@
$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 KEY$FG$
$ID,2$Delete file or tree.
$ID,-2$
$FG,2$CTRL-C or CTRL-INS$FG$
$ID,2$Copy selected 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 directory.
$ID,-2$
$FG,2$LEFT-CLICK,same file or <SPACE BAR>$FG$
$ID,2$Edit file.
$ID,-2$
$FG,2$SHIFT-SPACE KEY$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 Directory.
$ID,-2$
$FG,2$'m'$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$'M'$FG$
$ID,2$Make CD/DVD ISO file. This creates a file image of the directory the cursor is on. The name of the ISO file is $LK,"sys_dft_iso_name","MN:sys_dft_iso_name"$ 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, $LK,"sys_dft_iso_name","MN:sys_dft_iso_name"$ 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 OSMain and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount","MN:Mount"$ to define your CD/DVD drive. Place a CD/DVD in the drive and press $FG,2$'m'$FG$ when on top of the CD/DVD drive letter to mount the drive. It will call $LK,"ChgDsk","MN:ChgDsk"$(), the SparrowOS cmd to mount removable media.
$ID,-2$
$FG,5$Instructions on Burning CD/DVD's$FG$
$ID,2$Create a temporary holding drive in RAM or on disk, copy files into the holding drive. Make an ISO image of the drive by pressing $FG,2$'M'$FG$ when on top of the holding drive. Press $FG,2$'B'$FG$ when on top of the CD/DVD ROM drive to burn the ISO to disk. If you have not recompiled $FG,2$OSMain$FG$ and defined your CD/DVD drive, exit the file mgr and use $LK,"Mount","MN:Mount"$.
$FG,5$Making a Bootable CD/DVD$FG$
$ID,2$
This is a quick way to make an ISO.
$FG,8$
$HL,1$$WW,0$#define PROD_CDROM_CFG "b10x20000\nt3 \n\n\n\n\n"
U0 MakeMyISO()
{
Fmt('B',TRUE,FALSE);
CopyTree("::/SparrowOS","B:/SparrowOS");
//Del("B:/SparrowOS/Adam/WordStat/WSDefs.DAT");
Auto(PROD_CDROM_CFG);
InstallBoot('B','T');
CDFileCreate(,"B:/*","",BOOTCD_BIN_Z);
}
$WW,1$$HL,0$$FG$
I have the following code in my start-up script.
$FG,2$'E'$FG$ is my main hard drive SparrowOS partition
$FG,2$'T'$FG$ is my CD/DVD drive
$FG,2$'Z'$FG$ is a RAM temporary drive from which I make an ISO image. You could use a hard drive directory instead of RAM.
$FG,8$
$HL,1$$WW,0$#define PROD_CDROM_CFG "b10x20000\nt3 \n\n\n\n\n"
U0 BurnProductionCDImage()
{
Cd("E:/SparrowOS");
//This enters my cfg
//for compiling OSMain.
Auto(PROD_CDROM_CFG);
InstallBoot('E','T');
Fmt('Z',TRUE,FALSE);
Drv('Z');
CopyTree("E:/SparrowOS","/SparrowOS");
MkDir("/Temp");
CopyTree("E:/0000Boot","/0000Boot");
CDFileCreate(sys_dft_iso_name,"Z:/*",NULL,BOOTCD_BIN_Z);
CDImageWrite('T',
sys_dft_iso_name);
}
$HL,0$$WW,1$
$FG$Study my account examples $LK,"Cfg Strs","FL:::/SparrowOS/Demo/AcctExample/TSAdam.CPP.Z,1"$ $LK,"Update Funs","FL:::/SparrowOS/Demo/AcctExample/TSDistribute.CPP.Z,1"$.
$FG$
$ID,-2$$ID,-2$
+26
View File
@@ -0,0 +1,26 @@
File
{
ChgDsk(,'m');
FmtDrv(,'f');
MakeISOFile(,'M');
BurnISOFile(,'B');
Abort(,CH_SHIFT_ESC);
Exit(,CH_ESC);
}
Edit
{
Ed(,CH_SPACE);
Plain(,CH_SHIFT_SPACE);
Rename(,'r');
MkDir(,'d');
Copy(,CH_CTRLC);
Paste(,CH_CTRLV);
DeleteFile(,CH_CTRLY);
}
Program
{
Include(,0,0x3F0000003F);
AdamInclude(,0,0x23F0000023F);
}
+231
View File
@@ -0,0 +1,231 @@
$WW,1$$TR,"Abbreviations"$
$ID,2$$FG,5$Abs$FG$ Absolute
$FG,5$Acct$FG$ Account
$FG,5$Add/Addr$FG$ Address
$FG,5$AOT$FG$ Ahead-of-Time
$FG,5$AP$FG$ Application Processor (CPU# > 0)
$FG,5$Arg$FG$ Argument
$FG,5$Attr$FG$ Attribute
$FG,5$Aux$FG$ Auxilliary
$FG,5$Blk$FG$ Block
$FG,5$BSP$FG$ Boot-strap Processor (CPU#0)
$FG,5$Buf$FG$ Buffer
$FG,5$CB$FG$ Call-Back or Code Block
$FG,5$Cfg$FG$ Config
$FG,5$Chg$FG$ Change
$FG,5$Chk$FG$ Check
$FG,5$Cmd$FG$ Command
$FG,5$Cmp$FG$ Compiler
$FG,5$Cnt$FG$ Count
$FG,5$Ctrl$FG$ Control. The ctrl key is indicated with "$FG,2$^$FG$" in documentation.
$FG,5$Cur$FG$ Current
$FG,5$Dbg$FG$ Debug
$FG,5$Dbl$FG$ Double
$FG,5$CDC$FG$ Device Context
$FG,5$Del$FG$ Delete
$FG,5$Desc$FG$ Descriptor or Description
$FG,5$Dev$FG$ Device
$FG,5$Dft$FG$ Default
$FG,5$Dir$FG$ Directory
$FG,5$Drv$FG$ Drive
$FG,5$Dsk$FG$ Disk
$FG,5$Dst$FG$ Destination
$FG,5$Ed$FG$ Edit, Editor
$FG,5$Elem$FG$ Element
$FG,5$Evt$FG$ Event
$FG,5$Exe$FG$ Execute
$FG,5$Ext$FG$ Extern or Extended
$FG,5$Feat$FG$ Feature
$FG,5$$FG,5$Fmt$FG$ Format
$FG,5$Fwd$FG$ Forward
$FG,5$fp_$FG$ Function ptr
$FG,5$Fun$FG$ Function
$FG,5$Gen$FG$ Generate
$FG,5$Glbl$FG$ Global
$FG,5$Gr$FG$ Graphic
$FG,5$IDE$FG$ Integrated Development Environment or Integrated Drive Electronics
$FG,5$IDT$FG$ Interrupt Descriptor Table
$FG,5$Init$FG$ Initialize
$FG,5$Ins$FG$ Insert
$FG,5$Int$FG$ Interrupt
$FG,5$ip_$FG$ Input Pointer. See $LK,"InputPointer.CPP.Z","FI:::/SparrowOS/OSMain/KbdMouse/InputPointer.CPP.Z"$.
$FG,5$Irq$FG$ Interrupt (Request)
$FG,5$JIT$FG$ Just-in-Time
$FG,5$Kbd$FG$ Keyboard
$FG,5$Len$FG$ Length
$FG,5$Let$FG$ Letter
$FG,5$Lex$FG$ Lexical Analyser
$FG,5$Lit$FG$ Literal
$FG,5$Loc$FG$ Location, Lines of Code
$FG,5$Log$FG$ Logarithm or Logical
$FG,5$Doc$FG$ Linked-Text-File (doubly-linked-list of rich text and graphic cmds)
$FG,5$Man$FG$ Manual
$FG,5$Mem$FG$ Memory
$FG,5$Mgd$FG$ Managed
$FG,5$Mgr$FG$ Manager
$FG,5$Mon$FG$ Month
$FG,5$MP$FG$ MultiProcessor
$FG,5$Msg$FG$ Message
$FG,5$Num$FG$ Number
$FG,5$Obj$FG$ Object
$FG,5$Occ$FG$ Occurrence
$FG,5$CMathODE$FG$ Ordinary Differential Equation
$FG,5$Paren$FG$ Parenthesis
$FG,5$Pkg$FG$ Package
$FG,5$Pmt$FG$ Prompt
$FG,5$Poly$FG$ Polygon
$FG,5$Pos$FG$ Position
$FG,5$Prec$FG$ Precedence
$FG,5$Prod$FG$ Product or Production
$FG,5$Pri$FG$ Primary
$FG,5$Prt$FG$ Partition
$FG,5$Pt$FG$ Point
$FG,5$Ptr$FG$ Pointer
$FG,5$Que$FG$ Queue
$FG,5$Reg$FG$ Register or Regular
$FG,5$Rem$FG$ Remove
$FG,5$Rep$FG$ Report
$FG,5$Rqst$FG$ Request
$FG,5$Rst$FG$ Reset
$FG,5$Rot$FG$ Rotation
$FG,5$Rx$FG$ Receive
$FG,5$Sec$FG$ Second or Secondary
$FG,5$$FG,5$Sect$FG$ Sector
$FG,5$Seq$FG$ Sequence
$FG,5$Snd$FG$ Sound
$FG,5$Src$FG$ Source
$FG,5$Stat$FG$ Status or Statistic
$FG,5$$FG,5$Stk$FG$ Stack
$FG,5$Str$FG$ String
$FG,5$Sym$FG$ Symbol
$FG,5$Sys$FG$ System
$FG,5$Term$FG$ Terminal
$FG,5$Tx$FG$ Transmit
$FG,5$Val$FG$ Value
$FG,5$Var$FG$ Variable
$FG,5$Vect$FG$ Vector
$FG,5$Vol$FG$ Volume
$FG,5$Win$FG$ Window
$FG,5$Wiz$FG$ Wizard
$FG,5$WS$FG$ WordStat
$FG,5$WSD$FG$ WordStat Dictionary
$ID,-2$$TR,"Task/Process/Thread"$
$ID,2$There is no distinction between "task", "process" or "thread." The $FG,2$Fs$FG$ segment register is kept pointing to the current task's $LK,"CTask","MN:CTask"$. There is only one window per task.
$ID,-2$$TR,"Adam Task"$
$ID,2$This is Adam, as in Adam and Eve, the parent of all tasks. This task is created at start-up and appears in the small window at the top beneath the user windows. On it's heap are all memory objects which are system wide. When created, it runs the file $LK,"::/SparrowOS/OSMain/Adam1.CPP.Z","FI:::/SparrowOS/OSMain/Adam1.CPP.Z"$ Normally, Adam1.CPP.Z ends by $FG,2$#include$FG$ $LK,"::/SparrowOS/Adam/Adam2.CPP.Z","FI:::/SparrowOS/Adam/Adam2.CPP.Z"$ where the remainder of the operating system is "$FG,2$#include$FG$d". When start-up is finished, the adam task enters a server mode where it accepts requests from other tasks. The $LK,"Adam","MN:Adam"$("") routine will cause the adam task to compile and run text src code. "$FG,2$#include$FG$" statements can be sent to the $LK,"Adam","MN:Adam"$("") routine, creating system-wide code and data which don't disappear when any particular task ends. (The Adam task is immortal.)
$ID,-2$$TR,"Seth Task"$
$ID,2$This is Seth, as in Adam and Eve's child. Each CPU core has a special task which is immortal and which is special. The Adam task on CPU#0 is also it's Seth task.
$ID,-2$$TR,"Code and Data Heaps"$
$ID,2$SparrowOS uses the asm $FG,2$CALL$FG$ instruction exclusively and it's limited to calling routines +/-2 Gig from the current code location. To prevent out-of-range issues, I decided to separate code and data, placing all code within the lowest 2 Gig of memory. The compiler and $LK,"Load","MN:Load"$()er allocate memory from the code heap to store code and glbl vars, unless the compiler option $LK,"OPTf_GLBLS_ON_DATA_HEAP","MN:OPTf_GLBLS_ON_DATA_HEAP"$ is used. When programs call $LK,"MAlloc","MN:MAlloc"$() is comes from the data heap, which in not limited in size, except by how much physical RAM memory you have. You can allocate from any heap you like, or even make independent heaps.
$ID,-2$$TR,"Parent/Child Task"$
$ID,2$Often a task will $LK,"Spawn","MN:Spawn"$() or $LK,"PopUp","MN:PopUp"$() a task as a helper. The helper is known as a Child Task, though you can $FG,2$Spawn$FG$ a task and assign it a different parent... like $FG,2$Adam$FG$. Links are kept as to who spawned what so that when one task is $LK,"Kill","MN:Kill"$()ed the helper tasks disappear, too. You can get a report on current system tasks with $LK+S,"TaskRep","MN:TaskRep"$(). There is just one possible window per task, so child tasks are needed.
$ID,-2$$TR,"C+"$
$ID,2$The language used by SparrowOS is more than $FG,2$C$FG$ and less than $FG,2$C++$FG$, so it's just $FG,2$C+$FG$, perhaps. See $LK,"Differences","FI:::/SparrowOS/Doc/Differences.TXT.Z"$. It has the default arg feature 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 integers. It has a slightly different operator precedence. See $LK,"OP_precedence","FA:::/SparrowOS/Doc/Differences.TXT.Z,OP_precedence"$ It has the $FG,2$PASCAL$FG$-like feature of function calls with no parens, but requires an "$FG,2$&$FG,2$$FG$" when referring to function addresses.
$ID,-2$$TR,"Static Compile Mode"$
$ID,2$I coined this term to refer to conventional AOT compilation mode, but it is not the preferred mode for this operating system and is discouraged. $FG,2$.SP?$FG$ files are compiled to $FG,2$.BI?$FG$ files, skipping $FG,2$.OBJ$FG$ files. After compiling, you do a $LK,"Load","MN:Load"$() cmd which is available from right-clicking on a link (like from $LK,"Dir","MN:Dir"$()). There is no $FG,2$main()$FG$ routine. Instead, statements outside functions are automatically executed upon loading. There is no way to unload except by killing the task. To invoke $FG,2$Static Compiled Mode$FG$, use the $LK,"Cmp","MN:Cmp"$() routine or right-click on a link. The $FG,2$OSMain$FG$ modules and compiler are made in static compiled mode and stored in $FG,2$OSMain.BIN.C$FG$ and $FG,2$Compiler.BIN.Z$FG$, respectively.
See $LK,"::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z"$ for an example of static module.
$ID,-2$$TR,"JIT Compile Mode"$
$ID,2$In just-in-time mode, the compiler allocates objects, code and data, from the heap, incrementally. This mode is used during cmd line operations. When you $FG,2$#include$FG$ a file, it is compiled function by function and objects are placed all over in mem. The $LK,"ExeFile","MN:ExeFile"$() routine is the same as $FG,2$#include$FG$ but can be placed in programs. $LK,"ExePutS","MN:ExePutS"$() routine will compile and run a string.
$ID,-2$$TR,"Compiler Intermediate Code"$
$ID,2$The compiler generates instructions one step before making actual assembly(machine) language instructions. This code is reverse polish in nature and can be viewed with $LK,"PTrace","MN:PTrace"$() or $LK,"OTrace","MN:OTrace"$(). The compiler does not "interpret" code, except in the process of optimization. The assembly language can be viewed when it is compiled with the $LK,"CTrace","MN:CTrace"$() routine, or afterward with $LK,"U","MN:U"$().
$ID,-2$$TR,"Partition/Drive"$
$ID,2$There is no distinction between "partition" or "drive." They are specified with a single letter from '$FG,2$A$FG$'-'$FG,2$Z$FG$'.
'$FG,2$:$FG$' is the boot drive.
For commands taking a drive letter as an argument, $FG,2$0$FG$ is the current drive.
$ID,-2$$LK,"AutoFile","HI:AutoFile"$
$LK,"Sprite","HI:Graphics/CSprite"$
$LK,"Hash Table","HI:Hash"$
$LK,"Define","HI:Char/Define"$
$LK,"Link Types","MN:LK_FILE"$
$TR,"files_find_mask"$
$ID,2$$LK,"FilesFindMatch","MN:FilesFindMatch"$(). An optional directory plus a list of file name masks, as in $FG,2$/SparrowOS/Demo/*.TXT.Z;*.CPP.Z$FG$
See $LK,"FUF_RECURSE","MN:FUF_RECURSE"$ and $LK,"ST_FILE_UTIL_FLAGS","MN:ST_FILE_UTIL_FLAGS"$.
Be aware of $LK,"TEXT_FILE_MASK","MN:TEXT_FILE_MASK"$ and $LK,"SRC_FILE_MASK","MN:SRC_FILE_MASK"$.
$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$*.TXT.Z;*.TXT;*.LOG.Z;*.LOG$FG$
Text Files
$FG,5$*.CPP.Z;*.CPP$FG$
C+ src files. The default C+ compiler type is "$FG,2$.CPP.Z$FG$".
$FG,5$*.PRJ.Z;*.PRJ$FG$
C+ src files to be compiled statically.
$FG,5$*.HPP.Z;*.HPP$FG$
C+ 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","MN:Cmp"$() and read by $LK,"Load","MN:Load"$().
$FG,5$*.DAT.Z;*.DAT$FG$
Data files
$FG,5$*.ISO$FG$
CD-ROM image file--ISO9660.
$FG,5$*.AUT.Z;*.AUT$FG$
"AutoFile" Basically a C+ program who's stdout goes to the input of a task when $LK,"AutoFile","MN:AutoFile"$() is called.
$FG,5$*.GRA.Z;*.GRA$FG$
Graphics file
$LK,"SRC_FILE_MASK","MN:SRC_FILE_MASK"$$FG$
This $FG,2$#define$FG$ holds a list of src file extensions.
$LK,"TEXT_FILE_MASK","MN:TEXT_FILE_MASK"$$FG$
This $FG,2$#define$FG$ holds a list of text file extensions.
$ID,-2$$TR,"Naming Convention"$
$ID,2$$FG,5$$FG$The following are rules I stick to. If you work on the operating system, it'd be good to stick with them for uniformity, but you can do what you like. 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. "WS","Doc","Lex"
$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 $FG,2$C+$FG$ callible should have a leading underscore.
$FG,5$MixedCaps$FG$
$FG,2$C+$FG$ 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$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$".
$ID,-2$
$AN,"Fs","Fs"$ The CPU FS segment register. This register points to the current task's $LK,"CTask","MN:CTask"$.
$AN,"Gs","Gs"$ The CPU GS segment register. This register points to the $LK,"CCPU","MN:CCPU"$.
$AN,"Bt,Bts,Btr,Btc,LBts,LBtr,LBtc","Bt,LBts,LBtr,LBtc"$
These are bit manipulation functions named after Intel instructions. They stand for "Bit Test", "Bit Test and Set", "Bit Test and Rst" and "Bit Test and Compliment". An $FG,2$'L'$FG$ means locked.
$AN,"Cli,Sti","Cli,Sti"$ Turn on or off interrupts. They are named after the x86 instructions. "Cli" turns off interrupts.
$AN,"Heap","Heap"$ Programs can dynamically request chunks of memory allocated from a "heap" using $LK,"MAlloc","MN:MAlloc"$(). They must $LK,"Free","MN:Free"$() it when finished. Ptrs are used to refer to it. The "heap" is dynamically allocated mem.
$AN,"Root","root"$ The base of a binary tree or the head of a queue. (I don't like the word "head.")
$AN,"Join","Join"$ When two parts of a program have a common low-level routine, that routine is often labeled SomethingJoin.
$AN,"user_data","user_data"$ 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.
$AN,"BSP/AP","BSP/AP"$ Boot-strap Processor/Application Processor
+8
View File
@@ -0,0 +1,8 @@
$WW,1$A $FG,4$CSprite$FG$, is an ordered list of the $LK,"following","MN:GRST_END"$ elements, created with $FG,2$<CTRL-R>$FG$$FG$. Normally, they are packed together in a list and the addr of the first is passed to routines.
See $LK,"::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePlot.CPP.Z"$, $LK,"::/SparrowOS/Demo/Graphics/SpritePlot3D.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePlot3D.CPP.Z"$ and $LK,"::/SparrowOS/Demo/Graphics/SpritePut.CPP.Z","FI:::/SparrowOS/Demo/Graphics/SpritePut.CPP.Z"$ and $LK,"CSpriteMesh","MN:CSpriteMesh"$().
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,"::/SparrowOS/Adam/Gr/GrSpritePlot.CPP.Z","FL:::/SparrowOS/Adam/Gr/GrSpritePlot.CPP.Z,1"$ for how CSprite are stored.$FG$
Binary file not shown.
+24
View File
@@ -0,0 +1,24 @@
$FG,5$$TX+CX,"The Grub Master Bootloader"$$FG$
$WW,1$Here are my $FG,2$grub.cfg$FG$ file entries for my SparrowOS partitions. I don't have the patience to do it correctly and GRUB obfuscates. Chain loading is just the normal way an operating system like Windows boots. They do drives, zero-based, and partitions on drives, one-based. They call traditional partitioning a "msdos" partition and I presume, if there is a new way to partition drives, it has a new name.
In addition to a Windows and a Linux partition, I have a Primary SparrowOS $FG,2$'D'$FG$, Backup SparrowOS $FG,2$'E'$FG$ and a Transfer $FG,2$'I'$FG$ partition for transferring between Windows and SparrowOS. "hd0" is 1st hard drive, zero-based numbering. "msdos1" is partition #1, traditional msdos partitioning. I keep $FG,2$'D'$FG$, $FG,2$'E'$FG$, and $FG,2$'I'$FG$ identical by frequently copying all files and I use $FG,2$'I'$FG$ to transfer files. They only need to be a couple Gig in size. Every time I copy files, use $LK,"InstallBoot","MN:InstallBoot"$() to $LK,"MakeAll","MN:MakeAll"$ and prepare the partition $LK,"boot sector","FI:::/SparrowOS/Adam/Boot/BootHD.CPP.Z"$ for chainloading by patching the new block address and size of $FG,2$OSMain.BIN.C$FG$.
menuentry "SparrowOS D" {
insmod chain
set root=(hd0,msdos1)
chainloader +1
}
menuentry "SparrowOS E" {
insmod chain
set root=(hd0,msdos5)
chainloader +1
}
menuentry "SparrowOS I" {
insmod chain
set root=(hd1,msdos5)
chainloader +1
}
+71
View File
@@ -0,0 +1,71 @@
$WW,1$$FG,5$$TX+CX,"ACCT FILES"$$FG$
You can add and remove accts by making or removing directories in the $FG,2$::/SparrowOS/Accts$FG$ directory. An empty account directory should be valid because it will get default files from the parent directory.
See $LK-A,"HOME/PersonalMenu.TXT.Z"$ for a personal menu which can be viewed at the cmd line with the $FG,2$<CTRL-M>$FG$ key or by clicking "$FG,2$MENU$FG$" in the upper left border area of a window.
See $LK-A,"HOME/PersonalNotes.TXT.Z"$ for a personal note file which can be viewed with the $FG,2$<CTRL-SHIFT-M>$FG$ key.
See $LK-A,"HOME/DoItOnce.CPP.Z"$ for a file which is invoked at the start-up of the first user.
See $LK-A,"HOME/Adam3.CPP.Z"$ for the user files that get loaded into the adam task at start-up. These are only loaded once.
$LK-A,"HOME/Registry.CPP.Z"$ can be edited by hand or deleted to rst to defaults. Takes affect next boot.
$FG,5$$TX+CX,"APPLICATION POLICIES"$$FG$
* Place applications in their own $FG,2$/SparrowOS/Apps$FG$ subdirectory.
* Make a file called $FG,2$Load.CPP.Z$FG$ to load the application.
* Make a file called $FG,2$Run.CPP.Z$FG$ to load and run the application, preferable by $FG,2$#include$FG$ing the $FG,2$Load.CPP.Z$FG$ file.
* Place user data in a subdirectory of $FG,2$HOME$FG$, preferably naming the subdirectory the same as the $FG,2$/SparrowOS/Apps$FG$ subdirectory. Or, place data in the $FG,2$Registry.CPP.Z$FG$ file. See $LK,"::/SparrowOS/Demo/RegistryDemo.CPP.Z","FI:::/SparrowOS/Demo/RegistryDemo.CPP.Z"$.
* Make a file called $FG,2$Install.CPP.Z$FG$ or $FG,2$Install.AUT.Z$FG$ to create the $FG,2$HOME$FG$ subdirectory and do similar stuff.
$FG,5$$TX+CX,"OS PROGRAMMING GUIDELINES:"$$FG$
* Virtual mem is not used (It is identity mapped in EM64T mode). The stk does not grow, so allocate enough when the task (process) is $LK,"Spawn","MN:Spawn"$ed and use the heap for most things. (The "heap" refers to $LK,"MAlloc","MN:MAlloc"$() and $LK,"Free","MN:Free"$().)
* See $LK,"Naming convention","FF:::/SparrowOS/Doc/Glossary.TXT.Z,Naming convention"$.
* There are two modes of compiling $LK,"Static Compiled Mode","FF:::/SparrowOS/Doc/Glossary.TXT.Z,Static Compiled Mode"$ and $LK,"JIT Mode","FF:::/SparrowOS/Doc/Glossary.TXT.Z,JIT"$. Actual compilation is done in both--nothing is "interpreted".
* $LK,"Differences from C/C++","FI:::/SparrowOS/Doc/Differences.TXT.Z"$
* $LK,"System Programming Guidelines","FI:::/SparrowOS/Doc/SysPgmGuide.TXT.Z"$
$FG,5$$TX+CX,"Hash sym tables:"$$FG$
* See $LK,"::/SparrowOS/Adam/Hash2a.CPP.Z","FI:::/SparrowOS/Adam/Hash2a.CPP.Z"$ 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 C/C++ syms loaded in on start-up.
* $FG,2$Fs->hash_table$FG$ holds user C+ syms and if a sym is not found, it checks parents. When a duplicate sym is added to the table, it overshadows the previous sym unless you have done $LK,"OptOn","MN:OptOn"$($LK,"OPTf_REPLACE_SYMS","MN:OPTf_REPLACE_SYMS"$). 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","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,"HashRep","MN:HashRep"$() routine or the varients. $LK,"HashDepthRep","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 Concerns:"$$FG$
* $FG,2$FS$FG$ must always point to the $LK,"CTask","MN:CTask"$.
* $FG,2$GS$FG$ must always point to the $LK,"CCPU","MN:CCPU"$.
* Don't change the segment registers unless interrupts are off.
* When interacting with compiled code, preserve $FG,2$RBP, RSI, RDI, R10-R15$FG$ because the compiler uses these for register vars. You are free to clobber $FG,2$RAX, RBX, RCX, RDX$FG$, $FG,2$R8$FG$ and $FG,2$R9$FG$.
* I recommend using the standard stk frame for functions because $LK,"Caller","MN:Caller"$() is used to display the call stk, such as for the wallpaper.
$FG,2$ ENTER nnnn
...
LEAVE
RET
$FG$
* The args are removed from the stack with $FG,2$RET1$FG$ statements.
$FG,2$RET1 16 //remove two args$FG$
+4
View File
@@ -0,0 +1,4 @@
$WW,1$There are sym(hash) tables maintained by each task. When a sym is not found, the parent task's sym table is checked. All process chain back to the $FG,2$Adam$FG$ task.
SparrowOS sym tables are implemented with an array of linked-lists. A num is generated from a string to index into it. Since multiple strings could generate the same num, a linked-list is built. Usually, newer entries overshadow older ones unless otherwise specified, in which case old entries are removed. There are various types of entries. See $LK,"Hash Entry Types","MN:HTT_EXPORT_SYS_SYM"$.
+183
View File
@@ -0,0 +1,183 @@
$LK,"Welcome","FI:::/SparrowOS/Doc/Welcome.TXT.Z"$ $LK,"Trivial Solutions","FI:::/SparrowOS/Doc/TrivialSolutions.TXT.Z"$
$LK,"Quick Start--Command Line","HI:Cmd Line (Typically)"$
$LK,"Demo Index","FI:::/SparrowOS/Doc/DemoIndex.TXT.Z"$ $MA+A-X+PU,"Take Tour","SpawnUser(\"Cd(\\\"::/SparrowOS/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$ $MA+A-X+PU,"Key Map","KeyMap;View;\n"$
$LK,"Features","FI:::/SparrowOS/Doc/Features.TXT.Z"$ $LK,"Requirements","FI:::/SparrowOS/Doc/Requirements.TXT.Z"$
$LK,"SparrowOS Constitution","FI:::/SparrowOS/Doc/Constitution.TXT.Z"$ $LK,"Strategic Decisions","FI:::/SparrowOS/Doc/Strategy.TXT.Z"$
$LK,"Mysteries Explained","FI:::/SparrowOS/Doc/Mysteries.TXT.Z"$ $LK,"Clearing Confusions","FI:::/SparrowOS/Doc/Confuse.TXT.Z"$
$LK,"Differences from C/C++","FI:::/SparrowOS/Doc/Differences.TXT.Z"$ $LK,"Compiler Directives","FI:::/SparrowOS/Doc/Directives.TXT.Z"$
$LK,"ChangeLog","FI:::/SparrowOS/Doc/ChangeLog.TXT.Z"$
$WW,1$$TR,"Level 1: USER HELP"$
$ID,2$
$TR,"Keyboard Ctrls"$
$ID,2$
$FG,9$Enter$FG$ Right-click menu
$FG,9$Space Bar$FG$ Edit (view)
$FG,9$Esc$FG$ Save and exit
$FG,9$Shift-Esc$FG$ Abort
$FG,9$Ctrl-m$FG$ Personal Menu
$FG,9$Windows Key$FG$ Pull-down Menu
Other keys: $MA+A-X+PU,"Key Map","KeyMap;View;\n"$
$ID,-2$$TR,"Mouse Ctrls"$
$ID,2$
$FG,9$Right-Click$FG$ Right-click menu
$FG,9$Left-Click$FG$ Edit (view)
$FG,9$Double-Left$FG$ Save and exit
$FG,9$Double-Right$FG$ Abort
$FG,9$Top of Screen$FG$ Pull-down menu
$ID,-2$$LK,"Glossary","FI:::/SparrowOS/Doc/Glossary.TXT.Z"$
$LK,"TSZ Window's Utility","FI:::/SparrowOS/Doc/TSZ.TXT.Z"$
$LK,"Tips on Using SparrowOS","FI:::/SparrowOS/Doc/Tips.TXT.Z"$
$LK,"SparrowOS Quirks","FI:::/SparrowOS/Doc/Quirks.TXT.Z"$
$SP,"",1$ This button on the wall paper
starts a terminal window.
$TR,"DIRECTORY STRUCTURE"$
$ID,2$
$FG,2$/SparrowOS/Accts$FG$ Each subdirectory is an acct. When you boot, you can select an acct to login to, unless you compile OSMain soas to pick one. Your acct directory is your $FG,2$HOME$FG$ directory and 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$/SparrowOS/Apps$FG$ Applications are placed in subdirectories of $FG,2$/SparrowOS/Apps$FG$. Applications should have a file called $FG,2$Install.CPP.Z$FG$ which will install the app for the current user acct. The file, $FG,2$Load.CPP.Z$FG$ will load the application into mem. The file, $FG,2$Run.CPP.Z$FG$, will usually load and execute the app. To add an app to your personal menu, use $FG,2$<CTRL-L>$FG$, insert a macro with the PopUp option checked and invoke the $FG,2$Run.CPP.Z$FG$ file.
$FG,2$/SparrowOS/Demo$FG$ Here you can find lots of sample code to do various things.
$FG,2$/SparrowOS/Doc$FG$ Here you can find documentation.
$FG,2$/SparrowOS/OSMain$FG$ The core of the operating system is found here. Since priviledge levels are not used, calling it a "kernel" would be confusing, but that's what it is. It is statically compiled by $LK,"InstallBoot","MN:InstallBoot"$(). It is loaded by the boot loader and must fit in 640K.
$FG,2$/SparrowOS/Compiler$FG$ The compiler module src code is found here. The compiler is statically compiled to produce a binary file which is loaded at boot. It is also statically compiled by $LK,"InstallBoot","MN:InstallBoot"$().
$FG,2$/SparrowOS/Adam$FG$ The non-kernel part of the operating system is found here. It is JIT compiled during boot.
$FG,2$/0000Boot$FG$ directory and the $FG,2$0000OSMain.BIN.C$FG$ file are named so that they are first in alphabetical order and, therefore, at a predictable CD/DVD block address. The $LK,"CD/DVD Boot Loader","FI:::/SparrowOS/Adam/Boot/BootCD.CPP.Z"$ will find $FG,2$0000OSMain.BIN.C$FG$ at $LK,"Block #0x16","MN:CDBootFileCreate"$. The SparrowOS boot loader can be used with $FG,4$$TX+HTML,"http://www.magiciso.com","http://www.magiciso.com"$$FG$ if you place $FG,2$0000OSMain.BIN.C$FG$ in the right spot. $FG,2$OldMBR.BIN.C$FG$ and $FG,2$BootMHD2.BIN.C$FG$ will be found in $FG,2$/0000Boot$FG$ if you run $LK,"InstallMasterBoot","MN:InstallMasterBoot"$() to install a hard-drive master boot loader.
$ID,-2$$TR,"DOLLAR SIGN CMDS"$
$ID,2$
$LK,"Dollar Sign Cmds","FI:::/SparrowOS/Doc/Dollar.TXT.Z"$ are rich-text cmds. The editor, compiler, assembler and operating system are seamlessly equiped to handle SparrowOS rich text. Cmds like $LK,"Dir","MN:Dir"$() and $LK,"Grep","MN:Grep"$() can output links to the cmd line.
$ID,-2$$TR,"CMD PROMPT"$
$ID,2$
The SparrowOS cmd line interface is based on C/C++. Explore the ".CPP.Z" files. A cmd which takes no args may be executed by typing the name and a semicolon. Cmds with args require placing the arg in parentheses like a function call.
$MA,"Dir(\"*\");"$ will list files in the current directory.
$MA,"Dir;"$ uses default of "*".
$MA,"Cd(\"::/SparrowOS/Apps\");"$ will change directories.
Directories are referenced with "/" not "\". The Boot drive is referred to with "$FG,2$::$FG$". Other drives are referred to by a letter and a colon. Your user acct directory is referred to with "$FG,2$HOME$FG$".
If a file is not found in one directory, all it's parents are searched.
$FG,9$Ed("FILENAME.TXT.Z");$FG$ Invokes the editor. See $LK,"DOC LINK TYPES","MN:LK_FILE"$.
Some cmds like $LK,"Grep","MN:Grep"$() take a "find_files_mask". They begin with the name of a dir tree and end with a list of filename masks. See $LK,"FilesFindMatch","MN:FilesFindMatch"$().
$FG,9$Grep("pattern","/SparrowOS/Demo/*.CPP.Z;*.TXT.Z;");$FG$
Be aware of $LK,"TEXT_FILE_MASK","MN:TEXT_FILE_MASK"$ and $LK,"SRC_FILE_MASK","MN:SRC_FILE_MASK"$.
$ID,-2$$TR,"BURNING CD-ROMs/DVDs"$
$ID,2$
0) Prepare a directory with the files you wish to burn.
1) Use $LK+S,"CDFileCreate","MN:CDFileCreate"$() to make an ISO image file.
2) Use $LK+S,"CDImageWrite","MN:CDImageWrite"$() to burn an ISO file onto a CD or DVD.
$LK,"Bootable CD-ROMs","FF:::/SparrowOS/Doc/FileMgr.TXT.Z,Bootable"$
$ID,-2$
$ID,-2$$TR,"Level 2: ADMIN HELP"$
$ID,2$
Use $LK,"Mount","MN:Mount"$() to mount disk drives.
$LK,"Installing","FI:::/SparrowOS/Doc/Install.TXT.Z"$
$LK,"Acct Files","FF:::/SparrowOS/Doc/GuideLines.TXT.Z,ACCT FILES"$
$LK-A+S,"::/SparrowOS/OSMain/Adam1.CPP.Z"$ the SparrowOS equivalent of the $FG,2$AUTOEXEC.BAT$FG$.
$ID,-2$$TR,"Level 3: PROGRAMMER HELP"$
$ID,2$
$LK,"Guidelines","FI:::/SparrowOS/Doc/GuideLines.TXT.Z"$
$LK,"Differences from C/C++","FI:::/SparrowOS/Doc/Differences.TXT.Z"$
$LK,"Graphics","FI:::/SparrowOS/Doc/Graphics.TXT.Z"$
$LK,"Multitasking","FI:::/SparrowOS/Doc/MultiTasking.TXT.Z"$
$LK,"Doc Documents","FI:::/SparrowOS/Demo/Doc/FileRead.CPP.Z"$
$LK,"Lectures/AndNotMod.CPP.Z","FI:::/SparrowOS/Demo/Lectures/AndNotMod.CPP.Z"$
$LK,"Lectures/FixedPoint.CPP.Z","FI:::/SparrowOS/Demo/Lectures/FixedPoint.CPP.Z"$
$LK,"Lectures/Uncached.CPP.Z","FI:::/SparrowOS/Demo/Lectures/Uncached.CPP.Z"$
$LK,"Lectures/Optimization.CPP.Z","FI:::/SparrowOS/Demo/Lectures/Optimization.CPP.Z"$
$LK,"Lectures/ScreenMemory.CPP.Z","FI:::/SparrowOS/Demo/Lectures/ScreenMemory.CPP.Z"$
$LK,"Lectures/GraphicsCPULoad.CPP.Z","FI:::/SparrowOS/Demo/Lectures/GraphicsCPULoad.CPP.Z"$
$LK,"Lectures/InterruptDemo.CPP.Z","FI:::/SparrowOS/Demo/Lectures/InterruptDemo.CPP.Z"$
$LK,"Lectures/Spinning.CPP.Z","FI:::/SparrowOS/Demo/Lectures/Spinning.CPP.Z"$
$ID,-2$$TR,"Level 4: SYSTEM PROGRAMMER HELP"$
$ID,2$
$LK,"System Programming Guide-Lines","FI:::/SparrowOS/Doc/SysPgmGuide.TXT.Z"$
$LK,"Hash Tables","FL:::/SparrowOS/OSMain/Hash1a.CPP.Z,1"$
$LK,"Keyboard Handling","FA:::/SparrowOS/Doc/KeyBoard.TXT.Z,PutKeyHandling"$
$LK,"Page Table Entries 1","FI:::/SparrowOS/Demo/Lectures/PageTableEntries1.CPP.Z"$
$LK,"Page Table Entries 2","FI:::/SparrowOS/Demo/Lectures/PageTableEntries2.CPP.Z"$
$LK,"PCIInterrupts.CPP.Z","FI:::/SparrowOS/Demo/Lectures/PCIInterrupts.CPP.Z"$
$LK,"MemRep","MN:MemRep"$
$LK,"WallPaper.CPP.Z","FI:::/SparrowOS/Adam/WallPaper.CPP.Z"$
$LK,"Adding a New File System","FI:::/SparrowOS/Doc/NewFileSystem.TXT.Z"$
$LK,"Scheduler.CPP.Z","FL:::/SparrowOS/OSMain/Scheduler.CPP.Z,1"$
$LK,"Doc","FA:::/SparrowOS/Adam/Doc/Doc.CPP.Z,Doc"$
$LK,"MiniGrLib","FI:::/SparrowOS/Demo/Lectures/MiniGrLib.CPP.Z"$
$LK,"MiniCompiler","FI:::/SparrowOS/Demo/Lectures/MiniCompiler.CPP.Z"$
$LK,"Backend","FL:::/SparrowOS/Compiler/BackEnd.CPP.Z,1"$
$ID,-2$
$WW,0$$LK,"AutoFile","HI:AutoFile"$
$LK,"Bit","HI:Bit"$
$LK,"Boot","HI:Boot"$
$LK,"Call","HI:Call"$
$LK,"Char","HI:Char"$
$LK,"Circular Queue","HI:Circular Queue"$
$LK,"Cmd Line (Typically)","HI:Cmd Line (Typically)"$
$LK,"Compiler","HI:Compiler"$
$LK,"Compression","HI:Compression"$
$LK,"Ctrls","HI:Ctrls"$
$LK,"Debugging","HI:Debugging"$
$LK,"Device","HI:Device"$
$LK,"Exceptions","HI:Exceptions"$
$LK,"Fifo","HI:Fifo"$
$LK,"File","HI:File"$
$LK,"Graphics Overview","FI:::/SparrowOS/Doc/Graphics.TXT.Z"$
$LK,"Graphic Routines","HI:Graphics"$
$LK,"Hash","HI:Hash"$
$LK,"Help System","HI:Help System"$
$LK,"Info","HI:Info"$
$LK,"Input Pointer","HI:Input Pointer"$
$LK,"Install","HI:Install"$
$LK,"I/O","HI:I/O"$
$LK,"Doc","HI:Doc"$
$LK,"TSZ","FI:::/SparrowOS/Doc/TSZ.TXT.Z"$
$LK,"Math","HI:Math"$
$LK,"Memory","HI:Memory"$
$LK,"Menus","HI:Menus"$
$LK,"Messages","HI:Messages"$
$LK,"Misc","HI:Misc"$
$LK,"MultiCore","HI:MultiCore"$
$LK,"Named Frames","HI:Hash/Named Frame"$
$LK,"CMathODE","HI:CMathODE"$
$LK,"OpCodes","FI:::/SparrowOS/Compiler/OpCodes.TXT.Z"$
$LK,"Operator Precedences","FF:::/SparrowOS/Doc/Differences.TXT.Z,operator precedence"$
$LK,"PrintF Extended Codes","FA:::/SparrowOS/Doc/Differences.TXT.Z,PrintF_Codes"$
$LK,"Processor","HI:Processor"$
$LK,"Profiler","HI:Profiler"$
$LK,"PCI","HI:PCI"$
$LK,"Sound","HI:Snd"$
$LK,"Task","HI:Task"$
$LK,"Time","HI:Time"$
$LK,"Training","HI:Training"$
$LK,"Windows","HI:Windows"$
$LK,"WordStat","HI:WordStat"$
$LK,"Utils","HI:Utils"$
7üÿÿÿ-  ) Term
+6
View File
@@ -0,0 +1,6 @@
$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 multiple topics separated by a '$FG,2$;$FG$'. The index ctrls $FG,4$HI:topic$FG$ links.
$FG,2$#help_file "filename[.TXT.Z]"$FG$
The help file preprocessor directive places a file as the heading text in a $FG,4$HI:topic$FG$ link for the current help index.
+109
View File
@@ -0,0 +1,109 @@
$FG,5$$TX+CX,"Details of Scoping and Linkages"$$FG$
$WW,1$
$LK,"Just-In-Time Compilation","FF:::/SparrowOS/Doc/Glossary.TXT.Z,JIT"$ 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.
$LK,"Statical Compilation","FF:::/SparrowOS/Doc/Glossary.TXT.Z,Static Compiled"$ creates a new, empty, sym table which you must populate by $FG,2$#include$FG$ing $LK,"::/SparrowOS/OSMain/StaticAdam.HPP.Z","FI:::/SparrowOS/OSMain/StaticAdam.HPP.Z"$ or whatever to import syms.
When a sym is placed into a table, older syms with identical names will be overshadowed if they exist, unless you use the compiler option $LK,"OPTf_REPLACE_SYMS","MN:OPTf_REPLACE_SYMS"$. 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$UpdateWin()$FG$". This case might occur when the $FG,2$adam task$FG$ is starting-up loading-in many little utilities.
$FG,2$extern$FG$ binds a new $LK,"HTT_FUN","MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR","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","MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR","MN:HTT_GLBL_VAR"$ sym to a sym of the same name imported from the task's sym table at $LK,"Load","MN:Load"$() time. If no sym exists to bind to at $LK,"Load","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","MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR","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","MN:HTT_FUN"$ or $LK,"HTT_GLBL_VAR","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","MN:Load"$() time. If no sym exists to bind to at $LK,"Load","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,2$S$FG$taticModule/$FG,2$J$FG$ustInTime
| Code occurs in $FG,2$G$FG$lobalScope/$FG,2$F$FG$unctionScope
| | $FG,2$C$FG$Code/$FG,2$A$FG$smCodeBlk
| | | $FG,2$extern$FG$/$FG,2$import$FG$/$FG,2$_extern$FG$/$FG,2$_import$FG$/$FG,2$IMPORT$FG$/$FG,2$static$FG$/$FG,2$class$FG$/$FG,2$goto$FG$
| | | | $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$M$FG$acro/$FG,2$F$FG$unction/$FG,2$C$FG$lass/$FG,2$T$FG$ypedef
| | | | | | 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
S G A C label:: S MG N
S G A C label: MG N
S G A C @@label: AL N
S G A IMPORT C label; MR N
S F A C label:: S BG N
S F A C label: BG N
S F A C @@label: AL N
S F A IMPORT C label; BR N
S x x #define MR D
S G C C function S MR D
S F C R var FR N
S F C S var FR N
S F C static C var FR D N
S F C goto C label: FG N
S G C C var S MR D D
S G C D var MR N D
S G C class MR D
S G C class member MR P
S G C extern class MR D
S G C extern C function MR W
S G C import C function MR D
S G C import C var MR D
S G C _extern C function MR D
S G C _extern C var MR D
S G C _import C function MR D
S G C _import C var MR D
J G A C label:: S Tg N
J G A C label: BG N
J G A C @@label: AL N
J G A IMPORT C label; TR N
J F A C label:: BG N
J F A C label: BG N
J F A C @@label: AL N
J F A IMPORT C label; BR N
J x x #define M TR D
J G C C function F TR D
J F C R var FR N
J F C S var FR N
J F C static C var FR D N
J F C goto C label: FG N
J G C C var G TR D D
J G C D var G TR S D
J G C class C TR D
J G C class member TR P
J G C extern class C TR D
J G C extern C function F TR W
J G C extern C var G TR D
J G C extern D var G TR D
J G C _extern C function F TR D
J G C _extern C var 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 register var allocation. You can, optionally, specify a reg after the "$FG,2$reg$FG$" keyword.
* Local nonregister 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 C+ structure members can be used in asm blks.
* No register vars are used in functions with a try/catch. They will be force to $FG,2$noreg$FG$.
* Using $FG,2$&i$FG$ or $FG,2$i.u8[2]$FG$ on a local var, $FG,2$i$FG$, will force it 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","MN:OPTf_GLBLS_ON_DATA_HEAP"$$FG$. They may in the future.
* $LK,"OPTf_EXTERNS_TO_IMPORTS","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$static compiled$FG$ header.
$WW,0$
+7
View File
@@ -0,0 +1,7 @@
$WW,1$"Input Ptr" is the mouse at this point.
$LK,"ipx","MN:ipx"$ and $LK,"ipy","MN:ipy"$ can be used to access the x and y coordinates of the input ptr. They are relative to the screen, not window. These can be used if you don't want to use msg passing. $LK,"ipz","MN:ipz"$ is the wheel.
$LK,"iptx","MN:iptx"$ and $LK,"ipty","MN:ipty"$ are the text column and row of the input ptr. See $LK,"::/SparrowOS/Demo/Maze.CPP.Z","FI:::/SparrowOS/Demo/Maze.CPP.Z"$.
You can make the input ptr snap to a grid by adjusting $FG,4$Fs->snap$FG$.
+48
View File
@@ -0,0 +1,48 @@
$WW,1$$FG,5$$TX+CX,"Installing SparrowOS"$$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 SparrowOS. You'll need a partition for SparrowOS. 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 CD-ROM "Install" will automate much of this.
See $LK,"Boot.TXT.Z","FI:::/SparrowOS/Doc/Boot.TXT.Z"$ for an overview of booting. See $LK,"Requirements","FI:::/SparrowOS/Doc/Requirements.TXT.Z"$ for supported hardware. See $LK,"Upgrading","FI:::/SparrowOS/Doc/Upgrade.TXT.Z"$ if you are upgrading.
Two SparrowOS 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 SparrowOS partitions.
1)
$ID,2$$LK,"Mount","MN:Mount"$() use if the drive is partitioned.
$ID,2$This command mounts a drive making it accessible. For simplicity, select $FG,2$'C'$FG$ as the base drive letter for your hard drive. The first partition will be $FG,2$'C'$FG$, second, $FG,2$'D'$FG$, etc. SparrowOS 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","MN:PrtDsk"$($FG,2$'C'$FG$) use if drive is not partitioned
$ID,2$This will perform a special $LK,"Mount","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,"MasterBootZero","MN:MasterBootZero"$() to restore your drive to a state where other operating systems can partition it.
$ID,-2$
$ID,-2$2) $LK,"Fmt","MN:Fmt"$($FG,2$'D'$FG$,$FG,2$TRUE,FALSE,PT_FAT32$FG$)
$ID,2$This command formats a partition with $FG,2$FAT32$FG$ or the SparrowOS native 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","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-ROM. Use the drive letter of the partition in place of $FG,2$'D'$FG$.
$ID,-2$4) $LK,"InstallBoot","MN:InstallBoot"$($FG,2$'D'$FG$)
$ID,2$This command recompiles the source code on a partition and writes to the $UL,1$partition's$UL,0$ boot record. You'll need to reenter the $LK,"Mount","MN:Mount"$ information so it can be stored in the kernel.
$ID,-2$5) Use Linux's $LK,"Grub","FI:::/SparrowOS/Doc/Grub.TXT.Z"$ or SparrowOS' $LK,"InstallMasterBoot","MN:InstallMasterBoot"$($FG,2$'D'$FG$)
$ID,2$
The $LK,"InstallMasterBoot","MN:InstallMasterBoot"$() command places a boot loader on a drive to boot partitions. 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 partition.
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-SparrowOS 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 of MicroSoft Corp.
* "Linux" is probably a trademark owned by Linus Torvalds.
+69
View File
@@ -0,0 +1,69 @@
$WW,1$$FG,5$$TX+CX,"Keyboard Allocations"$$FG$
See $LK,"Char","HI:Char"$ for definition of scan codes.
When you are at the cmd line, editing documents, browsing documentation and help, entering items in forms or in menu's, the $LK,"CDoc","MN:CDoc"$ editor handles keys. It allows you to define your own key handlers in a $LK,"MyPutKey","MN:MyPutKey"$() function. If you choose, you can catch most keys, overriding the default handlers. See $LK,"DocPutKey","MN:DocPutKey"$(). The following is an overview of key allocations.
$FG,2$ALT-keys and ALT-SHIFT-keys$FG$
Free for user cfgurations in your $LK,"MyPutKey","MN:MyPutKey"$() handler, 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$ALT-digit keys$FG$
Extended ASCII (3 digit decimal number).
$FG,2$CTRL-ALT-keys and CTRL-ALT-SHIFT-keys$FG$
Handled at a system level, NOT by the $LK,"CDoc","MN:CDoc"$ editor. I reserve the right to allocate these, but in the mean time, you can make your own by assigning handlers to the $LK,"fp_ctrl_alt_let_cbs","MN:fp_ctrl_alt_let_cbs"$[] array. Be aware that they operate in an interrupt framework, so they are tricky to use.
$FG,2$CTRL-function key$FG$
Auto-completes wordstat 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 and SHIFT-function keys$FG$
$FG$I reserve the right to allocate these, but there are some free now.
$FG,2$CTRL-key and CTRL-SHIFT-key$FG$
I reserve the right to allocate to these. There are not many free.
$FG,5$$TX+CX,"Behind the Scenes"$$FG$
$AN,"","PutKeyHandling"$The editor mostly stays in a $LK,"GetKey","MN:GetKey"$()/$LK,"PutKey","MN:PutKey"$() loop. The putkey portion is where keys are acted-upon. SparrowOS has a chain of putkey handlers in a $LK,"Circular Queue","HI:Circular Queue"$ with priorities. The highest priority handlers can choose to terminate handling, otherwise, the keys get sent on down the chain.
$LK,"KeyDevAdd","MN:KeyDevAdd"$() defines a putkey device with a priority. "Device" might be a misnomer. Currently, the following are defined:
Priority Handler
---------- ---------
$FG,2$0x20000000$FG$ $LK,"MyPutKey","MN:MyPutKey"$() user handler
$FG,2$0x40000000$FG$ $LK,"AKDInputFilterPutKey","MN:AKDInputFilterPutKey"$() for $LK,"Auto","MN:Auto"$(), $LK,"AutoStr","MN:AutoStr"$(), and $LK,"AutoFile","MN:AutoFile"$() handling.
$FG,2$0x60000000$FG$ $LK,"AKDRawDisplayPutKey","MN:AKDRawDisplayPutKey"$() direct to video mem debug output.
$FG,2$0x80000000$FG$ $LK,"AKDDocPutKey","MN:AKDDocPutKey"$() standard document cmds
Since handling individual keys is slow, SparrowOS supports $LK,"PutS","MN:PutS"$() as well. If no puts handler is defined, individual keys are sent.
$LK,"CDoc","MN:CDoc"$$FG,2$.user_put_key$FG$ and $LK,"CDoc","MN:CDoc"$$FG,2$.user_put_s$FG$ are call back routines which offer some neat tricks. See $LK,"::/SparrowOS/Apps/MusicOrgan/JukeBox.CPP.Z","FI:::/SparrowOS/Apps/MusicOrgan/JukeBox.CPP.Z"$. There is a var $LK,"CDoc","MN:CDoc"$$FG,2$.user_put_data$FG$ which gets passed to them.
+4
View File
@@ -0,0 +1,4 @@
$WW,1$The compiler's lexical analyzer can be used in your programs to simplify parsing. See $LK,"Doc Parsing","FF:::/SparrowOS/Adam/Doc/DocPlain.CPP.Z,LexNew"$ or $LK,"Parse Opcode File","FF:::/SparrowOS/Compiler/CmpInit.CPP.Z,Opcodes.TXT.Z"$.
See $LK,"Tokens","MN:TK_IDENT"$.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
$WW,1$A menu appears when you move the mouse to the top of the screen. Menus are created with $LK,"MenuPush","MN:MenuPush"$(), $LK,"MenuFilePush","MN:MenuFilePush"$(), $LK,"MenuNew","MN:MenuNew"$() or $LK,"MenuFile","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","MN:MSG_KEY_DOWN_UP"$. The second arg is the msg $FG,2$p1$FG$ value which is $FG,2$ASCII$FG$ of the key in the case of $LK,"MSG_KEY_DOWN","MN:MSG_KEY_DOWN"$. The third arg is the msg $FG,2$p2$FG$ value which is the $FG,2$Scan Code$FG$ of the key in the case of $LK,"MSG_KEY_DOWN","MN:MSG_KEY_DOWN"$.
See $LK,"::/SparrowOS/Demo/PullDownMenu.CPP.Z","FI:::/SparrowOS/Demo/PullDownMenu.CPP.Z"$.
+14
View File
@@ -0,0 +1,14 @@
$WW,1$$FG,5$$TX+CX,"SparrowOS MutliCore"$$FG$
SparrowOS does master-slave multicore instead of SMP. Core#0 is the master. The master core assigns computational jobs to other cores. It is symmetrical in the sense that you can do file access and heap allocations because there are locks. Call $LK,"TaskInitExt","MN:TaskInitExt"$ to enable file access. See $LK,"::/SparrowOS/Demo/MultiCore/LoadTest.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/LoadTest.CPP.Z"$. SparrowOS does not move tasks between cores.
Only tasks on core#0 can have windows, but other cores can help render them.
Each core has a "seth task" which is the father of all tasks on that core. Adam is the seth task on core 0.
You give a job to a seth task with $LK,"MPJob","MN:MPJob"$() and get the result with $LK,"MPJobResult","MN:MPJobResult"$(). You spawn a task on another core with $LK,"MPSpawn","MN:MPSpawn"$().
Note: you must use the $FG,2$LOCK$FG$ asm prefix when changing shared structures in a multicore environment. The $LK,"LBts","MN:LBts"$(), $LK,"LBtr","MN:LBtr"$() and $LK,"LBtc","MN:LBtc"$() instructions have $FG,2$LOCK$FG$ prefixes. The compiler has a $FG,2$lock{}$FG$ feature but it doesn't work well. See $LK,"::/SparrowOS/Demo/MultiCore/Lock.CPP.Z","FI:::/SparrowOS/Demo/MultiCore/Lock.CPP.Z"$.
See $LK,"::/SparrowOS/Demo/Graphics/Transform.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Transform.CPP.Z"$.
See $LK,"::/SparrowOS/OSMain/MultiProc.CPP.Z","FI:::/SparrowOS/OSMain/MultiProc.CPP.Z"$.
+22
View File
@@ -0,0 +1,22 @@
$FG,5$$TX+CX,"MultiTasking"$$FG$
$WW,1$SparrowOS is a preemptive multitasking operating system. However, you can turn-off preemption on a task by task basis and the task will not yield ctrl unless it volunteers with $LK,"Yield","MN:Yield"$(), $LK,"Sleep","MN:Sleep"$() or a call to I/O which yields ctrl. Use the $LK,"Preempt","MN:Preempt"$() cmd to turn on or off preemption. This is useful when you have multiple tasks modifying data structures simultaneously. Interrupts still occur when preemption is off.
$BK,1$Preemption is turned-off by default when a task is $LK,"Spawn","MN:Spawn"$()ed.$BK,0$
The time-slice rate is set by $LK,"JIFFY_FREQ","MN:JIFFY_FREQ"$.
SparrowOS does not remove tasks from "the queue" when they are waiting. They swap-in, check for whatever condition they are waiting for and swap-out. This keeps it simple, but would cause problems if too many tasks existed. SparrowOS is intended for non-server home computers with a maximum of around ten, or so, tasks. See $LK,"Scheduler","FL:::/SparrowOS/OSMain/Scheduler.CPP.Z,1"$.
SparrowOS has no task priority scheme.
Disk requests are not broken into pieces for sharing. Therefore, if one task makes a big request, the drive is locked onto that task until it is done. During that time, other tasks can do CPU-only operations, however.
$FG,5$$TX+CX,"Interrupts"$$FG$
You can turn-on and off interrupts, in your user programs. This is part of the mission statement, giving complete freedom to programmers Use $LK,"Cli","MN:Cli"$() or $LK,"Sti","MN:Sti"$(). SparrowOS currently doesn't use interrupt besides the timer and keyboard interrupt. Since the interrupt flag is part of your task context and since you are voluntarily swapped-out if you call $LK,"GetChar","MN:GetChar"$() or whatever, you won't even notice if you turn-off interrupts at the cmd prompt because you are being swapped-out and interrupts are being turned-on by the next task.
I saw no reason to make the hard drive or CD-ROM drive code interrupt driven -- it just creates potential compatibility issues. On a home system, you do one thing at a time, mostly. SparrowOS can do multiple things at once, but not as efficiently as a server operating system. It would bogg down with a hundred tasks asking for service. It sure is simpler, though... smaller... simpler to maintain... and understandable by a layman! The disk code does not break-up requests, if you are curious why one task must wait until another finishes an operation.
See $LK,"::/SparrowOS/Demo/Lectures/Spinning.CPP.Z","FI:::/SparrowOS/Demo/Lectures/Spinning.CPP.Z"$.
+67
View File
@@ -0,0 +1,67 @@
$WW,1$$FG,5$This is to clearify how several mysterious things happen in SparrowOS.$FG$
* SparrowOS runs in $FG,2$VGA 640x480 16 color$FG$ graphics mode, not text mode. It changes to this mode with a $LK,"BIOS call","FF:::/SparrowOS/OSMain/OSStart.CPP.Z,INT 0x10"$ while in real-mode before it switches to 64-bit mode. The text is $LK,"drawn manually","MN:GrUpdateForegroundOfText"$. If graphics mode fails, it falls-back on text mode. You can force text mode with an $LK,"OSMain config","FI:::/SparrowOS/OSMain/OSCfg.CPP.Z"$ option.
* SparrowOS identity-maps all memory, all the time. There is no "high half" memory space. SparrowOS is ring-0-only, so everything is kernel, even user programs. There is a special task called "Adam" and he doesn't die, so his heap never gets freed. That's as close to "kernel memory" as it gets.
* SparrowOS puts all code in the lowest 2 Gig, so that REL32 addressing can be used. SparrowOS is 64-bit, but I just thought 2 Gig was enough for code. It actually puts global variables there, too, but you can turn that off with $LK,"OPTf_GLBLS_ON_DATA_HEAP","MN:OPTf_GLBLS_ON_DATA_HEAP"$. $LK,"MAlloc","MN:MAlloc"$() can allocate any memory, of course.
* SparrowOS doesn't use software interrupts or SYSCALL instructions because it never needs to change out of ring-0, even running user programs. Calls are always CALL REL32 instructions.
* The stack does not grow. In theory, memory gets fragmented, too.
* 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","FI:::/SparrowOS/Doc/CmdLine.TXT.Z"$.
* If you use $LK,"Grub","FI:::/SparrowOS/Doc/Grub.TXT.Z"$, you "chain-load" like Windows. You can use the SparrowOS boot-loader. $LK,"Master-Boot-Loader-Stage1","FI:::/SparrowOS/Adam/Boot/BootMHD.CPP.Z"$, $LK,"Master-Boot-Loader-Stage2","FI:::/SparrowOS/Adam/Boot/BootMHD2.CPP.Z"$, $LK,"Partition-Boot-Loader","FI:::/SparrowOS/Adam/Boot/BootHD.CPP.Z"$, $LK,"CD-DVD-Boot-Loader","FI:::/SparrowOS/Adam/Boot/BootCD.CPP.Z"$.
* The boot-loaders must be patched by you running $LK,"InstallBoot","MN:InstallBoot"$() or $LK,"InstallMasterBoot","MN:InstallMasterBoot"$(). Those will write the block address into the boot-loader because the boot-loaders do not navigate file systems to find the $LK,"Stage2","FI:::/SparrowOS/OSMain/OSStart.CPP.Z"$ if you relocate it.
* The $FG,2$/0000Boot$FG$ directory and the $FG,2$0000OSMain.BIN.C$FG$ file are named so that they are first in alphabetical order and, therefore, at a predictable block address. The $LK,"CD/DVD Boot Loader","FI:::/SparrowOS/Adam/Boot/BootCD.CPP.Z"$ will find $FG,2$0000OSMain.BIN.C$FG$ at $LK,"Block #0x16","MN:CDBootFileCreate"$. The SparrowOS boot loader can be used with $FG,4$$TX+HTML,"http://www.magiciso.com","http://www.magiciso.com"$$FG$ if you place $FG,2$0000OSMain.BIN.C$FG$ in the right spot.
* SparrowOS is 64-bit. Like all PC operating systems, the boot-loader starts in 16-bit real-mode. SparrowOS calls a few BIOS info routines, switches to VGA-640x480x4bit, switches to 32-bit, then, 64-bit mode. There is an odd thing called a $FG,2$$TX+HTML,"PCI BIOS","http://www.o3one.org/hwdocs/bios_doc/pci_bios_21.pdf"$$FG$ which is 32-bit used for PCI config space access. SparrowOS calls $LK,"that","FI:::/SparrowOS/OSMain/BIOS32.CPP.Z"$ a couple times. It must temporarily drop-out-of 64-bit mode for that and stop multi-tasking.
* PUSH EAX : All stack operations in 64-bit mode are 64-bits.
* XOR EAX,EAX : Operations on 32-bit registers clear the high 32-bits.
* MOV RAX,FS:[RAX] : FS can be set with a WRMSR, but displacement is RIP relative, so it's tricky to use. FS is used for the current $LK,"CTask","MN:CTask"$, GS for $LK,"CCPU","MN:CCPU"$.
* SparrowOS uses JIT file compression on a file-by-file basis. Files are $LK,"compressed","FI:::/SparrowOS/OSMain/Compress.CPP.Z"$, not encrypted.
* SparrowOS has a dictionary that is shipped compressed. When you boot the first time it is uncompressed. SparrowOS has a Windows utility for uncompressing. That utility needs Microsoft DLL files. SparrowOS does not use any libraries, modules or code from other sources -- I wrote it all from scratch and it is self-contained.
* There are no OBJ or EXE files. There are only two files compiled ahead-of-time -- $FG,2$OSMain.BIN.C$FG$ and $FG,2$Compiler.BIN.Z$FG$. You can delete them and recompile with $LK,"InstallBoot","MN:InstallBoot"$(). SparrowOS is $TX+D,"135,799","DD_SPARROWOS_LOC"$ lines. Roughly 50,000 is compiled AOT and 50,000 during boot JIT. The rest is JIT demos and applications.
* The main difference between SparrowOS and other systems is that the heap and compiler sym table are associated with tasks, not applications.
* There are sym(hash) tables maintained by each task. They are similar in scope to environment variables. When a symbol is not found, the parent task's symbol table is checked. All process chain back to the $FG,2$Adam$FG$ process. $FG,2$Adam$FG$ has the symbols from headers you normally $FG,2$#include$FG$ in other operating systems, so you do not need to $FG,2$#include$FG$ any headers in SparrowOS.
* The compiler only creates pos independent code. You can't create code which is loaded at a fixed, specified location. The code is pos independent by virtue of the fact that abs addresses get patched.
* Binary executable files have export syms which are loaded into the sym tables. The operating system $FG,2$OSMain$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","MN:Man"$()/$FG,2$WORDSTAT$FG$ feature can find src lines.
* The word "$FG,2$public$FG$" does very little except allow the $LK,"help_index","FI:::/SparrowOS/Doc/HelpIndex.TXT.Z"$ and $LK,"HashRep","MN:HashRep"$() program varients to exclude meaningless syms. If you wish a full report of public and nonpublic syms $MA+A-X+PU,"Click Here","DocMax(1000000);HAllRep;View;\n"$.
* When compilation takes place, the structures used by the compiler stick around. Data on classes can be accessed by code. See $LK,"ClassRep","MN:ClassRep"$().
* Filenames ending in "$FG,2$.Z$FG$" are automatically compressed and uncompressed when writing to disk. File size in directory listing is the compressed size. You can view uncompressed size with $LK,"Dir","MN:Dir"$("*",TRUE); if you use the native SparrowOS filesystem. See $LK,"::/SparrowOS/Doc/TSZ.TXT.Z","FI:::/SparrowOS/Doc/TSZ.TXT.Z"$ for uncompressing from $FG,2$WINDOWS$FG$.
* Some memory objects are allocated when needed and will decrease the available memory displayed. A task keeps mem objects smaller than a couple blocks in it's own separate heap when freed and these are not counted in the available system free memory, though they are free. They get returned to the system when the task is killed. To get a sense of this, compile the operating system and see the amount of mem used. Then, compile it again and far less will be allocated. This is because it is reusing the small chunks. See $LK,"Memory","HI:Memory"$. $MA+A-X+PU,"Click Here","MemRep;View;"$ for a $LK,"MemRep","MN:MemRep"$.
* 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","MN:S2T"$(). The $FG,2$ASCII 28$FG$ is $FG,2$SHIFT-ESC$FG$.
* Binary data is stored beyond the terminating $FG,2$NULL$FG$ in text files. Map files store debug src lines and other files store sprites.
* Sprites can be stored as vect graphics so they might take shockingly little room. They can be converted to bitmaps.
* If you change code in the $FG,2$/SparrowOS/Adam$FG$, $FG,2$/SparrowOS/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 JIT compilation. There is no "$FG,2$.BIN$FG$" file for JIT compilation.
* If a file is not found, the parent directories are searched for a file of the same name.
* SparrowOS supports $FG,2$FAT32$FG$ and a native SparrowOS file system type. The native SparrowOS partitions will appear as $FG,2$FAT32$FG$ to other operating systems, but will not work. Do not access the native SparrowOS partitions from other operating systems. This was to fool a bootloader when I tricked it to use it's recovery partition feature.
* The CPU usage during disk operation expands to 99%. It polls while swapping-out. You can do other, non-disk activity during disk operations because it swaps-out a lot and task swaps take only half a microsecond, probably a hundred times faster than a typical OS. See $LK,"Cooperative Multitasking","FI:::/SparrowOS/Demo/Lectures/Spinning.CPP.Z"$. It does not break-up disk operations into small pieces for sharing, however, so the disk is lock onto that one task.
$FG,8$
* "Windows" is a trademark of MicroSoft Corp.
+2
View File
@@ -0,0 +1,2 @@
$WW,1$If you require separate global vars for multiple instances of a routine, you can use $FG,4$NamedFrame$FG$s. See $LK,"CSpriteMesh","MN:CSpriteMesh"$(), $LK,"::/SparrowOS/Demo/Graphics/Pick3D.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Pick3D.CPP.Z"$ or $LK,"Noise","MN:Noise"$().
+7
View File
@@ -0,0 +1,7 @@
$FG,5$$WW,1$$TX+CX,"Adding a New File System"$$FG$
If you want to add a support for a new file system, do a text search on "PT_FAT32". All the places where that occurs will require new entries for your file system type. $MA+A-X+PU,"Click here for search.","Grep(\"PT_FAT32\",\"/SparrowOS/\" SRC_FILE_MASK);View;"$
You will also need to add an entry $LK,"here.","FF:::/SparrowOS/OSMain/Define1a.CPP.Z,ST_PRT_TYPES"$
+7
View File
@@ -0,0 +1,7 @@
$WW,1$SparrowOS 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","MN:CMathODE"$ and $LK,"ODEsUpdate","MN:ODEsUpdate"$ for an overview.
See $LK,"ODECallDerivative","MN:ODECallDerivative"$ to see what support there is for masses and springs.
See $LK,"::/SparrowOS/Demo/GameStarters/Whap.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Whap.CPP.Z"$, $LK,"::/SparrowOS/Demo/GameStarters/Rocket.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Rocket.CPP.Z"$, $LK,"::/SparrowOS/Demo/GameStarters/MassSpring.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/MassSpring.CPP.Z"$, $LK,"::/SparrowOS/Apps/Span/SpanMain.CPP.Z","FI:::/SparrowOS/Apps/Span/SpanMain.CPP.Z"$ or $LK,"::/SparrowOS/Apps/X-Caliber/X-Caliber.CPP.Z","FI:::/SparrowOS/Apps/X-Caliber/X-Caliber.CPP.Z"$ for a masses and springs examples, or $LK,"::/SparrowOS/Demo/WinMgr2.CPP.Z","FI:::/SparrowOS/Demo/WinMgr2.CPP.Z"$, or $LK,"::/SparrowOS/Demo/GameStarters/Rocks.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/Rocks.CPP.Z"$.
+21
View File
@@ -0,0 +1,21 @@
$WW,1$$FG,5$$TX+CX,"Compiler Options"$$FG$
Use $LK,"OptOn","MN:OptOn"$() $LK,"OptOff","MN:OptOff"$(). You might need to do $FG,2$#exe {OptOn();}$FG$.
$LK,"OPTf_REPLACE_SYMS","MN:OPTf_REPLACE_SYMS"$ is to cause new declaritions to replace old, instead of overshadowing them in the hash sym table.
$LK,"OPTf_GLBLS_ON_DATA_HEAP","MN:OPTf_GLBLS_ON_DATA_HEAP"$ without this option, global vars are placed in the code heap which is limited to 2 Gig. In static 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 static modules is they can't be initialized.
$LK,"OPTf_EXTERNS_TO_IMPORTS","MN:OPTf_EXTERNS_TO_IMPORTS"$ and $LK,"OPTf_KEEP_PRIVATE","MN:OPTf_KEEP_PRIVATE"$ are strange options, you'll never need. They're to allow the same header file for $FG,2$OSMain$FG$ to act as $FG,2$extern$FG$s when compiling itself and $FG,2$import$FG$s when compiled by static modules. They are used in $LK,"::/SparrowOS/OSMain/Static.HPP.Z","FI:::/SparrowOS/OSMain/Static.HPP.Z"$.
$LK,"OPTf_WARN_UNUSED_VAR","MN:OPTf_WARN_UNUSED_VAR"$ warning if unused var. It is applied to functions.
$LK,"OPTf_WARN_PAREN","MN:OPTf_WARN_PAREN"$ warning if parenthesis are not needed.
$LK,"OPTf_WARN_DUP_TYPES","MN:OPTf_WARN_DUP_TYPES"$ warning if dup local var type statements.
$LK,"OPTf_NO_REG_VAR","MN:OPTf_NO_REG_VAR"$ forces all function local vars to the stk not registers. Applied to functions.
$LK,"OPTf_NO_BUILTIN_CONST","MN:OPTf_NO_BUILTIN_CONST"$ Disable 10-byte float consts for ã, log2_10, log10_2, loge_2. Applied to functions.
+10
View File
@@ -0,0 +1,10 @@
$WW,1$The SparrowOS profiler records statistics on what code location was executing when a task was preempted. You can learn where most time is wasted. There are two modes, $LK,"ProfBin","MN:ProfBin"$() which monitors a range of buckets and $LK,"ProfAll","MN:ProfAll"$() which records a hit location as well as count. I recommend $LK,"ProfAll","MN:ProfAll"$().
You can pass a subroutine depth level argument which records a hit in not only the routine executing, but the routines which called it, as well.
When done collecting statistics, use $LK,"ProfRep","MN:ProfRep"$() for a report. You might need a $LK,"DocMax","MN:DocMax"$() to expand the command line window buffer to fit it all.
You can set the CPU to monitor with $LK,"ProfCPUSet","MN:ProfCPUSet"$().
Study the code. The profiler is very simple and you might want to enhance it or modify it to debug something in particular.
+6
View File
@@ -0,0 +1,6 @@
$WW,1$A $FG,2$Queue$FG$ is a bunch of $LK,"MAlloc","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.
Be careful when writing multitasking code not to access $FG,2$Queues$FG$ while in the middle of a change. You might turn-off preemption or interrupts.
+48
View File
@@ -0,0 +1,48 @@
$FG,5$$TX+CX,"SparrowOS 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$, SparrowOS does not generate unique short-entry names. Not all $FG,2$FAT32$FG$ filenames are valid SparrowOS names and it will complain. Do not access $FG,2$FAT32$FG$ drives not dedicated to SparrowOS. Disable them with $LK,"DrvEnable","MN:DrvEnable"$(OFF), or they will generate error messages. $FG,2$FAT32$FG$ involves a long and short name for each file. SparrowOS isn't so good at making distinct short names, so don't make files with same 11 characters, or you're asking for trouble when accessing from Windows.
* The stk does not grow because virtual mem is not used. I recommend allocating large local vars from the heap. You can change $LK,"DFT_STK","MN:DFT_STK"$ and recompile $FG,2$OSMain$FG$ or request more when doing a $LK,"Spawn","MN:Spawn"$().
* The syntax highlighting occassionally glitches. The compiler doesn't.
* Call $LK,"ChgDsk","MN:ChgDsk"$() when you insert a new removable media.
* Accessing CD-ROM's is flacky. Try $LK,"Drv","MN:Drv"$() or $LK,"ChgDsk","MN:ChgDsk"$() twice.
* You can only $FG,2$extern$FG$ something once. There is a varient called $FG,2$_extern$FG$ which binds a C+ definition to a asm sym. This, too, can only be done once.
* You must call $LK,"TaskInitExt","MN:TaskInitExt"$() in a task you $LK,"Spawn","MN:Spawn"$() before you can do file I/O. And, preemption is off by default, so use $LK,"Preempt","MN:Preempt"$(ON) if you wish.
* A terminal task has a $LK,"CDoc","MN:CDoc"$ document structure that remains active even when you change $FG,4$Fs->draw_it$FG$. To prevent links in the $LK,"CDoc","MN:CDoc"$ from being activated when the user clicks in the window, do one of three things:
$ID,2$
A) $LK,"DocBottom","MN:DocBottom"$() followed by $LK,"DocClear","MN:DocClear"$() to clear the $LK,"CDoc","MN:CDoc"$ so it has no active widgets.
B) Disable window mgr button click checking with $FG,4$Fs->win_inhibit$FG$ set to mask $LK,"WIF_IP_L","MN:WIF_IP_L"$ and $LK,"WIF_IP_R","MN:WIF_IP_R"$. This inhibits window mgr operations but still generates messages from button clicks.
$ID,-2$
* $FG,2$switch/case$FG$ statements allocate 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","MN:MemCpy"$() only goes fwd.
* Don't attempt to use $FG,2$Fs->ignore_except$FG$ with $FG,2$<CTRL-ALT-C>$FG$.
* A $LK,"Cd","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$" statements 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,4$$ID,2$$ID,2$U16 *_w=0xF0000000;
*_w|=0x8000;
$ID,-2$$FG$The $FG,2$|=$FG$ will be coded as a $FG,2$U32 Bts$FG$ instruction 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.
+32
View File
@@ -0,0 +1,32 @@
$WW,1$$FG,5$$TX+CX,"Requirements for SparrowOS"$$FG$
$FG,5$User Skills Required$FG$
* Knowledge of the $FG,2$C$FG$ programming language.
$FG,5$Supported Hardware$FG$
* $FG,4$$TX+HTML,"x86_64","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 256 Meg RAM; Maximum $TX+D,"128 Gig","DD_MAPPED_MEM_SPACE_GIG"$ RAM (easily increased).
* HD Audio or 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 besides HD Audio.
* $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.
$FG,8$
+6
View File
@@ -0,0 +1,6 @@
$WW,1$Uncomment $LK,"#include \"HDAudio\"","FF:HOME/Adam3cSnd.CPP.Z,#include \"HDAudio\""$ in your $FG,2$/HOME/Adam3cSnd.CPP.Z$FG$ file to install a driver for HD Audio. Cfgure it with $LK,"::/SparrowOS/Adam/Snd/HDCfg.CPP.Z","FI:::/SparrowOS/Adam/Snd/HDCfg.CPP.Z"$ and add the file created, $FG,4$HOME/HDAudioCfg.CPP.Z$FG$, to your start-up scripts. $BK,1$Comment it out everything if you get no snd -- the PC Speaker should still work.$BK,0$
If you don't have HDAudio, you'll have to live with the PC Speaker. You might write a driver for your snd card following the HDAudio template.
See $LK,"::/SparrowOS/Demo/Snd/PolyPhonic.CPP.Z","FI:::/SparrowOS/Demo/Snd/PolyPhonic.CPP.Z"$, $LK,"SndFileFillBuf","MN:SndFileFillBuf"$() and $LK,"HDFillBuf","MN:HDFillBuf"$() for using HD Audio. The buffers are managed by $LK,"HDAudioTask","MN:HDAudioTask"$().
+31
View File
@@ -0,0 +1,31 @@
SparrowOS V1.02
$SP+BP,"",1,"::/SparrowOS/Demo/Graphics/Logo.CPP.Z,1"$
Public Domain
Operating System
$LK,"Trivial Solutions","FI:::/SparrowOS/Doc/TrivialSolutions.TXT.Z"$
+31
View File
@@ -0,0 +1,31 @@
$FG,5$$TX+CX,"SparrowOS"$$FG$
$LK+CX,"Trivial Solutions","FI:::/SparrowOS/Doc/TrivialSolutions.TXT.Z"$
$WW+H,1$$TR-C,"Keyboard Ctrls"$
$ID,2$$FG,9$Enter$FG$ Right-click menu
$FG,9$Space Bar$FG$ Edit (view)
$FG,9$Esc$FG$ Save and exit
$FG,9$Shift-Esc$FG$ Abort
$FG,9$Ctrl-m$FG$ Personal Menu
$FG,9$Windows Key $FG$Pull-down Menu
$BK,1$$MA+A+LA-X,"F1","Msg(MSG_KEY_DOWN,0,SC_F1);"$$BK,0$ Help
Other keys: $MA+A-X+PU,"Key Map","KeyMap;View;\n"$
$ID,-2$
$TR-C,"Mouse Ctrls"$
$ID,2$$FG,9$Right-Click$FG$ Right-click menu
$FG,9$Left-Click$FG$ Edit (view)
$FG,9$Double-Left$FG$ Save and exit
$FG,9$Double-Right$FG$ Abort
$FG,9$Top of Screen$FG$ Pull-down menu
$ID,-2$
$TR-C,"Keyboard-Mouse Ctrls"$
$ID,2$$FG,9$Ctrl-LeftDrag$FG$ Grab-Scroll Window
$FG,9$Ctrl-Right$FG$ Null scrolling
$FG,9$Ctrl-Alt-z$FG$ Zoom screen on Mouse
$FG,9$Ctrl-Alt-Z$FG$ Unzoom screen on Mouse
$ID,-2$
Remember to terminate cmds with a semicolon.
$LK,"Help Index","FI:::/SparrowOS/Doc/HelpIndex.TXT.Z"$ $LK,"Quick Start--Command Line","HI:Cmd Line (Typically)"$
+48
View File
@@ -0,0 +1,48 @@
$WW,1$$FG,5$$TX+CX,"Strategic Decisions Making"$
$TX+CX,"SparrowOS Simple"$
$FG$
The $FG,2$$TX+HTML,"trivial solution","http://en.wikipedia.org/wiki/Trivial_solution"$$FG$ in math is the simple, obvious answer. SparrowOS has many examples of using trivial solutions.
* 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 equal to physical.
* One platform -- $FG,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ PC's, no 32-bit support.
* No security.
* 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. PS/2 keyboard/mouse is used instead of USB, also more compatible.
* $FG,2$640x480$FG$ 16 colors. Updates whole screen at 60 fps, optimized for full screen games where "invalid rectangles" 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. Linking can be done at $LK,"Load","MN:Load"$() time for static modules, if you insist on not using $FG,2$JIT$FG$. Modules have imports and exports.
* Whole files are processed almost exclusively, allowing compression.
* One language and compiler for command-line, scripts, 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. Buttons are widgets, not child windows. There are child tasks, however.
* No distinction between "thread", "process" or "task".
* The $LK,"Scheduler","FI:::/SparrowOS/OSMain/Scheduler.CPP.Z"$ is mostly for home systems, not servers or mainframes. The focus task is all important. Disk requests are not broken-up, so sharing is bad, however.
* $LK,"MultiCore","FI:::/SparrowOS/Doc/MultiCore.TXT.Z"$ is done master/slave, instead of $FG,2$SMP$FG$. Core zero explicitly assigns jobs. Locks are present allowing multicore file, heap, and hardware access, though.
* $LK,"Music","MN:Play"$ is done with an elegant one-voice notation.
* 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 $FG,2$Adam task$FG$'s symbol system-wide global.
* Sometimes, I $LK,"cut corners","FI:::/SparrowOS/Doc/CutCorners.TXT.Z"$ in the interest of keeping the code beautiful.
$FG,8$
+31
View File
@@ -0,0 +1,31 @@
$WW,1$$FG,5$$TX+CX,"System Programming Guide-Lines"$$FG$
* See $LK,"Naming convention","FF:::/SparrowOS/Doc/Glossary.TXT.Z,Naming convention"$.
* See $LK,"Abbreviations","FF:::/SparrowOS/Doc/Glossary.TXT.Z,Abbreviations"$.
* I avoid the '$FG,2$?$FG$' operator. It's not very efficient with my compiler since it executes both expressions and I just don't like it.
* I place "New", "Del", "Init", "Rst", ect. on the end of a function name instead of beginning. "$FG,4$RstMusicSettings$FG$" should be "$FG,4$MusicSettingsRst$FG$".
* I often use 64-bit values in function args when smaller would be more appropriate because the compiler generally is more efficient with 64-bit values. (All value get promoted to 64-bit by the SparrowOS compiler, when fetched.)
* Short circuit logic is assumed.
* I generally avoid boolean expression assignments because $FG,2$TRUE$FG$ is dangerous with different compilers, though, the SparrowOS compiler should use $FG,2$1$FG$ for TRUE values, not just nonzero. 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 int -- nothing forces it to 1 or 0. There is a $LK,"ToBool","MN:ToBool"$() function.
* If you use floats in your interrupt routine, save and restore the fpu state with $LK,"Fxsave","MN:Fxsave"$() and $LK,"Fxrstor","MN:Fxrstor"$(). The timer interrupt does this. The keyboard and mouse don't use floats.
* Bracketing code with $FG,2$$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 put an '$FG,2$_$FG$' on the front of the name of pass-by-ref fun args.
* I put an '$FG,2$_$FG$' on the front of C callable ASM routines.
* $LK,"SysDbg","MN:SysDbg"$() and $LK,"IsSysDbg","MN:IsSysDbg"$() are really handy when working on the compiler or OSMain. It's just a bit you can set and test.
* I don't use "$FG,2$U0 *$FG$" because the size would be weird for ptr arithmetic.
* "$FG,2$result$FG$" is reserved for local variable that holds function return val.
* I use $FG,2$I64$FG$ instead of $FG,2$U64$FG$ unless necessary.
+38
View File
@@ -0,0 +1,38 @@
$WW,1$$FG,5$$TX+CX,"Linux TSZ Utility"$$FG$
$FG,2$TSZ [-ascii] filename$FG$
Will uncompress a single file from Linux. The $FG,2$-ascii$FG$ flag will convert the irregular SparrowOS 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,5$$TX+CX,"Windows TSZ Utility"$$FG$
$FG,2$TSZ$FG$ is a Windows cmd line program which will assist transferring files from SparrowOS to Windows. It will also uncompress SparrowOS files you have gotten to Windows. There are three ways to get files from SparrowOS to Windows -- via CD-ROM, a $FG,2$FAT32$FG$ partition or via a "file partition" you have created with $FG,2$TSZ$FG$ on a Windows partition.
$FG,2$TSZ -expand [-ascii] dirname$FG$:
will uncompress all SparrowOS files with names ending in "$FG,2$.Z$FG$" in a Windows directory and in all subdirectories. The $FG,2$-ascii$FG$ flag used in combination will convert the irregular SparrowOS 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.) Note: If you pick names not ending in "$FG,2$.Z$FG$", they will not need to be uncompressed. You can $LK,"Move","MN:Move"$() or $LK,"Copy","MN:Copy"$() them to a name not ending in "$FG,2$.Z$FG$" and they will be stored uncompressed.
$FG,2$TSZ -make megcnt partitionfilename signnum$FG$:
will create a file on a Windows partition and fill it with a signature num that can be searched for block-by-block from SparrowOS. Once some blocks have been allocated by Windows and located by SparrowOS, and if you don't mess with them, you can use them to transfer files between SparrowOS and Windows. This is a little risky. It's pretty safe if you create this file on a partition dedicated for this purpose.
$LK,"NonNativeScan","MN:NonNativeScan"$():
is a SparrowOS cmd which will scan for some blocks created by $FG,2$TSZ$FG$ and provide a block num you can use to specify a "Non-LT file partition". You can recompile OSMain and define this partition or use $LK,"Mount","MN:Mount"$() each time. You will be asked to provide a drive letter and from then on, you just copy files to that partition, boot Windows and run $FG,2$TSZ$FG$ to extract them.
$FG,2$TSZ -extract dstdirname partitionfilename$FG$:
will copy all files in a file partition to a Windows directory, making them available from Windows.
$BK,1$WARNING:$BK,0$ Do not run a defrag operation on a partition holding a file partition. If you store files to it after such an operation, you'll ruin data on your hard drive.
$FG,8$
* "Windows" is a trademark of MicroSoft Corp.
* "Linux" is probably a trademark owned by Linus Torvalds.
+3
View File
@@ -0,0 +1,3 @@
$WW,1$Intel has an instruction that returns the num of CPU cycles since boot. This is not calibrated to an accurate real time value, but SparrowOS measures it and you can convert with $LK,"time_stamp_freq","MN:time_stamp_freq"$, a value continuously calibrated from other timers. This is the fastest timer available.
+5
View File
@@ -0,0 +1,5 @@
$WW,1$SparrowOS uses a 64-bit value, $LK,"CDate","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","MN:CDate"$'s to get a time span.
Use $LK,"CDATE_FREQ","MN:CDATE_FREQ"$ to convert.
+1
View File
@@ -0,0 +1 @@
$WW,1$The HPET, high precision event timer, is read with $LK,"HPET","MN:HPET"$() and has a frequency of $LK,"HPET_freq","MN:HPET_freq"$. A typical freq value is 14.3 Mhz It might not be available on all systems.
+9
View File
@@ -0,0 +1,9 @@
$WW,1$One jiffy is one time slice. $LK,"sys_jiffies","MN:sys_jiffies"$ returns time slices since boot.
$LK,"SysTimerRead","MN:SysTimerRead"$ reads the timer ticks since boot. It's not as fast as $LK,"GetTimeStamp","MN:GetTimeStamp"$.
Use $LK,"JIFFY_FREQ","MN:JIFFY_FREQ"$ to convert $LK,"sys_jiffies","MN:sys_jiffies"$.
Use $LK,"SYS_TIMER_FREQ","MN:SYS_TIMER_FREQ"$ to convert $LK,"SysTimerRead","MN:SysTimerRead"$.
+143
View File
@@ -0,0 +1,143 @@
$WW,1$$FG,5$$IV,1$$TX+CX,"TIPS"$$IV,0$$FG$
* Turn-off or reboot ($FG,2$<CTRL-ALT-DEL>$FG$) at any time, except during disk writes. Writes are not cached.
* 64-bit values are most efficient for the compiler.
* If you make changes to SparrowOS 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 SparrowOS 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 SparrowOS CD-ROM and use $LK,"Mount","MN:Mount"$() to mount your hard drive.
* I copy my files to a mirrored identical partition, periodically with $LK,"CopyTree","MN:CopyTree"$() commands in scripts. I do merge commands with a menu entry like this:
$FG,5$M(\"D:/SparrowOS/*\",\"E:/SparrowOS/*\",\"+r+d\");$FG$ to check my changes.
* $FG,2$<CTRL-M>$FG$ at the cmd line to access your personal menu. 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","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 adjust the num of answers displayed by setting $FG,2$Fs->answers_displayed$FG$ to a num from 0-3 in your $LK,"UserStartUp","MN:UserStartUp"$ routine.
* You can use $FG,2$ans0$FG$,$FG,2$ans1$FG$, etc. in cmd line expressions. They hold results from the last cmd line operations. You can use the cmd prompt as a calculator by just entering expressions like $FG,2$1+2*3;$FG$. $FG,2$F64$FG$ results can be accessed with $FG,2$ansf0$FG$ or $FG,2$ansf1$FG$.
* Use the PullDown menu at the top of the screen to learn commands, like for games.
* You can adjust the mouse movement rate by setting global vars in your start-up file. See $LK,"mouse scale","FF:HOME/Adam3aLocalize.CPP.Z,mxx_scale"$.
* If your mouse wheel doesn't work, you might try an actual $FG,2$PS/2$FG$ mouse. My new machine does not have $FG,2$PS/2$FG$ ports.
* You can set your local time zone by setting the $LK,"local_time_offset","MN:local_time_offset"$ global var in a start-up file. It's units are $LK,"CDATE_FREQ","MN:CDATE_FREQ"$. See $LK,"local time","FF:HOME/Adam3aLocalize.CPP.Z,local_time"$.
* Use $LK,"DocCurAttr","MN:DocCurAttr"$() in $LK,"UserStartUp","MN:UserStartUp"$() to set terminal window colors.
* See $MA+A-X+PU,"Key Map","KeyMap;View;\n"$ for a list of defined keys. Define your own keys in $LK,"MyPutKey","MN:MyPutKey"$(). See $LK,"::/SparrowOS/Doc/KeyBoard.TXT.Z","FI:::/SparrowOS/Doc/KeyBoard.TXT.Z"$.
* $FG,2$<CTRL-SHIFT-L>$FG$ in the editor to autoindent a $FG,2$C+$FG$ function or renumber an asm routine's local labels. If it does not have $FG,2$#exe$FG$ config stuff, select "recompile." Otherwise, don't recompile$FG$ and it will use the compiler info collected when it was most recently compiled. $BK,1$$FG,2$<CTRL-SHIFT-L>$FG$ can be used to test if a file will compile.$BK,0$
* While developing applications, keeping everything in one source file allows you to use the $FG,2$<CTRL-SHIFT-L>$FG$ compile check/autoindent feature. Alternatively, you can $FG,2$#include$FG$ the files in a project a file depends on before entering the editor and $FG,2$<CTRL-SHIFT-L>$FG$ it.
* 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,"InstallBoot","MN:InstallBoot"$(). You'll probably want to make a function for recompiling that uses the $LK,"Auto","MN:Auto"$() function to answer the cfg questions. See my technique $LK,"Cfg Strs","FL:::/SparrowOS/Demo/AcctExample/TSAdam.CPP.Z,1"$ $LK,"Update Funs","FL:::/SparrowOS/Demo/AcctExample/TSDistribute.CPP.Z,1"$.
* You can disable $FG,2$WORDSTAT$FG$ commenting-out $LK,"WSInit","FF:HOME/Adam3fSys.CPP.Z,WSInit"$() in $LK,"HOME/Adam3fSys.CPP.Z","FF:HOME/Adam3fSys.CPP.Z,WSInit"$.
* You can rst MultiCore CPU's if they get hung with $LK,"MPStart","MN:MPStart"$(). HD Audio will get screwed-up, however.
* Boolean expressions $BK,1$not$BK,0$ in $FG,2$if$FG$ statements don't have short circuit logic and are compiled inefficiently.
* You can use $LK,"progress1","MN:progress1"$-$LK,"progress4","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,"::/SparrowOS/Demo/Progress.CPP.Z","FI:::/SparrowOS/Demo/Progress.CPP.Z"$.
* You can save the cmd line doc as text with $FG,2$<CTRL-A>$FG$. For a bitmap screen capture, use $LK,"BMPFileCaptureScreen","MN:BMPFileCaptureScreen"$(). You might want to make a hot key. See $LK,"BMPFileCaptureScreen","FF:::/SparrowOS/Demo/AcctExample/TSAdam.CPP.Z,BMPFileCaptureScreen"$.
* Use $LK,"DocMax","MN:DocMax"$() to adjust the size of the cmd line buf. It counts $LK,"CDoc","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","MN:CTask"$, $LK,"CDocEntry","MN:CDocEntry"$ and $LK,"CDirEntry","MN:CDirEntry"$ have them. You shouldn't encounter conflicts with SparrowOS using them.
* You can reduce mem usage by making a smaller disk cache when you recompile the kernel; disabling $FG,2$WORDSTAT$FG$; Specifying smaller stk sizes when doing $LK,"Spawn","MN:Spawn"$(), changing $LK,"DFT_STK","MN:DFT_STK"$, and using $LK,"DocMax","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","MN:Move"$()ing them to a filename not ending in "$FG,2$.Z$FG$". See $LK,"::/SparrowOS/Doc/TSZ.TXT.Z","FI:::/SparrowOS/Doc/TSZ.TXT.Z"$ if you want to uncompress while in $FG,2$WINDOWS$FG$.
* $LK,"MergeChk","MN:MergeChk"$() 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","MN:LinkChk"$() which will check for broken links in documentation.
* You can use $LK,"OptOn","MN:OptOn"$($LK,"OPTf_WARN_PAREN","MN:OPTf_WARN_PAREN"$) to find unnecessary parentheses in code.
* You can use $LK,"OptOn","MN:OptOn"$($LK,"OPTf_WARN_DUP_TYPES","MN:OPTf_WARN_DUP_TYPES"$) to find unnecessary local var type statements.
* $LK,"OptEqu","MN:OptEqu"$($LK,"OPTf_ECHO","MN:OPTf_ECHO"$,ON) can be placed in $LK,"Adam1.CPP.Z","FI:::/SparrowOS/OSMain/Adam1.CPP.Z"$ to echo start-up scripts.
* Use $LK,"Plain","MN:Plain"$() to edit a plain text file. You'll need this if your file has $FG,2$$$$FG$'s. Use the $LK,"::/SparrowOS/Misc/Dollar.CPP.Z","FI:::/SparrowOS/Misc/Dollar.CPP.Z"$ utility to strip dollar signs in text files.
* Use $LK,"Silent","MN:Silent"$() to disable screen text output.
* Use $LK,"IOSnd","MN:IOSnd"$() to disable noise from disk access.
* Grab-scroll any window at any time with $FG,2${CTRL-LEFT-DRAG}$FG$. Null grab-scrolling with $FG,2${CTRL-RIGHT}$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","MN:gr_continuous_scroll"$ 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 screen.
* Use $FG,2$<CTRL-ALT-A>$FG$ to enter an extended ASCII char.
* There are handy functions--$FG,2$F(),R(),FD()$FG$ and $FG,2$RD()$FG$ which are defined in $LK,"HOME/Adam3eWrappers.CPP.Z","FI:HOME/Adam3eWrappers.CPP.Z"$. You're encouraged to change them, since they're in acct files. 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$+lf$FG$ and $FG,2$+lb$FG$ flags limit to whole labels, just front or back. You are encouraged to add or modify handy wrapper functions to make cmd line operations easier.
* When using $LK,"Grep","MN:Grep"$() 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 {","FF:::/SparrowOS/OSMain/OSEnd.CPP.Z,#exe {"$.
* If you output to the cmd line and wish to allow users to scroll around and view data, you can use $LK,"View","MN:View"$().
* Use $LK+S,"View","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,"ws_cur_word","MN:ws_cur_word"$, but you should probably turn-off preemption or interrupts momentarily to copy it.
* You can reactivate $FG,2$WORDSTAT$FG$ after closing it by pressing $FG,2$CTRL-FUN KEY$FG$.
* If you use consistent var names for items of different classes, you'll usually be able to use $FG,2$WORDSTAT$FG$'s autocomplete for member vars. I always use $FG,2$lx$FG$ for $LK,"CLex","MN:CLex"$ ptrs; $FG,2$doc$FG$ for $LK,"CDoc","MN:CDoc"$ ptrs; $FG,2$doc_e$FG$ or $FG,2$doc_ce$FG$ for $LK,"CDocEntry","MN:CDocEntry"$ ptrs, etc.
* $LK,"Preempt","MN:Preempt"$() is used to keep a task from being interrupted and swapped-out. It has a similar effect to turning-off interrupts. Each task has it's own preemption ctrl. A task with preemption turned-off can voluntarily $LK,"Yield","MN:Yield"$() with preemption off.
* You can set a color for different drives with $LK,"SetDrvTextAttr","MN:SetDrvTextAttr"$(). Place calls to this in $LK,"HOME/Adam3aLocalize.CPP.Z","FI:HOME/Adam3aLocalize.CPP.Z"$.
* $FG,2$<CTRL-SHIFT-T>$FG$ to toggle to/from plain text just the $LK,"CDoc","MN:CDoc"$ cmd under the cursor. See $LK,"::/SparrowOS/Demo/Doc/TextDemo.CPP.Z","FI:::/SparrowOS/Demo/Doc/TextDemo.CPP.Z"$.
* 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>",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","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 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","MN:GrFloodFill"$() is slow. $LK,"GrRect","MN:GrRect"$() is fast.
* You can customize the $FG,2$wallpaper$FG$. See $LK,"::/SparrowOS/Demo/Graphics/MyWallPaper.CPP.Z","FI:::/SparrowOS/Demo/Graphics/MyWallPaper.CPP.Z"$.
* You can adjust the screen refresh rate (software). It is automatically adjusted based on load. The range is $LK,"win_min_refresh","MN:win_min_refresh"$ - $FG,4$Fs->win_max_refresh$FG$.
* 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-register.
* Using a sub-int array, $FG,2$i.u8[3]$FG$, for example, will force a var non-register.
* You can delete the $FG,4$HOME/Registry.CPP.Z$FG$ file. The policy is that deleting it will restore defaults. It should plain text, if you want to edit it. Be careful of tree indentations.
* Study $LK,"::/SparrowOS/Adam/MemRep.CPP.Z","FI:::/SparrowOS/Adam/MemRep.CPP.Z"$ and $LK,"WallPaper","MN:WallPaper"$() to learn how the system resources are put together.
* The editor's select-text mechanism allows for disjoint portions of selected text. This is a feature, not a bug -- you can cut-and-paste disjoint text.
* $LK,"time_stamp_freq","MN:time_stamp_freq"$ is continuously calibrated, so be careful because expressions involving it might decrease. Take a snap-shot, like this: $FG,2$timeout=$LK,"GetTimeStamp","MN:GetTimeStamp"$+$LK,"time_stamp_freq","MN:time_stamp_freq"$ x seconds;$FG$ and compare against $LK,"GetTimeStamp","MN:GetTimeStamp"$().
* Use $LK,"HeapLog","MN:HeapLog"$() and $LK,"HeapLogRep","MN:HeapLogRep"$() to find leaks. Don't be confused by $LK,"CDoc","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","MN:_CFG_HEAP_DBG"$. You're on your own.
* You can use $LK,"Type","MN:Type"$() to display $FG,2$.BMP$FG$ or $FG,2$.GRA$FG$ files.
+14
View File
@@ -0,0 +1,14 @@
$WW,1$$LK,"CDC","MN:CDC"$'s have a 4x4 matrix for rotating, scaling, skewing and shifting in 3 dimensions. To make the graphics routines respond to the transformation, you must set the $LK,"DCF_TRANSFORMATION","MN:DCF_TRANSFORMATION"$ flag.
The matrix consists of integers that have been scaled 32 bits ($LK,"gr_scale","MN:gr_scale"$). See $LK,"::/SparrowOS/Demo/Lectures/FixedPoint.CPP.Z","FI:::/SparrowOS/Demo/Lectures/FixedPoint.CPP.Z"$ to learn why.
See $LK,"GrRotX","MN:GrRotX"$(), $LK,"GrRotY","MN:GrRotY"$(), $LK,"GrRotZ","MN:GrRotZ"$(), $LK,"GrScaleMat","MN:GrScaleMat"$(), $LK,"GrRotXEqu","MN:GrRotXEqu"$(), $LK,"GrRotYEqu","MN:GrRotYEqu"$(), $LK,"GrRotZEqu","MN:GrRotZEqu"$() and $LK,"GrScaleMatEqu","MN:GrScaleMatEqu"$() to rotate about axes and scale. Combine them with $LK,"GrMulMat","MN:GrMulMat"$() and assign them to the $LK,"CDC","MN:CDC"$.$FG,2$dc$FG$ with $LK,"GrSetRotMat","MN:GrSetRotMat"$(). See $LK,"::/SparrowOS/Demo/Graphics/Box.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Box.CPP.Z"$.
You can rotate single points using $LK,"GrRot","MN:GrRot"$().
The 4th dimension allows a neat trick where you can place pos shifts (translations), into the matrix and $LK,"GrMulMat","MN:GrMulMat"$ them to combine rotation/shift operations. Normally, you can't combine pos shift operations. See $LK,"GrSetTranslation","MN:GrSetTranslation"$() and $LK,"::/SparrowOS/Demo/Graphics/Transform.CPP.Z","FI:::/SparrowOS/Demo/Graphics/Transform.CPP.Z"$.
Finally, $LK,"CDC","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","MN:CDC"$'s $FG,2$transform()$FG$ member. The default $FG,2$transfrom()$FG$ callback is $LK,"GrTransform","MN:GrTransform"$(). See $LK,"::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/EagleDive.CPP.Z"$ or $LK,"::/SparrowOS/Demo/GameStarters/FPS.CPP.Z","FI:::/SparrowOS/Demo/GameStarters/FPS.CPP.Z"$ to see how to change the $FG,2$transfrom()$FG$ callback for foreshortening.
+20
View File
@@ -0,0 +1,20 @@
$WW,1$$FG,5$$TX+CX,"Trivial Solutions"$$FG$
The $FG,2$$TX+HTML,"trivial solution","http://en.wikipedia.org/wiki/Trivial_solution"$$FG$ in math is the simple, obvious answer. The fable that NASA spent millions on a space pen while Russia used a pencil is another example. SparrowOS uses many $LK,"trivial solutions","FI:::/SparrowOS/Doc/Strategy.TXT.Z"$.
See $LK,"::/SparrowOS/Doc/Acknowledgements.TXT.Z","FI:::/SparrowOS/Doc/Acknowledgements.TXT.Z"$.
$FG,2$Website:$FG$
$TX+HTML,"www.sparrowos.com","http://www.sparrowos.com"$
$FG,2$Owner/President:$FG$
Terry A. Davis
$TX+HTML,"ASU Transcripts","http://www.sparrowos.com/files/ASU_Transcripts.pdf"$
8144 Sickle Lane
Las Vegas, NV 89128
(702)254-4223
$TX+HTML,"tdavis@sparrowos.com","mailto:tdavis@sparrowos.com"$
$FG,2$About Me:$FG$
I was a National Merit Scholar with a 1440 SAT at Arizona State University. Here are my $TX+HTML,"ASU Transcripts","http://www.sparrowos.com/files/ASU_Transcripts.pdf"$. 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. I worked for a company named Xytec Corp. 1997-1999. We made FPGA-based image processing equipment. I wrote $FG,2$$TX+HTML,"SimStructure","http://www.sparrowos.com/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.
+8
View File
@@ -0,0 +1,8 @@
$WW,1$$FG,5$$TX+CX,"Upgrading SparrowOS"$$FG$
To upgrade, you generally boot the new SparrowOS CD/DVD, install on top of your partition, modify your files and set it to boot your account by executing $LK,"InstallBoot","MN:InstallBoot"$(). Often, your code will have to be modified to work with the new version. See $LK,"ChangeLog","FI:::/SparrowOS/Doc/ChangeLog.TXT.Z"$. You might have to boot an alternate partition or the CD and modify your code until it boots okay.
The $FG,2$INSTALL$FG$ option when you boot a CD will install on top of an existing install if you tell it not to delete the $FG,2$/SparrowOS$FG$ directory.
See the $LK,"Installing","FI:::/SparrowOS/Doc/Install.TXT.Z"$ documentation.
+67
View File
@@ -0,0 +1,67 @@
$WW,1$$FG,5$$TX+CX,"Welcome to SparrowOS"$$FG$
$LK,"Trivial Solutions","FI:::/SparrowOS/Doc/TrivialSolutions.TXT.Z"$'s SparrowOS is a x86_64, multi-cored, multi-tasking, ring-0-only, single-address_mapped (identity), operating system for recreational programming:
$ID,2$* Professional hobby projects
* Teenager projects
* Non-professional, older-person projects
$ID,-2$
Simplicity is a goal to $LK,"keep the line count down","FI:::/SparrowOS/Doc/Strategy.TXT.Z"$, 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+D,"134,203","DD_SPARROWOS_LOC"$ lines of code including the kernel, the 64-bit compiler, the graphics library and all the tools. More importantly, it's designed to keep the user's line count down -- you can do a "hello world" application in one line of code and can put graphics on the screen with a three line program!
It's a kayak, not a Titanic -- it will crash if you do something wrong. You quickly reboot, however. DOS and the 8-bit home computers of the 80's worked fine without memory protection and most computers in the world -- the embedded ones -- operate without protection. The resulting simplicity of no protections is why SparrowOS has value. In facts, that's the point of SparrowOS. See the $LK,"SparrowOS Constitition","FI:::/SparrowOS/Doc/Constitution.TXT.Z"$.
Two things to know about SparrowOS are that $UL,1$tasks$UL,0$ have $LK,"MAlloc","MN:MAlloc"$/$LK,"Free","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.
In other operating systems, I hated learning one language for command line scripts and another for programming. With $FG,2$SparrowOS$FG$, the command line feeds right into the $FG,2$C+$FG$ (more than $FG,2$C$FG$, less than $FG,2$C++$FG$) compiler, line by line, and it places code into memory it $LK,"MAlloc","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 compiled before you have access to the command line. (Don't worry, booting takes only a couple 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,4$$TX+HTML,"x86_64","http://en.wikipedia.org/wiki/Amd64#AMD64"$$FG$ and nothing is "interpreted".
Statements at the global scope (outside the scope of $FG,2$C+$FG$ 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,4$Dir("*.*",FALSE);
$FG$So, I added default args from $FG,2$C++$FG$ and it looked like this:
>$FG,4$Dir();
$FG$I didn't like that, so I made parentheses optional on calls with no args and it, now, looks like this:
>$FG,4$Dir;$FG$
The syntax change created an ambiguity when specifying function addresses. 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 syntax, I decided to change everything I didn't like. Here are the new $LK,"operator precedence","FA:::/SparrowOS/Doc/Differences.TXT.Z,OP_precedence"$ rules. See $LK,"Departures from C/C++","FI:::/SparrowOS/Doc/Differences.TXT.Z"$. It's Biblical! See $LK,"Luke,5:37","BF:Luke,5:37"$.
There are no object files in SparrowOS and, normally, you don't make executable files either, but you can. That's known as "$FG,2$static$FG$" compilation. Instead, you "$FG,2$just-in-time$FG$" compile.
Tasks have no priority scheme 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","FL:::/SparrowOS/OSMain/Scheduler.CPP.Z,1"$. Polling keeps it simple. It's 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. See $LK,"SparrowOS MultiTasking","FI:::/SparrowOS/Doc/MultiTasking.TXT.Z"$.
The SparrowOS native file system is simple, so I don't get sued. There is an allocation bitmap for clusters and all files are stored contiguously. You can't grow files. It's geared toward reading and writing whole files. Since whole files are processed, checksums and compression are possible. Filenames ending in $FG,2$'Z'$FG$ are automatically compressed or uncompressed when stored or fetched. SparrowOS supports direct block random access into files, however -- $LK,"FRBlks","MN:FRBlks"$() and $LK,"FWBlks","MN:FWBlks"$(). There is no $FG,2$PATH$FG$, but parent directories are searched when a file is not found. This feature is used for default account files. Note: the $FG,2$FAT32$FG$ filesystem is supported, which makes exchanging files with a dual booted other operating system easy. If you don't have a $FG,2$FAT32$FG$ partition, you can use the $LK,"TSZ","FI:::/SparrowOS/Doc/TSZ.TXT.Z"$ program to transfer files to your primary operating system's partition.
It's fun being able to turn-off interrupts with $LK,"Cli","MN:Cli"$() $FG$and on with $LK,"Sti","MN:Sti"$(). $FG,2$SparrowOS$FG$ runs all programs in kernel mode, ring 0, so no instructions are off-limits. Turning-off and on preemption with $LK,"Preempt","MN:Preempt"$() is a less drastic measure that is usually sufficient. A newly $LK,"Spawn","MN:Spawn"$()ed task begins with preemption off.
The graphic resolution is poor, $FG,2$640x480 16 color$FG$, but that's all I feel comfortable with without GPU acceleration supported. A $FG,2$1600x1200x24$FG$ bit screen 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.
SparrowOS is for hobbyist programmers on single user (at a time) home computers, not mainframes or servers, but it is preemptive multitasking. 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 SparrowOS does master/slave multiprocessing. The anticipated use for multicore is primarily putting graphics on the screen. Hardware graphics acceleration is not used, so this is possible. See $LK,"SparrowOS MultiCore","FI:::/SparrowOS/Doc/MultiCore.TXT.Z"$.
There is no distinction between the terms "task", "process" or "thread". All have a task record, $LK,"CTask","MN:CTask"$(), pointed to by the $FG,2$FS$FG$ segment register and are accessed with $FG,4$Fs->$FG$ while $FG,4$Gs->$FG$ points to a $LK,"CCPU","MN:CCPU"$ for the current CPU core. Each task can have just one window, but a task can have children with windows. (The segment registers are just used as extra registers -- there is nothing segmented about SparrowOS' memory.)
In SparrowOS, "$FG,2$Adam$FG$" refers to a task that is 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 allocate 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 "root" task and even had a "$FG,2$/SparrowOS/Root$FG$" directory ;-) $FG,2$Adam$FG$ executes $LK,"::/SparrowOS/OSMain/Adam1.CPP.Z","FI:::/SparrowOS/OSMain/Adam1.CPP.Z"$ at boot time.
For easy back-ups, place everything you author in your $FG,2$HOME$FG$ directory and subdirectories. Then, use $LK,"CopyTree","MN:CopyTree"$(). That should make upgrading easy, too. To make an account use $LK,"MkDir","MN:MkDir"$() to create a directory under $FG,2$/SparrowOS/Accts$FG$. It will be $FG,2$HOME$FG$ if you boot to it. Recompile with $LK,"InstallBoot","MN:InstallBoot"$() and make it boot your acct. Customizable start-up scripts go in your $FG,2$HOME$FG$ directory. The default start-up scripts are in $FG,2$/SparrowOS/Accts$FG$, the parent of all accounts. Copy the start-up files you wish to customize into $FG,2$HOME$FG$ and modify them. See $LK,"Acct Files","FF:::/SparrowOS/Doc/GuideLines.TXT.Z,ACCT FILES"$.
Typically, your usage pattern through the day will be repeatedly left or right clicking on filenames in a cmd line $LK,"Dir","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","MN:Ed"$(""); and supply 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","MN:Dir"$() cmd, periodically, so make a macro on your personal menu. Access your personal menu by pressing $FG,2$<CTRL-M>$FG$, cursoring until you are on top of it and pressing $FG,2$<SPACE BAR>$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 nongraphic widget. $FG,2$<CTRL-R>$FG$ inserts a graphic resource or edits the graphic under the cursor.
$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-ALT-E>$FG$ creates a new terminal window. $FG,2$<CTRL-ALT-X>$FG$ kills a window. You'll do these periodically.
$LK,"Grep","MN:Grep"$() is your best friend. There's a wrapper function called $LK,"F","MN:F"$() in your $FG,2$HOME/Adam3eWrappers.CPP.Z$FG$ file. Feel free to make wrapper functions for functions you use often and customize the args. By the way, $LK,"Grep","MN:Grep"$() or $LK,"R","MN:R"$() can be used to replace strings across multiple files. You can access $LK,"Grep","MN:Grep"$() using $FG,2$<CTRL-SHIFT-F>$FG$.
As you browse code, use the $FG,2$WordStat$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","FI:::/SparrowOS/Doc/HelpIndex.TXT.Z"$ or $LK,"Demo Index","FI:::/SparrowOS/Doc/DemoIndex.TXT.Z"$ 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$/SparrowOS/Demo$FG$ or $FG,2$/SparrowOS/Apps$FG$ directories for inspiration.
$MA+A-X+PU,"Take Tour","SpawnUser(\"Cd(\\\"::/SparrowOS/Misc/Tour\\\");;AutoFile(\\\"Tour\\\");\n\");"$
+8
View File
@@ -0,0 +1,8 @@
$FG,2$$WW,1$WordStat$FG$ collects statistics from all text files in subdirectories when you call $LK,"WSInit","MN:WSInit"$(). It counts which words follow which other words with what frequency in a big sparse matrix.
It provides auto-complete typing and jump-to-code or jump-to-dictionary_definition functionality.
Tip: If you use consistent var names for items of different classes, you'll usually be able to autocomplete the member vars. I always use $FG,2$lx$FG$ for $LK,"CLex","MN:CLex"$ ptrs; $FG,2$doc$FG$ for $LK,"CDoc","MN:CDoc"$ ptrs; $FG,2$doc_e$FG$ or $FG,2$doc_ce$FG$ for $LK,"CDocEntry","MN:CDocEntry"$ ptrs, etc.
If you have the raw Project Gutenberg dictionary file, you can generate the SparrowOS processed dictionary files with the stand-alone program $LK,"::/SparrowOS/Adam/WordStat/WSDictGen.CPP.Z","FI:::/SparrowOS/Adam/WordStat/WSDictGen.CPP.Z"$.