diff --git a/arch/x86_64/cpu/panic.c b/arch/x86_64/cpu/panic.c index 1ebf1d5..4631f6d 100644 --- a/arch/x86_64/cpu/panic.c +++ b/arch/x86_64/cpu/panic.c @@ -12,21 +12,21 @@ void panic(const char *reason, int_frame_t frame) { - printf("\t* %s\n\n", reason); + printf("\n\n* %s\n\n", reason); - printf("\trax: 0x%.16llX, rbx: 0x%.16llX, rcx: 0x%.16llX, rdx: 0x%.16llX\n", + printf("rax: 0x%.16llX, rbx: 0x%.16llX, rcx: 0x%.16llX, rdx: 0x%.16llX\n", frame.rax, frame.rbx, frame.rcx, frame.rdx); - printf("\trsp: 0x%.16llX, rbp: 0x%.16llX, rsi: 0x%.16llX, rdi: 0x%.16llX\n", + printf("rsp: 0x%.16llX, rbp: 0x%.16llX, rsi: 0x%.16llX, rdi: 0x%.16llX\n", frame.rsp, frame.rbp, frame.rsi, frame.rdi); - printf("\tr8: 0x%.16llX, r9: 0x%.16llX, r10: 0x%.16llX, r11: 0x%.16llX\n", + printf("r8: 0x%.16llX, r9: 0x%.16llX, r10: 0x%.16llX, r11: 0x%.16llX\n", frame.r8, frame.r9, frame.r10, frame.r11); - printf("\tr12: 0x%.16llX, r13: 0x%.16llX, r14: 0x%.16llX, r15: 0x%.16llX\n", + printf("r12: 0x%.16llX, r13: 0x%.16llX, r14: 0x%.16llX, r15: 0x%.16llX\n", frame.r12, frame.r13, frame.r14, frame.r15); - printf("\trfl: 0x%.16llX, rip: 0x%.16llX, cs: 0x%.16llX, ss: 0x%.16llX\n", + printf("rfl: 0x%.16llX, rip: 0x%.16llX, cs: 0x%.16llX, ss: 0x%.16llX\n", frame.rflags, frame.rip, frame.cs, frame.ss); dprintf("[\e[0;31mKernel Panic\e[0m] rax: 0x%.16llX, rbx: 0x%.16llX, rcx: " diff --git a/initrd/usr/share/paradox/version b/initrd/usr/share/paradox/version new file mode 100644 index 0000000..5949f17 --- /dev/null +++ b/initrd/usr/share/paradox/version @@ -0,0 +1 @@ +1.69.420-dev diff --git a/kernel/entry/init.c b/kernel/entry/init.c index 2427d01..e35e1e1 100644 --- a/kernel/entry/init.c +++ b/kernel/entry/init.c @@ -80,17 +80,17 @@ void init_boot(int debug_info) else if (kstatus == KERNEL_QUIT_ERROR) { dprintf( - "[\e[0;32mKernel Error] A kernel error occured, check kmesg for rason! " + "[\e[0;32mKernel Error\e[0m] A kernel error occured, check kmesg for reason! " "Rebooting...\n"); reboot(); } else if (kstatus == KERNEL_QUIT_PANIC) { - panic("[Kernel Panic] Kernel quit with a critical error code, please see " + panic("[\e[0;32mKernel Panic\e[0m] Kernel quit with a critical error code, please see " "kmsg for extra info.\n", *cur_frame); dprintf( - "[\e[0;32mKernel\e[0m Panic] Kernel quit with a critical error code, " + "[\e[0;32mKernel Panic\e[0m] Kernel quit with a critical error code, " "the kernel " "process returned with a 2 that means something went really wrong, " "and we are shutting down your computer in 10 seconds!\n"); @@ -103,7 +103,7 @@ void init_boot(int debug_info) } else { - dprintf("[\e[0;32mKernel\e[0m Warning] Kernel returned %d\n", kstatus); + dprintf("[\e[0;32mKernel Warning\e[0m] Kernel returned %d\n", kstatus); } // If we reach this point, something unexpected happened diff --git a/kernel/entry/kernel.c b/kernel/entry/kernel.c index 2ab6220..16e2f68 100644 --- a/kernel/entry/kernel.c +++ b/kernel/entry/kernel.c @@ -31,18 +31,18 @@ return codes) #include #include -void test() +void terminal_launch() { - printf("Hello from PID 0!\n"); + tty_spawn(1, "/usr/share/fonts/Uni3-Terminus20x10.psf"); + printf("Paradox 1.4.1-dev (tty1)\n\n"); + keyboard.out = true; } int main() { keyboard.out = false; - tty_spawn(0); + tty_spawn(0, "/usr/share/fonts/Uni3-Terminus12x6.psf"); register_pci(); - pit_sleep(1000); - tty_spawn(1); - printf("local @ tty1\n"); + terminal_launch(); return KERNEL_QUIT_HANG; } diff --git a/kernel/tty/tty.c b/kernel/tty/tty.c index c745ed5..6367de0 100644 --- a/kernel/tty/tty.c +++ b/kernel/tty/tty.c @@ -19,7 +19,7 @@ void tty_flush() { nighterm_set_cursor_position(cur_tty->context, 0, 0); } -int tty_spawn(uint8_t id) +int tty_spawn(uint8_t id, char* font_path) { if(ttys[id] != NULL) return 1; @@ -29,7 +29,7 @@ int tty_spawn(uint8_t id) return 4; char *font_data; - vfs_op_status status = driver_read(vfs_b, 0x00000000, "/usr/share/fonts/Uni3-Terminus12x6.psf", &font_data); + vfs_op_status status = driver_read(vfs_b, 0x00000000, font_path, &font_data); if (status != STATUS_OK) { free(context); diff --git a/kernel/tty/tty.h b/kernel/tty/tty.h index 38b000d..445bbd1 100644 --- a/kernel/tty/tty.h +++ b/kernel/tty/tty.h @@ -18,7 +18,7 @@ typedef struct { extern tty* ttys[MAX_TTYS]; void tty_init(VFS_t *vfs, struct limine_framebuffer *framebuffer); -int tty_spawn(uint8_t id); +int tty_spawn(uint8_t id, char* font_path); int tty_destroy(uint8_t id); void tty_switch(uint8_t id);