Fix UserFS, support more blocks.

This commit is contained in:
TXuian
2024-05-16 10:34:39 +08:00
parent 52387d47a7
commit c6de550e45
6 changed files with 33 additions and 28 deletions
@@ -18,12 +18,13 @@
// Block size
#define BLOCK_SIZE 512
#define NR_BIT_BLOCKS 2
// bits size
#define BITS 8
// Bitmap size of one block
#define BITMAP_SIZE (BLOCK_SIZE * BITS)
#define BITMAP_SIZE (BLOCK_SIZE * BITS * NR_BIT_BLOCKS)
// Inode size of one block
#define INODE_SIZE (BLOCK_SIZE / sizeof(struct Inode))
@@ -77,6 +77,7 @@ struct SuperBlock {
uint32_t size; // Number of total blocks of file system image
uint32_t nblocks; // Number of data blocks
uint32_t ninodes; // Number of inodes.
uint32_t nbitblocks;
};
// Inode structure