NetBSD/lib/libahdi/ahdi.4

136 lines
4.7 KiB
Groff

.\" $NetBSD: ahdi.4,v 1.1 2000/02/05 20:40:36 jdc Exp $
.\"
.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Julian Coleman.
.\"
.\" 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.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the NetBSD
.\" Foundation, Inc. and its contributors.
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
.\" contributors may be used to endorse or promote products derived
.\" from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``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 FOUNDATION OR CONTRIBUTORS
.\" 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.
.\"
.Dd January 5, 2000
.Dt ahdi 4
.Sh NAME
.Nm ahdi
.Nd format of AHDI partitioned disk
.Sh DESCRIPTION
The AHDI disk format consists of a root sector (sector 0) containing:
.Bl -column "Offset" "Contents" -offset indent
.It Em Offset Ta Em Contents
.It Li 0x000 Ta
Boot code (can be empty)
.It Li 0x1c2 Ta
Size of hard disk in sectors
.It Li 0x1c6 Ta
First partition information
.It Li 0x1d2 Ta
Second partition information
.It Li 0x1de Ta
Third partition information
.It Li 0x1ea Ta
Fourth partition information
.It Li 0x1f6 Ta
Sector containing start of bad sector list (usually 1)
.It Li 0x1fa Ta
Length of bad sector list, in sectors (usually 1)
.It Li 0x1fe Ta
Root sector checksum
.El
.Pp
The format of the partition information is:
.Bl -column "Offset" "Contents" -offset indent
.It Li Em Offset Ta Em Contents
.It Li 0x00 Ta
Partition flag (0x1 if partition is valid, 0x0 otherwise)
.It Li 0x01 Ta
Partition ID (e.g. NBD, GEM)
.It Li 0x04 Ta
Partition start sector
.It Li 0x08 Ta
Partition size in sectors
.El
.Pp
The offsets are in bytes from the start of the sector.
.Pp
If the partition ID is
.Em XGM ,
the partition is a pointer to an extended partition, where the start
sector is the sector containing the auxiliary root and the size is the
size of the auxiliary root and any partitions it references.
.Pp
The format of the auxiliary root sector is the same as that of the root
sector. However, the only valid fields are at most two of the partition
structures. Only one of these can reference to a non-XGM partition. The
start sector in the partition structure contains the offset of the partition
from the start of the
.Em first
auxiliary partition.
.Pp
Partitions referenced from the root sector (sector 0) are known as
.Em primary partitions ,
while those referenced from auxiliary root sectors are known as
.Em extended partitions .
.Pp
The bad sector list consists of 3-byte entries. The first entry contains
the number of vendor bad sectors recorded. The first byte of the second
entry contains a checksum byte which causes the bytewise sum of the whole
bad sector list to be 0xa5. The remaining entries are vendor bad sectors
followed by user bad sectors.
.Pp
The
.Nx
disklabel is written in the first partition with ID
.Em NBD
or
.Em RAW .
If neither of these partition ID's is present on the disk, no
.Nx
disklabel will exist on the disk. In this case, an in-core disklabel is
automatically generated by the
.Nx
kernel.
.Sh NOTES
The AHDI disk format only supports media with a 512 byte sector size.
.Pp
It is only possible to boot from a
.Em primary partition .
.Sh SEE ALSO
.Xr ahdi_buildlabel 3 ,
.Xr ahdi_checklabel 3 ,
.Xr ahdi_readlabel 3 ,
.Xr ahdi_writedisktab 3 ,
.Xr ahdi_writelabel 3
.Sh HISTORY
The
.Nm libahdi
package appeared in
.Nx 1.5 .
.Sh AUTHORS
.An Julian Coleman, Waldi Ravens, Leo Weppelman