joncampbell123 / dosbox-x

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

Unable to Format 1.44M , or 200k and below Floppy Disk #2914

Open ghost opened 3 years ago

ghost commented 3 years ago

Describe the bug creating or mounting 1.44m floppy image and formatting using FreeDOS Format doesn't work To Reproduce Steps to reproduce the behavior: imgmake floppy.img -t fd_1440 imgmount a floppy.img format A: get error "Media type 1440k not supported by this drive?"

Expected behavior expected to format the drive Screenshots image

Environment (please complete the following information):

Additional context here is log file

Logging: opened logfile 'log.txt' successfully. All further logging will go to this file.
Win32 EnumDisplayDevices #0: name=\\.\DISPLAY1 string=Intel(R) UHD Graphics 600
Win32 EnumDisplayDevices #1: name=\\.\DISPLAY2 string=Intel(R) UHD Graphics 600
Win32 EnumDisplayDevices #2: name=\\.\DISPLAY3 string=Intel(R) UHD Graphics 600
DOSBox-X version 0.83.16 (Windows SDL1)
Windows keyboard layout ID is 0x4009
Host keyboard layout is now us (US English)
Mapper keyboard layout is now us (US English)
The default output for the video system: direct3d
Configured windowposition: 
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
ISA BCLK: 8333333.333Hz (25000000/3)
monopal: green, 
Active save slot: 1 [Empty]
USING AVI+ZMBV
Max 1048576 sz 65536
Final 65536
MIDI:Opened device:win32
Pentium CMPXCHG8B emulation is enabled
VOODOO LFB now at d0000000
Serial1: BASE 3f8h
Serial2: BASE 2f8h
Serial: port 1 will write to file serial
Parallel1: BASE 378h
MPU-401 Registering I/O ports as if IBM PC MPU-401 at base 330h
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Allocated APM BIOS pm entry point at f000:e88c
Writing code to fe88c
FDC installing to io=3f0h IRQ=6 DMA=2
IDE: Not registering port 3F7h, FDC will occupy it.
WARNING: IDE interface 4: Insufficient resources assigned by dosbox-x.conf, and no appropriate default resources for this interface.
WARNING: IDE interface 5: Insufficient resources assigned by dosbox-x.conf, and no appropriate default resources for this interface.
WARNING: IDE interface 6: Insufficient resources assigned by dosbox-x.conf, and no appropriate default resources for this interface.
WARNING: IDE interface 7: Insufficient resources assigned by dosbox-x.conf, and no appropriate default resources for this interface.
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Windows: IID_ITaskbarList3 is available
ISA Plug & Play BIOS enabled
VGA ROM BIOS init callback
     74026 ERROR BIOS:Keyboard layout file auto not found
     74026 ERROR BIOS:Keyboard layout file auto not found
XMS: 50 handles allocated for use by the DOS environment
EMS page frame at 0xe000-0xefff
COMMAND.COM env size:             720 bytes
COMMAND.COM environment block:    0x0701 sz=0x002d
COMMAND.COM main body (PSP):      0x072f sz=0x009a
COMMAND.COM stack:                0x0749
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
pixratio 1.350, dw false, dh false
Aspect ratio: 720 x 540  xToY=1.333 yToX=0.750
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Aspect ratio: 720 x 540  xToY=1.333 yToX=0.750
Screen report: Method 'Win98base' (1280.000 x 800.000 pixels) at (0.000 x 0.000) (338.667 x 211.667 mm) (13.333 x 8.333 in) (96.000 x 96.000 DPI)
Creating image file "floppy.img" with 80 cylinders, 2 heads and 18 sectors
IDE: index -1 slave=0
IDE: index -1 slave=0
Identified 'C:\users\siddhant\downloads\dosbox-x\floppy.img' as C/H/S 80/2/18 512 bytes/sector
Mounted FAT volume is FAT12 with 2847 clusters
FDC: Primary controller, drive 0 assigned to INT 13h drive 0
1651176862 ERROR BIOS:INT13: Function 18 called on drive 0 (dos drive 0)
--END OF LOG--
ghost commented 3 years ago

Note: 0.83.16 doesn't include FORMAT, but i added it to drivez folder

ghost commented 3 years ago

same happens with 2.88m floppy image

rderooy commented 3 years ago

Can confirm the same thing with 0.83.17 (which does include FORMAT) on Linux.

ghost commented 3 years ago

also FORMAT keeps giving errors if i try formatting a 200k or smaller floppy disk image image

rderooy commented 3 years ago

If you boot FreeDOS, can you format 160 and 320KiB disks? It may be that FreeDOS Format cannot handle the early 8-sector per track formats of DOS 1.x or you may need to specifically specify you only want to format it as 8 sectors.

180 and 360KiB use 9-sector per track formats of DOS 2.0+.

ghost commented 3 years ago

image tried booting into FreeDOS 1.3 RC4 Boot Floppy i made, i mounted the floppy image as drive B: , tried formatting it , it gives same errors

rderooy commented 3 years ago

Part of the problem with formatting as 160, 180, 320 and such seems to be that the drive type being reported is a 3.5" type, even if you have a 160KiB floppy mounted. And none of those formats are valid for 3.5" disk types.

If the disk type mounted is a 5.25" type, the BIOS type should be set to a 5.25" drive type.

ghost commented 3 years ago

ok

grapeli commented 3 years ago

I don't expect every low-end program on another dos system to be dosbox-x compatible. The most important thing is that it works under the system for which it was created.

Works under freedos 1.2.

https://user-images.githubusercontent.com/452325/133436863-0c9b6a12-aecc-45d7-9d50-c03660d61911.mp4

rderooy commented 3 years ago

@grapeli Thing is that since 0.83.17, FORMAT is included with DOSBox-X, which to me raises the expectations of it working.

grapeli commented 3 years ago

@rderooy I did not know.

In this case, you would actually expect it to work properly.

grapeli commented 3 years ago

It works as long as the system version is > 7. -set "dos ver=7.10"

https://gitlab.com/FDOS/base/format/-/blob/master/SOURCE/FORMAT/FLOPPY.C#L848

rderooy commented 3 years ago

I did a quick check, created a 160KB disk image, mounted as A: and a 1.44MB disk image, mounted as B: Then I started Norton SysInfo 8.0 and it reported two 3.5" 1.44MB disk drives.

I also tried with "ver set 7.1" and did a format a: /F:160 and it failed with format complaining it is not a supported size for the drive type. Format B: however succeeded, with some warnings:

Geometry set (int 13.18) error (FF). Ignored.
SECTORS PER TRACK stuck to 207, wanted 18. Continuing anyway.
rderooy commented 3 years ago

Looking quickly through the code, I found the table of fdd types near the top in src/ints/bios_disk.cpp. Based on the mapping in include/bios_disk.h the 5th column is the bios drive type. e.g., type 6 is a 2.88MB FDD type.

And in bios_disk.cpp it seems that this function should return the drive bios type based on the table.

uint8_t imageDisk::GetBiosType(void) {
    if(!hardDrive) {
        return (uint8_t)DiskGeometryList[floppytype].biosval;
    } else return 0;
}

And this seems like it is called by src/hardware/cmos.cpp so I don't yet understand why Norton SysInfo and FreeDOS format think the drive type is always 1.44MB.

grapeli commented 3 years ago

It may not work. In my life I have never used a floppy disk formatted to 160kB.

Ticket Title - "Unable to Format 1.44M Floppy Disk".

rderooy commented 3 years ago

@grapeli your right on the title.

As to 160KB size disks. Just boot PC-DOS 1.x ;-)

ghost commented 3 years ago

i had problem with 1.44M Floppies, also with 200kb floppies and below