diff --git a/format/main.c b/format/main.c index a7f8ec7..51d08e7 100644 --- a/format/main.c +++ b/format/main.c @@ -35,6 +35,7 @@ #include "ubixfs.h" #include "superblock.h" #include "inode.h" +#include "btree.h" static void usage() { fprintf(stderr, "usage: format [-q] disk [slice]\n"); @@ -51,6 +52,7 @@ short batSize = 0x0; u_int32_t blocks = 0x0; u_int32_t batSect = 0x0; + bTreeHeader * bth = (bTreeHeader *)malloc(4096); char sector[512]; char q = 0x0; @@ -151,15 +153,25 @@ sb->logStart = 0; sb->logEnd = 0; // sb->magic3 = ? - sb->indicies.allocationGroup = 1; + sb->indicies.allocationGroup = 0; sb->indicies.start = 0; - sb->indicies.len = 1; + sb->indicies.len = 0; sb->rootDir.allocationGroup = 2; sb->rootDir.start = 0; sb->rootDir.len = 1; - fwrite(sb,512,1,fd); + fwrite(sb, 512, 1, fd); + +// write out the root dir + + memset(bth, sb->blockSize, 0); + bth->firstDeleted = -1; + rewind(fd); + fseek(fd, + sb->rootDir.allocationGroup * sb->blockSize * sb->blocksPerAG, + SEEK_SET); + fwrite(bth, 4096, 1, fd); /* Write BAT */ @@ -191,6 +203,9 @@ /*** $Log$ + Revision 1.8 2004/09/06 10:24:56 flameshadow + chg: sync + Revision 1.7 2004/09/03 14:05:41 reddawg Fixed format to move super block diff --git a/include/inode.h b/include/inode.h index 7543322..6a1bb18 100644 --- a/include/inode.h +++ b/include/inode.h @@ -38,15 +38,14 @@ // inodeAddr attributes __attribute__ ((packed)); uInt32 type __attribute__ ((packed)); int32 inodeSize __attribute__ ((packed)); - ubixfsInode * parentBigPtr __attribute__ ((packed)); - ubixfsInode * parent __attribute__ ((packed)); - ubixfsInode * nextBigPtr __attribute__ ((packed)); - ubixfsInode * next __attribute__ ((packed)); - ubixfsInode * prevBigPtr __attribute__ ((packed)); - ubixfsInode * prev __attribute__ ((packed)); + void * parentBigPtr __attribute__ ((packed)); + void * parent __attribute__ ((packed)); + void * nextBigPtr __attribute__ ((packed)); + void * next __attribute__ ((packed)); + void * prevBigPtr __attribute__ ((packed)); + void * prev __attribute__ ((packed)); // binodeEtc *etc ?? dataStream data __attribute__ ((packed)); - int32 pad[4] __attribute__ ((packed)); - char smallData[3620] __attribute__ ((packed)); + char smallData[3636] __attribute__ ((packed)); } ubixfsInode; #endif