Port-i386 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: LBA vs CHS?



> I don't know about it ignoring the cylinder number, but int 13h
> function 02h is limited to approximately 8GB [...], so I'd expect the
> boot code to use int 13h function 42h for larger disks.  I see a
> biosdisk_extread routine in [bios_disk.S].  I haven't looked to see
> when it's used though.  [...]

Turns out it's used when

        if (NEED_INT13EXT(d, dblk, num)) {

which is defined earlier in biosdisk_ll.c:

/*
 * Because some older BIOSes have bugs in their int13 extensions, we
 * only try to use the extended read if the I/O request can't be addressed
 * using CHS.
 *
 * Of course, some BIOSes have bugs in ths CHS read, such as failing to
 * function properly if the MBR table has a different geometry than the
 * BIOS would generate internally for the device in question, and so we
 * provide a way to force the extended on hard disks via a compile-time
 * option.
 */
#if defined(FORCE_INT13EXT)
#define NEED_INT13EXT(d, dblk, num)                             \
        (((d)->dev & 0x80) != 0)
#else
#define NEED_INT13EXT(d, dblk, num)                             \
        (((d)->type == BIOSDISK_TYPE_CD) ||                     \
         ((d)->type == BIOSDISK_TYPE_HD &&                      \
          ((dblk) + (num)) >= (d)->chs_sectors))
#endif

I tried building with FORCE_INT13EXT and it works just fine.  So at
least I have a workaround.  It's not great, since it means I have to do
machine-specific hackery to build working bootblocks, but it's a lot
better than the previous situation.  I'll try to figure out a way to
make that decision post-build-time.

I've sent Soekris a ping.  No response yet, but it's been only about
twenty minutes, so that doesn't mean anything.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index