152130Smckusick /* 252130Smckusick * Copyright (c) 1992 Regents of the University of California. 352130Smckusick * 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*59847Sralph * @(#)dec_boot.h 7.3 (Berkeley) 05/09/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 49*59847Sralph #define DEC_BOOT_MAGIC 0x0002757a 50*59847Sralph #define DEC_BOOT_SECTOR 0 51*59847Sralph 52*59847Sralph /* 53*59847Sralph * DEC_NUM_DISK_PARTS is the number of partitions that are recorded in 54*59847Sralph * the label information. The size of the padding in the Dec_DiskLabel 55*59847Sralph * type is dependent on this number... 56*59847Sralph */ 57*59847Sralph #define DEC_NUM_DISK_PARTS 8 58*59847Sralph 59*59847Sralph /* 60*59847Sralph * A disk is divided into partitions and this type specifies where a 61*59847Sralph * partition starts and how many bytes it contains. 62*59847Sralph */ 63*59847Sralph typedef struct Dec_DiskMap { 64*59847Sralph int numBlocks; /* Number of 512 byte blocks in partition. */ 65*59847Sralph int startBlock; /* Start of partition in blocks. */ 66*59847Sralph } Dec_DiskMap; 67*59847Sralph 68*59847Sralph /* 69*59847Sralph * Label information on the 31st (DEC_LABEL_SECTOR) sector. 70*59847Sralph */ 71*59847Sralph typedef struct Dec_DiskLabel { 72*59847Sralph char pad0[440]; /* DIFFERENT from sprite!!! */ 73*59847Sralph int magic; /* DEC_LABEL_MAGIC */ 74*59847Sralph int isPartitioned; /* 1 if disk is partitioned. */ 75*59847Sralph Dec_DiskMap map[DEC_NUM_DISK_PARTS]; /* Indicates disk partitions. */ 76*59847Sralph } Dec_DiskLabel; 77*59847Sralph 78*59847Sralph #define DEC_LABEL_MAGIC 0x00032957 79*59847Sralph #define DEC_LABEL_SECTOR 31 80