/*
* HOME(PROJECTS) || RESUME || LINKS || ABOUT
*/

[viewing Newest] . . . |Older >>| . . . |Oldest|
(view all as one document)

Retrochallenge 2024: Cat-644 Microcomputer

The Cat-644 is a computer I've been developing around an Atmega 644 microcontroller. It has been a long running side project that I get out every once in a while to work on. I've decided to work on it some more for this round of the retrochallenge.

[viewing Newest] . . . |Older >>| . . . |Oldest|
(view all as one document)

October 14, 2024

We are about halfway through the retrochallenge. This is what I've managed to get done so far:

Boot Shell

When the computer starts up, a short C program runs after the hardware and drivers are initialized. This program displays a "@>" prompt, and accepts a few short commands. The motivation behind this was to be able to boot bytecode programs without having to reflash the AVR... previously the bytecode was copied from the ROM.

Working shell commands:

Syscalls

I added several syscalls reachable from the bytecode interpreter. The previous demo has only basic keyboard/screen terminal style syscalls: read1, write1, and ready, which are the equivalent of getc, putc and kbhit from C. These are the syscalls currently supported:

Character Device Syscalls: Operate on serial port, keyboard (readonly) and screen. The screen device, if asked to read, will read from the keyboard and forward them to the application. Programs that read/write from a character device work either the screen, or over the serial port.

Graphics Syscalls: These are implied direct to the video driver.

Memory Syscalls

The OS has several memory syscalls. On the surface, alloc and free look like classic malloc. However, progams should take advance of the handle api. An object that is not immediately needed can be "released." The OS is free to move released objects around... when the working set of memory exceeds internal SRAM, objects will be moved to external memory. Data structures like trees and lists are preferable on this OS... the tree can be much larger than the internal 4k SRAM, if the application uses handles for its next/prev and parent/child pointers. Applications should pass handles around until it actually needs to access the data. At any time, the program can call "hgrab" on a handle to get a real pointer to it. This may trigger a copy from XRAM. The pointer is valid until the object is released again. If the system it out of internal memory, and too many objects are grabbed at once, grab can fail. Programs should grab only what is needed, when its needed. There are some more calls I want to implement, mostly as optimization opportunties. For instance, if an object was grabbed and released without writing to it, there is no reason to copy it back to XRAM; there needs to be a read-only version of hgrab.

Disk Syscalls

In the last retrochallenge, I got a simple linked list tree filesystem partly running. This is not yet available to the bytecode interpreter. I need to add a directory API on top the the tree API, so that the root can contain a list of named subtrees. These, I suppose, would roughly be directories. Each subtree can then either be a named list of subtrees (I suppose subdirectories), or a program-specific tree structure. (Files)

What next?

I have enough syscalls to interact with the screen and keyboard, including sprites. Instead of diving into disk syscalls, I want to write a simple game. The best way to keep me motivated on a project is to get it actually doing something.

[viewing Newest] . . . |Older >>| . . . |Oldest|
(view all as one document)