From: Ben Gras Date: Fri, 20 May 2005 12:30:19 +0000 (+0000) Subject: Removed root filesystem blocksize restriction by reducing boot monitor X-Git-Tag: v3.1.0~827 X-Git-Url: http://zhaoyanbai.com/repos/tz-link.htm?a=commitdiff_plain;h=f8bd2691ec56ccb53cdfc8ed9adbaf356bf0e4da;p=minix.git Removed root filesystem blocksize restriction by reducing boot monitor stack size from 16kB to 8kB. No apparent adverse affects. --- diff --git a/boot/Makefile b/boot/Makefile index 6d73afa6a..753e8ea63 100755 --- a/boot/Makefile +++ b/boot/Makefile @@ -38,7 +38,7 @@ rawfs86.o: rawfs.c rawfs.o boot: boothead.s boot.o bootimage.o rawfs86.o $(LD86) -o $@ \ boothead.s boot.o bootimage.o rawfs86.o $(LIBS) - install -S 16kb boot + install -S 8kb boot bootcd: bootcdhead.s boot.o bootimage.o rawfs86.o $(LD86) -o $@ \ diff --git a/boot/rawfs.c b/boot/rawfs.c index e86db038d..d0f0478f3 100755 --- a/boot/rawfs.c +++ b/boot/rawfs.c @@ -52,12 +52,10 @@ static struct super_block super; /* Superblock of file system */ #define SUPER_V1 SUPER_MAGIC /* V1 magic has a weird name. */ #endif -#define RAWFS_MAX_BLOCK_SIZE 1024 - static struct inode curfil; /* Inode of file under examination */ -static char indir[RAWFS_MAX_BLOCK_SIZE]; /* Single indirect block. */ -static char dindir[RAWFS_MAX_BLOCK_SIZE]; /* Double indirect block. */ -static char dirbuf[RAWFS_MAX_BLOCK_SIZE]; /* Scratch/Directory block. */ +static char indir[MAX_BLOCK_SIZE]; /* Single indirect block. */ +static char dindir[MAX_BLOCK_SIZE]; /* Double indirect block. */ +static char dirbuf[MAX_BLOCK_SIZE]; /* Scratch/Directory block. */ #define scratch dirbuf static block_t a_indir, a_dindir; /* Addresses of the indirects. */ @@ -72,7 +70,10 @@ off_t r_super(int *bs) * (zero on error). */ { - /* Read superblock. */ + /* Read superblock. (The superblock is always at 1kB offset, + * that's why we lie to readblock and say the block size is 1024 + * and we want block number 1 (the 'second block', at offset 1kB).) + */ readblock(1, scratch, 1024); memcpy(&super, scratch, sizeof(super)); @@ -83,7 +84,7 @@ off_t r_super(int *bs) super.s_block_size = 1024; *bs = block_size = super.s_block_size; if(block_size < MIN_BLOCK_SIZE || - block_size > RAWFS_MAX_BLOCK_SIZE) { + block_size > MAX_BLOCK_SIZE) { printf("bogus block size %d\n", block_size); return 0; }