diff --git a/kernel/Makefile b/kernel/Makefile index 54a5598..2e2e5f8 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -73,8 +73,8 @@ lang/conv.o: lang/conv.h hos_defines.h display/kout.o: hos_defines.h display/kout.h lang/conv.h devices.h display/kout.o: char/misc_char.h char/misc_char.h functions.h sys/io.h display/display.o: devices.h hos_defines.h char/vconsole.h display/display.h -display/display.o: lang/lang.h kernel.h multiboot.h display/vesafb.h -display/display.o: char/keyboard.h display/kout.h +display/display.o: lang/lang.h kernel.h multiboot.h char/keyboard.h +display/display.o: display/kout.h sys/pic.o: hos_defines.h sys/pic.h sys/io.h char/keyboard.o: hos_defines.h char/keyboard.h sys/io.h functions.h char/keyboard.o: lang/conv.h display/kout.h display/display.h devices.h @@ -90,9 +90,9 @@ block/ramdisk.o: functions.h hos_defines.h sys/io.h mm/vmm.h multiboot.h block/ramdisk.o: lang/lang.h block/ramdisk.h devices.h devices.o: hos_defines.h devices.h char/misc_char.h char/misc_char.h devices.o: char/vconsole.h block/ramdisk.h -fs/vfs.o: hos_defines.h display/kout.h fs/vfs.h devices.h lang/string.h -fs/vfs.o: fs/FileSystem.h fs/VFSMount.h fs/FileSystem.h fs/vfs.h -fs/vfs.o: fs/ext2/ext2.h lang/vector.h +fs/vfs.o: hos_defines.h display/kout.h functions.h sys/io.h fs/vfs.h +fs/vfs.o: devices.h lang/string.h fs/FileSystem.h fs/VFSMount.h +fs/vfs.o: fs/FileSystem.h fs/vfs.h fs/ext2/ext2.h lang/vector.h fs/ext2/ext2.o: display/kout.h hos_defines.h mm/vmm.h multiboot.h lang/lang.h fs/ext2/ext2.o: fs/ext2/ext2.h fs/vfs.h devices.h fs/sysfs/sysfs.o: display/kout.h hos_defines.h fs/vfs.h devices.h diff --git a/kernel/Makefile.bak b/kernel/Makefile.bak index 4433349..54a5598 100644 --- a/kernel/Makefile.bak +++ b/kernel/Makefile.bak @@ -102,5 +102,7 @@ fs/sysfs/sysfs_entry.o: fs/sysfs/sysfs_entry.h lang/vector.h hos_defines.h fs/sysfs/sysfs_entry.o: lang/string.h sys/pci.o: hos_defines.h display/kout.h sys/io.h sys/pci.h lang/vector.h proc/proc.o: hos_defines.h mm/mm.h kernel.h multiboot.h mm/vmm.h lang/lang.h -proc/proc.o: functions.h sys/io.h proc/proc.h proc/hash.h -proc/hash.o: hos_defines.h proc/hash.h +proc/proc.o: functions.h sys/io.h display/kout.h proc/proc.h proc/hash.h +proc/proc.o: lang/vector.h +proc/hash.o: hos_defines.h proc/hash.h lang/vector.h display/kout.h mm/vmm.h +proc/hash.o: multiboot.h diff --git a/kernel/boot.asm b/kernel/boot.asm index 429e47e..b189ff1 100644 --- a/kernel/boot.asm +++ b/kernel/boot.asm @@ -1,7 +1,7 @@ ;boot.asm ;Author: Josh Holtrop ;Date: 07/08/04 -;Modified: 07/10/04 +;Modified: 11/01/05 %define MULTIBOOT_MAGIC 0x1BADB002 @@ -25,7 +25,7 @@ %define KERNEL_P PHYS_START+0x8000 ;1mb+32kb - the kernel's physical address %define KERNEL_V KERNEL_P+VIRT_OFFSET ;3gb+1mb+32kb, the virtual address of the kernel -extern _k_init, _isr, _k_mbsave, _end, _rm_params, _initrd, _tss0, _kprintf +extern _k_init, _isr, _k_mbsave, _end, _rm_params, _initrd, _tss0 [bits 32] diff --git a/kernel/display/display.c b/kernel/display/display.c index 1b5c8a0..b40fa19 100644 --- a/kernel/display/display.c +++ b/kernel/display/display.c @@ -8,7 +8,6 @@ #include "display.h" #include "lang/lang.h" #include "kernel.h" -#include "display/vesafb.h" #include "char/keyboard.h" #include "display/kout.h" @@ -24,6 +23,7 @@ int display_init() { vconsole_setup(80, 25); display_activate(KERNEL_MSG_CONSOLE); + display_type = DISPLAY_CONSOLE; } else display_type = DISPLAY_GRAPHICAL; @@ -66,8 +66,10 @@ void display_key_event(u32_t keyCode) display_activate(kbdScan - 0x4D); return; } + if (KBD_ASCII(keyCode)) + putc(KBD_ASCII(keyCode)); } - if (KBD_ASCII(keyCode)) - putc(KBD_ASCII(keyCode)); + /* TODO: send key to process on active console + or graphical control process */ } diff --git a/kernel/display/kout.c b/kernel/display/kout.c index 07ee911..81dae3d 100644 --- a/kernel/display/kout.c +++ b/kernel/display/kout.c @@ -1,7 +1,7 @@ // kout.c // Author: Josh Holtrop // Date: 08/02/04 -// Modified: 03/19/05 +// Modified: 11/02/05 #include "hos_defines.h" #include "kout.h" @@ -21,7 +21,7 @@ void putc(int c) outportb(0x37a, 0x1); // char_write(MAJOR_MISC_CHAR, MISC_CHAR_LP0, c); #endif - char_write(MAJOR_VCONSOLE, KERNEL_MSG_CONSOLE, c); // write to vconsole with minor 1, first allocated + char_write(MAJOR_VCONSOLE, KERNEL_MSG_CONSOLE, c); } diff --git a/kernel/kernel.c b/kernel/kernel.c index c865bdf..8b617ff 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,8 +1,9 @@ -// kernel.h -// Author: Josh Holtrop -// Date: 08/16/04 -// Modified: 08/18/05 -// This is the main kernel initialization and boot-strapping file +/* kernel.h + * Author: Josh Holtrop + * Date: 08/16/04 + * Modified: 11/02/05 + * This is the main kernel initialization and boot-strapping file + */ #include "kernel.h" #include "multiboot.h" @@ -127,7 +128,6 @@ void k_init() } } display_init(); // initialize display subsystem - display_activate(11); // activate kernel dump vconsole kprintf("HOS v0.16 initializing...\n"); kprintf("Kernel load size: %d (0x%x) bytes (%d kb)\n", kernel_size(), kernel_size(), kernel_size() >> 10); kprintf("Kernel memory size: %d (0x%x) bytes (%d kb)\n", kernel_size_used(), kernel_size_used(), kernel_size_used() >> 10); @@ -227,7 +227,7 @@ void isr(u32_t num, int_stack_t *int_stack) } -void k_enter_critical() // functions for implementing "atomic actions" +void k_enter_critical() // functions for implementing "atomic actions" { disable_ints(); criticalCounter++; diff --git a/kernel/lang/vector.h b/kernel/lang/vector.h index e31284c..2e44872 100644 --- a/kernel/lang/vector.h +++ b/kernel/lang/vector.h @@ -99,6 +99,7 @@ vector & vector::operator=(const vector & v1) myData = new (type *)[myAllocated]; for (u32_t i = 0; i < mySize; i++) myData[i] = new type(*v1.myData[i]); + return *this; } template diff --git a/kernel/proc/proc.cpp b/kernel/proc/proc.cpp index 5a78a93..52b582c 100644 --- a/kernel/proc/proc.cpp +++ b/kernel/proc/proc.cpp @@ -74,8 +74,7 @@ u32_t get_pid() void switch_task(int_stack_t *int_stack, u32_t new_task) { - memcpy(&((process_t *)processes->get(cur_task))->int_stack, - (void *) int_stack, + memcpy(&((process_t *)processes->get(cur_task))->int_stack, int_stack, sizeof(int_stack_t)); cur_task = new_task; memcpy(int_stack, &((process_t *)processes->get(cur_task))->int_stack, diff --git a/rmmod/rmmod.asm b/rmmod/rmmod.asm index e7b19ac..fef3605 100644 --- a/rmmod/rmmod.asm +++ b/rmmod/rmmod.asm @@ -2,7 +2,7 @@ ; real mode module for HOS ; Author: Josh Holtrop ; Date: 09/20/04 -; Modified: 01/04/05 +; Modified: 11/01/05 %define VIRT_OFFSET 0xC0000000 %define SIZEOF_RMPARAMS 20 @@ -20,7 +20,7 @@ ; ebx = return address ; ecx = where to store real mode parameter table start: - jmp 24:start_pm16 + jmp 24:start_pm16 ; uses KERNEL_CODE_BS16 from kernel/boot.asm [bits 16] start_pm16: ; in 16-bit protected mode mov ax, 32 @@ -104,6 +104,12 @@ vesa_mode_loop: and ax, VESA_MODE_SUPPORTED | VESA_MODE_COLOR | VESA_MODE_GRAPHICS | VESA_MODE_LFB cmp ax, VESA_MODE_SUPPORTED | VESA_MODE_COLOR | VESA_MODE_GRAPHICS | VESA_MODE_LFB jnzfar vesa_mode_loop_next + mov ax, [XResolution] + cmp ax, 640 + jlfar vesa_mode_loop_next + mov ax, [YResolution] + cmp ax, 480 + jlfar vesa_mode_loop_next mov al, [BitsPerPixel] cmp al, 15 jz vesa_mode_good diff --git a/rmmod/rmmod.inc b/rmmod/rmmod.inc index 330a396..4d1b605 100644 --- a/rmmod/rmmod.inc +++ b/rmmod/rmmod.inc @@ -1,7 +1,7 @@ ; rmmod.inc ; Author: Josh Holtrop ; Date: 01/04/05 -; Modified: 01/04/05 +; Modified: 11/02/05 %macro jzfar 1 jnz %%skip @@ -15,6 +15,12 @@ %%skip: %endmacro +%macro jlfar 1 + jge %%skip + jmp %1 +%%skip: +%endmacro + %macro ccall 2 push %2 call %1