[Soekris] Net5401 + OpenBSD + 256MB CF

jason hord lists at wyrmsoft.tzo.net
Tue Feb 4 05:43:29 UTC 2003


> Maybe the OpenBSD's and FreeBSD's bootloaders are still affected by a
> bug which used to affect NetBSD's? Here is the log message for a patch
> I made to NetBSD:

actually, i have already tried this.  i haven't read the PC BIOS spec (i
guess i should), but i thought it couldn't hurt.

> The patch affected sys/arch/i386/stand/lib/bios_disk.S. You might
> examine the equivalent OpenBSD source file to find out if it does a
> proper disk reset on read failures.

here is the relevant code from
/usr/src/sys/arch/i386/stand/biosboot/biosboot.S:

   1:
           pushl   %cx
           putc('.')               /* show progress indicator */
           cld
           lodsl   /* word */      /* cylinder/sector */
           movl    %ax, %cx
           lodsb                   /* head */
           movb    %al, %dh
           lodsb                   /* # of sectors to load */
           movb    $0x2, %ah
           pushl   %ax
           int     $0x13
           jnc     3f

           /* read error */
           puts(2f)
           jmp     halt
   2:      .asciz  "\r\nRead error\r\n"

   3:      /* read next block */

           popl    %ax
           data32
           movzbl  %al, %eax  
           shll    $9, %ax         /* 512 bytes sectors */
           addl    %ax, %bx
           popl    %cx     
           loop    1b

quick rundown:  when using the installboot program, a table is written
into the biosboot program before it is installed into the boot sector. 
the lods{lb} instructions load this data from the table.

as you can see, no disk resets.  however, i did add a BIOS disk reset
before'1:' as well as an infinite read loop with a reset before '2:'
right after the'jnc 3f' instruction. this did absolutely nothing.  i've
also tried various sector read counts (%al register before the 'int
$0x13') since LILO seems to do a probe for 36, 18, 15, and 9 sector
reads.  the only one that ever worked was a 1 sector read.

of course, i'm no guru with this stuff...



More information about the Soekris-tech mailing list