Monarch Open ROM Description and FAQ

Discussion of the open source Monarch Open ROM.
neutrino
Posts: 182
Joined: Wed Oct 19, 2022 5:26 pm

Monarch Open ROM Description and FAQ

Post by neutrino »



On 10/21/2022 at 8:21 AM, TomXP411 said:




to design an operating system,



A fundamental design decision to take is if the operating system will be multi-tasking or single-task.


On 10/21/2022 at 8:21 AM, TomXP411 said:




then KERNAL/BASIC is already there.



The problem is that it's locked into a licensing scheme. A free "commodore Kernal+BasicV2" would enable C64 clones and emulators shipped ready to run.

TomXP411
Posts: 1785
Joined: Tue May 19, 2020 8:49 pm

Monarch Open ROM Description and FAQ

Post by TomXP411 »



On 10/20/2022 at 11:33 PM, neutrino said:




A fundamental design decision to take is if the operating system will be multi-tasking or single-task.



The problem is that it's locked into a licensing scheme. A free "commodore Kernal+BasicV2" would enable C64 clones and emulators shipped ready to run.



That's still not what Monarch is meant to be. If you are looking for an open source KERNAL, look at the MEGA 65 Open ROM project.

neutrino
Posts: 182
Joined: Wed Oct 19, 2022 5:26 pm

Monarch Open ROM Description and FAQ

Post by neutrino »


Is Monarch going to be multi-tasking or single-task?

kelli217
Posts: 532
Joined: Sun Jul 05, 2020 11:27 pm

Monarch Open ROM Description and FAQ

Post by kelli217 »


While projects like GeckOS and LUnix and TEOS and Contiki prove that context switching is possible even on a lowly 6502, I really don't think Tom is interested in reinventing *that* particular wheel.

CP/M, not MP/M.

User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: Monarch Open ROM Description and FAQ

Post by Daedalus »

I like the cut of this project's Jib.

These are my assumptions:
It's a BIOS, not really an "OS" in that it's specifically a bare minimum disk I/O system and the minimum support systems needed for a 65c02 platform, namely the Commander X16. It's specifically single tasking, with the ability to load and execute TSR programs.

So it needs:
BIOS routines for an SD card formatted with FAT32.
Mouse and keyboard input code, In the case of the X16, literally the same software implemented I2C that connects the PS/2 mouse and keyboard currently.
Joystick (SNES) would be nice, but that can be loaded in with user software... doesn't need to be in the BIOS.

Obviously, video is needed. Is it assumed that the VERA is the video by default? That makes this more specific to the X16 as nothing else is using the VERA that I'm aware of.

So, basically. the shell is an always resident application in ROM that can take over the VERA and display a shell display that can view directory listings, run programs from the SD card, then be reentered into when that program is done.

It seems to me the obvious model to use is the UNIX model, but massively simplified. The shell wouldn't have any ability to actually do anything but display a terminal screen and run one program at a time. All the commands it accesses are programs that it runs off the SD card from a "bin" directory, or directly from where the current directory is.

Is that about right?
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: Monarch Open ROM Description and FAQ

Post by Daedalus »

Ok.

So, I've been working on my own "take" on this project for a while now. I started by writing a command shell that ran on the x16 and used CBM_DOS (SETLFS, SETNAM, etc.) to implement Unix like commands and test the feasibility of having the commands run from disk like Unix does it. That was a test to see if a "light Unix-like command system" would work with the VERA's possible text output modes. Then I wrote a ROM test with nothing but a "Hello World" program in it to see how hard it is to implement a ROM that the emulator can use from the barest metal possible. Ok. That worked fine.

The next step was to make a ROM file that could be run by the emulator that has the bare minimum to access the SDcard using the non-cloanto code in the current ROMs. For that I needed the fat32 subsystem, the SDcard subsystem, and... well, that's it. I used virtually none of the "driver" code, as I wrote my own versions of that. I also wrote my own version of the interrupt management system, the "ROM bank farcall" hook system, and the BIOS call hooks that application programs would use.

All the code I used is clearly licensed as clause 2 or 3 BSD, and not licensed by cloanto. It will, of course, be fully attributed to it's proper authors.

I am in no way interested in making a clone of the x16. I'm simply using the x16 as an ideal development platform as it has all the elements I want, mainly the 65c02 cpu, an SDcard, and the VERA module. Not to mention the emulator, which is awesome for me.

My system is not code compatible with the x16. I would have liked it to have a "compatibility mode" so I could run x16 games on it, but that just doesn't work... The CBM_DOS call structure and the fat32 call structure are just too different. I went full fat32 on the file interface, and that allowed me to have simple macros that load or save files.

I don't have a problem with the name "Monarch" except that it connotes a connection to the x16 and the "butterfly" image in it's branding. As such, I chose a new name, "Light Unix-like Command Shell", which is shortened to the homophone acronym of "lux."

My ROM has 2 banks in it, Bank 0 is the BIOS bank, the one that runs the interrupt system and has all the application program interface points in it. Bank 1 holds the guts of the fat32 and SDcard interfaces. About half of RAM bank 0 is used for the data fat32 and the SDcard need, which is the same place the x16 puts that data. I don't think I even need 2 banks... it would all fit into 1. But I'm using 2 because more code will doubtlessly need to be added.

I expect to be adding this as a public project to my github shortly, so if anyone thinks I'm doing anything astoundingly stupid, now it the time to speak up.
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: Monarch Open ROM Description and FAQ

Post by Daedalus »

This is going quite well. If nothing else, I'll be an expert on fat32 before I'm done!

Of course I can't use "host file mode" in the emulator, only SDcard images will work due to the complete absence of the KERNAL cbdos flags.
lux 9-2-2023.png
lux 9-2-2023.png (46.94 KiB) Viewed 6593 times
User avatar
desertfish
Posts: 1098
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: Monarch Open ROM Description and FAQ

Post by desertfish »

This looks super nice, BUT I do think the only way to make it actually viable is if it can load and run existing programs.
(not BASIC, just the bare minimum to parse out the initial SYS instruction that calls the machine code program).
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: Monarch Open ROM Description and FAQ

Post by Daedalus »

Running the program would be trivial, but there is no CBM DOS to respond to "KERNAL calls" with. I considered a "minimum compatibility mode", but even that would have to handle all edge cases. I already made a version that operates under the x16's normal ROM and KERNAL, but that was never my "end goal."

Once this version is up and running and on my github, I'll probably use what I've learned and fix the other version to operate as a shell under the x16's KERNAL much like your DOS shell does.
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: Monarch Open ROM Description and FAQ

Post by Daedalus »

But thanks for saying it looks nice. I had to make a new 8x16 font to get the "look" I wanted. I understand the need for the 8x8 one in 1980, but in today's world, with VERA, we have other options.
Post Reply