From 051b6d482183b74777315e00d138bba0d1479325 Mon Sep 17 00:00:00 2001 From: captain-n3m0 Date: Wed, 10 May 2023 02:07:34 +0530 Subject: [PATCH] Major fixes. --- Kernel16F.c | 4 ++-- disk_operations/disk.c | 6 +++--- display/display.c | 2 +- fat16/fat16fs.c | 9 +++++---- fat16/fat16fs.h | 4 ++-- filesystem/filesystem.c | 17 +++++++++-------- filesystem/filesystem.h | 4 ++-- types.h | 8 ++++++++ 8 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 types.h diff --git a/Kernel16F.c b/Kernel16F.c index 6578b93..65fb784 100644 --- a/Kernel16F.c +++ b/Kernel16F.c @@ -45,8 +45,8 @@ void main() void panic(char *message) { - print("!!!KERNEL PANIC!!!: "); - print(message); + printf("!!!KERNEL PANIC!!!: "); + printf(message); while (1) { } diff --git a/disk_operations/disk.c b/disk_operations/disk.c index e536046..8c7f15e 100644 --- a/disk_operations/disk.c +++ b/disk_operations/disk.c @@ -1,8 +1,8 @@ +#include "../headers/stdio.h" #include "disk.h" #include "config.h" -#include "memory_manager.h" -#include "kernel.h" -#include "memory/kheap.h" +#include "../memory_manager/mem_manager.h" +#include "Kernel16F.h" static struct disk disks[Kernel16F_MAX_DISKS]; static int num_disks = 0; diff --git a/display/display.c b/display/display.c index 0da57c4..c2ad43d 100644 --- a/display/display.c +++ b/display/display.c @@ -1,4 +1,4 @@ -#include +#include "../headers/stdio.h" #include "display.h" void display_init() { diff --git a/fat16/fat16fs.c b/fat16/fat16fs.c index e5dd85b..b954dc3 100644 --- a/fat16/fat16fs.c +++ b/fat16/fat16fs.c @@ -1,9 +1,10 @@ -#include "fat16fs.h" +#include "../headers/stdio.h" +#include "../fat16/fat16fs.h" #include "memory_manager/mem_manager.h" #include "string_manipulation/string_utils.h" -#include "status.h" -#include "config.h" -#include "disk_operations/disk.h" +#include "../Kernel16F/status.h" +#include "../Kernel16F/config.h" +#include "../disk_operations/disk.h" struct fat_header_extended { diff --git a/fat16/fat16fs.h b/fat16/fat16fs.h index 89924d8..4955dc7 100644 --- a/fat16/fat16fs.h +++ b/fat16/fat16fs.h @@ -1,5 +1,5 @@ -#include "filesystem/filesystem.h" -#include "types.h" +#include "../filesystem/filesystem.h" +#include "../types.h" #define Kernel16F_FAT16_SIGNATURE 0x29 diff --git a/filesystem/filesystem.c b/filesystem/filesystem.c index de40e2c..02d39b5 100644 --- a/filesystem/filesystem.c +++ b/filesystem/filesystem.c @@ -1,11 +1,12 @@ -#include "file.h" -#include "config.h" -#include "kernel.h" -#include "memory/memory.h" -#include "fat16/fat16.h" -#include "disk_operations/disk.h" -#include "string_manipulation/string.h" -#include "status.h" +#include "filesystem.h" +#include "../config.h" +#include "../Kernel16F.h" +#include "../memory_manager/mem_manager.h" +#include "../fat16/fat16fs.h" +#include "../disk_operations/disk.h" +#include "../string_manipulation/string_utils.h" +#include "../status.h" +#include "../headers/stdlib.h" #define MAX_FILESYSTEMS 10 struct filesystem *filesystems[MAX_FILESYSTEMS]; diff --git a/filesystem/filesystem.h b/filesystem/filesystem.h index 4689d3c..21da256 100644 --- a/filesystem/filesystem.h +++ b/filesystem/filesystem.h @@ -1,8 +1,8 @@ #ifndef FILESYSTEM_H #define FILESYSTEM_H -#include -#include "/disk_operations/disk.h" +#include "../headers/stdio.h" +#include "../disk_operations/disk.h" typedef void* (*FS_OPEN_FUNCTION)(struct disk* disk, char* filename, char mode); typedef int (*FS_RESOLVE_FUNCTION)(struct disk* disk); diff --git a/types.h b/types.h new file mode 100644 index 0000000..374f0de --- /dev/null +++ b/types.h @@ -0,0 +1,8 @@ +#ifndef TYPES_H +#define TYPES_H + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned long uint32; + +#endif