interrupts again
Posted: Mon Jun 24, 2002 11:00 pm
I don't understand ... how can I know with device interrupts ... on a shared irq?
When I get irq15 ... witch device interrupts? ... first drive on ide0 or the second ...
One more thing!
What is wrong with this code? ... Why does it display Double fault (8) and General protection (d)?
[org 0x7c00]
[bits 16]
cli
lgdt [gdtr]
lidt [idtr]
mov eax, cr0
or al, 1
mov cr0, eax
jmp 0x0008:pm_start
[bits 32]
pm_start:
mov ax, 0x0010
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov sp, 0x7c00
sti
mov cx, 80*25
mov ebx, 0xb8000
clear_screen:
mov [ebx], word 0x0720
inc ebx
inc ebx
loop clear_screen
int 0x20
jmp $
exception0:
mov [0xb8000], byte '0'
iret
exception1:
mov [0xb8002], byte '1'
iret
exception2:
mov [0xb8004], byte '2'
iret
exception3:
mov [0xb8006], byte '3'
iret
exception4:
mov [0xb8008], byte '4'
iret
exception5:
mov [0xb800a], byte '5'
iret
exception6:
mov [0xb800c], byte '6'
iret
exception7:
mov [0xb800e], byte '7'
iret
exception8:
mov [0xb8010], byte '8'
iret
exception9:
mov [0xb8012], byte '9'
iret
exception10:
mov [0xb8014], byte 'a'
iret
exception11:
mov [0xb8016], byte 'b'
iret
exception12:
mov [0xb8018], byte 'c'
iret
exception13:
mov [0xb801a], byte 'd'
iret
exception14:
mov [0xb801c], byte 'e'
iret
exception15:
mov [0xb801e], byte 'f'
iret
unhand:
iret
int20:
mov [0xb8020], byte 'O'
mov [0xb8022], byte 'k'
iret
gdtr:
dw gdt-gdtend-1
dd gdt
idtr:
dw idt-idtend-1
dd idt
gdt:
null:
dd 0x00000000, 0x00000000
code:
dd 0x0000ffff, 0x00cf9a00
data:
dd 0x0000ffff, 0x00cf9200
gdtend:
idt:
dw exception0, 0x0008, 0x8e00, 0x0000 ; 0x00
dw exception1, 0x0008, 0x8e00, 0x0000 ; 0x01
dw exception2, 0x0008, 0x8e00, 0x0000 ; 0x02
dw exception3, 0x0008, 0x8e00, 0x0000 ; 0x03
dw exception4, 0x0008, 0x8e00, 0x0000 ; 0x04
dw exception5, 0x0008, 0x8e00, 0x0000 ; 0x05
dw exception6, 0x0008, 0x8e00, 0x0000 ; 0x06
dw exception7, 0x0008, 0x8e00, 0x0000 ; 0x07
dw exception8, 0x0008, 0x8e00, 0x0000 ; 0x08
dw exception9, 0x0008, 0x8e00, 0x0000 ; 0x09
dw exception10, 0x0008, 0x8e00, 0x0000 ; 0x0a
dw exception11, 0x0008, 0x8e00, 0x0000 ; 0x0b
dw exception12, 0x0008, 0x8e00, 0x0000 ; 0x0c
dw exception13, 0x0008, 0x8e00, 0x0000 ; 0x0d
dw exception14, 0x0008, 0x8e00, 0x0000 ; 0x0e
dw exception15, 0x0008, 0x8e00, 0x0000 ; 0x0f
irq0: ; 0x10
dw unhand, 0x0008, 0x8e00, 0x0000
irq1: ; 0x11
dw unhand, 0x0008, 0x8e00, 0x0000
irq2: ; 0x12
dw unhand, 0x0008, 0x8e00, 0x0000
irq3: ; 0x13
dw unhand, 0x0008, 0x8e00, 0x0000
irq4: ; 0x14
dw unhand, 0x0008, 0x8e00, 0x0000
irq5: ; 0x15
dw unhand, 0x0008, 0x8e00, 0x0000
irq6: ; 0x16
dw unhand, 0x0008, 0x8e00, 0x0000
irq7: ; 0x17
dw unhand, 0x0008, 0x8e00, 0x0000
irq8: ; 0x18
dw unhand, 0x0008, 0x8e00, 0x0000
irq9: ; 0x19
dw unhand, 0x0008, 0x8e00, 0x0000
irq10: ; 0x1a
dw unhand, 0x0008, 0x8e00, 0x0000
irq11: ; 0x1b
dw unhand, 0x0008, 0x8e00, 0x0000
irq12: ; 0x1c
dw unhand, 0x0008, 0x8e00, 0x0000
irq13: ; 0x1d
dw unhand, 0x0008, 0x8e00, 0x0000
irq14: ; 0x1e
dw unhand, 0x0008, 0x8e00, 0x0000
irq15: ; 0x1f
dw unhand, 0x0008, 0x8e00, 0x0000
; 0x20 - 0xff
dw int20, 0x0008, 0x8e00, 0x0000
idtend:
times 510-($-$$) db 0
dw 0xaa55
When I get irq15 ... witch device interrupts? ... first drive on ide0 or the second ...
One more thing!
What is wrong with this code? ... Why does it display Double fault (8) and General protection (d)?
[org 0x7c00]
[bits 16]
cli
lgdt [gdtr]
lidt [idtr]
mov eax, cr0
or al, 1
mov cr0, eax
jmp 0x0008:pm_start
[bits 32]
pm_start:
mov ax, 0x0010
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov sp, 0x7c00
sti
mov cx, 80*25
mov ebx, 0xb8000
clear_screen:
mov [ebx], word 0x0720
inc ebx
inc ebx
loop clear_screen
int 0x20
jmp $
exception0:
mov [0xb8000], byte '0'
iret
exception1:
mov [0xb8002], byte '1'
iret
exception2:
mov [0xb8004], byte '2'
iret
exception3:
mov [0xb8006], byte '3'
iret
exception4:
mov [0xb8008], byte '4'
iret
exception5:
mov [0xb800a], byte '5'
iret
exception6:
mov [0xb800c], byte '6'
iret
exception7:
mov [0xb800e], byte '7'
iret
exception8:
mov [0xb8010], byte '8'
iret
exception9:
mov [0xb8012], byte '9'
iret
exception10:
mov [0xb8014], byte 'a'
iret
exception11:
mov [0xb8016], byte 'b'
iret
exception12:
mov [0xb8018], byte 'c'
iret
exception13:
mov [0xb801a], byte 'd'
iret
exception14:
mov [0xb801c], byte 'e'
iret
exception15:
mov [0xb801e], byte 'f'
iret
unhand:
iret
int20:
mov [0xb8020], byte 'O'
mov [0xb8022], byte 'k'
iret
gdtr:
dw gdt-gdtend-1
dd gdt
idtr:
dw idt-idtend-1
dd idt
gdt:
null:
dd 0x00000000, 0x00000000
code:
dd 0x0000ffff, 0x00cf9a00
data:
dd 0x0000ffff, 0x00cf9200
gdtend:
idt:
dw exception0, 0x0008, 0x8e00, 0x0000 ; 0x00
dw exception1, 0x0008, 0x8e00, 0x0000 ; 0x01
dw exception2, 0x0008, 0x8e00, 0x0000 ; 0x02
dw exception3, 0x0008, 0x8e00, 0x0000 ; 0x03
dw exception4, 0x0008, 0x8e00, 0x0000 ; 0x04
dw exception5, 0x0008, 0x8e00, 0x0000 ; 0x05
dw exception6, 0x0008, 0x8e00, 0x0000 ; 0x06
dw exception7, 0x0008, 0x8e00, 0x0000 ; 0x07
dw exception8, 0x0008, 0x8e00, 0x0000 ; 0x08
dw exception9, 0x0008, 0x8e00, 0x0000 ; 0x09
dw exception10, 0x0008, 0x8e00, 0x0000 ; 0x0a
dw exception11, 0x0008, 0x8e00, 0x0000 ; 0x0b
dw exception12, 0x0008, 0x8e00, 0x0000 ; 0x0c
dw exception13, 0x0008, 0x8e00, 0x0000 ; 0x0d
dw exception14, 0x0008, 0x8e00, 0x0000 ; 0x0e
dw exception15, 0x0008, 0x8e00, 0x0000 ; 0x0f
irq0: ; 0x10
dw unhand, 0x0008, 0x8e00, 0x0000
irq1: ; 0x11
dw unhand, 0x0008, 0x8e00, 0x0000
irq2: ; 0x12
dw unhand, 0x0008, 0x8e00, 0x0000
irq3: ; 0x13
dw unhand, 0x0008, 0x8e00, 0x0000
irq4: ; 0x14
dw unhand, 0x0008, 0x8e00, 0x0000
irq5: ; 0x15
dw unhand, 0x0008, 0x8e00, 0x0000
irq6: ; 0x16
dw unhand, 0x0008, 0x8e00, 0x0000
irq7: ; 0x17
dw unhand, 0x0008, 0x8e00, 0x0000
irq8: ; 0x18
dw unhand, 0x0008, 0x8e00, 0x0000
irq9: ; 0x19
dw unhand, 0x0008, 0x8e00, 0x0000
irq10: ; 0x1a
dw unhand, 0x0008, 0x8e00, 0x0000
irq11: ; 0x1b
dw unhand, 0x0008, 0x8e00, 0x0000
irq12: ; 0x1c
dw unhand, 0x0008, 0x8e00, 0x0000
irq13: ; 0x1d
dw unhand, 0x0008, 0x8e00, 0x0000
irq14: ; 0x1e
dw unhand, 0x0008, 0x8e00, 0x0000
irq15: ; 0x1f
dw unhand, 0x0008, 0x8e00, 0x0000
; 0x20 - 0xff
dw int20, 0x0008, 0x8e00, 0x0000
idtend:
times 510-($-$$) db 0
dw 0xaa55