2 #include "libopenbios/bindings.h"
10 extern unsigned char *dict
;
17 uint32_t eax
, ecx
, edx
, ebx
, esp
, ebp
, esi
, edi
;
25 static const char * const exception_names
[]= {
31 "bound range exceeded",
35 "FPU segment overrun",
37 "segment not present",
39 "general protection fault",
42 "floating point exception",
44 "machine check exception",
47 void do_nothing(void);
50 printk("Doing nothing\n");
53 void x86_exception(struct eregs
*info
);
54 void x86_exception(struct eregs
*info
)
56 if(info
->vector
<= 18) {
57 printk("\nUnexpected Exception: %s",
58 exception_names
[info
->vector
]);
60 printk("\nUnexpected Exception: %d", info
->vector
);
64 " @ %02x:%08lx - Halting\n"
65 "Code: %d eflags: %08lx\n"
66 "eax: %08lx ebx: %08lx ecx: %08lx edx: %08lx\n"
67 "edi: %08lx esi: %08lx ebp: %08lx esp: %08lx\n",
68 info
->cs
, (unsigned long)info
->eip
,
69 info
->error_code
, (unsigned long)info
->eflags
,
70 (unsigned long)info
->eax
, (unsigned long)info
->ebx
,
71 (unsigned long)info
->ecx
, (unsigned long)info
->edx
,
72 (unsigned long)info
->edi
, (unsigned long)info
->esi
,
73 (unsigned long)info
->ebp
, (unsigned long)info
->esp
);
75 printk("\ndict=0x%x here=0x%x(dict+0x%x) pc=0x%x(dict+0x%x)\n",
76 (ucell
)dict
, (ucell
)dict
+ dicthead
, dicthead
, PC
, PC
- (ucell
) dict
);
77 printk("dstackcnt=%d rstackcnt=%d\n",
78 dstackcnt
, rstackcnt
);
83 PC
=findword("outer-interpreter");
85 info
->eip
=(uint32_t)&do_nothing
;