1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-30 20:08:06 +11:00
collapseos/recipes/ti84
Virgil Dupras 019d05f64c Make the shell a userspace app
That's my mega-commit you've all been waiting for.

The code for the shell share more routines with userspace apps than with kernel
units, because, well, its behavior is that of a userspace app, not a device
driver.

This created a weird situation with libraries and jump tables. Some routine
belonging to the `kernel/` directory felt weird there.

And then comes `apps/basic`, which will likely share even more code with the
shell. I was seeing myself creating huge jump tables to reuse code from the
shell. It didn't feel right.

Moreover, we'll probably want basic-like apps to optionnally replace the shell.

So here I am with this huge change in the project structure. I didn't test all
recipes on hardware yet, I will do later. I might have broken some...

But now, the structure feels better and the line between what belongs to
`kernel` and what belongs to `apps` feels clearer.
2019-11-15 15:37:49 -05:00
..
keys recipes/ti84: add upload instructions 2019-11-07 13:42:40 -05:00
glue.asm Make the shell a userspace app 2019-11-15 15:37:49 -05:00
Makefile Make the shell a userspace app 2019-11-15 15:37:49 -05:00
README.md recipes/ti84: TI-84+ base recipe is complete! 2019-11-12 20:32:56 -05:00
user.h Make the shell a userspace app 2019-11-15 15:37:49 -05:00

TI-84+

The TI-84+ is a machine with many advantages, one being that it's very popular. It also has a lot of flash memory and RAM.

Its builtin keyboard and screen, however, are hard to use, especially the screen. With a tiny font, the best we can get is a 24x10 console.

There is, however, a built-in USB controller that might prove very handy.

Recipe

This recipe gets the Collapse OS shell to run on the TI-84+, using its LCD screen as output and its builtin keyboard as input.

Gathering parts

  • zasm
  • A TI-84+ (TI-83+ compatibility is being worked on. See issue #41)
  • A USB cable
  • tilp
  • mktiupgrade
  • Optional: z80e to emulate

Build the ROM

Running make will result in os.rom being created.

Emulate through z80e

KnightOS has a handy emulator, z80e for TI calculators and it also emulates the screen. It is recommended to use this tool.

Once z80e is installed (build it with SDL support) and os.rom is created, you can run the emulator with:

z80e-sdl -d TI84p --no-rom-check os.rom

You will start with a blank screen, it's normal, you haven't pressed the "ON" key yet. This key is mapped to F12 in the emulator. Once you press it, the Collapse OS prompt will appear.

See z80e's KEYBINDINGS.md file for details.

Upload to the calculator

WARNING: the instructions below will wipe all the contents of your calculator, including TI-OS.

To send your ROM to the calculator, you'll need two more tools: mktiupgrade and tilp.

Once you have them, you need to place your calculator in "bootloader mode", that is, in a mode where it's ready to receive a new binary from its USB cable. To do that you need to:

  1. Shut down the calculator by removing one of the battery.
  2. Hold the DEL key
  3. But the battery back.
  4. A "Waiting... Please install operating system now" message will appear.

Once this is done, you can plug the USB cable in your computer and run make send. This will create an "upgrade file" with mktiupgrade and then push that upgrade file with tilp. tilp will prompt you at some point. Press "1" to continue.

When this is done, you can press the ON button to see Collapse OS' prompt!

Usage

The shell works like a normal shell, but with very tight screen space.

When pressing a "normal" key, it spits the symbol associated to it depending on the current mode. In normal mode, it spits the digit/symbol. In Alpha mode, it spits the letter. In Alpha+2nd, it spits the uppercase letter.

Special keys are Alpha and 2nd. Pressing them toggles the associated mode. Alpha and 2nd mode don't persist for more than one character. After the character is spit, mode reset to normal.

Pressing 2nd then Alpha will toggle the A-Lock mode, which is a persistent mode. The A-Lock mode makes Alpha enabled all the time. While A-Lock mode is enabled, you have to enable Alpha to spit a digit/symbol.

Simultaneous keypresses have undefined behavior. One of the keys will be registered as pressed. Mode key don't work by simultaneously pressing them with a "normal" key. The presses must be sequential.

Keys that aren't a digit, a letter, a symbol that is part of 7-bit ASCII or one of the two mode key have no effect.