System Partition details

Overview

In a recent Discord thread, there was some curiosity as to the contents of the System Partition (the 2nd partition made on the sd-card). Some users may have thought that it was possible to mount this on their pc’s and view the contents within (as is possible with the win32 partition), but this is not possible.

The gist of the contents of this system partition is roughly as follows:

  • Some header information describing the freeze slots and service slots that follow

  • Multiple freeze slots (usually 1024 sectors in size = 512KB each)

  • Multiple service slots

 

Exploring with mega65_ftp

Most end-users won't need to dive into the details of the system partition, and can just choose to see the partition as a black box that stores their freeze slots.

You probably only need to dive deeper when you're debugging things or improving upon what's there in some way.

If that’s the case for you, you may find mega65_ftp a useful tool to explore further into it.

  • Inside mega65_ftp, type the mbrinfo command and make a note of the system partition’s first sector

image-20240707-075744.png

We can inspect this sector (512 bytes) by typing sector 26921982:

image-20240707-075902.png

We can see this magic signature of MEGA65SYS00 located here and a few other bytes, but apart from that, mostly zero.

Header information

Details on the format were in "src/hyppo/syspart.asm". I’ve provided an example below where I’ve dissected the various fields.

Retrieving and Copying over freeze slots

The mega65_ftp tool has two commands relating to retrieving and restoring slots via mega65_ftp were:

  • putslot <slot> <source name> - upload a freeze slot.

  • getslot <slot> <destination name> - download a freeze slot.

Making use of them in this short example can give you a sense of how the freeze slots operate.

Let’s try to download slot 1 locally to our pc, then upload it to slot 10.

  • Having something interesting in slot 1 (in my case, the thumbnail shows the intro disk)

 

  • Via mega65_ftp, save slot 1 locally with:
    getslot 1 slot1.bin

  • Then let's try copy it to slot10, with:
    putslot 10 slot1.bin

  • Then browse in the freezer to slot 10, and hey presto!

On its own, probably not an incredibly exciting example, but the workflow could have some interesting applications. E.g., if a user is experiencing an issue with some software, and nobody else can seem to replicate it, then we could request for them to make a freeze slot, save it out locally, then pass the .bin file onto us devs, so we can put the freeze slot on our machines, unfreeze, and debug the issue.

Service Slots

Service Slots are an upcoming idea that @gardners had in mind to temporarily load in services into memory when occasions called for them, but they are still a work in progress.

In this snippet of a Discord thread, gardners shared more of his vision of how it was going to work:

gardners — 29/01/2022
I have been thinking about a mechanism for having "libraries" in other banks and able to be called conveniently with only a very small wedge in lowe memory.
Yes, the code is ugly. I freely admit this.
But until someone has lots of time on their hands, it largely works.
M3wP — 29/01/2022
Having dependency properties would be nice so that they are loaded when figurig out wht sort of tool it is
gardners — 29/01/2022
There is actually provision on the system partition for "services" which are really just libraries that would automatically do a lot of that.
M3wP — 29/01/2022
lovely
gardners — 29/01/2022
But I have never had the time and energy to attack finishing it.
You would have a D81 containing the library and some documentation and meta-data, and it would get installed in a "service slot" on the system partition.
M3wP — 29/01/2022
okay, I may have to look at it bevcause I'd like for the apps to be able to load libraries etc to save space
gardners — 29/01/2022
You would then use hypervisor calls to request functions from those libraries.
M3wP — 29/01/2022
hmmm
gardners — 29/01/2022
In that model, they would live externally to your program completely.
M3wP — 29/01/2022
I don't know, I just want to load modules ito memory
gardners — 29/01/2022
But one function can be "install your library into memory"
M3wP — 29/01/2022
okay
gardners — 29/01/2022
so that things that you want to call all the time are acceptably fast.
M3wP — 29/01/2022
hmm
gardners — 29/01/2022
The "out of memory" functions would enable things like "download the file at this URL" with only a few bytes occupied in your program's memory.
M3wP — 29/01/2022
I guess so...
gardners — 29/01/2022
But things like your widget library would probably get installed in a higher memory bank (possibly even in attic ram), and then the hook wedge installed somewhere in first 64KB, occupying 1 or 2 pages each.

gardners — 29/01/2022
I have been thinking about a mechanism for having "libraries" in other banks and able to be called conveniently with only a very small wedge in lowe memory.
Yes, the code is ugly. I freely admit this.
But until someone has lots of time on their hands, it largely works.
M3wP — 29/01/2022
Having dependency properties would be nice so that they are loaded when figurig out wht sort of tool it is
gardners — 29/01/2022
There is actually provision on the system partition for "services" which are really just libraries that would automatically do a lot of that.
M3wP — 29/01/2022
lovely
gardners — 29/01/2022
But I have never had the time and energy to attack finishing it.
You would have a D81 containing the library and some documentation and meta-data, and it would get installed in a "service slot" on the system partition.
M3wP — 29/01/2022
okay, I may have to look at it bevcause I'd like for the apps to be able to load libraries etc to save space
gardners — 29/01/2022
You would then use hypervisor calls to request functions from those libraries.
M3wP — 29/01/2022
hmmm
gardners — 29/01/2022
In that model, they would live externally to your program completely.
M3wP — 29/01/2022
I don't know, I just want to load modules ito memory
gardners — 29/01/2022
But one function can be "install your library into memory"
M3wP — 29/01/2022
okay
gardners — 29/01/2022
so that things that you want to call all the time are acceptably fast.
M3wP — 29/01/2022
hmm
gardners — 29/01/2022
The "out of memory" functions would enable things like "download the file at this URL" with only a few bytes occupied in your program's memory.
M3wP — 29/01/2022
I guess so...
gardners — 29/01/2022
But things like your widget library would probably get installed in a higher memory bank (possibly even in attic ram), and then the hook wedge installed somewhere in first 64KB, occupying 1 or 2 pages each.