1 /* 2 * Copyright (c) 1992 Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Ralph Campbell. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)dec_boot.h 7.3 (Berkeley) 05/09/93 11 * 12 * devDiskLabel.h -- 13 * 14 * This defines the disk label that Sun writes on the 0'th sector of 15 * the 0'th cylinder of its SMD disks. The disk label contains some 16 * geometry information and also the division of the disk into a 17 * number of partitions. Each partition is identified to the drive 18 * by a different unit number. 19 * 20 * from: $Header: /sprite/src/kernel/dev/RCS/devDiskLabel.h, 21 * v 9.4 90/03/01 12:22:36 jhh Exp $ SPRITE (Berkeley) 22 */ 23 24 /* 25 * Boot block information on the 0th sector. 26 * The boot program is stored in sequences of contiguous blocks. 27 * If mode is 0, there is just one sequence of blocks and one Dec_BootMap 28 * is used. If mode is 1, there are multiple sequences of blocks 29 * and multiple Dec_BootMaps are used, the last with numBlocks = 0. 30 * 31 * NOTE: The standard disk label offset is 64 which is 32 * after the boot information expected by the PROM boot loader. 33 */ 34 35 struct Dec_BootMap { 36 int numBlocks; /* Number of blocks to read. */ 37 int startBlock; /* Starting block on disk. */ 38 }; 39 40 struct Dec_DiskBoot { 41 char pad[8]; 42 int magic; /* DEC_BOOT_MAGIC */ 43 int mode; /* Mode for boot info. */ 44 int loadAddr; /* Address to start loading. */ 45 int execAddr; /* Address to start execing. */ 46 struct Dec_BootMap map[61]; /* boot program sections. */ 47 }; 48 49 #define DEC_BOOT_MAGIC 0x0002757a 50 #define DEC_BOOT_SECTOR 0 51 52 /* 53 * DEC_NUM_DISK_PARTS is the number of partitions that are recorded in 54 * the label information. The size of the padding in the Dec_DiskLabel 55 * type is dependent on this number... 56 */ 57 #define DEC_NUM_DISK_PARTS 8 58 59 /* 60 * A disk is divided into partitions and this type specifies where a 61 * partition starts and how many bytes it contains. 62 */ 63 typedef struct Dec_DiskMap { 64 int numBlocks; /* Number of 512 byte blocks in partition. */ 65 int startBlock; /* Start of partition in blocks. */ 66 } Dec_DiskMap; 67 68 /* 69 * Label information on the 31st (DEC_LABEL_SECTOR) sector. 70 */ 71 typedef struct Dec_DiskLabel { 72 char pad0[440]; /* DIFFERENT from sprite!!! */ 73 int magic; /* DEC_LABEL_MAGIC */ 74 int isPartitioned; /* 1 if disk is partitioned. */ 75 Dec_DiskMap map[DEC_NUM_DISK_PARTS]; /* Indicates disk partitions. */ 76 } Dec_DiskLabel; 77 78 #define DEC_LABEL_MAGIC 0x00032957 79 #define DEC_LABEL_SECTOR 31 80