]> Zhao Yanbai Git Server - minix.git/commitdiff
Removed root filesystem blocksize restriction by reducing boot monitor
authorBen Gras <ben@minix3.org>
Fri, 20 May 2005 12:30:19 +0000 (12:30 +0000)
committerBen Gras <ben@minix3.org>
Fri, 20 May 2005 12:30:19 +0000 (12:30 +0000)
stack size from 16kB to 8kB. No apparent adverse affects.

boot/Makefile
boot/rawfs.c

index 6d73afa6a2aa27f117e27ac535dcfaf2fda27d3b..753e8ea6333f5c1dd8c0358eadb5b0e235ab56a9 100755 (executable)
@@ -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 $@ \
index e86db038dd1eb3a4cdffbfc89f088bfc784f9090..d0f0478f313503361e01feb8bf76fe8419261df2 100755 (executable)
@@ -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;
                }