/* $NetBSD: bootinfo_biosgeom.c,v 1.24 2019/08/01 13:11:03 manu Exp $ */
/*
* Copyright (c) 1997
* Matthias Drochner. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef GEOM_DEBUG
printf("#%d: %x: C %d H %d S %d\n", nvalid,
d.dev, d.cyl, d.head, d.sec);
printf(" sz %d fl %x cyl %d head %d sec %d totsec %"PRId64" sbytes %d\n",
ed.size, ed.flags, ed.cyl, ed.head, ed.sec,
ed.totsec, ed.sbytes);
#endif
if (d.flags & BIOSDISK_INT13EXT) {
bibg->disk[nvalid].totsec = ed.totsec;
bibg->disk[nvalid].flags |= BI_GEOM_EXTINT13;
}
#ifdef BIOSDISK_EXTINFO_V3
#ifdef GEOM_DEBUG
printf(" edd_cfg %x, sig %x, len %x, bus %s type %s\n",
ed.edd_cfg, ed.devpath_sig, ed.devpath_len,
ed.host_bus, ed.iface_type);
#endif
/* The v3.0 stuff will help identify the disks */
if (ed.size >= offsetof(struct biosdisk_ext13info, checksum)
&& ed.devpath_sig == EXTINFO_DEVPATH_SIGNATURE) {
char *cp;