Konamiman / Nextor

A disk operating system for MSX computers, forked from MSX-DOS 2.31
Other
183 stars 35 forks source link

FDISK will not load on Korean MSX #100

Closed bifo8 closed 1 year ago

bifo8 commented 2 years ago

Hi, I am experiencing an issue when attempting to CALL FDISK on a Daewoo CPC-400 MSX2 using a Carnivore2 cartridge. Initially, the screen will flash up an FDISK screen for a moment as if it is loading, but then it crashes to a blank blue screen with a line of dashes across the top.

I contacted the maker of my particular Carnivore2 who looked into it and recommended I report it:

The Korean MSX BIOS and Basic (Hangul module) are very buggy. It took a significant effort to make Carnivore2 Boot Menu and tools work on Korean-made computers. The problem you are experiencing comes from the Nextor BIOS that is used in Carnivore2. Most likely the problem occurs because the Hangul module corrupts index registers (IX and IY) that Nextor is actively using. So, before every call to BIOS functions these registers should be preserved in the stack and then restored after the function exits. Only then the software will be working correctly.

I am also able to replicate the exact issue using OpenMSX emulating a CPC-400 and the Carnivore2:

Capture

I am able to load and access MSX-DOS from a CF card which was formatted for a Sunrise IDE board, so my physical Carnivore2 does not appear to have issues.

Konamiman commented 2 years ago

Hi, I've been able to reproduce this issue in an emulator.

In order to fix this it would be helpful to know where are those offending BIOS calls. Who's the person that gave you that information?

Konamiman commented 2 years ago

Hi @bifo8, could you please confirm if FDISK works for you after executing the following in BASIC:

POKE &HFDA4,&HC9

bifo8 commented 2 years ago

It runs! Thank you. It gives me an Invalid disk driver error when attempting to format a CF card, not sure if that's related or simply an issue with using the CF card.

Konamiman commented 2 years ago

The problem is that the CHPUT routine is supposed to preserve the contents of the IX and IY registers, but in that particular computer it doesn't because it's doing an interslot call to slot 0-1 (I guess that's to handle the display of Korean characters); and the printf routine used in FDISK goes bananas if these registers are corrupted. I'll add a fix to the next version of Nextor.

The disk driver error shouldn't be related, when and where are you getting it exactly?

bifo8 commented 2 years ago

Appears to be related to the particular CF card I was using, trying it with another CF card seems to work fine. Issue appears to be resolved with the POKE.

Konamiman commented 2 years ago

Cool, this will be included in the next version of Nextor so the issue will be fixed without needing the poke: https://github.com/Konamiman/Nextor/pull/106

bifo8 commented 2 years ago

Just wanted to confirm that this also works with the SD512 cartridge, which had the same issue.