UbixOS V2 2.0

Data Structures | Macros | Typedefs | Functions
ubixfs.h File Reference
`#include <sys/types.h>`
`#include <vfs/vfs.h>`
`#include <sys/device.h>`
`#include <mpi/mpi.h>`
`#include <ubixfs/dirCache.h>`
Include dependency graph for ubixfs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | blockAllocationTableEntry
struct | bootSect
struct | directoryEntry
struct | directoryList
struct | partitionInformation
struct | ubixDiskLabel
struct | ubixDiskLabel::ubixPartitions
struct | ubixFSInfo

## Macros
#define | blockSize 8
#define | EOBC -1
#define | MAXUBIXPARTITIONS 16
#define | typeContainer 2
#define | typeDeleted 8
#define | typeDirectory 4
#define | typeFile 1
#define | UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */
#define | UBIXFS_ALIGN(size) (size + ((((size) % (UBIXFS_BLOCKSIZE_BYTES)) == 0)? 0 : ((UBIXFS_BLOCKSIZE_BYTES) - ((size) % (UBIXFS_BLOCKSIZE_BYTES)))))
#define | UBIXFS_BLOCKSIZE_BYTES blockSize*512

## Typedefs
typedef struct directoryList * | dirList_t

## Functions
int | addDirEntry (struct directoryEntry *dir, fileDescriptor_t *fd)
int | freeBlocks (int block, fileDescriptor_t *fd)
int | getFreeBlocks (int count, fileDescriptor_t *fd)
int | readFile (char *file)
int | readUbixFS (fileDescriptor_t *fd, char *data, uInt32, long size)
void | syncBat (struct vfs_mountPoint *mp)
int | ubixfs_init ()
int | ubixfs_initialize ()
void | ubixfs_thread ()
dirList_t | ubixFSLoadDir (char *)
int | ubixFSmkDir (char *dir, fileDescriptor_t *fd)
void | ubixFSUnlink (char *path, struct vfs_mountPoint *mp)
int | writeFileByte (int ch, fileDescriptor_t *fd, long offset)
int | writeUbixFS (fileDescriptor_t *fd, char *data, long offset, long size)

## Macro Definition Documentation

## ◆ blockSize

#define blockSize 8

Definition at line 43 of file ubixfs.h.

## ◆ EOBC

#define EOBC -1

Definition at line 45 of file ubixfs.h.

## ◆ MAXUBIXPARTITIONS

#define MAXUBIXPARTITIONS 16

Definition at line 42 of file ubixfs.h.

## ◆ typeContainer

#define typeContainer 2

Definition at line 48 of file ubixfs.h.

## ◆ typeDeleted

#define typeDeleted 8

Definition at line 50 of file ubixfs.h.

## ◆ typeDirectory

#define typeDirectory 4

Definition at line 49 of file ubixfs.h.

## ◆ typeFile

#define typeFile 1

Definition at line 47 of file ubixfs.h.

## ◆ UBIXDISKMAGIC

#define UBIXDISKMAGIC ((uInt32)0x45) /* The disk magic number */

Definition at line 41 of file ubixfs.h.

## ◆ UBIXFS_ALIGN

#define UBIXFS_ALIGN | ( |  | size | ) | (size + ((((size) % (UBIXFS_BLOCKSIZE_BYTES)) == 0)? 0 : ((UBIXFS_BLOCKSIZE_BYTES) - ((size) % (UBIXFS_BLOCKSIZE_BYTES)))))

Definition at line 39 of file ubixfs.h.

## ◆ UBIXFS_BLOCKSIZE_BYTES

#define UBIXFS_BLOCKSIZE_BYTES blockSize*512

Definition at line 38 of file ubixfs.h.

## Typedef Documentation

## ◆ dirList_t

typedef struct directoryList* dirList_t

Definition at line 61 of file ubixfs.h.

## Function Documentation

## ◆ addDirEntry()

int addDirEntry | ( | struct directoryEntry * | dir,
|  | fileDescriptor_t * | fd
| ) |  |

Definition at line 64 of file directory.c.

References kmalloc(), kprintf(), memcpy(), fileDescriptor::offset, readUbixFS(), fileDescriptor::size, and writeUbixFS().

Referenced by ubixFSmkDir().

Here is the call graph for this function:

## ◆ freeBlocks()

int freeBlocks | ( | int | block,
|  | fileDescriptor_t * | fd
| ) |  |

Definition at line 78 of file block.c.

References blockAllocationTableEntry::attributes, ubixFSInfo::blockAllocationTable, vfs_mountPoint::fsInfo, fileDescriptor::mp, blockAllocationTableEntry::nextBlock, and syncBat().

Here is the call graph for this function:

## ◆ getFreeBlocks()

int getFreeBlocks | ( | int | count,
|  | fileDescriptor_t * | fd
| ) |  |

Definition at line 95 of file block.c.

References blockAllocationTableEntry::attributes, ubixFSInfo::batEntries, ubixFSInfo::blockAllocationTable, vfs_mountPoint::fsInfo, fileDescriptor::mp, blockAllocationTableEntry::nextBlock, and syncBat().

Referenced by ubixFSmkDir(), and writeUbixFS().

Here is the call graph for this function:

## ◆ readFile()

int readFile | ( | char * | file | ) |

## ◆ readUbixFS()

int readUbixFS | ( | fileDescriptor_t * | fd,
|  | char * | data,
|  | uInt32 | ,
|  | long | size
| ) |  |

Definition at line 192 of file ubixfs.c.

References assert, buffer, fileDescriptor::cacheNode, fdEof, vfs_mountPoint::fsInfo, cacheNode::info, kpanic(), fileDescriptor::mp, NULL, cacheNode::present, fileDescriptor::size, and fileDescriptor::status.

Referenced by addDirEntry(), and ubixfs_init().

Here is the call graph for this function:

## ◆ syncBat()

void syncBat | ( | struct vfs_mountPoint * | mp | ) |

Definition at line 73 of file block.c.

References ubixFSInfo::blockAllocationTable, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, vfs_mountPoint::fsInfo, device_interface::info, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pBatSize, ubixDiskLabel::ubixPartitions::pOffset, and device_interface::write.

Referenced by freeBlocks(), and getFreeBlocks().

## ◆ ubixfs_init()

int ubixfs_init | ( |  | ) |

Definition at line 450 of file ubixfs.c.

References NULL, readUbixFS(), ubixfs_initialize(), and writeUbixFS().

Here is the call graph for this function:

## ◆ ubixfs_initialize()

int ubixfs_initialize | ( |  | ) |

## ◆ ubixfs_thread()

void ubixfs_thread | ( |  | ) |

## ◆ ubixFSLoadDir()

dirList_t ubixFSLoadDir | ( | char * |  | ) |

Definition at line 39 of file directory.c.

References directoryList::dirName, kmalloc(), and sprintf().

Here is the call graph for this function:

## ◆ ubixFSmkDir()

int ubixFSmkDir | ( | char * | dir,
|  | fileDescriptor_t * | fd
| ) |  |

Definition at line 92 of file directory.c.

References addDirEntry(), directoryEntry::attributes, ubixFSInfo::blockAllocationTable, blockSize, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, directoryEntry::fileName, vfs_mountPoint::fsInfo, getFreeBlocks(), device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, vfs_mountPoint::partition, ubixDiskLabel::partitions, directoryEntry::permissions, ubixDiskLabel::ubixPartitions::pOffset, blockAllocationTableEntry::realSector, directoryEntry::size, sprintf(), directoryEntry::startCluster, typeDirectory, UBIXFS_BLOCKSIZE_BYTES, and device_interface::write.

Here is the call graph for this function:

## ◆ ubixFSUnlink()

void ubixFSUnlink | ( | char * | path,
|  | struct vfs_mountPoint * | mp
| ) |  |

Definition at line 306 of file ubixfs.c.

## ◆ writeFileByte()

int writeFileByte | ( | int | ch,
|  | fileDescriptor_t * | fd,
|  | long | offset
| ) |  |

Definition at line 116 of file ubixfs.c.

References assert, blockAllocationTableEntry::attributes, ubixFSInfo::batEntries, ubixFSInfo::blockAllocationTable, fileDescriptor::buffer, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, fdOpen, fdRead, fileDescriptor::fileName, directoryEntry::fileName, vfs_mountPoint::fsInfo, device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, blockAllocationTableEntry::nextBlock, NULL, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pBatSize, ubixDiskLabel::ubixPartitions::pOffset, device_interface::read, blockAllocationTableEntry::realSector, fileDescriptor::size, directoryEntry::size, fileDescriptor::start, fileDescriptor::status, strcmp(), and device_interface::write.

Here is the call graph for this function:

## ◆ writeUbixFS()

int writeUbixFS | ( | fileDescriptor_t * | fd,
|  | char * | data,
|  | long | offset,
|  | long | size
| ) |  |

Definition at line 229 of file ubixfs.c.

References assert, ubixFSInfo::blockAllocationTable, blockSize, fileDescriptor::buffer, vfs_mountPoint::device, device_node::devInfo, vfs_mountPoint::diskLabel, EOBC, fileDescriptor::fileName, directoryEntry::fileName, vfs_mountPoint::fsInfo, getFreeBlocks(), device_interface::info, kfree(), kmalloc(), fileDescriptor::mp, blockAllocationTableEntry::nextBlock, NULL, vfs_mountPoint::partition, ubixDiskLabel::partitions, ubixDiskLabel::ubixPartitions::pOffset, device_interface::read, blockAllocationTableEntry::realSector, fileDescriptor::size, directoryEntry::size, fileDescriptor::start, directoryEntry::startCluster, strcmp(), and device_interface::write.

Referenced by addDirEntry(), and ubixfs_init().

Here is the call graph for this function: