Made the KPanic routine switch back to 0xB8000 text mode
[tpg/acess2.git] / Kernel / arch / x86 / desctab.asm
index bc37711..43bd8e4 100644 (file)
@@ -13,7 +13,6 @@ GDT_SIZE      equ     (1+2*2+1+MAX_CPUS)*8
 [section .data]
 ; GDT
 [global gGDT]
-[global gGDTptr]
 gGDT:
        ; PL0 - Kernel
        ; PL3 - User
@@ -24,22 +23,26 @@ gGDT:
        dd 0x0000FFFF, 0x00CFF200       ; 20 PL3 Data
        dd 26*4-1, 0x00408900   ; Double Fault TSS
        times MAX_CPUS  dd 26*4-1, 0x00408900
-gGDTptr:
+[global gGDTPtr]
+gGDTPtr:
        dw      GDT_SIZE-1
        dd      gGDT
 ; IDT
 ALIGN 8
+[global gIDT]
 gIDT:
        times   256     dd      0x00080000,0x00000F00
+[global gIDTPtr]
 gIDTPtr:
        dw      256 * 16 - 1    ; Limit
        dd      gIDT            ; Base
 
 [section .text]
+
 [global Desctab_Install]
 Desctab_Install:
        ; Set GDT
-       lgdt [gGDTptr]
+       lgdt [gGDTPtr]
        mov ax, 0x10    ; PL0 Data
        mov ss, ax
        mov ds, ax
@@ -144,7 +147,6 @@ Isr%1:
 %macro DEF_IRQ 1
 [global Isr%1]
 Isr%1:
-       ;cli    ; HACK!
        push    0
        push    %1
        jmp     IRQCommon
@@ -203,12 +205,19 @@ Isr240:
 ; ---------------------
 [extern ErrorHandler]
 ErrorCommon:
+       ;xchg bx, bx
        pusha
        push ds
        push es
        push fs
        push gs
        
+       mov ax, 0x10
+       mov ds, ax
+       mov es, ax
+       mov fs, ax
+       mov gs, ax
+       
        push esp
        call ErrorHandler
        add esp, 4
@@ -255,6 +264,12 @@ IRQCommon:
        push fs
        push gs
        
+       mov ax, 0x10
+       mov ds, ax
+       mov es, ax
+       mov fs, ax
+       mov gs, ax
+       
        push esp
        call IRQ_Handler
        add esp, 4
@@ -278,6 +293,12 @@ SchedulerBase:
        push fs
        push gs
        
+       mov ax, 0x10
+       mov ds, ax
+       mov es, ax
+       mov fs, ax
+       mov gs, ax
+       
        mov eax, [esp+12*4]     ; CPU Number
        push eax        ; Pus as argument
        

UCC git Repository :: git.ucc.asn.au