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
This commit is contained in:
paul 1994-08-21 17:47:26 +00:00
parent cc2a9a6486
commit eb40903ae1
8 changed files with 46 additions and 32 deletions

View File

@ -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

View File

@ -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

View File

@ -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:
/***************************************************************\

View File

@ -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;

View File

@ -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)

View File

@ -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:
/***************************************************************\

View File

@ -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;

View File

@ -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)