From b800448bd50d97aeaa6c51303f7024c0046d77ec Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Tue, 8 Jul 2014 17:04:11 +0200 Subject: moved idt stuff to C successfully --- boot/mbr.asm | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'boot') diff --git a/boot/mbr.asm b/boot/mbr.asm index 93126b1..1e7c53d 100644 --- a/boot/mbr.asm +++ b/boot/mbr.asm @@ -38,7 +38,7 @@ BOOT_DRIVE: ; default interrupt handler interrupt: - mov al, 0xA0 ; set bit 4 of OCW 2 + mov al, 0xA0 ; set bit 4 of OCW 1 out 0xA0, al ; write to primary PIC command register mov al, 0x20 ; set bit 4 of OCW 2 @@ -46,6 +46,7 @@ interrupt: iret + ;handle keyboard interrupt interrupt2: @@ -70,6 +71,8 @@ interrupt2: iret +;;;;; + ;lets put our temporary GDT (Global Descriptor Table) here %include "boot/GDT.asm" @@ -94,7 +97,7 @@ boot_16: ;remember BOOT_DRIVE (as was set by BIOS) mov [BOOT_DRIVE],dl - + ;print FoolOS version info mov bx, STR_VERSION call print_string @@ -125,7 +128,7 @@ boot_32_pm: mov al, 0xdd ; command 0xdd: enable a20 out 0x64, al ; send command to controller - lidt [idt_descriptor] ;load descriptor table! + ; lidt [idt_descriptor] ;load descriptor table! ;pollkb example ; pollkb: @@ -140,7 +143,7 @@ boot_32_pm: ;out 0x61, al - sti ;enable interrupts + ; sti ;enable interrupts ;************************************************************************ ; Map the 8259A PIC to use interrupts 32-47 within our interrupt table @@ -221,17 +224,20 @@ out 0xA1, al ; write the value back into IMR - call KERNEL_OFFSET+(idt_end-idt_start) ;jump into our Kernel it + call KERNEL_OFFSET;+(idt_end-idt_start) ;jump into our Kernel it ; will follow our ; interrupt table -idt_descriptor: - dw idt_end-idt_start-1 - dd KERNEL_OFFSET +;idt_descriptor: +; dw idt_end-idt_start-1 +; dd KERNEL_OFFSET ;;;; DEBUGGING STUFF times 8 db '@' +dw interrupt +times 8 db '@' +dw interrupt2 times 8 db '@' @@ -242,11 +248,11 @@ times 510-($-$$) db 0 dw 0xaa55 ;interrupt descriptor table (hardcoded address of interrupts:) -idt_start: -times 33 db 0x50,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 -db 0x59,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 -times 253 db 0x50,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 -idt_end: +;idt_start: +;times 33 db 0x50,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 +;db 0x59,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 +;times 253 db 0x50,0x7c,0x08,0x00,0x00,10001110b,0x0,0x0 +;idt_end: -- cgit v1.2.3