diff options
author | Marvin Borner | 2021-07-13 19:46:13 +0200 |
---|---|---|
committer | Marvin Borner | 2021-07-13 19:46:13 +0200 |
commit | c9b5256eb58fd4dce5b027c1a2aadaaf2638c33b (patch) | |
tree | 871dd1de7378f22f69c7009e44c7ac7e88f5d8ea | |
parent | 08cd951ea8410bc87e316e6c11d34a118437ba8b (diff) |
-rw-r--r-- | example/segelboot.cfg | 3 | ||||
-rwxr-xr-x | run | 6 | ||||
-rw-r--r-- | src/loader/config.c | 2 | ||||
-rw-r--r-- | src/loader/device.c | 7 | ||||
-rw-r--r-- | src/loader/interrupt.c | 10 | ||||
-rw-r--r-- | src/loader/main.c | 1 | ||||
-rw-r--r-- | src/loader/protocols/all.c | 2 | ||||
-rw-r--r-- | src/loader/protocols/mb2.c | 2 |
8 files changed, 16 insertions, 17 deletions
diff --git a/example/segelboot.cfg b/example/segelboot.cfg index 640ebca..d30fc0d 100644 --- a/example/segelboot.cfg +++ b/example/segelboot.cfg @@ -1,8 +1,5 @@ TIMEOUT=10 -# Melvix -PATH=hda0:/apps/kernel/exec - # Multiboot 1 PATH=hda0:/boot/mb1.elf @@ -19,7 +19,7 @@ build_cross() { echo -n "Do you want to compile a cross compiler (this can take around 20 minutes)? [yn] " read -r answer if ! [ "$answer" != "${answer#[Yy]}" ]; then - echo "The compilation of melvix requires a cross compiler!" + echo "The compilation of SegelBoot requires a cross compiler!" exit 1 fi fi @@ -99,8 +99,8 @@ build() { $SUDO cp example/segelboot.cfg mnt/boot/ $SUDO cp build/examples/* mnt/boot/ - $SUDO cp -r "$HOME"/code/melvix/disk/* mnt/ || true - $SUDO cp -r "$HOME"/code/melvix/build/apps/ mnt/apps/ || true + #$SUDO cp -r "$HOME"/code/melvix/disk/* mnt/ || true + #$SUDO cp -r "$HOME"/code/melvix/build/apps/ mnt/apps/ || true $SUDO umount mnt/ || (sync && $SUDO umount mnt/) rm -rf mnt/ diff --git a/src/loader/config.c b/src/loader/config.c index 2471d87..86b7369 100644 --- a/src/loader/config.c +++ b/src/loader/config.c @@ -2,10 +2,10 @@ #include <config.h> #include <device.h> -#include <protocols/all.h> #include <library.h> #include <log.h> #include <panic.h> +#include <protocols/all.h> // Keys #define TIMEOUT "TIMEOUT" diff --git a/src/loader/device.c b/src/loader/device.c index 9c3e2ee..eb2bdd0 100644 --- a/src/loader/device.c +++ b/src/loader/device.c @@ -51,8 +51,8 @@ void device_foreach(enum device_type type, u8 (*cb)(struct dev *)) } u8 device_register(enum device_type type, char *name, u32 data, - s32 (*read)(void *, u32, u32, struct dev *), - s32 (*write)(const void *, u32, u32, struct dev *)) + s32 (*read)(void *, u32, u32, struct dev *), + s32 (*write)(const void *, u32, u32, struct dev *)) { static u8 id = 0; assert(++id < 0xff); @@ -79,6 +79,7 @@ void device_print(void) struct dev *dev = &devices[i]; if (!dev->id) continue; - log("[DEV] %d: %s device: %s\n", dev->id, device_resolve_type(dev->type), dev->name); + log("[DEV] %d: %s device: %s\n", dev->id, device_resolve_type(dev->type), + dev->name); } } diff --git a/src/loader/interrupt.c b/src/loader/interrupt.c index e05b4e0..d750832 100644 --- a/src/loader/interrupt.c +++ b/src/loader/interrupt.c @@ -2,8 +2,8 @@ #include <interrupt.h> #include <log.h> -#include <pic.h> #include <panic.h> +#include <pic.h> /** * IDT @@ -11,10 +11,12 @@ extern u32 interrupt_table[]; static struct idt_entry idt_entries[256] = { 0 }; -REAL static struct idt_ptr idt = { .size = sizeof(idt_entries) - 1, .base = idt_entries }; +static struct idt_ptr idt = { .size = sizeof(idt_entries) - 1, .base = idt_entries }; void idt_install(void) { + // Initialize IDT using handler offset, segment and type + for (u8 i = 0; i < 3; i++) idt_entries[i] = IDT_ENTRY(interrupt_table[i], 0x18, INTERRUPT_GATE); @@ -82,8 +84,8 @@ static void interrupt_trap_handler(struct interrupt_frame *frame) __asm__ volatile("cli\nhlt"); } - log("%s Exception (code %x) at 0x%x!\n", interrupt_trap_names[frame->interrupt_no], frame->err_code, - frame->eip); + log("%s Exception (code %x) at 0x%x!\n", interrupt_trap_names[frame->interrupt_no], + frame->err_code, frame->eip); while (1) __asm__ volatile("cli\nhlt"); diff --git a/src/loader/main.c b/src/loader/main.c index 1884b2f..5d2afc8 100644 --- a/src/loader/main.c +++ b/src/loader/main.c @@ -32,7 +32,6 @@ int start(u8 disk) pic_install(); idt_install(); - // acpi_probe(); // TODO: Fix slow ACPI probing pci_probe(); device_print(); diff --git a/src/loader/protocols/all.c b/src/loader/protocols/all.c index 8ea16dd..324692f 100644 --- a/src/loader/protocols/all.c +++ b/src/loader/protocols/all.c @@ -1,9 +1,9 @@ // MIT License, Copyright (c) 2021 Marvin Borner +#include <panic.h> #include <protocols/all.h> #include <protocols/mb1.h> #include <protocols/mb2.h> -#include <panic.h> u8 impl_detect(struct config_entry *cfg) { diff --git a/src/loader/protocols/mb2.c b/src/loader/protocols/mb2.c index 8f0a660..3adf312 100644 --- a/src/loader/protocols/mb2.c +++ b/src/loader/protocols/mb2.c @@ -2,9 +2,9 @@ // Everything according to spec #include <elf.h> -#include <protocols/mb2.h> #include <library.h> #include <panic.h> +#include <protocols/mb2.h> // The address where data gets stored #define MB2_LOAD_ADDRESS 0x10000 |