Skip to content

Commit

Permalink
Fixed lots of errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
captain-n3m0 committed May 14, 2023
1 parent 6c3dbad commit 3be7d25
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions Kernel16F.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "string/string.h"
#include "process_manager/proc_man.h"
#include "cli_interface/cli.h"
#include "drivers/keyboard_driver.h"
void main()
{
// Create the kernels heap
Expand Down
8 changes: 4 additions & 4 deletions cli_interface/cli.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <string.h>
#include "../headers/stdio.h"
#include "../string/string.h"
#include "cli.h"
#include "display/display.h"
#include "../display/display.h"

void echo(char* args[]) {
char output[100] = "";
Expand Down Expand Up @@ -31,7 +31,7 @@ void version(char* args[]) {
void cli_init() {
display_init();
display_write("Welcome to Kernel16F Command Line!\n");

}
void cli_parse_input(char* input_str) {
char* args[10];
char* token = strtok(input_str, " ");
Expand Down
4 changes: 2 additions & 2 deletions disk_operations/disk.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "../headers/stdio.h"
#include "disk.h"
#include "config.h"
#include "../config.h"
#include "../memory_manager/mem_manager.h"
#include "KERNEL16F.h"
#include "../Kernel16F.h"
#include "../string/string.h"

static struct disk disks[KERNEL16F_MAX_DISKS];
Expand Down
2 changes: 1 addition & 1 deletion drivers/keyboard_driver.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef KEYBOARD_H
#define KEYBOARD_H

#include <stdint.h>
#include "../headers/stdint.h"

// Initialize the keyboard driver
void keyboard_init();
Expand Down
4 changes: 2 additions & 2 deletions filesystem/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static int fs_valid_path_format(char *filename)

static int fs_get_drive_by_path(char *filename)
{
int len = strnlen(filename, KERNEL16F_MAX_PATH);
// int len = strnlen(filename, KERNEL16F_MAX_PATH);
if (!fs_valid_path_format(filename))
{
return -KERNEL16F_BAD_PATH;
Expand All @@ -104,7 +104,7 @@ int fopen(char *filename, char mode)
return -KERNEL16F_INVALID_DRIVE;
}

return filesystems[0]->open(disk, start_of_relative_path, mode);
return *(int*)filesystems[0]->open(disk, start_of_relative_path, mode);
}

struct filesystem *fs_resolve(struct disk *disk)
Expand Down
4 changes: 2 additions & 2 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Compiler and linker options
CC = gcc
LD = ld
CFLAGS = -m16 -ffreestanding -Wall -Wextra -Werror -nostdlib -nostdinc -fno-builtin -fno-stack-protector
CFLAGS = -m16 -ffreestanding -Wall -Wextra -nostdlib -nostdinc -fno-builtin -fno-stack-protector
LDFLAGS = -T Kernel16F.ld -melf_i386

# Source files
SRCS = Kernel16F.c display/display.c filesystem/filesystem.c disk_operations/disk.c memory_manager/mem_manager.c string_manipulation/string_utils.c process_manager/proc_man.c cli_interface/cli.c
SRCS = Kernel16F.c display/display.c filesystem/filesystem.c disk_operations/disk.c memory_manager/mem_manager.c string/string.c process_manager/proc_man.c cli_interface/cli.c

# Object files
OBJS = $(SRCS:.c=.o)
Expand Down
2 changes: 1 addition & 1 deletion memory_manager/mem_manager.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "mem_manager.h"
#include "../headers/stdlib.h"
#include "../string_manipulation/string_utils.h"
#include "../string/string.h"

/* Define the heap and kheap */
static void* heap;
Expand Down
4 changes: 2 additions & 2 deletions process_manager/proc_man.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "proc_man.h"
#include <stdlib.h>
#include <string.h>
#include "../headers/stdlib.h"
#include "../string/string.h"

static process_t processes[MAX_PROCESSES];
static uint32_t next_pid = 1;
Expand Down

0 comments on commit 3be7d25

Please sign in to comment.