File system management (BLACKSheep OS)

From BlueWiki

Jump to: navigation, search


1 Introduction

The files system driver hides the specific architecture of the device and file system management from the user. From the users point of view all devices have a common interface. The user can call standard I/O functions as fopen, fclose, fread, fwrite to access the devices. Each devices is addressed by a path. The path consists of the partition name followed by a colon and the path in Microsoft Windows style.

1.1 Naming convention

The style of the path naming is associated to Microsoft Windows. A possible path on the SD Memory Card could be: sd0:\samplepath1\samplepath2

2 File System Manager

Files associated: fsmgr.c , fsmgr.h

Directories: BLACKSheep/common/fs

The file system manager manages different file systems. Each file-system has to be registered at the file system manager to be known at the system. The example shows how to register a file-system to the file system manager and how a partition is mounted into the system.


// registering the fat file system
fs_register("fat", fat_getFileFunctions() );
// mounting a sd-card partitionformattet with the FAT file system
// The partition name is sd0
fs_mountPartition("sd0", "sd0", "fat");

Prior to use any functionality of the file system manager he has to be initialized by calling the fs_setup function.

3 FreeDOS FAT driver

Directories: BLACKSheep/common/fs , BLACKSheep/common/fs/fat

The FAT driver is a full featured driver for FAT12/16/32 based on the FreeDOS FAT driver. Please refer to the FreeDOS FAT driver documentation.

The FAT driver supports long file names for FAT32 but also the long file name extension for FAT16.

4 FullFAT driver

Directories: BLACKSheep/common/fs , BLACKSheep/common/fs/fullfat

The main features of FullFAT are:

  • 100% FAT12, FAT16, and FAT32 compatible.
  • Supports Multi-Threaded and Single Threaded applications.
  • Platform Independent Architecture
  • Modular Design, allows unrequired features to be removed.
  • Multiple Concurrent open files.
  • Fully featured API.
  • API compatible with E-FS.
  • High Performance

More informations are avaiable at the FullFAT Wiki website.

Personal tools