joncampbell123 / dosbox-x

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

"change current floppy image" doesn't work after booting a freedos(98) hdd image #5251

Open Jimmy-Z opened 3 weeks ago

Jimmy-Z commented 3 weeks ago

Describe the bug

update: it's likely a dosbox-x - freedos(98) incompatibility issue. title updated to reflect this, previous title:

"change current floppy image" doesn't work after booting a pc98 hdd image

Steps to reproduce the behaviour

  1. machine is set to pc98
  2. mount disk A of the game on drive A:
  3. mount freedos(98) hdd image (from here) on drive C:
  4. boot c:
    • for whatever reason A: and B: are both that hdd image now (more on this later), C: is floppy
  5. start installation from C:
  6. the installer prompt to insert disk B, I choose "dos" -> "change current floppy image" and choose that.
  7. press enter, the installer still prompt to insert disk B

Expected behavior

installer should continue

What operating system(s) this bug have occurred on?

Windows 10 22H2

What version(s) of DOSBox-X have this bug?

2024.10.01 (VS SDL1 64-bit)

Used configuration

default except:

machine = pc98

Output log

Identified 'G:\pc98\night slave\Night Slave - Disk B.hdm' as C/H/S 77/2/8 1024 bytes/sector
Mounted FAT volume is FAT12 with 1221 clusters

Additional information

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

maron2000 commented 3 weeks ago

I don't have any difficulties in installing Night Slave. Mounted a hard drive in C: and Disk A in A: then boot c:, and "change current floppy image" accordingly to the instructions of the installer. After installation, you don't have to boot a guest OS to launch the game.

Edit: I used genuine MS-DOS 6.2. FreeDOS doesn't work.

image image

Jimmy-Z commented 3 weeks ago

Thanks for the reply and sorry I'm new to pc98, I tried ms-dos.

after mounting a blank hd image on c: and ms-dos 6.20 disk 1 on a: and boot a:, it also shows two hd: image image

I chose the 1st one

then it will complain something and need to format the disk (I'm not sure about those Japanese terms) image

then it let me chose the size and starts formatting (if I chose the 2nd hd, it will stuck here)

while formatting, log is flooded with:

PC-98 INT 1Bh unknown SCSI BIOS call AX=0100 BX=7E00 CX=F430 DX=03EF SI=0010 DI=00A1 DS=5008 ES=7000
PC-98 INT 1Bh unknown SCSI BIOS call AX=0100 BX=7E00 CX=F820 DX=03EF SI=0010 DI=00A1 DS=5008 ES=7000
PC-98 INT 1Bh unknown SCSI BIOS call AX=0100 BX=7E00 CX=FC10 DX=03EF SI=0010 DI=00A1 DS=5008 ES=7000

then it seems to be stuck on a blinking "please wait a little" I press enter it says "will reboot shortly" now it's back to dosbox-x z: imgmount will complain "could not extract drive geometry from image" if I supply those though, it will instead complain "Cannot create drive from file" there's these in log:

LOG: FAT: Partition type is IPL1 (PC-98)
LOG: No partition chosen

I tried -o partidx=0 and 1, same result. I could imgmount 2 ... (I believe this is like setting up a loop device but not mounting the file system in linux?) then boot the dos floppy again but it still just start formatting again.

also the log is flooded with:

LOG: 1211856159 ERROR INT10:INT10_SetCursorPos page 77

I also tried starting from the freedos(98) hdi image, but ms-dos will still try to format it, and fails basically the same way above.

I'm currently stuck here.

Jimmy-Z commented 3 weeks ago

I tried preparing a hdi with ms-dos installed using np21w, boot that in dosbox-x, then night slave hdinst will indeed work.

btw: I had to strip config.sys and autoexec.bat installed by default to a minimum, otherwise it stucks in various stages.

maron2000 commented 3 weeks ago

Yeah, you're right. I can't prepare a HDD image on DOSBox-X. It seems that you need to prepare a bootable HDD image in advance using other emulators.

Jimmy-Z commented 3 weeks ago

Thanks for the confirmation.

While I do understand this is a niche in a niche, but I think we should probably update the wiki to reflect this?

joncampbell123 commented 4 days ago

In order for MS-DOS to detect disk change the BIOS interrupt needs to signal it in a way that MS-DOS understands as disk change.

On the IBM PC side, after disk change an INT 13h read should fail, before succeeding when called again. There's a later addition to INT 13h to read the disk change event. MS-DOS supports these.

Whatever FreeDOS for PC-98 expects as a signal for disk change, DOSBox-X is clearly not emulating it correctly.

maron2000 commented 3 days ago

From the FreeDOS(98) source code, I see the following code. https://github.com/lpproj/fdkernel/blob/fa81d6e7c524f95f4ed6a903c28bf98817d80a9e/nec98/kernel/dsk.c#L362

  /* can not detect or error... */
#if defined(NEC98)
  if (is_daua_exact_hd(pddt->ddt_driveno))
    return M_NOT_CHANGED;

  if (is_daua_IF1M(pddt->ddt_driveno)) {
    BYTE ua = pddt->ddt_driveno & 0x0f;
    if (ua < 4)
    {
      BYTE st0 = peekb(0, 0x564 + (ua << 3));
      WORD sense = fl_sense(pddt->ddt_driveno);
      if ((sense & 0xffe0U) == 0 && st0 < 0xc0U /* 0x40U */)
        return M_NOT_CHANGED;
    }
  }

  return M_DONT_KNOW;