Autor Thema: [Erledigt - Leichtsinnsfehler] IDT - Bei Exception Reset [BOCHS]  (Gelesen 3361 mal)

iUse

  • Beiträge: 11
    • Profil anzeigen
Gespeichert
Hey,

wenn ich eine Exception hervorrufe (z.B. eine Divison durch Null) gibt
es in Bochs einen Reset. Ich kann den Fehler einfach nicht finden.  :roll:

Beim Compilen gibt es folgende Warnings:

Welcome to the iUse BuildCreatr v0.1 RC1


        » Initializing the enviroment
        » Compiling the ASM-Code
        » Compiling the C-Code
In file included from main.c:5:
inc/gdt.c: In function 'gdt_install':
inc/gdt.c:59: warning: assignment makes integer from pointer without a cast
In file included from main.c:6:
inc/idt.c: In function 'idt_install':
inc/idt.c:55: warning: assignment makes integer from pointer without a cast
        » Linking the  Files into one
        » Creating ISO with GRUB and mkisofs

Size of boot image is 4 sectors -> No emulation
Total translation table size: 2048
Total rockridge attributes bytes: 922
Total directory bytes: 4704
Path table size(bytes): 34
Max brk space used 4000
128 extents written (0 Mb)


FINISH!

Der Compiler ist ein GCC-elf-Crosscompiler V.4.4.0 unter Windows
Unter Linux tritt aber der selbe Fehler auf.

Hier das LOG-File von Bochs
[...]

00056321310e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x00)
00056321310e[CPU0 ] interrupt(): gate descriptor is not valid sys seg (vector=0x08)
00056321310i[CPU0 ] CPU is in protected mode (active)
00056321310i[CPU0 ] CS.d_b = 32 bit
00056321310i[CPU0 ] SS.d_b = 32 bit
00056321310i[CPU0 ] EFER   = 0x00000000
00056321310i[CPU0 ] | RAX=0000000000000000  RBX=00000000000329c0
00056321310i[CPU0 ] | RCX=00000000001fffc0  RDX=0000000000000000
00056321310i[CPU0 ] | RSP=00000000001fffd0  RBP=00000000001fffe8
00056321310i[CPU0 ] | RSI=0000000000026ac0  RDI=0000000000101560
00056321310i[CPU0 ] |  R8=0000000000000000   R9=0000000000000000
00056321310i[CPU0 ] | R10=0000000000000000  R11=0000000000000000
00056321310i[CPU0 ] | R12=0000000000000000  R13=0000000000000000
00056321310i[CPU0 ] | R14=0000000000000000  R15=0000000000000000
00056321310i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf sf ZF af PF cf
00056321310i[CPU0 ] | SEG selector     base    limit G D
00056321310i[CPU0 ] | SEG sltr(index|ti|rpl)     base    limit G D
00056321310i[CPU0 ] |  CS:0008( 0001| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  DS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  SS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  ES:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  FS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  GS:0010( 0002| 0|  0) 00000000 ffffffff 1 1
00056321310i[CPU0 ] |  MSR_FS_BASE:0000000000000000
00056321310i[CPU0 ] |  MSR_GS_BASE:0000000000000000
00056321310i[CPU0 ] | RIP=00000000001009e8 (00000000001009e8)
00056321310i[CPU0 ] | CR0=0x60000011 CR2=0x0000000000000000
00056321310i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00056321310i[CPU0 ] 0x00000000001009e8>> idiv eax, dword ptr ss:[ebp+0xfffffff4] : F77DF4
00056321310e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00056321310i[SYS  ] bx_pc_system_c::Reset(HARDWARE) called
00056321310i[CPU0 ] cpu hardware reset

[...]

Das OS wird von GRUB schon in den Protected Mode geladen.

Hier der Link zum SVN (hier koennt ihr den Code finden,waere xtrem viel Copy&Paste :wink:):
klick

Ich kann den Fehler einfach nicht finden >.<
Wie soll ich jetzt vorgehen ?

Nach dem Laden von GDT und IDT gibt es keinen Reset.
Erst wenn eine Exception auftritt (in dem Fall Devision durch NULL).

Irgendwelche vorschlaege ?

Danke im Vorraus

iUse

« Letzte Änderung: 19. August 2009, 12:36 von iUse »

kevin

  • Administrator
  • Beiträge: 2 767
    • Profil anzeigen
Gespeichert
« Antwort #1 am: 19. August 2009, 12:24 »
Blöde Frage: Wird isrs_install() auch irgendwo aufgerufen?
Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end.

iUse

  • Beiträge: 11
    • Profil anzeigen
Gespeichert
« Antwort #2 am: 19. August 2009, 12:28 »
Nein, habs total vergessen ^^
Danke ... ich werde es jetzt testen :P

Edit: Es geht :P

« Letzte Änderung: 19. August 2009, 12:31 von iUse »

iUse

  • Beiträge: 11
    • Profil anzeigen
Gespeichert
« Antwort #3 am: 19. August 2009, 12:31 »
Aber wie krieg ich jetzt die unschoenen Warnings weg ?

kevin

  • Administrator
  • Beiträge: 2 767
    • Profil anzeigen
Gespeichert
« Antwort #4 am: 19. August 2009, 12:33 »
base als void* deklarieren oder die Adresse nach int casten.

Aber das hat jetzt nichts mit OS-Dev zu tun, sondern damit, dass man seine Sprache beherrschen sollte.
Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end.

iUse

  • Beiträge: 11
    • Profil anzeigen
Gespeichert
« Antwort #5 am: 19. August 2009, 12:35 »
Super!
Danke ;)

 

Einloggen