diff --git a/src/boot.asm b/src/boot.asm index 26d5726..e838764 100644 --- a/src/boot.asm +++ b/src/boot.asm @@ -30,19 +30,19 @@ mboot: dd start ; Reserve space for stack -section .bss align=16 +section .bss resb 8192 stack_end: section .text [GLOBAL start] ; Kernel entry point -[EXTERN kernel_main] ; C code entry point +[EXTERN kmain] ; C code entry point start: ; Load multiboot information - push ebx ; Save mboot information structure cli ; Disable interrupts mov esp, stack_end ; Set stack pointer to end of stack - call kernel_main ; Call 'kernel_main()' C function + push ebx ; Save mboot information structure + call kmain ; Call 'kernel_main()' C function jmp $ ; Continue loop diff --git a/src/keyboard.c b/src/keyboard.c index a854002..354f8c7 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -158,7 +158,7 @@ static void keyboard_handler(registers_t *regs) { memset(input_buffer, 0, sizeof(input_buffer)); } else if (ascii == BKSP) { // Try to delete last inputted character - if (monitor_delete() != -1) { + if (monitor_delete() != -1 && strlen(input_buffer) > 0) { // Delete last character from input buffer char tmp[INPUT_BUFFER_LEN] = {0}; memcpy(tmp, input_buffer, strlen(input_buffer) - 1); diff --git a/src/main.c b/src/main.c index 9133956..cd79e60 100644 --- a/src/main.c +++ b/src/main.c @@ -9,7 +9,7 @@ struct multiboot; -int kernel_main(struct multiboot *mboot_ptr) { +int kmain(struct multiboot *mboot_ptr) { // Initialize descriptor tables init_descriptor_tables(); @@ -30,7 +30,11 @@ int kernel_main(struct multiboot *mboot_ptr) { // TODO Multitasking //switch_to_user_mode(); - //syscall_monitor_write("Hello, user world!\n"); + + // System Call test + /* + syscall_monitor_write("Hello, user world!\n$ "); + */ // Paging and Heap test (comment 'init_paging()' above!) /* @@ -51,7 +55,7 @@ int kernel_main(struct multiboot *mboot_ptr) { monitor_write_hex(d); */ - // Page fault test + // Panic test /* uint *ptr = (uint*)0xA0000000; uint do_page_fault = *ptr;