-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boot from SD card #107
Comments
This is a step towards booting from a memory card For now requires that the file fits in 512 bytes For example Hello.gt1
We've gotten CardTest.gcl as far that it can load and run BOOT.GT1 files, even if they span multiple clusters. The entire loader is 2.5K of vCPU code, and that includes functions that are not strictly needed (directory listing for example). We can strip down the core to about 1.5K. This 1.5K excludes the card setup code, because that's allowed to be overwritten. On a 64K system we can easily stow this in the upper pages. E.g. $fa00..$ffff. On 128K systems we can even hide it in a memory bank. On 32K systems it's more difficult to find a place that doesn't conflict with GT1 files that are already out there. So it would go into normally-visible screen memory. Still, some GT1 files load directly there as well: Contrib/tbraun-de/tools/shuttle.gt1 is an extreme example. Mind that the the older serial Loader region (page $59, $5a, $5b) is too small for an SDC/MMC loader (most of the work is done by the Arduino and some application-specific SYS functions there). But we must make an honest attempt that Tetronis, Bricks and Gigatris load ok from SDC/MMC. The best seems to be to use more screen memory than Loader, and only the first 160 bytes of each page, not protruding into the high 96 bytes. But doing that doesn't solve all issues: a very significant portion of the zero page is in use as well, stretching from $30 to above $c0. Even when we require 64K of RAM, this presents a conflict for many GT1 files out there and must be solved. Approach 1 Approach 2 Step 1. Load the entire GT1 file into memory, in one large continuous chunk. The thought is that step 2 hardly needs any code space and variables. It is essentially the same size as the ROM loader that SYS_Exec_88 places on the stack: less than 64 bytes. At first sight it appears that between the two steps, we need a large block move from low memory to high memory. But we can avoid that if we use the file size attribute to calculate the start address. The advantage of this approach is that we can do faster block transfers on the SPI interface, and complete CRC checking before unfolding. The disadvantage is that this mangles the display without restoration. So it isn't suitable for an interactive command prompt environment, if we want that as well. Approach 3 To be continued.... |
Regarding approach 3: We currently have 81 GCL variables in CardTest.gcl (162 bytes), of which 51 variables are function pointers for use by CALL.
So the introduction of CALLI can reduce the zero page pressure to 30 variables, or 60 bytes. We also need some stack space, so keeping the footprint constrained to $c0..$ff remains a challenge. And it doesn't allow Tetronis and Bricks to be loaded without altering those (as suggested in #41). If we can avoid modifying these programs, that is better. |
Suggesting to close this issue since CardBoot works now (devrom) |
Minimum plan to untether the Gigatron from Arduino/Babelfish and special laptop/PC software (sendFile.py).
Building on top of CardTest:
From here we can bootstrap a lot of new functionality: full filesystem support (R/W), applications, operating system, editors...
The text was updated successfully, but these errors were encountered: