From 3fa203061bdae80c75c5f08afa1a607b1c62c075 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Sun, 31 Aug 2014 15:04:44 +0200 Subject: updated boot loader supports for LBA mode Now booting from usb stick on my Acer Aspire works fine too :) --- kernel/kernel.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 5844f49..ebb3841 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -50,7 +50,6 @@ void show_error(uint32_t err) void int_irq13() { X86_IRQ_BEGIN - uint32_t err; asm("pop %eax"); // get Error Code @@ -68,6 +67,17 @@ void int_irq16(){ X86_IRQ_BEGIN panic(FOOLOS_MODULE_NAME,"Coprocessor error"); void int_irq17(){ X86_IRQ_BEGIN panic(FOOLOS_MODULE_NAME,"Alignment Check"); X86_IRQ_END } void int_irq18(){ X86_IRQ_BEGIN panic(FOOLOS_MODULE_NAME,"Machine Check"); X86_IRQ_END } +void enable_a20() +{ +//; ;enable A20 +//; ;http://www.brokenthorn.com/Resources/OSDev9.html +//; ;Method 3.1: Enables A20 through keyboard controller +//; ;Not all keyboard controllers support this + asm("mov $0xdd, %al");// ; command 0xdd: enable a20 +//; ;mov al, 0xdf ; command 0xdf: disable a20 + asm("outb %al, $0x64");// ; send command to controller +} + // heart of our operating system. void kernel_main(uint32_t initial_stack) { @@ -96,6 +106,12 @@ void kernel_main(uint32_t initial_stack) // initial stack log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"initial esp: 0x%08X",initial_stack); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"enable A20"); + enable_a20(); + + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"setup PIC"); + pic_setup(); + // PIT config (timer) timer_init(); -- cgit v1.2.3