1139825Simp/*-
21541Srgrimes * Copyright (c) 1987, 1988, 1993
31541Srgrimes *	The Regents of the University of California.  All rights reserved.
41541Srgrimes *
51541Srgrimes * Redistribution and use in source and binary forms, with or without
61541Srgrimes * modification, are permitted provided that the following conditions
71541Srgrimes * are met:
81541Srgrimes * 1. Redistributions of source code must retain the above copyright
91541Srgrimes *    notice, this list of conditions and the following disclaimer.
101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111541Srgrimes *    notice, this list of conditions and the following disclaimer in the
121541Srgrimes *    documentation and/or other materials provided with the distribution.
131541Srgrimes * 4. Neither the name of the University nor the names of its contributors
141541Srgrimes *    may be used to endorse or promote products derived from this software
151541Srgrimes *    without specific prior written permission.
161541Srgrimes *
171541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271541Srgrimes * SUCH DAMAGE.
281541Srgrimes *
2914478Shsu *	@(#)disklabel.h	8.2 (Berkeley) 7/10/94
3050477Speter * $FreeBSD$
311541Srgrimes */
321541Srgrimes
33104314Sphk#ifndef _SYS_DISKPC98_H_
34104314Sphk#define	_SYS_DISKPC98_H_
352165Spaul
36108591Snyan#include <sys/ioccom.h>
37108591Snyan
38254015Smarcel#define	PC98_BBSECTOR	1	/* DOS boot block relative sector number */
39254015Smarcel#define	PC98_PARTOFF	0
40254015Smarcel#define	PC98_PARTSIZE	32
41254015Smarcel#define	PC98_NPARTS	16
42254015Smarcel#define	PC98_MAGICOFS	510
43254015Smarcel#define	PC98_MAGIC	0xAA55
44145762Snyan
45189695Snyan#define	PC98_MID_BOOTABLE	0x80
46189695Snyan#define	PC98_MID_MASK		0x7f
47189695Snyan#define	PC98_MID_386BSD		0x14
4816363Sasami
49189695Snyan#define	PC98_SID_ACTIVE		0x80
50189695Snyan#define	PC98_SID_MASK		0x7f
51189695Snyan#define	PC98_SID_386BSD		0x44
52189695Snyan
53189695Snyan#define	DOSMID_386BSD		(PC98_MID_386BSD | PC98_MID_BOOTABLE)
54189695Snyan#define	DOSSID_386BSD		(PC98_SID_386BSD | PC98_SID_ACTIVE)
55254015Smarcel#define	PC98_PTYP_386BSD	(DOSSID_386BSD << 8 | DOSMID_386BSD)
56189695Snyan
57108650Snyanstruct pc98_partition {
5816363Sasami    	unsigned char	dp_mid;
5916363Sasami	unsigned char	dp_sid;
6016363Sasami	unsigned char	dp_dum1;
6116363Sasami	unsigned char	dp_dum2;
6216363Sasami	unsigned char	dp_ipl_sct;
6316363Sasami	unsigned char	dp_ipl_head;
6416363Sasami	unsigned short	dp_ipl_cyl;
6516363Sasami	unsigned char	dp_ssect;	/* starting sector */
6616363Sasami	unsigned char	dp_shd;		/* starting head */
6716363Sasami	unsigned short	dp_scyl;	/* starting cylinder */
6816363Sasami	unsigned char	dp_esect;	/* end sector */
6916363Sasami	unsigned char	dp_ehd;		/* end head */
7016363Sasami	unsigned short	dp_ecyl;	/* end cylinder */
7116363Sasami	unsigned char	dp_name[16];
7216363Sasami};
73104616Snyan#ifdef CTASSERT
74254015SmarcelCTASSERT(sizeof (struct pc98_partition) == PC98_PARTSIZE);
75104616Snyan#endif
7616363Sasami
77114414Snyanvoid pc98_partition_dec(void const *pp, struct pc98_partition *d);
78114414Snyanvoid pc98_partition_enc(void *pp, struct pc98_partition *d);
79114414Snyan
80108591Snyan#define DIOCSPC98	_IOW('M', 129, u_char[8192])
81108591Snyan
82104314Sphk#endif /* !_SYS_DISKPC98_H_ */
83