Lowlevel
Lowlevel => Lowlevel-Coding => Thema gestartet von: urx_ am 27. April 2005, 18:40
-
hallo,
ich habe mal wieder ein problem mit meinem OS. und zwar wird der keyboard interrupt (0x21) nicht ausgelöst. die idt selbst ist denke ich nicht fehlerhaft, weil die exceptions aufgerufen werden.
hier einmal ein paar ausschnitte aus dem source (bitte nicht an den kommentaren stören lassen):
meine IDT
macro idtEntry func ; <- Tight
{
dw (func and 0xFFFF)
dw codesel
db 0
db 0x8E
dw (func shr 16)
}
idt_pointer:
dw idt_end - idt_start - 1
dd idt_start
idt_start:
idtEntry u_isr ; 00. Interrupt (exception)
idtEntry u_isr ; 01. Interrupt (exception)
idtEntry u_isr ; 02. Interrupt (exception)
idtEntry u_isr ; 03. Interrupt (exception)
idtEntry u_isr ; 04. Interrupt (exception)
idtEntry u_isr ; 05. Interrupt (exception)
idtEntry u_isr ; 06. Interrupt (exception)
idtEntry u_isr ; 07. Interrupt (exception)
idtEntry u_isr ; 08. Interrupt (exception)
idtEntry u_isr ; 09. Interrupt (exception)
idtEntry u_isr ; 0A. Interrupt (exception)
idtEntry u_isr ; 0B. Interrupt (exception)
idtEntry u_isr ; 0C. Interrupt (exception)
idtEntry u_isr ; 0D. Interrupt (exception)
idtEntry u_isr ; 0E. Interrupt (exception)
idtEntry u_isr ; 0F. Interrupt (exception)
idtEntry u_isr ; 10. Interrupt (exception)
idtEntry u_isr ; 11. Interrupt (exception)
idtEntry u_isr ; 12. Interrupt (exception)
idtEntry u_isr ; 13. Interrupt (exception)
idtEntry u_isr ; 14. Interrupt (exception)
idtEntry u_isr ; 15. Interrupt (exception)
idtEntry u_isr ; 16. Interrupt (exception)
idtEntry u_isr ; 17. Interrupt (exception)
idtEntry u_isr ; 18. Interrupt (exception)
idtEntry u_isr ; 19. Interrupt (exception)
idtEntry u_isr ; 1A. Interrupt (no good)
idtEntry u_isr ; 1B. Interrupt (no good)
idtEntry u_isr ; 1C. Interrupt (no good)
idtEntry u_isr ; 1D. Interrupt (no good)
idtEntry u_isr ; 1E. Interrupt (no good)
idtEntry u_isr ; 1F. Interrupt (no good)
idtEntry isr20 ; 20. Interrupt (timer)
idtEntry isr21 ; 21. Interrupt (keyboard)
idtEntry donothing ; 22. stupid shit
idtEntry donothing ; 23. "
idtEntry donothing ; 24. "
idtEntry donothing ; 25. "
idtEntry donothing ; 26. "
idtEntry donothing ; 27. "
idtEntry donothing ; 28. "
idtEntry donothing ; 29. "
idtEntry donothing ; 2A. "
idtEntry donothing ; 2B. "
idtEntry donothing ; 2C. "
idtEntry donothing ; 2D. "
idtEntry donothing ; 2E. "
idtEntry donothing ; 2F. "
idtEntry donothing ; 30. "
idtEntry donothing ; 31. "
idtEntry isr32 ; 32. Interrupt (my own (roflrofl))
idt_end:
die keyboard-isr:
isr21:
push esi
push eax
push gs
push fs
push ds
push es
xor al, al
div al
xor eax, eax
in al, 0x60
mov esi, kit ; I love blood
mov al, 0x07 ; in grey
call print_text ; kill
mov al, 0x20
out 0x20, al
pop es
pop ds
pop fs
pop gs
pop eax
pop esi
iret
das remappen von den pics:
remap_pics:
push eax
push ebx
push ecx
; ICW 1
mov al, 0x11
out 0x20, al
out 0xA0, al
; ICW 2
mov al, 0x20 ; Pic1, isr0 - isr7 TO int0x20 - int0x27
out 0x21, al
mov al, 0x28 ; Pic2, isr8 - isr15 TO int0x28 - int0x30
out 0xA1, al
; ICW 3
mov al, 0x04
out 0x21, al
mov al, 0x02
out 0xA1, al
; ICW 4
mov al, 0x01
out 0x21, al
out 0xA1, al
pop ecx
pop ebx
pop eax
ret
edit:
hab doch glatt vergessen, das an-/ausschalten von den irqs mit zu senden
hier:
; Disable all Irqs
disable_irqs:
push eax
mov al, 0xFF
out 0x21, al
out 0xA1, al
pop eax
ret
; Enable all Irqs
enable_irqs:
push eax
mov al, 0x00
out 0x21, al
out 0xA1, al
pop eax
ret
so, das wars schon, ich hoffe ihr könnt mir helfen
mfg
-
Ist 21h ueberhaupt der Keyboard Interrupt?
Das ist doch der DOS-Funktionsverteiler, wenn ich nicht irre.
Hardwareinterrupts (also auch Tastatur) muesste doch _eigentlich_
unter den ersten 15 liegen, oder liege ich falsch und das ist nur
RealMode-Denken?
Svenska
-
dafür habe ich ja die pics remappt, dass die hardware-ints bei 0x20 anfangen. deswegen denke ich, dass das noch realmode-denken ist^^
-
Hm, mag sein :lol:
Wie gesagt, ich habe mich damit noch nicht wirklich befasst. Und auch
nicht wirklich die guten Möglichkeiten, das muss dann bis nach dem
Sommer warten.
War nur ne Idee.
Svenska
-
Standardfrage: STI haste auch aufgerufen?
-
ja klar, zuerst sti und dann die enable_irqs (alles nachdem die idt geladen ist)
-
Hmm, ich hatte auch mal sowas, bei mir war das folgendes:
Ich hatte alle IRQs aktiviert im PIC, und nur nen leeren ASM Stub zur Behandlung für die meisten IRQs (meine Logik sollte über C++ zu Java gehen ;) ). Natürlich hatte ich ne Java-Methode für den Keyboard-ISR.
Jedoch passierte nix. Was war los? Ich hatte natürlich den PIT-IRQ 0 mitaktiviert. Der wurde ausgelöst und die CPU sprang ohne EOI aus dem ISR zurück, wodurch natürlich dann der Keyboard IRQ nicht mehr durchgereicht wurde.
Vielleicht hast du ja auch sowas ...
-
für die unbehandelten irqs habe ich extra die funktion geschrieben, die auch das eoi-signal an beide pics sendet. deswegen weiss ich nicht ob es daran liegen kann.
-
Wegen dem EOI-Senden an beide PICs wenn es unnötig ist hatte ein anderer Entwickler Probleme wenn ich mich richtig erinnere ...
-
dann wäre es wohl sinnvoll eine funktion zu schreiben, die nur ein interrupt aktiviert. weiss zufälligerweise jemand wie das geht?