dd 0x0000FFFF, 0x00CF9200 ; 10 PL0 Data
dd 0x0000FFFF, 0x00CFFA00 ; 18 PL3 Code
dd 0x0000FFFF, 0x00CFF200 ; 20 PL3 Data
- dd 26*4-1, 0x00408900 ; Double Fault TSS
- times MAX_CPUS dd 26*4-1, 0x00408900
+ dd 26*4-1, 0x00408900 ; 28 Double Fault TSS
+ times MAX_CPUS dd 26*4-1, 0x00408900 ; 30+ TSSes
[global gGDTPtr]
gGDTPtr:
dw GDT_SIZE-1
SETISR 0xAC
SETUSER 0xAC
+ %if USE_MP
+ SETISR 239
+ %endif
+
%assign i 0xF0
%rep 16
SETISR i
DEF_SYSCALL 0xAC ; Acess System Call
+; AP's Timer Interrupt
+%if USE_MP
+[global Isr239]
+[extern SchedulerBase]
+Isr239:
+ push 0
+ jmp SchedulerBase
+%endif
+
; IRQs
; - Timer
[global Isr240]
+[extern SchedulerBase]
+[extern SetAPICTimerCount]
Isr240:
push 0
+ %if USE_MP
+ jmp SetAPICTimerCount
+ %else
jmp SchedulerBase
+ %endif
; - Assignable
%assign i 0xF1
%rep 16
; IRQ Handling
; ------------
[extern IRQ_Handler]
+[global IRQCommon]
IRQCommon:
pusha
push ds
popa
add esp, 8 ; Error Code and ID
iret
-
-; --------------
-; Task Scheduler
-; --------------
-[extern Proc_Scheduler]
-SchedulerBase:
- pusha
- push ds
- push es
- 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
-
- call Proc_Scheduler
-
- add esp, 4 ; Remove Argument
-
- pop gs
- pop fs
- pop es
- pop ds
-
- mov dx, 0x20
- mov al, 0x20
- out dx, al ; ACK IRQ
- popa
- add esp, 4 ; CPU ID
- ; No Error code / int num
- iret