summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpaul <paul@FreeBSD.org>1994-08-21 17:47:26 +0000
committerpaul <paul@FreeBSD.org>1994-08-21 17:47:26 +0000
commiteb40903ae1b0169f8a1d4e210481c1d3b0f4a715 (patch)
tree679800aa3f0e3d401be5eca69c5551db4e3b80bf /sys
parentcc2a9a6486a9efb4e8b199fa0e2736d26369beeb (diff)
downloadFreeBSD-src-eb40903ae1b0169f8a1d4e210481c1d3b0f4a715.zip
FreeBSD-src-eb40903ae1b0169f8a1d4e210481c1d3b0f4a715.tar.gz
Fixed bootblocks to work with FreeBSD 2.0
1) Fixed up some header locations 2) Replaced list of boot files with /kernel 3) Changed disklabel use in Makefile to conform to 4.4 4) Added size command in Makefile to get close estimate of bootblock sizes. Total size of text and data must be below 64K, slightly overestimated since a.out header subsequently gets stripped. 5) Various buffer sizes are set to 8192 bytes in sys.c. In 4.4 MAXBSIZE is set to 64K which is too big for the bootblocks to deal with. Submitted by: Paul Richards
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/boot/Makefile7
-rw-r--r--sys/i386/boot/biosboot/Makefile7
-rw-r--r--sys/i386/boot/biosboot/boot.c11
-rw-r--r--sys/i386/boot/biosboot/boot.h9
-rw-r--r--sys/i386/boot/biosboot/sys.c12
-rw-r--r--sys/i386/boot/boot.c11
-rw-r--r--sys/i386/boot/boot.h9
-rw-r--r--sys/i386/boot/sys.c12
8 files changed, 46 insertions, 32 deletions
diff --git a/sys/i386/boot/Makefile b/sys/i386/boot/Makefile
index 568c747..228447f 100644
--- a/sys/i386/boot/Makefile
+++ b/sys/i386/boot/Makefile
@@ -20,13 +20,13 @@
# the rights to redistribute these changes.
#
# from: Mach, Revision 2.2 92/04/04 11:33:46 rpd
-# $Id: Makefile,v 1.9 1994/06/16 03:53:24 adam Exp $
+# $Id: Makefile,v 1.10 1994/06/20 04:32:40 jkh Exp $
#
wd0:
dd if=boot of=biosboot count=1
dd if=boot of=bootbios skip=1
- disklabel -r -w wd0 nec5655 newboot biosboot bootbios
+ disklabel -B -b biosboot -s bootbios wd0 nec5655
rm biosboot bootbios
NOPROG= noprog
@@ -54,6 +54,7 @@ boot: $(OBJS)
$(LD) -Bstatic -N -T 0 -o boot $(OBJS) $(LIBS)
cp boot boot.sym
@strip boot
+ @size boot
@sh ${.CURDIR}/rmaouthdr boot boot.tmp
@mv -f boot.tmp boot
@ls -l boot
@@ -95,7 +96,7 @@ all: biosboot bootbios
fd0:
dd if=boot of=biosboot count=1
dd if=boot of=bootbios skip=1
- disklabel -r -w fd0 floppy bootflpy biosboot bootbios
+ disklabel -B -b biosboot -s bootbios fd0 floppy
rm biosboot bootbios
install: wd sd fd
diff --git a/sys/i386/boot/biosboot/Makefile b/sys/i386/boot/biosboot/Makefile
index 568c747..228447f 100644
--- a/sys/i386/boot/biosboot/Makefile
+++ b/sys/i386/boot/biosboot/Makefile
@@ -20,13 +20,13 @@
# the rights to redistribute these changes.
#
# from: Mach, Revision 2.2 92/04/04 11:33:46 rpd
-# $Id: Makefile,v 1.9 1994/06/16 03:53:24 adam Exp $
+# $Id: Makefile,v 1.10 1994/06/20 04:32:40 jkh Exp $
#
wd0:
dd if=boot of=biosboot count=1
dd if=boot of=bootbios skip=1
- disklabel -r -w wd0 nec5655 newboot biosboot bootbios
+ disklabel -B -b biosboot -s bootbios wd0 nec5655
rm biosboot bootbios
NOPROG= noprog
@@ -54,6 +54,7 @@ boot: $(OBJS)
$(LD) -Bstatic -N -T 0 -o boot $(OBJS) $(LIBS)
cp boot boot.sym
@strip boot
+ @size boot
@sh ${.CURDIR}/rmaouthdr boot boot.tmp
@mv -f boot.tmp boot
@ls -l boot
@@ -95,7 +96,7 @@ all: biosboot bootbios
fd0:
dd if=boot of=biosboot count=1
dd if=boot of=bootbios skip=1
- disklabel -r -w fd0 floppy bootflpy biosboot bootbios
+ disklabel -B -b biosboot -s bootbios fd0 floppy
rm biosboot bootbios
install: wd sd fd
diff --git a/sys/i386/boot/biosboot/boot.c b/sys/i386/boot/biosboot/boot.c
index e186bdc..559d431 100644
--- a/sys/i386/boot/biosboot/boot.c
+++ b/sys/i386/boot/biosboot/boot.c
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, [92/04/03 16:51:14 rvb]
- * $Id: boot.c,v 1.13 1994/06/14 07:31:42 rgrimes Exp $
+ * $Id: boot.c,v 1.14 1994/06/16 03:53:27 adam Exp $
*/
@@ -60,7 +60,7 @@ struct exec head;
int argv[10], esym;
char *name;
char *names[] = {
- "/386bsd", "/o386bsd", "/386bsd.old"
+ "/kernel"
};
#define NUMNAMES (sizeof(names)/sizeof(char *))
@@ -71,12 +71,11 @@ int drive;
int loadflags, currname = 0;
char *t;
- printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory [%s]\n",
+ printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory\n",
ouraddr,
argv[7] = memsize(0),
- argv[8] = memsize(1),
- "$Revision: 1.14 $");
- printf("use hd(1,a)/386bsd to boot sd0 when wd0 is also installed\n");
+ argv[8] = memsize(1));
+ printf("use hd(1,a)/kernel to boot sd0 when wd0 is also installed\n");
gateA20();
loadstart:
/***************************************************************\
diff --git a/sys/i386/boot/biosboot/boot.h b/sys/i386/boot/biosboot/boot.h
index f77f882..2046990 100644
--- a/sys/i386/boot/biosboot/boot.h
+++ b/sys/i386/boot/biosboot/boot.h
@@ -24,14 +24,15 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:03 rpd
- * $Id$
+ * $Id: boot.h,v 1.3 1993/10/16 19:11:32 rgrimes Exp $
*/
#include <sys/types.h>
#include <sys/param.h>
-#include <ufs/quota.h>
-#include <ufs/fs.h>
-#include <ufs/inode.h>
+#include <sys/time.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ffs/fs.h>
+#include <ufs/ufs/inode.h>
extern char *devs[], *name, *iodest;
extern struct fs *fs;
diff --git a/sys/i386/boot/biosboot/sys.c b/sys/i386/boot/biosboot/sys.c
index 4ffe171..0b9476c 100644
--- a/sys/i386/boot/biosboot/sys.c
+++ b/sys/i386/boot/biosboot/sys.c
@@ -24,17 +24,23 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:36:34 rpd
- * $Id$
+ * $Id: sys.c,v 1.3 1993/10/16 19:11:39 rgrimes Exp $
*/
#include "boot.h"
#include <sys/dir.h>
#include <sys/reboot.h>
+#ifdef 0
/* #define BUFSIZE 4096 */
#define BUFSIZE MAXBSIZE
char buf[BUFSIZE], fsbuf[SBSIZE], iobuf[MAXBSIZE];
+#endif
+
+#define BUFSIZE 8192
+#define MAPBUFSIZE BUFSIZE
+char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE];
int xread(addr, size)
char * addr;
@@ -93,7 +99,7 @@ find(path)
struct direct *dp;
loop: iodest = iobuf;
cnt = fs->fs_bsize;
- bnum = fsbtodb(fs,itod(fs,ino)) + boff;
+ bnum = fsbtodb(fs,ino_to_fsba(fs,ino)) + boff;
devread();
bcopy(&((struct dinode *)iodest)[ino % fs->fs_inopb],
&inode.i_din,
@@ -125,7 +131,7 @@ loop: iodest = iobuf;
goto loop;
}
-char mapbuf[MAXBSIZE];
+char mapbuf[MAPBUFSIZE];
int mapblock = 0;
block_map(file_block)
diff --git a/sys/i386/boot/boot.c b/sys/i386/boot/boot.c
index e186bdc..559d431 100644
--- a/sys/i386/boot/boot.c
+++ b/sys/i386/boot/boot.c
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, [92/04/03 16:51:14 rvb]
- * $Id: boot.c,v 1.13 1994/06/14 07:31:42 rgrimes Exp $
+ * $Id: boot.c,v 1.14 1994/06/16 03:53:27 adam Exp $
*/
@@ -60,7 +60,7 @@ struct exec head;
int argv[10], esym;
char *name;
char *names[] = {
- "/386bsd", "/o386bsd", "/386bsd.old"
+ "/kernel"
};
#define NUMNAMES (sizeof(names)/sizeof(char *))
@@ -71,12 +71,11 @@ int drive;
int loadflags, currname = 0;
char *t;
- printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory [%s]\n",
+ printf("\n>> FreeBSD BOOT @ 0x%x: %d/%d k of memory\n",
ouraddr,
argv[7] = memsize(0),
- argv[8] = memsize(1),
- "$Revision: 1.14 $");
- printf("use hd(1,a)/386bsd to boot sd0 when wd0 is also installed\n");
+ argv[8] = memsize(1));
+ printf("use hd(1,a)/kernel to boot sd0 when wd0 is also installed\n");
gateA20();
loadstart:
/***************************************************************\
diff --git a/sys/i386/boot/boot.h b/sys/i386/boot/boot.h
index f77f882..2046990 100644
--- a/sys/i386/boot/boot.h
+++ b/sys/i386/boot/boot.h
@@ -24,14 +24,15 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:35:03 rpd
- * $Id$
+ * $Id: boot.h,v 1.3 1993/10/16 19:11:32 rgrimes Exp $
*/
#include <sys/types.h>
#include <sys/param.h>
-#include <ufs/quota.h>
-#include <ufs/fs.h>
-#include <ufs/inode.h>
+#include <sys/time.h>
+#include <ufs/ufs/quota.h>
+#include <ufs/ffs/fs.h>
+#include <ufs/ufs/inode.h>
extern char *devs[], *name, *iodest;
extern struct fs *fs;
diff --git a/sys/i386/boot/sys.c b/sys/i386/boot/sys.c
index 4ffe171..0b9476c 100644
--- a/sys/i386/boot/sys.c
+++ b/sys/i386/boot/sys.c
@@ -24,17 +24,23 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:36:34 rpd
- * $Id$
+ * $Id: sys.c,v 1.3 1993/10/16 19:11:39 rgrimes Exp $
*/
#include "boot.h"
#include <sys/dir.h>
#include <sys/reboot.h>
+#ifdef 0
/* #define BUFSIZE 4096 */
#define BUFSIZE MAXBSIZE
char buf[BUFSIZE], fsbuf[SBSIZE], iobuf[MAXBSIZE];
+#endif
+
+#define BUFSIZE 8192
+#define MAPBUFSIZE BUFSIZE
+char buf[BUFSIZE], fsbuf[BUFSIZE], iobuf[BUFSIZE];
int xread(addr, size)
char * addr;
@@ -93,7 +99,7 @@ find(path)
struct direct *dp;
loop: iodest = iobuf;
cnt = fs->fs_bsize;
- bnum = fsbtodb(fs,itod(fs,ino)) + boff;
+ bnum = fsbtodb(fs,ino_to_fsba(fs,ino)) + boff;
devread();
bcopy(&((struct dinode *)iodest)[ino % fs->fs_inopb],
&inode.i_din,
@@ -125,7 +131,7 @@ loop: iodest = iobuf;
goto loop;
}
-char mapbuf[MAXBSIZE];
+char mapbuf[MAPBUFSIZE];
int mapblock = 0;
block_map(file_block)
OpenPOWER on IntegriCloud