Hi
I have a little problem. After I enable hardware interrupts on Bochs, I get once exception no. 13. On Qemu and VirtualBox is OK. My code: http://los.svn.sourceforge.net/viewvc/los/trunk/
sti and exception
-
- Posts: 12
- Joined: Fri Mar 06, 2009 12:18 pm
- Location: Poland
- Contact:
Re: sti and exception
Mask all unused interrupts and set dummy handlers for them.
If you have seen bad English in my words, tell me what's wrong, please.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: sti and exception
How on earth do you get an exception?
Code: Select all
console.cpp:21:18: error: cstdio: No such file or directory
console.cpp: In function 'void Console::kprintf(const char*, ...)':
console.cpp:134: error: 'va_list' was not declared in this scope
console.cpp:134: error: expected ';' before 'args'
console.cpp:137: error: 'args' was not declared in this scope
console.cpp:137: error: 'va_start' was not declared in this scope
console.cpp:138: error: 'vsnprintf' was not declared in this scope
console.cpp:139: error: 'va_end' was not declared in this scope
-
- Posts: 12
- Joined: Fri Mar 06, 2009 12:18 pm
- Location: Poland
- Contact:
Re: sti and exception
You mean the IMR? But it is register of PIC, and I use APIC.
@Combuster: Now is OK.
@Combuster: Now is OK.
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: sti and exception
Next tip: read error messages
Code: Select all
00123347958e[CPU0 ] read_virtual_dqword_aligned_64(): #GP misaligned access
00123347958e[CPU0 ] interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0
(...)
00123347958i[CPU0 ] 0x0000008000001187>> movdqa xmm0, dqword ptr ds:[rdx] : 660F6F02
-
- Posts: 12
- Joined: Fri Mar 06, 2009 12:18 pm
- Location: Poland
- Contact:
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: sti and exception
Of course not. Bochs said there were at least two problems. (Actually, there's a third: your build system drags in glibc by default)
-
- Posts: 12
- Joined: Fri Mar 06, 2009 12:18 pm
- Location: Poland
- Contact:
Re: sti and exception
From Bochs source:
. Example IDT descriptor:
7B 1E 08 00 00 8E 00 00 80 00 00 00 00 00 00 00
desctmp2 = 0x8000000000000000
0x8000000000000000 & 0x00001F0000000000 = 0
So I don't understand where is the bug.
As regards the third: Where?
Code: Select all
if (desctmp2 & BX_CONST64(0x00001F0000000000)) {
BX_ERROR(("interrupt(long mode): IDT entry extended attributes DWORD4 TYPE != 0"));
exception(BX_GP_EXCEPTION, vector*8 + 2);
}
7B 1E 08 00 00 8E 00 00 80 00 00 00 00 00 00 00
desctmp2 = 0x8000000000000000
0x8000000000000000 & 0x00001F0000000000 = 0
So I don't understand where is the bug.
As regards the third: Where?