What information is stored in the header of MSX disk image files?

Par fernando_aires

Supporter (3)

Portrait de fernando_aires

07-04-2011, 17:30

Hello there,

I'd like to know what information is stored in the bytes that are at the beginning of all DSK files, that is, the header of files meant to store MSX floppy disk images.

After analyzing some DSK files I noticed that the first 3 bytes have always the same values in every file, still I have no clue what they mean:

EB FE 90

After that there are always 8 bytes representing a string of ASCII characters, I've mostly seen strings such as "MSX_02 ", "DSKTOOL ", etc. What's that?

And then there are lots of other bytes in the rest of the header, but I can't figure out what information they represent, and that's what I'd like to know.

Thanks in advance Smile

!login ou Inscrivez-vous pour poster

Par wouter_

Champion (508)

Portrait de wouter_

07-04-2011, 18:16

MSX disk image files don't have a header. It's a raw sector dump of the whole disk (each block of 512 bytes is one sector on the disk, sectors are stored in 'logical sector number' order).

Those common bytes you see in the beginning of each disk image are actually the first bytes of the boot-sector of the disk (= the first sector of the disk). Very often this indeed starts with EB FE 90, but that's not guaranteed.

Par fernando_aires

Supporter (3)

Portrait de fernando_aires

07-04-2011, 18:35

Thanks for your reply.

I thought DSK files had a header just like ROM files do.

Par flyguille

Prophet (3031)

Portrait de flyguille

07-04-2011, 19:55

you are seeing the boot-sector at the beggining.

Par wouter_

Champion (508)

Portrait de wouter_

07-04-2011, 20:01

I thought DSK files had a header just like ROM files do.

Also MSX ROM files don't have a header. That's why most MSX emulators come with a database of rom-checksums to e.g. select the correct rom-mapper-type for a given raw ROM dump.

Par fernando_aires

Supporter (3)

Portrait de fernando_aires

07-04-2011, 23:34

Also MSX ROM files don't have a header.

But what are those bytes that are included in nearly every MSX ROM file, such as the byte sequence:

41 42 (ASCII for "AB")

I always thought that byte sequence was part of the ROM header.

Par flyguille

Prophet (3031)

Portrait de flyguille

07-04-2011, 23:56

"AB" is a header that the MSX-BIOS recognizes that will to EXECUTE that ROM on the booting. the follow word will have the start address.

So, MSX-BIOS on the booting scans all slot/sslots looking for ROMs, if found then check what to do with the ROM, so AB means to execute the code inside.

Par konamiman

Paragon (1190)

Portrait de konamiman

08-04-2011, 10:58

EB FE 90 is 8086 assembler code, and is indeed at the start of the boot sector of any floppy formatted with a MSX. I'm not sure but I think it is a jump to itself. It is here so that if you put the disk in a PC disk drive and try to boot it, the PC will hang instead of trying to execute Z80 code as if it were 8086 code (which would have unexpected results).

Par wouter_

Champion (508)

Portrait de wouter_

08-04-2011, 11:52

But what are those bytes that are included in nearly every MSX ROM file, such as the byte sequence: 41 42

Those bytes are actually part of the content of the ROM. There is no header in a ROM file in front of the content. The vast majority of the game ROMs (but not system ROMs) indeed starts with 41 42, but there are exceptions.