-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfsLow.h
More file actions
50 lines (36 loc) · 1.46 KB
/
fsLow.h
File metadata and controls
50 lines (36 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Start Partition System
//
// This is the first function to call before your filesystem starts
// If the filename already exists, then the input values stored in
// volSize and blockSize are ignored. If the file does not exist, it will
// be created to the specified volume size in units of the block size
// (must be power of 2) plus one for the partition header.
//
// On return
// return value 0 = success;
// return value -1 = file exists but can not open for write
// return value -2 = insufficient space for the volume
// volSize will be filled with the volume size
// blockSize will be filled with the block size
#ifndef uint64_t
typedef u_int64_t uint64_t;
#endif
#ifndef uint32_t
typedef u_int32_t uint32_t;
#endif
typedef unsigned long long ull_t;
int startPartitionSystem (char * filename, uint64_t * volSize, uint64_t * blockSize);
int closePartitionSystem ();
int initFileSystem (uint64_t numberOfBlocks, uint64_t blockSize);
void exitFileSystem ();
uint64_t LBAwrite (void * buffer, uint64_t lbaCount, uint64_t lbaPosition);
uint64_t LBAread (void * buffer, uint64_t lbaCount, uint64_t lbaPosition);
void runFSLowTest(); //Do not use this, for testing only
#define MINBLOCKSIZE 512
#define PART_SIGNATURE 0x526F626572742042
#define PART_SIGNATURE2 0x4220747265626F52
#define PART_CAPTION "CSC-415 - Operating Systems File System Partition Header\n\n"
#define PART_ACTIVE 1
#define PART_INACTIVE 0
#define PART_NOERROR 0
#define PART_ERR_INVALID -4