Transfer Files to MSX, e.g. Update Files on VHD?

emuola
Posts: 91
Joined: Wed Dec 29, 2021 7:14 am
Been thanked: 2 times

Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by emuola »

Mister runs like a dream, but I realised that apparently it's at leat a bit different regarding updating the files for your MSX core, when compared to e.g. Amiga core or AO486, which both use MisterFS.

Is there any other way to add files to my MSX core's boot.vhd, other than update the boot.vhd on my Win10 computer and upload it again to the Mister?

akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by akeley »

For MSX 1 games you can try the unofficial core by Molekula: https://github.com/tdlabac/MSX1_MiSTer
It runs roms directly, you can also load tapes.

For MSX2 games the only way is to make your own vhds or update the one you have.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

emuola
Posts: 91
Joined: Wed Dec 29, 2021 7:14 am
Been thanked: 2 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by emuola »

akeley wrote: Sat Oct 01, 2022 1:52 pm For MSX 1 games you can try the unofficial core by Molekula: https://github.com/tdlabac/MSX1_MiSTer
It runs roms directly, you can also load tapes.

For MSX2 games the only way is to make your own vhds or update the one you have.
Ok, I'll update the VHD file 👍 Thanks for the help 👌
Yim
Posts: 126
Joined: Mon Jan 18, 2021 11:51 pm
Has thanked: 3 times
Been thanked: 87 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by Yim »

It’s been a while since I tried but I think I was able to mount VHDs stored on my MiSTer as drives on my Win10 PC through the network and change their contents that way, which was slightly more convenient than copying them over, making the changes, and copying them back.
Bad Toro
Posts: 1
Joined: Sat Oct 01, 2022 4:02 pm

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by Bad Toro »

I don't know if the MSX .vhd are the same like the AO486 .vhd files.

But if they are the same, i use this solution. Because the MiSTerFS does not work for me.

I create the vhd with this command on the linux shell:

cd /media/fat/games/AO486
dd if=/dev/zero of=DOS622.vhd bs=1M count=256

This commands create a 256 MB vhd.

And then i mount it in the MiSTers Linux Shell with the command:

mount -o loop,offset=32256 /media/fat/games/AO486/DOS622.vhd /mnt/

After that i use winscp to copy the files to /mnt

Then unmount the image with:

umount /mnt

Thats it ...!
User avatar
pgimeno
Top Contributor
Posts: 710
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 277 times
Been thanked: 226 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by pgimeno »

What Bad Toro said will work, with some changes. First, forget about how to create the image, that's not important here. The mount command is what is important. The problem is that the offset for the mount command can be different depending on how the VHD file was partitioned to start with.

To find out which offset, first run:

Code: Select all

fdisk -l /media/fat/games/MSX/boot.vhd
For me it outputs:

Code: Select all

Disk /media/fat/games/MSX/boot.vhd: 2 GiB, 2147484160 bytes, 4194305 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xebd96125

Device                         Boot Start     End Sectors Size Id Type
/media/fat/games/MSX/boot.vhd1        128 4188287 4188160   2G  e W95 FAT16 (LBA
From that output, there are only two parts that are important for us. One is where it says: "Units: sectors of 1 * 512 = 512 bytes" - that tells you that each unit listed is 512 bytes. The other is under "Start", which says "128". You have to multiply these two quantities, in this case 512 and 128, which results in 65536. Therefore, in this case the offset should be 65536 and the mount command should be:

Code: Select all

mount -o loop,offset=65536 /media/fat/games/MSX/boot.vhd /mnt/
That 65536 is valid for that image, therefore you don't have to run fdisk -l every time, just the mount command with the right offset (using the numbers you've found with fdisk) when you begin, and the umount command when you finish.

Very important: Do not forget to run 'umount /mnt' before starting the core. You could damage the VHD otherwise.
User avatar
JamesH
Posts: 56
Joined: Sat Dec 26, 2020 11:41 am
Has thanked: 5 times
Been thanked: 15 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by JamesH »

You can delegate the offset calculation to losetup(8) utility, just don't forget to explicitly release the loop device:

Code: Select all

/media/fat/games/MSX# losetup -Pf boot.vhd 
/media/fat/games/MSX# losetup -a
/dev/loop0: 0 /media/fat/linux/bluetooth
/dev/loop1: 0 boot.vhd
/dev/loop8: 0 
/media/fat/games/MSX# mount /dev/loop1p1 /mnt
/media/fat/games/MSX# ls /mnt | head -2
$RECYCLE.BIN
Archive
/media/fat/games/MSX# umount /mnt
/media/fat/games/MSX# losetup -d /dev/loop1
/media/fat/games/MSX#
User avatar
thera34
Posts: 132
Joined: Fri Sep 11, 2020 7:51 am
Has thanked: 96 times
Been thanked: 89 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by thera34 »

emuola wrote: Sat Oct 01, 2022 12:03 pm Mister runs like a dream, but I realised that apparently it's at leat a bit different regarding updating the files for your MSX core, when compared to e.g. Amiga core or AO486, which both use MisterFS.

Is there any other way to add files to my MSX core's boot.vhd, other than update the boot.vhd on my Win10 computer and upload it again to the Mister?
A lazy way I prefer is to use the AO486 core and its shared folder :)
I have a subfolder in the /games/ao486/shared called "MSX".
When I need something to add on the MSX VHDs, I simply copy my files there via ftp, fire up the ao486 with the MSX vhd mounted as slave, copy what I need to it from shared folder.
Tested from MS-DOS 7.1, but I guess it won't make a difference other versions. The MSX VHD is FAT16 so it should be readable just fine.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 195 times

Re: Transfer Files to MSX, e.g. Update Files on VHD?

Unread post by Malor »

There's a Linux utility called 'kpartx' that reads a partition layout and creates named partition links under /dev/mapper. It doesn't come by default with the Mister's distro, however, so someone would have to compile it.

Might be worth checking on a bigger system to see if "kpartx -a /path/to/MSX.vhd" correctly creates partition names, before trying to port it. When you're ready to remove them again, "kpartx -d /path/to/MSX.vhd" should remove them from /dev/mapper.
Post Reply