IBNOS
|
Functions | |
struct directory * | directoryCreate (struct directory *parent, char *name, uint32_t nameLength) |
Creates a new kernel directory object. More... | |
struct file * | fileCreate (struct directory *parent, char *name, uint32_t nameLength, uint8_t *staticBuffer, uint32_t staticSize) |
Creates a new kernel file object. More... | |
struct openedFile * | fileOpen (struct file *file) |
Creates a new kernel openedFile object. More... | |
struct openedDirectory * | directoryOpen (struct directory *directory) |
Creates a new kernel openedDirectory object. More... | |
void | fileSystemInit (void *addr, uint32_t length) |
Initializes the root file system. More... | |
struct directory * | fileSystemIsValidDirectory (struct object *obj) |
Checks if a given object is of the type directory and casts it if possible. More... | |
struct file * | fileSystemIsValidFile (struct object *obj) |
Checks if a given object is of the type file and casts it if possible. More... | |
struct directory * | fileSystemGetRoot () |
Returns a reference to the root node of the file system. More... | |
struct directory * | fileSystemSearchDirectory (struct directory *directory, char *path, uint32_t pathLength, bool create) |
Opens or creates a directory. More... | |
struct file * | fileSystemSearchFile (struct directory *directory, char *path, uint32_t pathLength, bool create) |
Opens or creates a file. More... | |
Variables | |
struct directory * | fileSystemRoot |
The filesystem implementation is still work in progress. It is similar to file handling on other platforms and based on named files and directory structures.
Creates a new kernel directory object.
parent | Pointer to the parent directory |
name | Name of the directory or NULL if the directory doesn't have a name |
nameLength | Length of the name |
Definition at line 174 of file filesystem.c.
struct openedDirectory* directoryOpen | ( | struct directory * | directory | ) |
Creates a new kernel openedDirectory object.
directory | Pointer to the directory |
Definition at line 699 of file filesystem.c.
struct file* fileCreate | ( | struct directory * | parent, |
char * | name, | ||
uint32_t | nameLength, | ||
uint8_t * | staticBuffer, | ||
uint32_t | staticSize | ||
) |
Creates a new kernel file object.
parent | Pointer to the parent directory |
name | Name of the file or NULL if the file doesn't have a name |
nameLength | Length of the name |
staticBuffer | Optional pointer to some heap memory |
staticSize | Size of the heap memory buffer |
Definition at line 333 of file filesystem.c.
struct openedFile* fileOpen | ( | struct file * | file | ) |
Creates a new kernel openedFile object.
file | Pointer to the file |
Definition at line 513 of file filesystem.c.
struct directory* fileSystemGetRoot | ( | ) |
Returns a reference to the root node of the file system.
This function returns a reference to the root node of the file system and increases the reference count. When the reference is not needed anymore you have to release the object.
Definition at line 985 of file filesystem.c.
void fileSystemInit | ( | void * | addr, |
uint32_t | length | ||
) |
Initializes the root file system.
Definition at line 858 of file filesystem.c.
Checks if a given object is of the type directory and casts it if possible.
Use this functio to safely convert an arbitrary object to a directory object pointer. If the object doesn't have the right type (or a NULL pointer is passed), then NULL will be returned.
obj | Arbitrary kernel object |
Definition at line 934 of file filesystem.c.
Checks if a given object is of the type file and casts it if possible.
Use this functio to safely convert an arbitrary object to a file object pointer. If the object doesn't have the right type (or a NULL pointer is passed), then NULL will be returned.
obj | Arbitrary kernel object |
Definition at line 960 of file filesystem.c.
struct directory* fileSystemSearchDirectory | ( | struct directory * | directory, |
char * | path, | ||
uint32_t | pathLength, | ||
bool | create | ||
) |
Opens or creates a directory.
This function will search for a given directory in the file system root. If create is true, then the directory object is created if it doesn't exist yet
directory | Directory in which to search for the specific directory or NULL |
path | Path to the directory |
pathLength | Length of the directory |
create | If true the directory (including parent directories) will be created if it doesn't exist yet |
Definition at line 1004 of file filesystem.c.
struct file* fileSystemSearchFile | ( | struct directory * | directory, |
char * | path, | ||
uint32_t | pathLength, | ||
bool | create | ||
) |
Opens or creates a file.
This function will search for a given file in the file system root. If create is specified the new file object is created if it doesn't exist yet
directory | Directory in which to search for the specific file or NULL |
path | Path to the file |
pathLength | Length of the filename |
create | If true the file (including parent directories) will be created if it doesn't exist yet |
Definition at line 1092 of file filesystem.c.
struct directory* fileSystemRoot |
Definition at line 41 of file filesystem.c.