Multitasking is working now - the graphics on the left and right are actually being produced by two separate programs!
Currently, this is cooperative multitasking (the programs are doing `swi $80` after each iteration), but all I have to do to make it preemptive is add a `jsr multitask` to the kernel's vblank ISR.
ok so turns out the two problems with multitasking were:
$00because Canid is big-endian
$00000000for new processes, which made Canid freak out
File operations are complete (for now)!
What's not implemented:
Not only that, but
fd_read will automatically find and move to the next data block until it fills the buffer you requested, rather than returning early. It should also do this when it hits CRFS's 48K limit and needs to traverse to the next file header, but I haven't tested that yet (and I probably won't, since I don't need files over 48K anytime soon).
no i'm dumb i just misread my debugging output
I JUST REALIZED HOW I CAN DO ADDRESS TRANSLATION AND THEREFORE MULTITASKING:
My assembler sets
lgdata on every instruction where the
data value is the address of a label, even if that address is <=
lgdata is set, Canid ignores the low byte of the instruction (where the 8-bit
data field would be stored), and reads the
data field from the next 4 bytes instead.
I can use that ignored byte to mark instructions that need their addresses translated!!
An unhinged liveblog of my thoughts as I program.
A Mastodon instance for users who like the study of programming languages, formal semantics, types, or linguistics.