From 11a9947f1a68e23001690955d8d0975ad4d6cf0c Mon Sep 17 00:00:00 2001 From: rtm Date: Fri, 21 Jul 2006 13:18:04 +0000 Subject: bread iget mkfs makes a file system image put this in your .bochsrc: ata0-slave: type=disk, mode=flat, path="fs.img", cylinders=1024, heads=1, spt=1 --- fs.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 fs.h (limited to 'fs.h') diff --git a/fs.h b/fs.h new file mode 100644 index 0000000..b710e1c --- /dev/null +++ b/fs.h @@ -0,0 +1,28 @@ +// on-disk file system format + +// second sector +struct superblock{ + int nblocks; + int ninodes; +}; + +#define NDIRECT 14 + +// inodes start at the third sector +// and blocks start at (ninodes * sizeof(dinode) + 511) / 512 +struct dinode { + short type; + short nlink; + uint size; + uint addrs[NDIRECT]; +}; +#define T_DIR 1 +#define T_FILE 2 + +#define IPB (512 / sizeof(struct dinode)) + +struct dirent { + ushort inum; + char name[14]; +}; + -- cgit v1.2.3