Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microdrive detection timeout #397

Open
skiselev opened this issue May 16, 2024 · 3 comments
Open

Microdrive detection timeout #397

skiselev opened this issue May 16, 2024 · 3 comments
Assignees

Comments

@skiselev
Copy link
Contributor

This issue is probably a bit geeky (but isn't it all?!).
I tried using a Hitachi 6 GB Microdrive, which is an actual spinning hard drive in a CompactFlash form factor.
It appears that RomWBW doesn't give it enough time to "spin" on boot. So I am getting a "BUSY TIMEOUT" error.
When the system is restarted from the RomWBW boot loader it properly detects the disk

RomWBW HBIOS v3.4.0, 2024-01-24

RCBus [RCZ80_skz] Z80 @ 8.000MHz
0 MEM W/S, 1 I/O W/S, INT MODE 1, Z2 MMU
512KB ROM, 512KB RAM
ROM VERIFY: 00 00 00 00 PASS

CTC: IO=0x88
SIO0: IO=0x80 SIO MODE=115200,8,N,1
SIO1: IO=0x82 SIO MODE=115200,8,N,1
DSRTC: MODE=STD IO=0xC0 Thu 2024-05-16 10:29:51 CHARGE=OFF
MD: UNITS=2 ROMDISK=384KB RAMDISK=352KB
FD: MODE=RCWDC IO=0x50 UNITS=2
IDE: IO=0x10 MODE=RC
IDE0: BUSY TIMEOUT
IDE1: NO MEDIA
PPIDE: IO=0x20 PPI NOT PRESENT
CH0: IO=0x3E NOT PRESENT
CH1: IO=0x3C NOT PRESENT
WDOG: MODE=SKZ IO=0x6E DISABLED
FP: IO=0x00 NOT PRESENT

Unit        Device      Type              Capacity/Mode
----------  ----------  ----------------  --------------------
Char 0      SIO0:       RS-232            115200,8,N,1
Char 1      SIO1:       RS-232            115200,8,N,1
Disk 0      MD0:        RAM Disk          352KB,LBA
Disk 1      MD1:        ROM Disk          384KB,LBA
Disk 2      FD0:        Floppy Disk       3.5",DS/HD,CHS
Disk 3      FD1:        Floppy Disk       3.5",DS/HD,CHS
Disk 4      IDE0:       Hard Disk         --
Disk 5      IDE1:       Hard Disk         --


RCBus [RCZ80_skz] Boot Loader

Boot [H=Help]: r

Restarting System...

RomWBW HBIOS v3.4.0, 2024-01-24

RCBus [RCZ80_skz] Z80 @ 8.000MHz
0 MEM W/S, 1 I/O W/S, INT MODE 1, Z2 MMU
512KB ROM, 512KB RAM
ROM VERIFY: 00 00 00 00 PASS

CTC: IO=0x88
SIO0: IO=0x80 SIO MODE=115200,8,N,1
SIO1: IO=0x82 SIO MODE=115200,8,N,1
DSRTC: MODE=STD IO=0xC0 Thu 2024-05-16 10:30:23 CHARGE=OFF
MD: UNITS=2 ROMDISK=384KB RAMDISK=352KB
FD: MODE=RCWDC IO=0x50 UNITS=2
IDE: IO=0x10 MODE=RC
IDE0: ATA 8-BIT LBA BLOCKS=0x00B71D2C SIZE=5859MB
IDE1: NO MEDIA
PPIDE: IO=0x20 PPI NOT PRESENT
CH0: IO=0x3E NOT PRESENT
CH1: IO=0x3C NOT PRESENT
WDOG: MODE=SKZ IO=0x6E DISABLED
FP: IO=0x00 NOT PRESENT

Unit        Device      Type              Capacity/Mode
----------  ----------  ----------------  --------------------
Char 0      SIO0:       RS-232            115200,8,N,1
Char 1      SIO1:       RS-232            115200,8,N,1
Disk 0      MD0:        RAM Disk          352KB,LBA
Disk 1      MD1:        ROM Disk          384KB,LBA
Disk 2      FD0:        Floppy Disk       3.5",DS/HD,CHS
Disk 3      FD1:        Floppy Disk       3.5",DS/HD,CHS
Disk 4      IDE0:       CompactFlash      5859MB,LBA
Disk 5      IDE1:       Hard Disk         --


RCBus [RCZ80_skz] Boot Loader

Boot [H=Help]: z

Loading Z-System...

CBIOS v3.4.0 [WBW]

Configuring Drives...

        A:=MD0:0
        B:=MD1:0
        C:=FD0:0
        D:=FD1:0
        E:=IDE0:0
        F:=IDE0:1
        G:=IDE0:2
        H:=IDE0:3
        I:=IDE0:4
        J:=IDE0:5
        K:=IDE0:6
        L:=IDE0:7

        1023 Disk Buffer Bytes Free

ZSDOS v1.1, 54.0K TPA

B>
@wwarthen wwarthen self-assigned this May 16, 2024
@wwarthen
Copy link
Owner

Hi @skiselev,

So, yes, this is very likely to be the same situation I have seen on several occasions. IDE drives are supposed to assert BUSY almost immediately at power-on or reset and hold it asserted until they are ready for I/O. RomWBW implements a somewhat arbitrary delay of about 300ms before checking for BUSY. This value has changed many times in the past as I have tried to balance the needs of different hardware while trying to avoid long arbitrary delays. I find that the more "intelligence" the drive has, the slower it is to assert BUSY because it seems to need to run through the startup time of whatever microcontroller is being used. CF Cards have this anomaly, but I have found that 300ms is almost always enough time.

As a short term solution, RomWBW has a BOOT_DELAY config setting. It will simply delay the boot process by the specified number of seconds prior to initializing hardware. Could you play with this and let me know if that helps? It is not a very granular timer, but it would still be good to know how many seconds of delay are needed.

Thanks, Wayne

@skiselev
Copy link
Contributor Author

I'll try to the BOOT_DELAY and report back. It might take a few days...

One solution might be adding a longer delay for the HDD BUSY specifically. That wouldn't affect the systems that don't have an HDD, or that use Flash-based CF cards, that don't hold BUSY signal for long.

@wwarthen
Copy link
Owner

Thanks. How would I differentiate an HDD before needing to use the BUSY signal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants