31void Rm(
const char *argv[],
int argc) {
33 Kprintf(
"Not enough args\nUsage: rm [filename] [ext]");
48void Mkf(
const char *argv[],
int argc) {
50 Kprintf(
"Not enough args\nUsage: mKfile [filename] [ext]");
68void Writef(
const char *argv[],
int argc) {
70 Kprintf(
"Not enough args\nUsage: write [filename] [ext]");
73 char *data = (
char *)
Kmalloc(512, 8);
79 Kprintf(
"Start Writing Data:\n");
84 while (len < 500 && data[len] !=
'\0') {
95 Writefile(argv[1], argv[2], data, len + 1);
108void Readf(
const char *argv[],
int argc) {
110 Kprintf(
"Not enough args\nUsage: read [filename] [ext]");
void * Kmalloc(size_t size, size_t align)
Allocate memory.
void Kfree(void *ptr)
Free allocated memory.
void Readf(const char *argv[], int argc)
Read and display contents of a file from the FAT16 filesystem.
void Rm(const char *argv[], int argc)
Delete a file from the FAT16 filesystem.
void Writef(const char *argv[], int argc)
Write data to a file in the FAT16 filesystem from user input.
void Mkf(const char *argv[], int argc)
Create a new empty file on the FAT16 filesystem.
Definitions and declarations for FAT16 filesystem and ATA I/O.
void Fileconts(const char *filename, const char *ext)
Prints contents of a FAT16 file.
void Mkfile(const char *filename, const char *ext)
Creates a new empty file in the FAT16 root directory.
void Writefile(const char *filename, const char *ext, const char *data, u32 size)
Writes data to a FAT16 file, replacing its contents.
void Fat16RemoveFile(const char *filename, const char *ext)
Removes a file from the FAT16 root directory and frees clusters.
void Kgetstr(char *str, int length)
Reads a line of input from the keyboard (blocking).
void Kflush()
Flushes the keyboard controller input buffer.
void Kprintf(const char *fmt,...)
Formatted output to the screen.