Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Migrate alpha/pmax/vax bootblock stuff from <dev/dec/dec...



details:   https://anonhg.NetBSD.org/src/rev/1f8cf08172a1
branches:  trunk
changeset: 526930:1f8cf08172a1
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue May 14 06:34:20 2002 +0000

description:
Migrate alpha/pmax/vax bootblock stuff from <dev/dec/dec_boot.h> to
<sys/bootblock.h>  (leaving ultrix compat goo in the former)

diffstat:

 sys/arch/alpha/stand/mkbootimage/mkbootimage.c |    5 +-
 sys/arch/vax/stand/installboot/installboot.c   |    5 +-
 sys/arch/vax/stand/installboot/loadbootstrap.c |    5 +-
 sys/dev/dec/dec_boot.h                         |  163 +------------------------
 sys/sys/bootblock.h                            |  164 ++++++++++++++++++++++++-
 5 files changed, 170 insertions(+), 172 deletions(-)

diffs (truncated from 447 to 300 lines):

diff -r b41abac67fef -r 1f8cf08172a1 sys/arch/alpha/stand/mkbootimage/mkbootimage.c
--- a/sys/arch/alpha/stand/mkbootimage/mkbootimage.c    Tue May 14 06:21:20 2002 +0000
+++ b/sys/arch/alpha/stand/mkbootimage/mkbootimage.c    Tue May 14 06:34:20 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkbootimage.c,v 1.5 2002/04/03 06:16:03 lukem Exp $ */
+/* $NetBSD: mkbootimage.c,v 1.6 2002/05/14 06:34:20 lukem Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -32,6 +32,7 @@
 
 #include <sys/param.h>                         /* XXX for roundup, howmany */
 #include <sys/stat.h>
+#include <sys/bootblock.h>
 #include <sys/disklabel.h>
 #include <assert.h>
 #include <err.h>
@@ -41,8 +42,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <dev/dec/dec_boot.h>
-
 static void usage(void);
 
 static void
diff -r b41abac67fef -r 1f8cf08172a1 sys/arch/vax/stand/installboot/installboot.c
--- a/sys/arch/vax/stand/installboot/installboot.c      Tue May 14 06:21:20 2002 +0000
+++ b/sys/arch/vax/stand/installboot/installboot.c      Tue May 14 06:34:20 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: installboot.c,v 1.3 2001/02/19 22:48:59 cgd Exp $ */
+/* $NetBSD: installboot.c,v 1.4 2002/05/14 06:34:20 lukem Exp $ */
 
 /*
  * Copyright (c) 1999 Ross Harvey.  All rights reserved.
@@ -62,6 +62,7 @@
 
 #include <sys/param.h>         /* XXX for roundup, howmany */
 #include <sys/stat.h>
+#include <sys/bootblock.h>
 #include <sys/disklabel.h>
 #include <isofs/cd9660/iso.h>
 #include <assert.h>
@@ -73,8 +74,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <dev/dec/dec_boot.h>
-
 #include "installboot.h"
 
 static void usage(void);
diff -r b41abac67fef -r 1f8cf08172a1 sys/arch/vax/stand/installboot/loadbootstrap.c
--- a/sys/arch/vax/stand/installboot/loadbootstrap.c    Tue May 14 06:21:20 2002 +0000
+++ b/sys/arch/vax/stand/installboot/loadbootstrap.c    Tue May 14 06:34:20 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: loadbootstrap.c,v 1.2 2000/06/17 01:05:11 matt Exp $ */
+/* $NetBSD: loadbootstrap.c,v 1.3 2002/05/14 06:34:20 lukem Exp $ */
 
 /*
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -36,6 +36,7 @@
 
 #include <sys/param.h>         /* XXX for roundup, howmany */
 #include <sys/types.h>
+#include <sys/bootblock.h>
 #include <sys/exec_elf.h>
 #include <sys/exec_aout.h>
 #include <err.h>
@@ -45,8 +46,6 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include <dev/dec/dec_boot.h>
-
 #include "installboot.h"
 
 #define MAX_SEGMENTS   10      /* We can load up to 10 segments */
diff -r b41abac67fef -r 1f8cf08172a1 sys/dev/dec/dec_boot.h
--- a/sys/dev/dec/dec_boot.h    Tue May 14 06:21:20 2002 +0000
+++ b/sys/dev/dec/dec_boot.h    Tue May 14 06:34:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dec_boot.h,v 1.4 2002/04/03 04:05:05 lukem Exp $       */
+/*     $NetBSD: dec_boot.h,v 1.5 2002/05/14 06:34:21 lukem Exp $       */
 
 /*
  * Copyright (c) 1992, 1993
@@ -41,170 +41,9 @@
  *     v 9.4 90/03/01 12:22:36 jhh Exp  SPRITE (Berkeley)
  */
 
-/*
- * Copyright (c) 1994, 1999 Christopher G. Demetriou
- * All rights reserved.
- *
- * 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 Christopher G. Demetriou
- *      for the NetBSD Project.
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
 #ifndef _DEV_DEC_DEC_BOOT_H_
 #define _DEV_DEC_DEC_BOOT_H_
 
-/*
- * Boot block information on the 0th sector.
- * The boot program is stored in sequences of contiguous blocks.
- *
- * NOTE: The standard disk label offset is 64 which is
- * after the boot information expected by the PROM boot loader.
- */
-
-/*
- *     Alpha (disk, but also tape) Boot Block.
- * 
- * See Section (III) 3.6.1 of the Alpha Architecture Reference Manual.
- */
-
-struct alpha_boot_block {
-       u_int64_t bb_data[63];          /* data (disklabel, also as below) */
-       u_int64_t bb_cksum;             /* checksum of the boot block,
-                                        * taken as u_int64_t's
-                                        */
-};
-#define        bb_secsize      bb_data[60]     /* secondary size (blocks) */
-#define        bb_secstart     bb_data[61]     /* secondary start (blocks) */
-#define        bb_flags        bb_data[62]     /* unknown flags (set to zero) */
-
-#define        ALPHA_BOOT_BLOCK_OFFSET         0       /* offset of boot block. */
-#define        ALPHA_BOOT_BLOCK_BLOCKSIZE      512     /* block size for sector
-                                                * size/start, and for boot
-                                                * block itself.
-                                                */
-
-#define        ALPHA_BOOT_BLOCK_CKSUM(bb,cksum)                                \
-       do {                                                            \
-               const struct alpha_boot_block *_bb = (bb);              \
-               u_int64_t _cksum;                                       \
-               int _i;                                                 \
-                                                                       \
-               _cksum = 0;                                             \
-               for (_i = 0;                                            \
-                   _i < (sizeof _bb->bb_data / sizeof _bb->bb_data[0]); \
-                   _i++)                                               \
-                       _cksum += _bb->bb_data[_i];                     \
-               *(cksum) = _cksum;                                      \
-       } while (0)
-
-
-/*
- *     PMAX (DECstation / MIPS) boot block information
- */
-
-/*
- * If mode is 0, there is just one sequence of blocks and one Dec_BootMap
- * is used.  If mode is 1, there are multiple sequences of blocks
- * and multiple Dec_BootMaps are used, the last with numBlocks = 0.
- */
-struct pmax_boot_map {
-       int32_t num_blocks;             /* Number of blocks to read. */
-       int32_t start_block;            /* Starting block on disk. */
-};
-
-/*
- * This is the structure of a disk or tape boot block.  The boot_map
- * can either be a single boot count and start block (contiguous mode)
- * or a list of up to 61 (to fill a 512 byte sector) block count and
- * start block pairs.  Under NetBSD, contiguous mode is always used.
- */
-struct pmax_boot_block {
-       u_int8_t        pad[8];
-       int32_t         magic;                  /* PMAX_BOOT_MAGIC */
-       int32_t         mode;                   /* Mode for boot info. */
-       u_int32_t       load_addr;              /* Address to start loading. */
-       u_int32_t       exec_addr;              /* Address to start execing. */
-       struct          pmax_boot_map map[61];  /* boot program section(s). */
-} __attribute__((__packed__));
-
-#define PMAX_BOOT_MAGIC                        0x0002757a
-#define PMAX_BOOTMODE_CONTIGUOUS       0
-#define PMAX_BOOTMODE_SCATTERED                1
-
-#define PMAX_BOOT_BLOCK_OFFSET         0
-#define PMAX_BOOT_BLOCK_BLOCKSIZE      512
-
-
-/*
- *     VAX boot block information
- */
-struct vax_boot_block {
-/* Note that these don't overlap any of the pmax boot block
- */
-       u_int8_t        pad0[2];
-       u_int8_t        bb_id_offset;   /* offset in words to id (magic1)*/
-       u_int8_t        bb_mbone;       /* must be one */
-       u_int16_t       bb_lbn_hi;      /* lbn (hi word) of bootstrap */
-       u_int16_t       bb_lbn_low;     /* lbn (low word) of bootstrap */
-       u_int8_t        pad1[332];
-
-       /* The rest of these fields are identification area and describe
-        * the secondary block for uVAX VMB.
-        */
-       u_int8_t        bb_magic1;      /* magic number */
-       u_int8_t        bb_mbz1;        /* must be zero */
-       u_int8_t        bb_pad1;        /* any value */
-       u_int8_t        bb_sum1;        /* ~(magic1 + mbz1 + pad1) */
-
-       u_int8_t        bb_mbz2;        /* must be zero */
-       u_int8_t        bb_volinfo;     /* volinfo */
-       u_int8_t        bb_pad2a;       /* any value */
-       u_int8_t        bb_pad2b;       /* any value */
-
-       u_int32_t       bb_size;        /* size in blocks of bootstrap */
-       u_int32_t       bb_load;        /* load offset to bootstrap */
-       u_int32_t       bb_entry;       /* byte offset in bootstrap */
-       u_int32_t       bb_sum3;        /* sum of previous 3 fields */
-
-       /* The rest is unused.
-        */
-       u_int8_t        pad2[148];
-} __attribute__((__packed__));
-
-#define        VAX_BOOT_MAGIC1                 0x18    /* size of BB info? */
-#define        VAX_BOOT_VOLINFO_NONE           0x00    /* no special info */
-#define        VAX_BOOT_VOLINFO_SS             0x01    /* single sided */
-#define        VAX_BOOT_VOLINFO_DS             0x81    /* double sided */
-
-#define        VAX_BOOT_SIZE                   15      /* 15 blocks */
-#define        VAX_BOOT_LOAD                   0       /* no load offset */
-#define        VAX_BOOT_ENTRY                  0x200   /* one block in */
-
-#define VAX_BOOT_BLOCK_OFFSET          0
-#define VAX_BOOT_BLOCK_BLOCKSIZE       512
-
 /* The following describes the ULTRIX partition tables.
  */
 /*
diff -r b41abac67fef -r 1f8cf08172a1 sys/sys/bootblock.h
--- a/sys/sys/bootblock.h       Tue May 14 06:21:20 2002 +0000
+++ b/sys/sys/bootblock.h       Tue May 14 06:34:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootblock.h,v 1.3 2002/05/14 02:41:34 lukem Exp $      */
+/*     $NetBSD: bootblock.h,v 1.4 2002/05/14 06:34:21 lukem Exp $      */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -33,6 +33,40 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ * Copyright (c) 1994, 1999 Christopher G. Demetriou
+ * All rights reserved.
+ *
+ * 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 Christopher G. Demetriou
+ *      for the NetBSD Project.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.



Home | Main Index | Thread Index | Old Index