view include/os/fsStructs.h @ 150:e72f984619c7

Consolidated a lot of the defines which relate to the memory layout There is a new file (include/os/memLayout.h) which now includes just about all the #defines
author Jonathan Pevarnek <pevarnj@gmail.com>
date Wed, 02 Nov 2011 09:55:09 -0400
parents f0bd97df958b
children
line wrap: on
line source

#ifndef __FSSTRUCTS_H
#define __FSSTRUCTS_H

#define FNAMELEN 28 //How long the filenames are
#define FSBLKSIZE 1024
#define DSKBLKSIZE 512
#define MAXBLOCKS 248 //max blocks in an inode

typedef struct {
	u32 magic;              // == 0x42420374
	u32 root_inode;         // the disk block containing the root inode
	u32 nblocks;            // number of block on the disk
	u32 _pad[253];          // unused (should be '\0' filled)
} Superblock;

typedef struct {
	u32 size;               // file length in bytes
	u32 _pad0;              // unused (should be 0)
	u64 ctime;              // creation time stamp
	u64 mtime;              // last modification time stamp
	u16 nblocks;            // number of data blocks in this file
	u16 _pad1;              // unused (should be 0)
	u32 _pad2;              // unused (should be 0)
	u32 blocks[MAXBLOCKS];  // file block ptrs
} Inode;

typedef struct {
	u8 blocks[FSBLKSIZE];
} FSBlk;

typedef struct {
	u8 blocks[DSKBLKSIZE];
} DskBlk;

typedef struct { //32 bytes
	char fname[FNAMELEN];
	u32 inode;
} Direntry;

#endif //__FSSTRUCTS_H