Go to the documentation of this file.
45 int media_read(
unsigned long sector,
unsigned char *
buffer,
unsigned long sector_count) {
51 int media_write(
unsigned long sector,
unsigned char *
buffer,
unsigned long sector_count) {
62 kprintf(
"ERROR: Media attach failed\n");
75 unsigned char data[] = {
85 kprintf(
"ERROR: Write file failed\n");
88 kprintf(
"ERROR: Create file failed\n");
105 if (
fl_fseek(_file, offset & 0xFFFFFFFF, 0) != 0)
108 size =
fl_fread(data, size, 1, _file);
110 fd->
offset = offset + size;
119 kprintf(
"Writing: %i[%i]\n", size, offset);
122 if (
fl_fwrite(data, 1, size, _file) != size)
123 kprintf(
"ERROR: Write file failed\n");
144 if ((fd->
mode & 0x1) == 0x1) {
147 else if ((fd->
mode & 0x2) == 0x2) {
148 if ((fd->
mode & 0x8) == 0x8) {
202 kpanic(
"Unable To Enable UbixFS");
int media_write(unsigned long sector, unsigned char *buffer, unsigned long sector_count)
int fat_initialize(struct vfs_mountPoint *mp)
int fl_fwrite(const void *data, int size, int count, void *f)
void kpanic(const char *fmt,...)
print panic message and halt system
int open_fat(const char *file, fileDescriptor_t *fd)
int media_read(unsigned long sector, unsigned char *buffer, unsigned long sector_count)
struct vfs_mountPoint * mp
int vfsRegisterFS(struct fileSystem newFS)
register a file system
int write_fat(fileDescriptor_t *fd, char *data, off_t offset, long size)
int(* write)(void *, void *, uInt32, uInt32)
int(* read)(void *, void *, uInt32, uInt32)
int fl_fread(void *buffer, int size, int length, void *f)
void * fl_fopen(const char *path, const char *mode)
struct device_node * device
struct vfs_mountPoint * _mp
struct device_interface * devInfo
int fl_fseek(void *f, long offset, int origin)
int kprintf(const char *,...)
int fl_attach_media(fn_diskio_read rd, fn_diskio_write wr)
int read_fat(fileDescriptor_t *fd, char *data, off_t offset, long size)