Removed root filesystem blocksize restriction by reducing boot monitor

stack size from 16kB to 8kB. No apparent adverse affects.
This commit is contained in:
Ben Gras 2005-05-20 12:30:19 +00:00
parent cff515edd8
commit f8bd2691ec
2 changed files with 9 additions and 8 deletions

View file

@ -38,7 +38,7 @@ rawfs86.o: rawfs.c rawfs.o
boot: boothead.s boot.o bootimage.o rawfs86.o boot: boothead.s boot.o bootimage.o rawfs86.o
$(LD86) -o $@ \ $(LD86) -o $@ \
boothead.s boot.o bootimage.o rawfs86.o $(LIBS) 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 bootcd: bootcdhead.s boot.o bootimage.o rawfs86.o
$(LD86) -o $@ \ $(LD86) -o $@ \

View file

@ -52,12 +52,10 @@ static struct super_block super; /* Superblock of file system */
#define SUPER_V1 SUPER_MAGIC /* V1 magic has a weird name. */ #define SUPER_V1 SUPER_MAGIC /* V1 magic has a weird name. */
#endif #endif
#define RAWFS_MAX_BLOCK_SIZE 1024
static struct inode curfil; /* Inode of file under examination */ static struct inode curfil; /* Inode of file under examination */
static char indir[RAWFS_MAX_BLOCK_SIZE]; /* Single indirect block. */ static char indir[MAX_BLOCK_SIZE]; /* Single indirect block. */
static char dindir[RAWFS_MAX_BLOCK_SIZE]; /* Double indirect block. */ static char dindir[MAX_BLOCK_SIZE]; /* Double indirect block. */
static char dirbuf[RAWFS_MAX_BLOCK_SIZE]; /* Scratch/Directory block. */ static char dirbuf[MAX_BLOCK_SIZE]; /* Scratch/Directory block. */
#define scratch dirbuf #define scratch dirbuf
static block_t a_indir, a_dindir; /* Addresses of the indirects. */ static block_t a_indir, a_dindir; /* Addresses of the indirects. */
@ -72,7 +70,10 @@ off_t r_super(int *bs)
* (zero on error). * (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); readblock(1, scratch, 1024);
memcpy(&super, scratch, sizeof(super)); memcpy(&super, scratch, sizeof(super));
@ -83,7 +84,7 @@ off_t r_super(int *bs)
super.s_block_size = 1024; super.s_block_size = 1024;
*bs = block_size = super.s_block_size; *bs = block_size = super.s_block_size;
if(block_size < MIN_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); printf("bogus block size %d\n", block_size);
return 0; return 0;
} }