Home | History | Annotate | Line # | Download | only in include
bootinfo.h revision 1.2
      1 /*	$NetBSD: bootinfo.h,v 1.2 1999/01/27 20:54:57 thorpej Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 1997
      5  *	Matthias Drochner.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed for the NetBSD Project
     18  *	by Matthias Drochner.
     19  * 4. The name of the author may not be used to endorse or promote products
     20  *    derived from this software without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  *
     33  */
     34 
     35 #ifndef _LOCORE
     36 
     37 struct btinfo_common {
     38 	int len;
     39 	int type;
     40 };
     41 
     42 #define BTINFO_BOOTPATH 0
     43 #define BTINFO_BOOTDISK 3
     44 #define BTINFO_NETIF 4
     45 #define BTINFO_CONSOLE 6
     46 #define BTINFO_BIOSGEOM 7
     47 
     48 struct btinfo_bootpath {
     49 	struct btinfo_common common;
     50 	char bootpath[80];
     51 };
     52 
     53 struct btinfo_bootdisk {
     54 	struct btinfo_common common;
     55 	int labelsector; /* label valid if != -1 */
     56 	struct {
     57 		u_int16_t type, checksum;
     58 		char packname[16];
     59 	} label;
     60 	int biosdev;
     61 	int partition;
     62 };
     63 
     64 struct btinfo_netif {
     65 	struct btinfo_common common;
     66 	char ifname[16];
     67 	int bus;
     68 #define BI_BUS_ISA 0
     69 #define BI_BUS_PCI 1
     70 	union {
     71 		unsigned int iobase; /* ISA */
     72 		unsigned int tag; /* PCI, BIOS format */
     73 	} addr;
     74 };
     75 
     76 struct btinfo_console {
     77 	struct btinfo_common common;
     78 	char devname[16];
     79 	int addr;
     80 	int speed;
     81 };
     82 
     83 #include <sys/disklabel_mbr.h>
     84 
     85 struct bi_biosgeom_entry {
     86 	int spc, spt;
     87 	struct mbr_partition dosparts[NMBRPART];
     88 };
     89 
     90 struct btinfo_biosgeom {
     91 	struct btinfo_common common;
     92 	int num;
     93 	struct bi_biosgeom_entry disk[1]; /* var len */
     94 };
     95 
     96 #ifdef _KERNEL
     97 void *lookup_bootinfo __P((int));
     98 #endif
     99 #endif /* _LOCORE */
    100 
    101 #ifdef _KERNEL
    102 #define BOOTINFO_MAXSIZE 1000
    103 #endif
    104