Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

SuperBlock Class Reference

#include <SuperBlock.h>

List of all members.

Public Member Functions

 SuperBlock (unsigned int partitionOffset)
void * operator new (unsigned int partitionOffset)
char * getID ()
char * getPartitionName ()
unsigned long long getRootDirectoryLink ()
unsigned long long getCreateTime ()
unsigned long long getLastModifiedTime ()
unsigned short getBlockSize ()
unsigned long long getNumberOfFreeAddressBlock ()
unsigned char * getUnused ()

Private Attributes

unsigned int partitionOffset
struct {
   char   id [3]
   char   partitionName [501]
   unsigned long long   rootDirectoryLink
   unsigned long long   createTime
   unsigned long long   lastModifiedTime
   unsigned short   blockSize
   unsigned long long   numberOfFreeAddressBlock
   unsigned char   unused [3560]
sbBlockStruct


Constructor & Destructor Documentation

SuperBlock::SuperBlock unsigned int  partitionOffset  ) 
 

Definition at line 3 of file SuperBlock.cpp.

References readSector(), and sbBlockStruct.

00004 {
00005         this->partitionOffset = partitionOffset;
00006 
00007         unsigned char bytes[4096];
00008 /*    readSector(partitionOffset / 512, 0, 0, bytes);
00009     readSector(partitionOffset / 512, 0, 1, bytes + 512);
00010     readSector(partitionOffset / 512, 0, 2, bytes + 1024);
00011     readSector(partitionOffset / 512, 0, 3, bytes + 1536);
00012     readSector(partitionOffset / 512, 0, 4, bytes + 2048);
00013     readSector(partitionOffset / 512, 0, 5, bytes + 2560);
00014     readSector(partitionOffset / 512, 0, 6, bytes + 3072);
00015     readSector(partitionOffset / 512, 0, 7, bytes + 3584);*/
00016         readSector(partitionOffset / 512, 0, 0, bytes, 8 * 512);
00017 
00018         sbBlockStruct.id[0] = bytes[0];
00019         sbBlockStruct.id[1] = bytes[1];
00020         sbBlockStruct.id[2] = '\0';
00021 
00022         for (int x = 0; x < 500; x++) {
00023                 sbBlockStruct.partitionName[x] = bytes[x + 2];
00024         }
00025         sbBlockStruct.partitionName[500] = '\0';
00026 
00027         unsigned long long templl1, templl2, templl3, templl4, templl5, templl6, templl7, templl8;
00028         templl1 = bytes[502];
00029         templl2 = bytes[503];
00030         templl3 = bytes[504];
00031         templl4 = bytes[505];
00032         templl5 = bytes[506];
00033         templl6 = bytes[507];
00034         templl7 = bytes[508];
00035         templl8 = bytes[509];
00036         sbBlockStruct.rootDirectoryLink = templl1 + (templl2 << 8) + (templl3 << 16) + (templl4 << 24) + (templl5 << 32) + (templl6 << 40) + (templl7 << 48) + (templl8 << 56);
00037 
00038         templl1 = bytes[510];
00039         templl2 = bytes[511];
00040         templl3 = bytes[512];
00041         templl4 = bytes[513];
00042         templl5 = bytes[514];
00043         templl6 = bytes[515];
00044         templl7 = bytes[516];
00045         templl8 = bytes[517];
00046         sbBlockStruct.createTime = templl1 + (templl2 << 8) + (templl3 << 16) + (templl4 << 24) + (templl5 << 32) + (templl6 << 40) + (templl7 << 48) + (templl8 << 56);
00047 
00048         templl1 = bytes[518];
00049         templl2 = bytes[519];
00050         templl3 = bytes[520];
00051         templl4 = bytes[521];
00052         templl5 = bytes[522];
00053         templl6 = bytes[523];
00054         templl7 = bytes[524];
00055         templl8 = bytes[525];
00056         sbBlockStruct.lastModifiedTime = templl1 + (templl2 << 8) + (templl3 << 16) + (templl4 << 24) + (templl5 << 32) + (templl6 << 40) + (templl7 << 48) + (templl8 << 56);
00057 
00058         unsigned short temps1, temps2;
00059         temps1 = bytes[526];
00060         temps2 = bytes[527];
00061         sbBlockStruct.blockSize = temps1 + (temps2 << 8);
00062 
00063         templl1 = bytes[528];
00064         templl2 = bytes[529];
00065         templl3 = bytes[530];
00066         templl4 = bytes[531];
00067         templl5 = bytes[532];
00068         templl6 = bytes[533];
00069         templl7 = bytes[534];
00070         templl8 = bytes[535];
00071         sbBlockStruct.numberOfFreeAddressBlock = templl1 + (templl2 << 8) + (templl3 << 16) + (templl4 << 24) + (templl5 << 32) + (templl6 << 40) + (templl7 << 48) + (templl8 << 56);
00072 
00073         for (int x = 536; x < 4096; x++) {
00074                 sbBlockStruct.unused[x - 536] = bytes[536];
00075         }
00076 }


Member Function Documentation

unsigned short SuperBlock::getBlockSize  ) 
 

Definition at line 111 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00112 {
00113         return sbBlockStruct.blockSize;
00114 }

unsigned long long SuperBlock::getCreateTime  ) 
 

Definition at line 103 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00104 {
00105         return sbBlockStruct.createTime;
00106 }

char * SuperBlock::getID  ) 
 

Definition at line 90 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00091 {
00092         return sbBlockStruct.id;
00093 }

unsigned long long SuperBlock::getLastModifiedTime  ) 
 

Definition at line 107 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00108 {
00109         return sbBlockStruct.lastModifiedTime;
00110 }

unsigned long long SuperBlock::getNumberOfFreeAddressBlock  ) 
 

Definition at line 115 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00116 {
00117         return sbBlockStruct.numberOfFreeAddressBlock;
00118 }

char * SuperBlock::getPartitionName  ) 
 

Definition at line 95 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by start_peter().

00096 {
00097         return sbBlockStruct.partitionName;
00098 }

unsigned long long SuperBlock::getRootDirectoryLink  ) 
 

Definition at line 99 of file SuperBlock.cpp.

References sbBlockStruct.

Referenced by PFS_Main::PFS_Main(), and start_peter().

00100 {
00101         return sbBlockStruct.rootDirectoryLink;
00102 }

unsigned char * SuperBlock::getUnused  ) 
 

Definition at line 119 of file SuperBlock.cpp.

References sbBlockStruct.

00120 {
00121         return sbBlockStruct.unused;
00122 }

void * SuperBlock::operator new unsigned int  partitionOffset  ) 
 

Definition at line 78 of file SuperBlock.cpp.

References kmalloc().

00079 {
00080         //this->partitionOffset=partitionOffset;
00081         void *superBlock = kmalloc(sizeof(SuperBlock));
00082         if (superBlock != NULL) {
00083                 return superBlock;
00084         } else {
00085                 return (void *) NULL;
00086         }
00087 
00088 }


Member Data Documentation

unsigned short SuperBlock::blockSize [private]
 

Definition at line 10 of file SuperBlock.h.

unsigned long long SuperBlock::createTime [private]
 

Definition at line 8 of file SuperBlock.h.

char SuperBlock::id[3] [private]
 

Definition at line 5 of file SuperBlock.h.

unsigned long long SuperBlock::lastModifiedTime [private]
 

Definition at line 9 of file SuperBlock.h.

unsigned long long SuperBlock::numberOfFreeAddressBlock [private]
 

Definition at line 11 of file SuperBlock.h.

char SuperBlock::partitionName[501] [private]
 

Definition at line 6 of file SuperBlock.h.

unsigned int SuperBlock::partitionOffset [private]
 

Definition at line 3 of file SuperBlock.h.

unsigned long long SuperBlock::rootDirectoryLink [private]
 

Definition at line 7 of file SuperBlock.h.

struct { ... } SuperBlock::sbBlockStruct [private]
 

Referenced by getBlockSize(), getCreateTime(), getID(), getLastModifiedTime(), getNumberOfFreeAddressBlock(), getPartitionName(), getRootDirectoryLink(), getUnused(), and SuperBlock().

unsigned char SuperBlock::unused[3560] [private]
 

Definition at line 12 of file SuperBlock.h.


The documentation for this class was generated from the following files:
Generated on Fri Jul 14 23:28:56 2006 for newstdlib by  doxygen 1.4.2