Autor Thema: Problem Mit IDT  (Gelesen 3989 mal)

FreakyPenguin

  • Administrator
  • Beiträge: 301
    • Profil anzeigen
    • toni.famkaufmann.info
Gespeichert
« am: 18. May 2005, 16:05 »
Hallo Mal wider,
Ich habe in meinem OS versucht ne IDT zu erstellen. Nun, zum testen hab ich ersteimal nur für den int0 einen Eintrag erstellt. Zum Testen des Eintrags wollte ich einfach eine Division durch Null machen. Doch bochs sgtartet immer neu mit dem fehler:
Exception():3rd <13> exception with no resolution, shutdown status is 00h, resetting


Und hier noch ein auschnitt aus meinem code:

; =================[ PIC ]===============================
mov al, 00010001b
out 0x20, al
out 0xA0, al

mov al, 0x20
out 0x21, al
mov al, 0x28
out 0xA1, al

mov al, 00000100b
out 0x21, al
mov al, 0x02
out 0xA1, al

mov al, 00000001b
out 0x21, al
out 0xA1, al

mov al,0x0
out 0x21, al
out 0xA1, al
; =================[ Main ]==============================

call ClearScreen

mov esi, Msg_Welcome
call PutString



lidt [idt_pointer]



 
mov ax,330
mov dh,0
div dh



jmp $
; =================[ End ]===============================
cli ; disable interrupts.
hlt ; halt the cpu.
; =================[ Misc Data ]=========================
CursorPosition dd 0x00000000
Background db 0x0706
Msg_Welcome db ">>Welcome To Easy Operating System", 0
msga db  "AAA"; 0

delay:
   jmp .1
.1:
   jmp .2
.2:
   ret

ClearScreen:
mov ecx, 80 * 25
xor edx, edx
mov ax, 0x0018
mov es, ax
.1:
mov byte [es:edx], ' '
inc edx
push ax
mov al, [Background]
mov byte [es:edx], al
pop ax
inc edx
loop .1
mov word [CursorPosition], 0
mov ax, 0x0010
mov es, ax
retn

PutString:
mov edx, [CursorPosition]
mov ax, 0x0018
mov es, ax
.1:
lodsb
or al, al
jz short .2
mov byte [es:edx], al
inc edx
push ax
mov al, [Background]
mov byte [es:edx], al
pop ax
inc edx
jmp .1
.2:
mov [CursorPosition], dx
mov ax, 0x0010
mov es, ax
retn


retn

;Interrupt ServiceRoutines
int0t db "Division durch 0 !!!",0

int0x00:
cli
mov esi, int0t
call PutString
retn
int0x01:
cli
mov esi, int0t
call PutString
retn
int0x02:
cli
mov esi, int0t
call PutString
retn
int0x03:
cli
mov esi, int0t
call PutString
retn
int0x04:
cli
mov esi, int0t
call PutString
retn
int0x05:
cli
mov esi, int0t
call PutString
retn
int0x06:
cli
mov esi, int0t
call PutString
retn
int0x07:
cli
mov esi, int0t
call PutString
retn
int0x08:
cli
mov esi, int0t
call PutString
retn
int0x09:
cli
mov esi, int0t
call PutString
retn
int0x0a:
cli
mov esi, int0t
call PutString
retn

idt_pointer:
   dw idt_end - idt - 1
   dd idt


idt:
;int 0x00
dw int0x00
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x01
dw int0x01
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x02
dw int0x02
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x03
dw int0x03
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x04
dw int0x04
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x05
dw int0x05
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x06
dw int0x06
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x07
dw int0x07
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x08
dw int0x08
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x09
dw int0x09
dw 0x10
dw 0x8E00
dw 0x0000
idt_end:



Kann mir jemand sagen, was ich falsch mache ?

Vielen Dank,

Mit Freundlichen güssen Togi

Svenska

  • Beiträge: 1 792
    • Profil anzeigen
Gespeichert
« Antwort #1 am: 18. May 2005, 16:21 »
Klingt nach Exception 13, allgemeiner Protection Error.

Eine Division durch Null erzeugt immer eine Exception, die du natuerlich
nicht abfängst. Eine nicht abgefangene Exception (bzw. Interrupt) zieht ne
Exception nach sich und diese eine Exception 8 (double fault). Da auch
diese nicht behandelt wird, hast du also 3 Exceptions beisammen und da
schaltet der Prozessor in den shutdown status ...

Du musst mindestens die Exceptions des Prozessors zulassen.

Svenska

FreakyPenguin

  • Administrator
  • Beiträge: 301
    • Profil anzeigen
    • toni.famkaufmann.info
Gespeichert
« Antwort #2 am: 18. May 2005, 19:36 »
ich hab jetzt alle Ints bis 32 eingebaut. Und es funktioiert immer noch nicht.
hier ist der neue Code:

; =================[ PIC ]===============================
mov al, 00010001b
out 0x20, al
out 0xA0, al

mov al, 0x20
out 0x21, al
mov al, 0x28
out 0xA1, al

mov al, 00000100b
out 0x21, al
mov al, 0x02
out 0xA1, al

mov al, 00000001b
out 0x21, al
out 0xA1, al

; =================[ Main ]==============================

call ClearScreen

mov esi, Msg_Welcome
call PutString



lidt [idt_pointer]
 
 mov ax,32
  mov bh,0
 div  bh

jmp $
; =================[ End ]===============================
cli ; disable interrupts.
hlt ; halt the cpu.
; =================[ Misc Data ]=========================
CursorPosition dd 0x00000000
Background db 0x0706
Msg_Welcome db ">>Welcome To Easy Operating System", 0
msga db  "AAA"; 0

delay:
   jmp .1
.1:
   jmp .2
.2:
   ret

ClearScreen:
mov ecx, 80 * 25
xor edx, edx
mov ax, 0x0018
mov es, ax
.1:
mov byte [es:edx], ' '
inc edx
push ax
mov al, [Background]
mov byte [es:edx], al
pop ax
inc edx
loop .1
mov word [CursorPosition], 0
mov ax, 0x0010
mov es, ax
retn

PutString:
mov edx, [CursorPosition]
mov ax, 0x0018
mov es, ax
.1:
lodsb
or al, al
jz short .2
mov byte [es:edx], al
inc edx
push ax
mov al, [Background]
mov byte [es:edx], al
pop ax
inc edx
jmp .1
.2:
mov [CursorPosition], dx
mov ax, 0x0010
mov es, ax
retn


retn

;Interrupt ServiceRoutines
int0t db "Division durch 0 !!!",0

Errorhandler:
mov esi, int0t
call PutString
;jmp $
ret


int0x00:
call Errorhandler
retn
int0x01:
call Errorhandler
retn
int0x02:
call Errorhandler
retn
int0x03:
call Errorhandler
retn
int0x04:
call Errorhandler
retn
int0x05:
call Errorhandler
retn
int0x06:
call Errorhandler
retn
int0x07:
call Errorhandler
retn
int0x08:
call Errorhandler
retn
int0x09:
call Errorhandler
retn
int0x0a:
call Errorhandler
retn
int0x0b:
call Errorhandler
retn
int0x0c:
call Errorhandler
retn
int0x0d:
call Errorhandler
retn
int0x0e:
call Errorhandler
retn
int0x0f:
call Errorhandler
retn
int0x10:
call Errorhandler
retn
int0x11:
call Errorhandler
retn
int0x12:
call Errorhandler
retn
int0x13:
call Errorhandler
retn
int0x14:
call Errorhandler
retn
int0x15:
call Errorhandler
retn
int0x16:
call Errorhandler
retn
int0x17:
call Errorhandler
retn
int0x18:
call Errorhandler
retn
int0x19:
call Errorhandler
retn
int0x1a:
call Errorhandler
retn
int0x1b:
call Errorhandler
retn
int0x1c:
call Errorhandler
retn
int0x1d:
call Errorhandler
retn
int0x1e:
call Errorhandler
retn
int0x1f:
call Errorhandler
retn
int0x20:
call Errorhandler
retn
idt_pointer:
   dw idt_end - idt - 1
   dd idt


idt:
;int 0x00
dw int0x00
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x01
dw int0x01
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x02
dw int0x02
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x03
dw int0x03
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x04
dw int0x04
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x05
dw int0x05
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x06
dw int0x06
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x07
dw int0x07
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x08
dw int0x08
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x09
dw int0x09
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0a
dw int0x0a
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0b
dw int0x0b
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0c
dw int0x0c
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0d
dw int0x0d
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0e
dw int0x0e
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x0f
dw int0x0f
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x10
dw int0x10
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x11
dw int0x11
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x12
dw int0x13
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x14
dw int0x0f
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x15
dw int0x15
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x16
dw int0x16
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x17
dw int0x17
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x18
dw int0x18
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x19
dw int0x19
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1a
dw int0x1a
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1b
dw int0x1b
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1c
dw int0x1c
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1d
dw int0x1d
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1e
dw int0x1e
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x1f
dw int0x1f
dw 0x10
dw 0x8E00
dw 0x0000

;int 0x20
dw int0x20
dw 0x10
dw 0x8E00
dw 0x0000
idt_end:



Wo könnte der Fehler noch sein ?

FreakyPenguin

  • Administrator
  • Beiträge: 301
    • Profil anzeigen
    • toni.famkaufmann.info
Gespeichert
« Antwort #3 am: 19. May 2005, 20:05 »
kann mir denn niemand helfen  :cry:  :?:

FreakyPenguin

  • Administrator
  • Beiträge: 301
    • Profil anzeigen
    • toni.famkaufmann.info
Gespeichert
« Antwort #4 am: 27. May 2005, 12:07 »
kann mir denn niemand helfen ??  ich hab immer noch keine Ahnung wo der fehler is !

DarkThing

  • Beiträge: 652
    • Profil anzeigen
Gespeichert
« Antwort #5 am: 27. May 2005, 12:16 »
Du könntest noch prüfen, ob alle Segmente usw. stimmen. Aber sonst sehe ich echt keinen Fehler.

Roshl

  • Beiträge: 1 128
    • Profil anzeigen
    • http://www.lowlevel.net.tc
Gespeichert
« Antwort #6 am: 27. May 2005, 12:28 »
Mal ein Hinweis^^ so extrem lange Codelistings sind ziemlich abschreckend für viele. Sie kommen rein sehen sowas Elend Langes und haben einfach keine Lust das zu lesen. Deswegen: Codelisting so kurz wie möglich halten und versuchen das zu isolieren was vermutlich den Fehler enthält. Dürfte einer der Hauptgründe sein warum keiner Antwortet. Aber abgesehen davon sehe ich auch keinen Fehler (lange Codelisting sind eben hier im Forum auch unbersichtlich)
[schild=1]Wieder ein wertvoller(?) Beitrag von Roshl[/schild]

 

Einloggen