Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/installboot roundup() write of hp300 boot code to a...
details: https://anonhg.NetBSD.org/src/rev/e731885755da
branches: trunk
changeset: 555284:e731885755da
user: dsl <dsl%NetBSD.org@localhost>
date: Thu Nov 13 08:19:43 2003 +0000
description:
roundup() write of hp300 boot code to a multiplr of the disk sector size.
and re-instate the hp300 code - seems to work.
diffstat:
usr.sbin/installboot/Makefile | 4 +-
usr.sbin/installboot/arch/hp300.c | 7 +-
usr.sbin/installboot/hp300_volhdr.h | 113 ------------------------------------
usr.sbin/installboot/installboot.8 | 12 +-
usr.sbin/installboot/machines.c | 10 +-
5 files changed, 15 insertions(+), 131 deletions(-)
diffs (234 lines):
diff -r a7efe8cf324f -r e731885755da usr.sbin/installboot/Makefile
--- a/usr.sbin/installboot/Makefile Thu Nov 13 08:17:12 2003 +0000
+++ b/usr.sbin/installboot/Makefile Thu Nov 13 08:19:43 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2003/11/10 09:14:58 fvdl Exp $
+# $NetBSD: Makefile,v 1.29 2003/11/13 08:19:43 dsl Exp $
#
.include <bsd.own.mk>
@@ -6,7 +6,7 @@
PROG= installboot
SRCS= installboot.c sum.c machines.c fstypes.c \
ffs.c ffs_bswap.c bbinfo.c \
- alpha.c amiga.c i386.c macppc.c news.c next68k.c pmax.c \
+ alpha.c amiga.c hp300.c i386.c macppc.c news.c next68k.c pmax.c \
sparc.c sparc64.c sun68k.c vax.c x68k.c
MAN= installboot.8
diff -r a7efe8cf324f -r e731885755da usr.sbin/installboot/arch/hp300.c
--- a/usr.sbin/installboot/arch/hp300.c Thu Nov 13 08:17:12 2003 +0000
+++ b/usr.sbin/installboot/arch/hp300.c Thu Nov 13 08:19:43 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hp300.c,v 1.3 2003/11/10 10:48:30 dsl Exp $ */
+/* $NetBSD: hp300.c,v 1.4 2003/11/13 08:19:43 dsl Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
-__RCSID("$NetBSD: hp300.c,v 1.3 2003/11/10 10:48:30 dsl Exp $");
+__RCSID("$NetBSD: hp300.c,v 1.4 2003/11/13 08:19:43 dsl Exp $");
#endif /* !__lint */
/* We need the target disklabel.h, not the hosts one..... */
@@ -69,7 +69,6 @@
#include <unistd.h>
#include "installboot.h"
-#include "hp300_volhdr.h"
int
hp300_setboot(ib_params *params)
@@ -189,7 +188,7 @@
/* Write files to BOOT partition */
offset = boot_offset <= HP300_SECTSIZE * 16 ? HP300_SECTSIZE * 16 : 0;
- i = params->s1stat.st_size - offset;
+ i = roundup(params->s1stat.st_size, secsize) - offset;
rv = pwrite(params->fsfd, bootstrap + offset, i, boot_offset + offset);
if (rv != i) {
if (rv == -1)
diff -r a7efe8cf324f -r e731885755da usr.sbin/installboot/hp300_volhdr.h
--- a/usr.sbin/installboot/hp300_volhdr.h Thu Nov 13 08:17:12 2003 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/* $NetBSD: hp300_volhdr.h,v 1.1 2003/11/08 16:44:35 dsl Exp $ */
-
-/*
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department.
- *
- * 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. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)volhdr.h 8.1 (Berkeley) 6/10/93
- */
-/*
- * Copyright (c) 1988 University of Utah.
- *
- * This code is derived from software contributed to Berkeley by
- * the Systems Programming Group of the University of Utah Computer
- * Science Department.
- *
- * 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 the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
- *
- * @(#)volhdr.h 8.1 (Berkeley) 6/10/93
- */
-
-/*
- * vohldr.h: volume header for "LIF" format volumes
- */
-
-struct hp300_lifvol {
- int16_t vol_id;
- char vol_label[6];
- int32_t vol_addr;
- int16_t vol_oct;
- int16_t vol_dummy;
- int32_t vol_dirsize;
- int16_t vol_version;
- int16_t vol_zero;
- int32_t vol_huh1;
- int32_t vol_huh2;
- int32_t vol_length;
-};
-
-struct hp300_lifdir {
- char dir_name[10];
- int16_t dir_type;
- int32_t dir_addr;
- int32_t dir_length;
- char dir_toc[6];
- int16_t dir_flag;
- int32_t dir_exec;
-};
-
-/* load header for boot rom */
-struct hp300_load {
- int32_t address;
- int32_t count;
-};
-
-#define HP300_VOL_ID -32768
-#define HP300_VOL_OCT 4096
-#define HP300_DIR_TYPE -5822
-#define HP300_DIR_FLAG 0x8001 /* dont ask me! */
-#define HP300_SECTSIZE 256
diff -r a7efe8cf324f -r e731885755da usr.sbin/installboot/installboot.8
--- a/usr.sbin/installboot/installboot.8 Thu Nov 13 08:17:12 2003 +0000
+++ b/usr.sbin/installboot/installboot.8 Thu Nov 13 08:19:43 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: installboot.8,v 1.36 2003/11/10 09:19:03 fvdl Exp $
+.\" $NetBSD: installboot.8,v 1.37 2003/11/13 08:19:43 dsl Exp $
.\"
.\" Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -196,7 +196,7 @@
.Sy alpha ,
.Sy amd64 ,
.Sy amiga ,
-.\" Sy hp300 ,
+.Sy hp300 ,
.Sy i386 ,
.Sy macppc ,
.Sy news68k ,
@@ -617,10 +617,10 @@
though some file systems (e.g., ISO 9660) are able to accommodate larger
ones.
.
-.\" .Ss NetBSD/hp300
-.\" The disk must have a boot partition large enough to hold the bootstrap code.
-.\" Currently the primary bootstrap must be a LIF format file.
-.\" .
+.Ss NetBSD/hp300
+The disk must have a boot partition large enough to hold the bootstrap code.
+Currently the primary bootstrap must be a LIF format file.
+.
.Ss NetBSD/i386 and NetBSD/amd64
The size of primary bootstrap programs is restricted to 8KB, even
though some file systems (e.g., ISO 9660) are able to accommodate larger
diff -r a7efe8cf324f -r e731885755da usr.sbin/installboot/machines.c
--- a/usr.sbin/installboot/machines.c Thu Nov 13 08:17:12 2003 +0000
+++ b/usr.sbin/installboot/machines.c Thu Nov 13 08:19:43 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machines.c,v 1.20 2003/11/10 09:19:03 fvdl Exp $ */
+/* $NetBSD: machines.c,v 1.21 2003/11/13 08:19:43 dsl Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: machines.c,v 1.20 2003/11/10 09:19:03 fvdl Exp $");
+__RCSID("$NetBSD: machines.c,v 1.21 2003/11/13 08:19:43 dsl Exp $");
#endif /* !__lint */
#include <sys/types.h>
@@ -52,10 +52,8 @@
IB_PASSWORD | IB_TIMEOUT },
{ "amiga", amiga_setboot, no_clearboot,
IB_STAGE1START | IB_STAGE2START | IB_COMMAND },
-#if 0 /* needs work */
- { "hp300", hp300_setboot, no_clearboot,
- 0 },
-#endif
+ { "hp300", hp300_setboot, no_clearboot,
+ IB_APPEND },
{ "i386", i386_setboot, no_clearboot,
IB_RESETVIDEO | IB_CONSOLE | IB_CONSPEED |
IB_PASSWORD | IB_TIMEOUT },
Home |
Main Index |
Thread Index |
Old Index