triple fault when writing to the screen

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

triple fault when writing to the screen

Post by xDDunce »

ok, so i switched to cygwin the other day and now when i want to write something to memory(e.g. to the screen), i get a triple fault.

closer inspection of the bochs log shows it is getting a exception (13) which is causing the triple fault.

i was using djgpp before now and it was working fine. but now that i've changed to cygwin it keeps getting this error.

thanks in advance.

James.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: triple fault when writing to the screen

Post by AJ »

Hi,

You are getting a General Projection Fault. Could you post your register dump?

I think the most likely cause without any other information is that in using a different binary format or compiler, something has possibly shown up an uninitialised variable.

Cheers,
Adam
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: triple fault when writing to the screen

Post by xDDunce »

Code: Select all

00020911649i[VBIOS] 
VGABios $Id: vgabios.c,v 1.67 2008/01/27 09:44:12 vruppert Exp $

00020911720i[CLVGA] VBE known Display Interface b0c0
00020911752i[CLVGA] VBE known Display Interface b0c4
00020914677i[VBIOS] VBE Bios $Id: vbe.c,v 1.60 2008/03/02 07:47:21 vruppert Exp $
00021237678i[BIOS ] Starting rombios32
00021238505i[BIOS ] ram_size=0x02000000
00021259061i[BIOS ] Found 1 cpu(s)
00021275362i[BIOS ] bios_table_addr: 0x000fb778 end=0x000fcc00
00021275429i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)
00021734236i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)
00022194817i[BIOS ] PIIX3 init: elcr=00 0a
00022215072i[BIOS ] PCI: bus=0 devfn=0x00: vendor_id=0x8086 device_id=0x1237
00022218309i[BIOS ] PCI: bus=0 devfn=0x08: vendor_id=0x8086 device_id=0x7000
00022221042i[BIOS ] PCI: bus=0 devfn=0x09: vendor_id=0x8086 device_id=0x7010
00022222386i[BIOS ] region 4: 0x0000c000
00022224962i[BIOS ] PCI: bus=0 devfn=0x0b: vendor_id=0x8086 device_id=0x7113
00022248929i[BIOS ] MP table addr=0x000fb850 MPC table addr=0x000fb780 size=0xd0
00022251132i[BIOS ] SMBIOS table addr=0x000fb860
00022254176i[BIOS ] ACPI tables: RSDP addr=0x000fb970 ACPI DATA addr=0x01ff0000 size=0x9d8
00022273709i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)
00022274721i[BIOS ] bios_table_cur_addr: 0x000fb994
00026222876i[BIOS ] IDE time out
00032321675i[BIOS ] Booting from 0000:7c00
00032425655i[BIOS ] int13_harddisk: function 41, unmapped device for ELDL=80
00032430430i[BIOS ] int13_harddisk: function 08, unmapped device for ELDL=80
00032435089i[BIOS ] *** int 15h function AX=00c0, BX=0000 not yet supported!
00052346121i[CPU0 ] LOCK prefix unallowed (op1=0x3f, attr=0x0, mod=0x0, nnn=0)
00052346121i[CPU0 ] CPU is in protected mode (active)
00052346121i[CPU0 ] CS.d_b = 32 bit
00052346121i[CPU0 ] SS.d_b = 32 bit
00052346121i[CPU0 ] EFER   = 0x00000000
00052346121i[CPU0 ] | RAX=00000000ffffffff  RBX=000000000002d2a0
00052346121i[CPU0 ] | RCX=0000000000000001  RDX=0000000000000000
00052346121i[CPU0 ] | RSP=0000000000102fec  RBP=0000000000067ed0
00052346121i[CPU0 ] | RSI=000000000002d724  RDI=000000000002d725
00052346121i[CPU0 ] |  R8=0000000000000000   R9=0000000000000000
00052346121i[CPU0 ] | R10=0000000000000000  R11=0000000000000000
00052346121i[CPU0 ] | R12=0000000000000000  R13=0000000000000000
00052346121i[CPU0 ] | R14=0000000000000000  R15=0000000000000000
00052346121i[CPU0 ] | IOPL=0 id vip vif ac vm RF nt of df if tf SF zf af PF cf
00052346121i[CPU0 ] | SEG selector     base    limit G D
00052346121i[CPU0 ] | SEG sltr(index|ti|rpl)     base    limit G D
00052346121i[CPU0 ] |  CS:0008( 0001| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  DS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  SS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  ES:0010( 0002| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  FS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  GS:0010( 0002| 0|  0) 00000000 000fffff 1 1
00052346121i[CPU0 ] |  MSR_FS_BASE:0000000000000000
00052346121i[CPU0 ] |  MSR_GS_BASE:0000000000000000
00052346121i[CPU0 ] | RIP=000000000010008a (000000000010008a)
00052346121i[CPU0 ] | CR0=0x60000011 CR1=0x0 CR2=0x0000000000000000
00052346121i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
00052346121i[CPU0 ] >> lock aas  : F03F
00052346121e[CPU0 ] exception(): 3rd (13) exception with no resolution, shutdown status is 00h, resetting
00052346121i[SYS  ] bx_pc_system_c::Reset(SOFTWARE) called
00052346121i[CPU0 ] cpu software reset
i think this could be because the gcc in cygwin is a lower version than the djgpp i was using previously.

thanks for the quick reply though!

James.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: triple fault when writing to the screen

Post by AJ »

You're right - I think the version of GCC with Cygwin is 3.4.x? Try the GCC Cross-Compiler wiki tutorial to get the latest GCC version.

I can't see any problems with the register dump itself, but the error message above this would indicate that EIP has somehow been misaligned and is trying to apply the LOCK prefix to an opcode that can't be locked.

People often find this with stack misalignments from ISR returns. First thing to try though, is update to the latest GCC as above.

Cheers,
Adam
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: triple fault when writing to the screen

Post by xDDunce »

ok, thanks AJ i'll try that now. i have tryed it before but i just got a bit confused.......

James.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: triple fault when writing to the screen

Post by xDDunce »

ok so i just tryed like, a billion times and i keep gettin errors in the process. the first error make runs into is making dummy.o which appears to be the first object to be created which isn't a good sign...

i'm currently regretting ever moving away from DJGPP. but i guess once i get this done, it will make life easier later on.

so any suggestions? i can edit with version numbers of make, gcc etc. if you think that may be the problem.

James.
Post Reply