Tiberiu Chibici
913e65b856
==================================================== + Changed 'align 0x4' line above multiboot header in loader.asm to 'align 4' + Removed -e option for echo in build.sh + Modified build.sh for linux + Fixed triple fault when enabling paging + Fixed page faults at memory manager initialization + Fixed 'mem' console function + Added more info about page fault at crash screen + Added Panic() macro + Added verbose mode for memory manager [ BAD] BUILD 0.1.0.390 DATE 8/27/2011 AT 10:54 PM ==================================================== + Added stdlib routines, separated in different files + Rewritten physical memory manager + Added virtual mem manager + Added memory allocation/freeing + Added memory library + Added temporary allocation (at end of kernel), until paging is started - Removed functionality from debug console function 'mem' - Removed system.h, the one remaining function now in stdio.h
160 lines
2.3 KiB
NASM
160 lines
2.3 KiB
NASM
bits 32
|
|
|
|
; !!! IRQ !!!
|
|
global Irq_0
|
|
global Irq_1
|
|
global Irq_2
|
|
global Irq_3
|
|
global Irq_4
|
|
global Irq_5
|
|
global Irq_6
|
|
global Irq_7
|
|
global Irq_8
|
|
global Irq_9
|
|
global Irq_10
|
|
global Irq_11
|
|
global Irq_12
|
|
global Irq_13
|
|
global Irq_14
|
|
global Irq_15
|
|
|
|
; 32: IRQ0
|
|
Irq_0:
|
|
cli
|
|
push byte 0
|
|
push byte 32; Note that these don't push an error code on the stack:
|
|
; We need to push a dummy error code
|
|
jmp irq_common_stub
|
|
|
|
; 33: IRQ1
|
|
Irq_1:
|
|
cli
|
|
push byte 0
|
|
push byte 33
|
|
jmp irq_common_stub
|
|
|
|
; 34: IRQ2
|
|
Irq_2:
|
|
cli
|
|
push byte 0
|
|
push byte 34
|
|
jmp irq_common_stub
|
|
|
|
; 35: IRQ3
|
|
Irq_3:
|
|
cli
|
|
push byte 0
|
|
push byte 35
|
|
jmp irq_common_stub
|
|
|
|
; 36: IRQ4
|
|
Irq_4:
|
|
cli
|
|
push byte 0
|
|
push byte 36
|
|
jmp irq_common_stub
|
|
|
|
; 37: IRQ5
|
|
Irq_5:
|
|
cli
|
|
push byte 0
|
|
push byte 37
|
|
jmp irq_common_stub
|
|
|
|
; 38: IRQ6
|
|
Irq_6:
|
|
cli
|
|
push byte 0
|
|
push byte 38
|
|
jmp irq_common_stub
|
|
|
|
; 39: IRQ7
|
|
Irq_7:
|
|
cli
|
|
push byte 0
|
|
push byte 39
|
|
jmp irq_common_stub
|
|
|
|
; 40: IRQ8
|
|
Irq_8:
|
|
cli
|
|
push byte 0
|
|
push byte 40
|
|
jmp irq_common_stub
|
|
; 41: IRQ9
|
|
Irq_9:
|
|
cli
|
|
push byte 0
|
|
push byte 41
|
|
jmp irq_common_stub
|
|
|
|
; 42: IRQ10
|
|
Irq_10:
|
|
cli
|
|
push byte 0
|
|
push byte 42
|
|
jmp irq_common_stub
|
|
|
|
; 43: IRQ11
|
|
Irq_11:
|
|
cli
|
|
push byte 0
|
|
push byte 43
|
|
jmp irq_common_stub
|
|
|
|
; 44: IRQ12
|
|
Irq_12:
|
|
cli
|
|
push byte 0
|
|
push byte 44
|
|
jmp irq_common_stub
|
|
|
|
; 45: IRQ13
|
|
Irq_13:
|
|
cli
|
|
push byte 0
|
|
push byte 45
|
|
jmp irq_common_stub
|
|
|
|
; 46: IRQ14
|
|
Irq_14:
|
|
cli
|
|
push byte 0
|
|
push byte 46
|
|
jmp irq_common_stub
|
|
|
|
; 47: IRQ15
|
|
Irq_15:
|
|
cli
|
|
push byte 0
|
|
push byte 47
|
|
jmp irq_common_stub
|
|
|
|
extern IrqHandler
|
|
|
|
; This is a stub that we have created for IRQ based ISRs. This calls
|
|
; 'Irq__handler' in our C code. We need to create this in an 'irq.c'
|
|
irq_common_stub:
|
|
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
|
|
push eax
|
|
mov eax, IrqHandler
|
|
call eax
|
|
pop eax
|
|
pop gs
|
|
pop fs
|
|
pop es
|
|
pop ds
|
|
popa
|
|
add esp, 8
|
|
iret
|