The bootstrap loader. This is the part of the OS that is originally on the calculator. It will be a TI-OS variable that will be called by s custom menu item, similar to the way all shells before it were started. This begins a process which loads the rest of the OS off the e2, including the Kernal, System Drivers, and SubSystems. The bootstrap loader also sets up the initial memory layout, assigning all the free memory to Arena 0. Then, it allocates room for the OS sytem code, whcih then creates the sencond arena after the code, for the rest of the free RAM. See the diagrams here and the big jpegs on the site for further info. (1) When running TI-OS +------------+ Top of user RAM |Bootstrap | TI-OS var for the bootstrap loader. +------------+ |Other TI-OS | vars +------------+ Top of FREE RAM (where next diagram begins) |FREEEEEEEEEE| |" | |" | +------------+ End of free user RAM (where following diagrams end) |VAT | VAT cannot be used during OS operation. emulated. +------------+ | stack | +------------+ | VIDEO RAM | +------------+ end of RAM (2) When the bootstrap loader is executed and it creats the arena layout +-------------+ Top of FREE RAM (Assigned Arena:0, size:all |FREEEEEEEEEEE| Free mem) |" | |" | +-------------+ End of arena 0 (3) bootstrap allocates an arena for the OS kernal code +-------------+ Arena 0 | | For the OS kernal code. arena0, size:sizeofcode +-------------+ Arena 1 size, rest of free ram | FREEEEEEEEEE| +-------------+ end of arena 0 (4) Code loads from e2 into the arena0 +-------------+arena0 |kernal | +-------------+arena1 |FREEEEEEEEEEE| +-------------+ (5) then allocates and loads the shell code +-------------+arena0 |kernal | +-------------+arena1 |Shell code | +-------------+arena2 |FREEEEEEEEEEE| +-------------+ (6) the shell takes control and loads a GUI DLL for further operation +-------------+arena0 |kernal | +-------------+arena1 |Shell code | +-------------+arena2 |GUI DLL(lib) | +-------------+arena3 |FREEEEEEEEEEE| +-------------+ (7) then the user selects a program to run fromthe shell. the shell allocates the space for the program *and its relocations table!* +-------------+arena0 |kernal | +-------------+arena1 |Shell code | +-------------+arena2 |GUI DLL(lib) | +-------------+arena3 |PRogram code | +-------------+arena4 |Reloc table | +-------------+arena5 |FREEEEEEEEEeE| +-------------+ The advantages to having the reloc table allocated seperately are so that once the program has been relocated, the reloc table can be erased, freeing up ram since the reloc table might be big and compel to support the new OS (8) after the relocation takes place and the reloc arena deleted, the program gains control and executes. Then it may decide to allocate room for a data file from the e2, say a level or something. +-------------+arena0 |kernal | +-------------+arena1 |Shell code | +-------------+arena2 |GUI DLL(lib) | +-------------+arena3 |PRogram code | +-------------+arena4 |datafile area| +-------------+arena5 |FREEEEEEEEEeE| +-------------+ (9) the program decides to close the file, so it deallocates the arena then it exits. the shell regains control and checks the program's tsr flag. if it is no residency, the program is deallocated. otherwise, it is left alone. (10) the user chooses to leave the OS, quitting the shell. it deallocates the GUI lib first, then exits the kernal is deallocated and the sytem is cleaned up. all resident programs are taken off the interrupt list for the OS (??) first version? before the kernal exits finally, the mem map looks like this: +-------------+arena0 |kernal | +-------------+arena1 |FREEEEEEEEEeE| +-------------+ then, once everyhting is clean and ready for exit, the kernal quits back to the bootstrap, which deallocates the kernal space and exits back to TI-OS. (11) now the RAM looks like it did at stage (1) Note: This document got a littel past the bootstrap, but i hope it cleared up a lot of questions. Also, when the shell and gui were loaded, i didnt talk about there reloc tables being allocated or used at all, but they were, just like for the normal program. Any questions please ask!!! also, give comments and ideas.