Re: gptzfsboot error using HP Smart Array P410i Controller

From: John Baldwin <jhb_at_freebsd.org>
Date: Mon, 15 Aug 2011 12:12:07 -0400
On Friday, August 05, 2011 10:08:27 am Christoph Hoffmann wrote:
> Hello Everyone,
> 
> Despite the BIOS information about the nonexistent floppy, the zfsboot.c 
code 
> will prevent to boot from the first HDD if a floppy is given as a first 
available device.
> 
> The drive 0x0 (floppy) will be probed before the code below and an error 
occurs:
> […]
> gptzfsboot: error 1 lba 32                                                      
> gptzfsboot: error 1 lba 1                                                       
> […]
> 
> The continue statement will skip the rest of the iteration because  
>          if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) 
> is true if the drive equals 0x80. As a result we do not call probe_drive()
> for this drive.

But that shouldn't happen if ARGS has a drive number of 0.  (In that case 0x80 
!= 0x0, so it shouldn't match.)

This shows that PTOV(ARGS) actually has a %dl value of 0x80 which is correct.  
The question is how your initial 'dsk' ended up using 0x0 instead of 0x80.
Note that your 'type' is 0, so that means that it was ok initially (TYPE_AD is 
0):

    dsk->drive = *(uint8_t *)PTOV(ARGS);
    dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD;

Somewhere between where 'dsk' is initalized in main() and before probe_drive() 
is called in main() for 'dsk', 'dsk->drive' is getting clobbered.  Can you add 
some additional printfs to nail down where that is happening?

-- 
John Baldwin
Received on Mon Aug 15 2011 - 14:12:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:16 UTC