joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.81k stars 383 forks source link

IBM DSKF format support #1466

Open rderooy opened 4 years ago

rderooy commented 4 years ago

Is your feature request related to a problem? Please describe. This is different then the XDF feature request. IBM released disk image files in what is referred to as DSKF format back in the day. There are mixed-mode DOS and OS/2 LOADDSKF and SAVEDSKF executables from IBM to handle the format. This format is incompatible with DOSBox-X.

My understanding is, that it is mostly compatible with standard DSK files, but with an added header. http://www.vcfed.org/forum/archive/index.php/t-13097.html

Trying to boot such a file in DOSBox will cause a stream of "Illegal Unhandled Interrupt Called 6".

Describe the solution you'd like Ideally that DOSBox-X would recognise the format and handle it. But in the interim it would already help if DOSBox-X would recognise it as an unsupported format and throw an error.

$ file 144US1.DSK 144US1.DSK: floppy image data (IBM SaveDskF)

Describe alternatives you've considered Trying to convert the DSKF format disk image to standard MFM DSK format in DOSBox-X.

In the directory where I have a DSKF file and LOADDSKF.EXE, I start DOSBox-X. MOUNT C . IMGMAKE fdd.img -t fd_1440 IMGMOUNT A fdd.img LOADDSKF 144US1.DSK A: Target disk is wrong format

Expecting 2 side(s) - 80 tracks - 18 sectors per track LOADDSKF 144US1.DSK A: /F

Disk error 0001 00 01 00 0000 00

At this point the DOSBox-X LOG contains the following: LOG: Identified 'fdd.img' as C/H/S 80/2/18 512 bytes/sector LOG: FAT: BPB says 18 sectors/track 2 heads 512 bytes/sector LOG: Mounted FAT volume is FAT12 with 2847 clusters LOG: 430184269 ERROR IOCTL:DOS:IOCTL Call 0D:40 Drive 0 unhandled

Additional context Trying to boot a PC-DOS 7.0 disk in DSKF format with DOSBox-X results in the following error stream:

LOG: Booting guest OS stack_seg=0x7000 load_seg=0x07c0 LOG: Removing UMB block 0xcc00-0xdfff LOG: Alright: DOS kernel shutdown, booting a guest OS LOG: CS:IP=0000:7c00 SS:SP=7000:0100 AX=0000 BX=7c00 CX=0001 DX=0000 LOG: 2028890 ERROR CPU:Illegal Unhandled Interrupt Called 6 LOG: 2028893 ERROR CPU:Illegal Unhandled Interrupt Called 6 LOG: 2028896 ERROR CPU:Illegal Unhandled Interrupt Called 6 LOG: 2028899 ERROR CPU:Illegal Unhandled Interrupt Called 6

rderooy commented 4 years ago

Just to be clear, once a DSKF image file is written to a diskette, it is a regular 1.44MB disk. No extra sectors or a different cluster size like XDF or DMF.

joncampbell123 commented 4 years ago

Do you have any DSKF files that can be used to test with during development?

rderooy commented 4 years ago

The PC DOS 2000 CD-ROM has disk image files on it in DSKF format. The first thing to do, I guess, would be to check why the included LOADDSKF is not able to write them to a disk image.

rderooy commented 4 years ago

Let me just add a comment. In my view there are 3 issues here.

1) DOSBox will happily try to boot a DSKF file and fail. This could be prevented by checking first for the magic bytes (mentioned in the link above), and throwing an error (e.g. "unsupported image format IBM DSKF"). 2) LOADDSKF is unable to run in DOSBox-X. Making this work would allow the conversion of DSKF image files to regular MFM image files. 3) Being able to use a DSKF file directly for IMGMOUNT/BOOT would be great, but the others in my view have priority.

Wengier commented 4 years ago

@rderooy DOSBox-X currently has limited support for handling drive IOCTL calls. So DOS disk utilities such as FDISK and FORMAT won't work properly at this time.

rderooy commented 4 years ago

@Wengier thanks for the info.

FYI, to create a DSKF image file from a regular diskette you would use SAVEDSKF.EXE (both LOADDSKF and SAVEDSKF are mixed mode DOS / OS/2 binaries). LOADDSKF is on the PC-DOS 2000 CD-ROM, but SAVEDSKF is not. They can however easily be found online. e.g. https://ecsoft2.org/loaddskf-savedskf

rderooy commented 4 years ago

The errors with running LOADDSKF are resolved, so it is now possible to convert DSFK images to regular MFM disk images in DOSBox-X.

I will leave this one open, as a feature request for being able to IMGMOUNT/BOOT a DSKF image directly.

misutoneko commented 3 years ago

Here's an alternative to LOADDSKF/SAVEDSKF/DIUNPACK that may or may not be useful: LZW compressed images can be decompressed with dskdcmps (the resulting file looks like a regular FAT12 image). Note though, that the original header will be discarded.

I've made a patch to allow dskdcmps compilation on Linux (and to use the offset from the header): https://gist.github.com/misutoneko/ad37644361f25e91257d707594554947