[BACK]Return to mbr.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / distrib / utils / sysinst

Annotation of src/distrib/utils/sysinst/mbr.h, Revision 1.4

1.4     ! fvdl        1: /*     $NetBSD: mbr.h,v 1.3 1998/07/21 14:53:36 rvb Exp $      */
1.1       jonathan    2:
                      3: /*
                      4:  * Copyright 1997, 1988 Piermont Information Systems Inc.
                      5:  * All rights reserved.
                      6:  *
                      7:  * Written by Philip A. Nelson for Piermont Information Systems Inc.
                      8:  *
                      9:  * Redistribution and use in source and binary forms, with or without
                     10:  * modification, are permitted provided that the following conditions
                     11:  * are met:
                     12:  * 1. Redistributions of source code must retain the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer.
                     14:  * 2. Redistributions in binary form must reproduce the above copyright
                     15:  *    notice, this list of conditions and the following disclaimer in the
                     16:  *    documentation and/or other materials provided with the distribution.
                     17:  * 3. All advertising materials mentioning features or use of this software
                     18:  *    must display the following acknowledgement:
                     19:  *      This product includes software develooped for the NetBSD Project by
                     20:  *      Piermont Information Systems Inc.
                     21:  * 4. The name of Piermont Information Systems Inc. may not be used to endorse
                     22:  *    or promote products derived from this software without specific prior
                     23:  *    written permission.
                     24:  *
                     25:  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
                     26:  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     27:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     28:  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
                     29:  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     30:  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     31:  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     32:  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     33:  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     34:  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
                     35:  * THE POSSIBILITY OF SUCH DAMAGE.
                     36:  *
                     37:  */
                     38:
                     39: /*
                     40:  * mbr.h -- definitions for reading, writing and editing DOS MBRs.
                     41:  * Use by including from md.h on ports  which use MBRs (i386, powerpc, arc)
                     42:  * naming convention:  dlxxxx => NetBSD disklabel, bxxxx => bios
                     43:  */
                     44:
                     45: /* constants and defines */
                     46:
1.4     ! fvdl       47: #include <sys/disklabel_mbr.h>
        !            48:
        !            49: /*
        !            50:  * XXX
        !            51:  */
        !            52: #define MBR_SECSIZE     512
        !            53:
        !            54: #define MBR_PUT_LSCYL(c)               ((c) & 0xff)
        !            55: #define MBR_PUT_MSCYLANDSEC(c,s)       (((s) & 0x3f) | (((c) >> 2) & 0xc0))
        !            56:
1.1       jonathan   57: /* incore fdisk (mbr, bios) geometry */
                     58: EXTERN int bcyl, bhead, bsec, bsize, bcylsize;
                     59:
                     60: /* incore copy of  MBR partitions */
1.4     ! fvdl       61: EXTERN struct mbr_partition *part;
1.1       jonathan   62: EXTERN int activepart;
                     63: EXTERN int bsdpart;                    /* partition in use by NetBSD */
                     64: EXTERN int usefull;                    /* on install, clobber entire disk */
                     65:
1.4     ! fvdl       66: extern char mbr[];
        !            67:
1.1       jonathan   68:
                     69: /* from mbr.c */
1.2       mrg        70: void   set_fdisk_geom __P((void));     /* edit incore BIOS geometry */
                     71: void   disp_cur_geom __P((void));
                     72: int    check_geom __P((void));         /* primitive geometry sanity-check */
1.1       jonathan   73:
1.4     ! fvdl       74: int    edit_mbr __P((struct mbr_partition *));
        !            75: int    partsoverlap __P((struct mbr_partition *, int, int));
1.1       jonathan   76:
1.4     ! fvdl       77: /* from mbr.c */
        !            78:
        !            79: int     read_mbr __P((char *, char *, int));
        !            80: int     write_mbr __P((char *, char *, int));
        !            81: int     valid_mbr __P((char *));
        !            82: int    guess_biosgeom_from_mbr __P((char *, int *, int *, int *));
        !            83: int    md_bios_info __P((char *));
        !            84: void   set_bios_geom __P((int, int, int));
        !            85: int    otherpart __P((int));
        !            86: int    ourpart __P((int));

CVSweb <webmaster@jp.NetBSD.org>