xref: /csrg-svn/sys/pmax/stand/dec_boot.h (revision 63226)
152130Smckusick /*
2*63226Sbostic  * Copyright (c) 1992, 1993
3*63226Sbostic  *	The Regents of the University of California.  All rights reserved.
452130Smckusick  *
552130Smckusick  * This code is derived from software contributed to Berkeley by
652130Smckusick  * Ralph Campbell.
752130Smckusick  *
852130Smckusick  * %sccs.include.redist.c%
952130Smckusick  *
10*63226Sbostic  *	@(#)dec_boot.h	8.1 (Berkeley) 06/10/93
1152130Smckusick  *
1252130Smckusick  * devDiskLabel.h --
1352130Smckusick  *
1452130Smckusick  *      This defines the disk label that Sun writes on the 0'th sector of
1552130Smckusick  *      the 0'th cylinder of its SMD disks.  The disk label contains some
1652130Smckusick  *      geometry information and also the division of the disk into a
1752130Smckusick  *      number of partitions.  Each partition is identified to the drive
1852130Smckusick  *      by a different unit number.
1952130Smckusick  *
2052130Smckusick  * from: $Header: /sprite/src/kernel/dev/RCS/devDiskLabel.h,
2152130Smckusick  *	v 9.4 90/03/01 12:22:36 jhh Exp $ SPRITE (Berkeley)
2252130Smckusick  */
2352130Smckusick 
2452130Smckusick /*
2552130Smckusick  * Boot block information on the 0th sector.
2652130Smckusick  * The boot program is stored in sequences of contiguous blocks.
2752130Smckusick  * If mode is 0, there is just one sequence of blocks and one Dec_BootMap
2852130Smckusick  * is used.  If mode is 1, there are multiple sequences of blocks
2952130Smckusick  * and multiple Dec_BootMaps are used, the last with numBlocks = 0.
3053205Sralph  *
3153205Sralph  * NOTE: The standard disk label offset is 64 which is
3253205Sralph  * after the boot information expected by the PROM boot loader.
3352130Smckusick  */
3453205Sralph 
3553205Sralph struct Dec_BootMap {
3653205Sralph 	int	numBlocks;		/* Number of blocks to read. */
3753205Sralph 	int	startBlock;		/* Starting block on disk. */
3853205Sralph };
3953205Sralph 
4053205Sralph struct Dec_DiskBoot {
4153205Sralph 	char	pad[8];
4253205Sralph 	int	magic;			/* DEC_BOOT_MAGIC */
4353205Sralph 	int	mode;			/* Mode for boot info. */
4453205Sralph 	int	loadAddr;		/* Address to start loading. */
4553205Sralph 	int	execAddr;		/* Address to start execing. */
4653205Sralph 	struct	Dec_BootMap map[61];	/* boot program sections. */
4753205Sralph };
4852130Smckusick 
4959847Sralph #define DEC_BOOT_MAGIC		0x0002757a
5059847Sralph #define DEC_BOOT_SECTOR		0
5159847Sralph 
5259847Sralph /*
5359847Sralph  * DEC_NUM_DISK_PARTS is the number of partitions that are recorded in
5459847Sralph  * the label information.  The size of the padding in the Dec_DiskLabel
5559847Sralph  * type is dependent on this number...
5659847Sralph  */
5759847Sralph #define DEC_NUM_DISK_PARTS	8
5859847Sralph 
5959847Sralph /*
6059847Sralph  * A disk is divided into partitions and this type specifies where a
6159847Sralph  * partition starts and how many bytes it contains.
6259847Sralph  */
6359847Sralph typedef struct Dec_DiskMap {
6459847Sralph 	int	numBlocks;	/* Number of 512 byte blocks in partition. */
6559847Sralph 	int	startBlock;	/* Start of partition in blocks. */
6659847Sralph } Dec_DiskMap;
6759847Sralph 
6859847Sralph /*
6959847Sralph  * Label information on the 31st (DEC_LABEL_SECTOR) sector.
7059847Sralph  */
7159847Sralph typedef struct Dec_DiskLabel {
7259847Sralph     char	pad0[440];		/* DIFFERENT from sprite!!! */
7359847Sralph     int		magic;			/* DEC_LABEL_MAGIC */
7459847Sralph     int		isPartitioned;		/* 1 if disk is partitioned. */
7559847Sralph     Dec_DiskMap map[DEC_NUM_DISK_PARTS]; /* Indicates disk partitions. */
7659847Sralph } Dec_DiskLabel;
7759847Sralph 
7859847Sralph #define DEC_LABEL_MAGIC		0x00032957
7959847Sralph #define DEC_LABEL_SECTOR	31
80