Page 1 of 1

exception(): 3rd (12) exception with no resolution on bochs

Posted: Tue Nov 12, 2013 7:01 am
by brighteningeyes
hi guys,
after 2 hours working with bochs, finally i can load my OS now!
but:
after loading the Bochs, i get this exception:
exception(): 3rd (12) exception with no resolution, shutdown

i read the log and fined this line
please help me!

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Tue Nov 12, 2013 10:42 pm
by thepowersgang
Around that line in the bochs log, there will be a register dump at the time of the exception that caused that triple fault. There should also be the reason why handling the original fault failed. Use the bochs debugger to single step your code and inspect the relevant structures if the cause of the fault is not able to be diagnosed from just the log.

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Tue Nov 12, 2013 11:22 pm
by brighteningeyes
when bochs want's to boot, it give's this error in 16 bit
this is the output:

Code: Select all

i Booting from 07c0:0000
e write_virtual_word_32(): segment limit violation
e write_virtual_word_32(): segment limit violation
e write_virtual_word_32(): segment limit violation
i CPU is in real mode (active)
i CS.mode = 16 bit
i SS.mode = 16 bit
i EFER   = 0x00000000
i | EAX=0000e0fc  EBX=00000003  ECX=00000000  EDX=000000e0
i | ESP=00000001  EBP=00000000  ESI=00005fec  EDI=00000001
i | IOPL=0 id vip vif ac vm RF nt of df IF tf sf zf AF pf CF
i | SEG sltr(index|ti|rpl)     base    limit G D
i |  CS:0820( 0004| 0|  0) 00008200 0000ffff 0 0
i |  DS:0000( 0005| 0|  0) 00000000 0000ffff 0 0
i |  SS:0000( 0005| 0|  0) 00000000 0000ffff 0 0
i |  ES:0000( 0005| 0|  0) 00000000 0000ffff 0 0
i |  FS:0000( 0005| 0|  0) 00000000 0000ffff 0 0
i |  GS:0000( 0005| 0|  0) 00000000 0000ffff 0 0
i | EIP=0000750e (0000750e)
i | CR0=0x60000010 CR2=0x00000000
i | CR3=0x00000000 CR4=0x00000000
i 0x000000000000750e>> push ax : 50
e exception(): 3rd (12) exception with no resolution, shutdown status is 00h, resetting
i bx_pc_system_c::Reset(HARDWARE) called
i cpu hardware reset
i allocate APIC id=0 (MMIO enabled) to 0x0000fee00000
i CPUID[0x00000000]: 00000005 756e6547 6c65746e 49656e69
i CPUID[0x00000001]: 00000633 00010800 00002028 1fcbfbff
i CPUID[0x00000002]: 00410601 00000000 00000000 00000000
i CPUID[0x00000003]: 00000000 00000000 00000000 00000000
i CPUID[0x00000004]: 00000000 00000000 00000000 00000000
i CPUID[0x00000005]: 00000040 00000040 00000003 00000020
i CPUID[0x80000000]: 80000008 00000000 00000000 00000000
i CPUID[0x80000001]: 00000000 00000000 00000101 2a100000
i CPUID[0x80000002]: 20202020 20202020 20202020 6e492020
i CPUID[0x80000003]: 286c6574 50202952 69746e65 52286d75
i CPUID[0x80000004]: 20342029 20555043 20202020 00202020
i CPUID[0x80000005]: 01ff01ff 01ff01ff 40020140 40020140
i CPUID[0x80000006]: 00000000 42004200 02008140 00000000
i CPUID[0x80000007]: 00000000 00000000 00000000 00000000
i CPUID[0x80000008]: 00003028 00000000 00000000 00000000
i reset of 'pci' plugin device by virtual method
i reset of 'pci2isa' plugin device by virtual method
i reset of 'cmos' plugin device by virtual method
i reset of 'dma' plugin device by virtual method
i reset of 'pic' plugin device by virtual method
i reset of 'pit' plugin device by virtual method
i reset of 'floppy' plugin device by virtual method
i reset of 'vga' plugin device by virtual method
i reset of 'acpi' plugin device by virtual method
i reset of 'ioapic' plugin device by virtual method
i reset of 'keyboard' plugin device by virtual method
i reset of 'harddrv' plugin device by virtual method
i reset of 'pci_ide' plugin device by virtual method
i reset of 'unmapped' plugin device by virtual method
i reset of 'biosdev' plugin device by virtual method
i reset of 'speaker' plugin device by virtual method
i reset of 'extfpuirq' plugin device by virtual method
i reset of 'parallel' plugin device by virtual method
i reset of 'serial' plugin device by virtual method
i reset of 'gameport' plugin device by virtual method
i reset of 'usb_uhci' plugin device by virtual method
it retry's and retry's and retry's until i close it
it log's these lines (now output is 4 MB)
when bochs is running, it says "booting" and clear's the screen and again says "booting" with a bad wink that pain's my eyes

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Tue Nov 12, 2013 11:32 pm
by thepowersgang
1. Disable 'reset on fault' in the bochs config file.
2. Use the bochs debuger to single-step through your code and locate the faulting instruction
3. Fix that faulting instruction.

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Wed Nov 13, 2013 12:06 am
by brighteningeyes
what should i write to bochs configuration file in order to disable reset on fault?
and how can i debug my kernel with bochs?

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Wed Nov 13, 2013 2:25 am
by thepowersgang
This should be included in the manual for bochs.

1. iirc, it's "cpu: reset_on_triple=no", but I think that chages every other bochs release
2. For windows, use the 'bochsdbg.exe' binary instead, this has the bochs debugger compiled in. For linux, either locate a package with it included, or re-compile with '--enable-debugger'.

May I also suggest you get intimately familiar with the bochs manuals, as they have some nice little gems for working with it.

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Wed Nov 13, 2013 2:41 am
by Combuster
ESP=00000001
(...)
i 0x000000000000750e>> push ax : 50
There's quite a bit broken in this situation considering you manage to triple fault in real mode - you should read the documentation for PUSH regarding it's behaviour in corner case situations like this.

At the very least, your stack is screwed, and my guess is that it happened to be that way for a while considering CS:IP is also reading as an unlikely value.
and how can i debug my kernel with bochs?
At least try, will you

Re: exception(): 3rd (12) exception with no resolution on bo

Posted: Wed Nov 13, 2013 12:04 pm
by brighteningeyes
i'm using cygwin's grub
before i copy all the grub files from cygwin to my OS's boot/grub/i386-pc and update my makefile, it worked
but, i want to use cygwin's grub
and, why it doesn't boot on pMode?
what should i do?
here is my OS's project on github:
https://github.com/brightening-eyes/AmirOS
what is the problem?