CoolFace
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes838downloads
Strategy.txt109 linesDownload Raw Back to Doc
1 2                        Decisions Making TempleOS Simple3 4Everybody is obsessed, Jedi mind-tricked, by the notion that when you scale-up,5it doesn't get bad, it gets worse.  They automatically think things are going to6get bigger.  Guess what happens when you scale down?  It doesn't get good, it7gets better!8 9I limited it to 100,000 lines of code, forever!  I never need a linker or make10utility and I can use small labels.11 12People mock Bill Gates for, "640K should be enough."  I say, "2Gig for code13should be enough."  The same people who mock Bill Gates are probably just like14the black woman who sued for a trillion dollars.15 16My Dad worked on converting the Titan missile to the Gemini Mission rocket.  It17had to be "man-rated".  You can bet that everything got an order of magnitude18more complexity and documentation.  My vision is a souped-up C64, not a 1970's19mainframe; a kayak, not a Titanic.20 21Linux is a semi-tractor -- you need professional drivers for 20 gears.  Linux22has file permissions.  Common people are hurt by file permissions.23 24Windows is a car.25 26TempleOS is a motorcycle -- if you lean-over too far, a motorcycle will crash.27Don't do that!  There are no side air bags on a motorcycle.  DOS and C64 had no28memory protections and ran in ring-0, with no security.  This saves an order of29magnitude complexity.30 31Linux and Windows are general purpose operating systems.  They attempt to do any32task you want.  TempleOS cherry-picks tasks and is designed to do the same33things a C64 did.  This saves and order of magnitude complexity.  For example,34the RedSea file system allocates just contiguous files -- you load and save35whole files at once.  A benefit is this allows compression.  Also, TempleOS does36not do networking or multimedia.  In theory, memory will fragment with lots of37big files.  The system would fall to pieces with multimedia, but God said38640x480 16 color is a permanent covenant like circumcision.39 40A three bttn mouse is like a leg you cannot put weight on.  TempleOS just does41hardware everybody has, with no divergent code bases for each machine's custom42hardware.  There is one graphics driver instead of 50 for different GPUs.  This43saves an order of magnitude complexity and makes for a delightful API, so44developer's code is not like a frayed rope end.45 46 47 48* Everything runs in kernel, ring 0, mode.49 50* One memory map for all tasks on all cores with virtual addresses set equ to51physical, just as though paging is not used.52 53* One platform -- x86_64 PC's, no 32-bit support.54 55* No security or cryptography.56 57* No networking.58 59* Least (greatest) common denominator hardware support.  Mostly, one driver for60each device class.  I can't be in the business of different drivers.61Compatibility is the greatest challenge for PC operating systems.  Disk code62does not use interrupts, avoiding compatibility risks.  PS/2 keyboard/mouse is63used instead of USB, also more compatible.64 65* 640x480 16 colors.  Updates whole scrn at 30 fps, optimized for full scrn66games where InvalidRectangles are counter-productive.67 68* One font, 8x8.  Text and graphic layers done in software with text normally on69an 8x8 grid.  It can run in Text mode if graphic initialization fails.70 71* Compiler extends all values to 64-bit when fetched and does only 64-bit72computations intermediately.  Assembler has minimal 16-bit support, good enough73for compiling boot loaders.74 75* No object files.  Use JIT.76 77* Whole files are processed almost exclusively, allowing compression.78 79* One language and compiler for command-line, scripts, songs, automations and80code.81 82* One editor/word processor/browser for the command-line window, source code,83documentation browser, dialog forms.84 85* No child windows.  One window per task.  Bttns are widgets, not child windows.86 There are child tasks, however.87 88* No distinction between thread, process or task.89 90* The Scheduler is for home systems.  It is not preemptiove.  Disk requests are91not broken-up, so sharing is bad.  It's wonderfully simple.92 93* MultiCore is done master/slave, instead of SMP.  Core0 applications explicitly94assigns jobs.  Locks are present allowing multicore file, heap, and hardware95access, though.96 97* Sound has single-voice 8-bit signed MIDI-like samples.98 99* All tasks have a heap and a sym table.  Scope is that of environment vars in100other operating systems.  As text is typed at the command line or you run101programs by #includeing them, the syms go in the table.  If a sym is not found,102the parent task's table is checked.  The father of all tasks has the API syms103you'll need waiting in it's table.  No need to #include headers.104 105* No need for namespaces -- scoping occurs automatically based on task symbol106table hierarchy with the Adam Task's symbol system-wide global.107 108* Sometimes, I cut corners in the interest of keeping the code beautiful.109