UbixOS V2 2.0

Functions | Variables
fat.c File Reference
`#include <vfs/vfs.h>`
`#include <ubixos/sched.h>`
`#include <ubixos/kpanic.h>`
`#include <ubixos/exec.h>`
`#include <lib/kmalloc.h>`
`#include <string.h>`
`#include <lib/kprintf.h>`
`#include <assert.h>`
`#include "fat_filelib.h"`
`#include "fat_access.h"`
Include dependency graph for fat.c:

Go to the source code of this file.

## Functions
int | fat_init ()
int | fat_initialize (struct vfs_mountPoint *mp)
int | media_read (unsigned long sector, unsigned char *buffer, unsigned long sector_count)
int | media_write (unsigned long sector, unsigned char *buffer, unsigned long sector_count)
int | mkdir_fat ()
int | open_fat (const char *file, fileDescriptor_t *fd)
int | read_fat (fileDescriptor_t *fd, char *data, uInt32 offset, long size)
int | unlink_fat ()
int | write_fat (fileDescriptor_t *fd, char *data, uInt32 offset, long size)

## Variables
fileDescriptor_t * | _fd
struct vfs_mountPoint * | _mp

## Function Documentation

## ◆ fat_init()

int fat_init | ( |  | ) |

Definition at line 179 of file fat.c.

References fat_initialize(), fl_init(), kpanic(), mkdir_fat(), NULL, open_fat(), read_fat(), unlink_fat(), vfsRegisterFS(), and write_fat().

Here is the call graph for this function:

## ◆ fat_initialize()

int fat_initialize | ( | struct vfs_mountPoint * | mp | ) |

Definition at line 56 of file fat.c.

References _mp, FAT_INIT_OK, file, fl_attach_media(), fl_fclose(), fl_fopen(), fl_fwrite(), fl_remove(), kprintf(), media_read(), and media_write().

Referenced by fat_init().

Here is the call graph for this function:

## ◆ media_read()

int media_read | ( | unsigned long | sector,
|  | unsigned char * | buffer,
|  | unsigned long | sector_count
| ) |  |

Definition at line 44 of file fat.c.

References _mp, buffer, vfs_mountPoint::device, device_node::devInfo, device_interface::info, and device_interface::read.

Referenced by fat_initialize().

## ◆ media_write()

int media_write | ( | unsigned long | sector,
|  | unsigned char * | buffer,
|  | unsigned long | sector_count
| ) |  |

Definition at line 50 of file fat.c.

References _mp, buffer, vfs_mountPoint::device, device_node::devInfo, device_interface::info, and device_interface::write.

Referenced by fat_initialize().

## ◆ mkdir_fat()

int mkdir_fat | ( |  | ) |

Definition at line 175 of file fat.c.

Referenced by fat_init().

## ◆ open_fat()

int open_fat | ( | const char * | file,
|  | fileDescriptor_t * | fd
| ) |  |

Definition at line 131 of file fat.c.

References assert, vfs_mountPoint::device, device_node::devInfo, sFL_FILE::filelength, fl_fopen(), fileDescriptor::ino, kprintf(), fileDescriptor::mode, fileDescriptor::mp, fileDescriptor::offset, fileDescriptor::perms, device_interface::read, fileDescriptor::res, fileDescriptor::size, and sFL_FILE::startcluster.

Referenced by fat_init().

Here is the call graph for this function:

## ◆ read_fat()

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

Definition at line 101 of file fat.c.

References fl_fread(), fl_fseek(), kprintf(), and fileDescriptor::res.

Referenced by fat_init().

Here is the call graph for this function:

## ◆ unlink_fat()

int unlink_fat | ( |  | ) |

Definition at line 171 of file fat.c.

Referenced by fat_init().

## ◆ write_fat()

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

Definition at line 116 of file fat.c.

References fl_fwrite(), kprintf(), and fileDescriptor::res.

Referenced by fat_init().

Here is the call graph for this function:

## Variable Documentation

## ◆ _fd

fileDescriptor_t* _fd

Definition at line 41 of file fat.c.

## ◆ _mp

struct vfs_mountPoint* _mp

Definition at line 42 of file fat.c.

Referenced by fat_initialize(), media_read(), and media_write().