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

Cannot boot from VHD - I/O error #6 #2

Open
jameshpdp opened this issue Feb 22, 2022 · 3 comments
Open

Cannot boot from VHD - I/O error #6 #2

jameshpdp opened this issue Feb 22, 2022 · 3 comments

Comments

@jameshpdp
Copy link

jameshpdp commented Feb 22, 2022

It looks like there may be some issues with VHD support. Apologies if I missed any important set up steps (in which case it is a good opportunity to update the README :)

I was trying to boot the core from a VHD image(s) (BK001M, floppy/HDD enabled, SMK-512 enabled), but no matter what I do I always get I/O error #6. The only semi-working config is booting a [floppy] disk attached as the first drive plus a VHD image. Such configuration works once (apps accessing other data/overlay files fail, presumably due to that error #6), until the system reset/reboot and after reset it produces a lot of I/O error #6. Reproducible with ANDOS, CSIDOS and MK-DOS.

Steps to reproduce:

  1. Fetch an OS bootable image (ANDOS, CSIDOS or MK-DOS). Note: all these are working just great if mounted by itself as the first floppy drive (also see footnote 1).
  2. Use bkhdutil to create a VHD image which includes a single OS image.
  3. Mount the VHD (and nothing else).

Expected results:

  • OS boots, works properly, and remains operational after reset.

Actual results:

  • All VHD images fail to boot into a working state with “I/O error 6”. MK-DOS attempts to boot from random drives/partitions on subsequent resets. Please see attached screenshots: csidos andos

Footnote 1: the opposite operation - extract an OS image from a VHD/IMG and mount it as the first floppy yields a bootable system.

Not sure if it is related or not, but the HDDInfo tool from Good Apple demo does not work at all, just crashes hddtests.dsk.zip. Test ALTV475F seems to find
potential issues with “HDD registers” and “modes” (apologies, not sure it is supposed to be that way).

@sorgelig
Copy link
Member

Error 6 means there is no disk. Probably systems trying to access wrong drive, probably A. While HDD starts from C...
Disable SMK512. Then while boot logo scrolls up keep SPACE pressed. It won't autoboot. Then type 2B and see if it works.
Btw, use BK0011M mode (not BK0010).

@jameshpdp
Copy link
Author

Apologies, it was a typo, I am experimenting in 0011M mode, of course.

Booting manually from drive number 2 by disabling the SMK and dropping out to the MONITOR (hitting SPACE while “Монитор БК-0011 В1.8” is moving towards the top of the screen) ultimately produces the same “Идет загрузка ANDOS, Ошибка #6, повторить?” and “Disk error #6, Retry, Skip” for CSIDOS. Surprisingly, MK-DOS does not boot that way at all, it stays in the MONITOR:

000000
@2B?
@

However, mounting MK-DOS vhd and performing reset without touching keyboard loads MK-DOS “kernel” (bootloader?). Few crazy ideas mentioned under "footnote 1" below.

Image headers for all VHDs are simple (actual disk images are 819200 bytes long, that is 1600 blocks of 512 bytes = 0x640):

00000000: 424b 4844 0100 0000 0000 0000 0000 0000  BKHD............
00000010: 0100 0000 4106 0000 0000 0000 0000 0000  ....A...........
[ rest is filled with 0’s and disk image starts at 0x200 ]

My MACRO-11 skills are quite rusty and there is a chance something got lost in translation when I was reading SMK API docs using google translate, but based on my experiments with HDDInfo it crashes during “sector read” test while trying to write 376 (one sector) to the register 177752 (sector count register) - line 828. Is it expected?

footnote 1. To me it looks like MK-DOS loads bootloader/”kernel” from the vhd but tries to load the rest from the drive A (maybe that is what other OSes are doing, too, they just do not provide detailed logs).
mkdos-drive-a
For MK-DOS, manually selecting boot drive C (by pressing C when MK-DOS logo appears) results in a boot loop, MK-DOS logo is shown, then something happens (crash? error #6?) and it starts again. If no drive is selected again, it tries drive A and fails “normally” (as nothing is mounted as drive A). It does not "remember" what drive it is booting from?

@sorgelig
Copy link
Member

You would laughing but being an author of CSIDOS i hardly remember what was there as it was almost 30 years ago :) Format of HDD you describe, i've made at that time :) But i also remember logical disks weren't limited by 819200 bytes because i had much larger disks.
Generally speaking only CSIDOS can fully utilize HDD format implemented in core. I have HDD image with many disks inside which is managing by CSIDOS. I remember at some point i've made 2 versions of CSIDOS: one is for FDD and another for HDD. But i don't remember if i combined them together later or not.
i'm going to try what you did and see the result.

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

No branches or pull requests

2 participants