EtchedPixels / FUZIX

FuzixOS: Because Small Is Beautiful
Other
2.15k stars 270 forks source link

msx2: make disk image bootable #1001

Closed balyuf closed 1 year ago

balyuf commented 1 year ago

MSX2 disk image is now bootable (hence no bootrom needed anymore) - that is if used with MegaFlash without romdisk, as I haven't found a key combination which disables booting from romdisk, except in the recovery mode (key up during boot) F3 which erases the romdisk (a bit drastic) ...

Would you consider publishing this MSX2 bootable diskimage on fuzix.org?

balyuf commented 1 year ago

There was a comment here about using Sunrise IDE in MSX2 ... I was thinking about that too, but it is more than just fiddling with the Makefile, as it also entails copying over some files from MSX1 and adapting them to the MSX2 platform structure, I am looking into it, but not sure yet if the adaptations will be trivial. Maybe Alan can comment? In the meantime we can perhaps merge in the bootable disk first and then I can create a new pull request for the Sunrise IDE (if feasible at all), as it may include changes to the diskimage creation (I seem to remember that disk images are not always interchangeable between the various disk technologies) ...

EtchedPixels commented 1 year ago

Thanks.

For images and stuff I'm trying to get everything stable for a 0.4 release soon, and since it's in the Images for that platform it should end up in the MSX2 release.

I'll take a look at the SunRise if I get time - the drivers for most platforms share nicely but MSX is problematic because of the use of MMIO.

balyuf commented 1 year ago

Thanks, looking into importing Sunrise IDE in MSX2, it seems the slot mapping and device tabulation stuff is not compatible, trying to understand the differences now ...

balyuf commented 1 year ago

Update: I've got the Sunrise IDE almost figured out, but discovered a big bummer: I cannot include both megasd and sunrise ide for then the kernel tips over the 48k boundary! :-( I didn't realize that we were so close ... and I was even dreaming of adding floppy and cassette drivers ... ;-) Is there any way to squeeze out a bit more, or are we waiting for the magic goal of a bankable kernel?

EtchedPixels commented 1 year ago

Bankable kernel with the MSX2 mapper isn't really magical - it's probably not too hard beyond the extra complexity of the horrible MSX1 legacy MMIO mapping. The rc2014 kernel is banked and is fairly similar in mapping capabilities (any 16K page in any 16K address bank).

There are a few other things that will make space in future like moving to loadable modules for some stuff, switching to tinydisk/tinysd (not yet doable for multi-sd devices) and there are some things that probably would work now.

One is to turn on the rst peepholes and add a bit of code to set the vectors in the low memory of the kernel. See commit cfac1788a5e1416c0c4ccd655826d34e0fb5c4f7. That can be worth about 1K.

Another is to either load the font in the bootloader or just grab the font from the VDP and put it where it is needed (assuming the location is predictable or defined).

balyuf commented 1 year ago

Thanks for the tips ... the rst peephole optimization indeed gives a code size just 95 bytes below 48k! Struggling now to get the vectors right, some interrupt madness apparently ... The good news is also that I have the Sunrise IDE working in MSX2, and it's blazingly fast in Turbo GT ... So I should get things stable in time for 0.4 ...