UbixOS  2.0
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, off_t offset, long size)
 
int unlink_fat ()
 
int write_fat (fileDescriptor_t *fd, char *data, off_t offset, long size)
 

Variables

fileDescriptor_t_fd
 
struct vfs_mountPoint_mp
 

Function Documentation

◆ fat_init()

int fat_init ( )

Definition at line 180 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(), 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 
)

◆ media_write()

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

◆ mkdir_fat()

int mkdir_fat ( )

Definition at line 176 of file fat.c.

Referenced by fat_init().

◆ open_fat()

◆ read_fat()

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

Definition at line 95 of file fat.c.

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

Referenced by fat_init().

Here is the call graph for this function:

◆ unlink_fat()

int unlink_fat ( )

Definition at line 172 of file fat.c.

Referenced by fat_init().

◆ write_fat()

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

Definition at line 115 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

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().