fachat / GeckOS-V2

GeckOS version 2, a multi-tasking and multithreading operating system for the 6502
http://www.6502.org/users/andre/osa/index.html
GNU General Public License v2.0
230 stars 26 forks source link

GeckOS on Commander X16? #89

Open example-user30 opened 4 months ago

example-user30 commented 4 months ago

This is a great project. I am wondering if there has been any thought to port the OS to the Commander X16 which is Commodore like in build and operation?

fachat commented 4 months ago

This has been discussed in #66 already, but maybe I should split it out from the discussion about Mega65. So, here are my main comments on the X16:

Ok, I see there is support for the X16 port :-)

I've looked up the X16 memory map. Unfortunately, with its low memory without banking, and fixed ROM in the top 16k this is similar to the pet32k architecture. If you have to put all the GeckOS code into the low 39k there really is not much space left for the application itself.

[And the ROM needs to have a changeable interrupt vector so GeckOS can take over the interrupt, but I assume that is the case]

(For ref I looked it up here https://github.com/X16Community/x16-docs/blob/master/X16%20Reference%20-%2008%20-%20Memory%20Map.md and here https://www.c64-wiki.com/wiki/Commander_X16#Memory_and_Operating_System )

I wonder how much sense it actually makes.

On the other hand, it could be an option to put GeckOS into the X16 ROM. This could be feasible, with say the kernel, and lib in the banked system ROM and support programs in the banked RAM. [Is the X16 ROM in-circuit programmable?]

Nevertheless, zeropage is still shared, and stack needs to be copied to achieve reasonable numbers of tasks/processes to run.

Add. comment: some support programs (e.g. SD-card filesystem, USB) will need more than the 8kB that is available as banked memory. These need to be put in ROM I'd guess, but at least require interrupt routines to map back to kernel etc.

fachat commented 4 months ago

So, in summary, the X16 requires a sophisticated banking scheme to move the kernel, lib6502, and support tasks out of the way to maximize the amount of memory available for user tasks.