Skip to content

Suggestion: Work around Xi8088 BIOS bug by setting DS = 40h for 13.41 call #156

Description

@ecm-pushbx

Circling back to the Xi8088 BIOS bug that affected at least some revisions of the Book8088:

The bug was described in http://www.bttr-software.de/forum/forum_entry.php?id=21275

This is where the kernel may call a ROM-BIOS that doesn't support LBA to detect that it doesn't support LBA:

kernel/kernel/initdisk.c

Lines 651 to 657 in 1b6de0f

/* check for LBA support */
regs.b.x = 0x55aa;
regs.a.b.h = 0x41;
regs.d.b.l = drive;
regs.flags = FLG_CARRY; /* ensure carry is set to force error if unsupported */
init_call_intr(0x13, &regs);

My idea is to force DS = 40h for this call, which will work around the bug of the BIOS writing to offset 41h without setting up DS.

I didn't have this idea yet because my use of 13.42 without the proper 13.41 check call makes this more difficult, however I just added a workaround to the Xi8088 bug to the callers that are not as size constrained as the lDOS boot sector loaders, eg lDOS iniload: https://hg.pushbx.org/ecm/ldosboot/rev/4c929733a229

(I will upload a blog post that also addresses this later.)

Activity

  1. boeckmann commented on May 5, 2024

    @boeckmann
    Contributor

    Sounds reasonable. That is directly related to my question on the developer mailinglist some time ago to what DS should be set in this case. There is a (closed) related FDISK issue FDOS/fdisk#80. I may implement setting DS as well for FDISK.

  2. ecm-pushbx commented on Jan 16, 2025

    @ecm-pushbx
    ContributorAuthor

    Has this still not been added yet?

  3. added a commit that references this issue on Oct 10, 2025
    a82e00d
  4. ecm-pushbx commented on Oct 10, 2025

    @ecm-pushbx
    ContributorAuthor

    Added a Pull Request with this change: #224

    @boeckmann It appears you patched fdisk in FDOS/fdisk@8126a21 - right?

  5. boeckmann commented on Oct 10, 2025

    @boeckmann
    Contributor

    @boeckmann It appears you patched fdisk in FDOS/fdisk@8126a21 - right?

    At least that was the intention. I think I tested it via 86box.

  6. ecm-pushbx commented on Oct 10, 2025

    @ecm-pushbx
    ContributorAuthor

    The FAT12/FAT16 loaders using either CHS or LBA set ds to 1FE0h:

    mov ds, ax

    So it corrupts the byte [1FE0h:41h] which is at linear 1FE41h, at 127 KiB. That's within the allocation for a large FAT or a large kernel file. If the FAT and file both are smaller, or the FAT entry that ends up at this address isn't used, then it will appear to work despite the memory corruption.

  7. ecm-pushbx commented on Oct 10, 2025

    @ecm-pushbx
    ContributorAuthor

    SYS also uses 13.41:

    kernel/sys/sys.c

    Line 1265 in e3bfd6a

    #ifdef __WATCOMC__

  8. added a commit that references this issue on Oct 10, 2025
    9b9b5b1
  9. ecm-pushbx commented on Oct 10, 2025

    @ecm-pushbx
    ContributorAuthor

    SYS also uses 13.41:

    kernel/sys/sys.c

    Line 1265 in e3bfd6a
    #ifdef WATCOMC

    Addressed in today's #226

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions