On Fri, Dec 29, 2017 at 12:40:21AM -0500, Jd Lyons wrote:
8010041 : (compile) my-space [ 0x103 ] 8010042 : (compile) + [ 0x1e ] 8010044 : (compile) [ 0xa08 ] <<<<<<< is this config-l@?
Not likely, no. It's some word defined in this fcode script.
8010045 : (compile) b(lit) [ 0x10 ] 801004a : (compile) and [ 0x23 ] 801004b : (compile) b(lit) [ 0x10 ] 8010050 : (compile) = [ 0x3c ]
The above looks to me like he's testing for the presence of 0x10 in a register (0x10 and 0x10 =). If he's looking at a series of BARs, that's the prefetchable bit he's looking for.
That's not a bad guess I bet :-)
Do you think it’s having trouble reading the PCI Configuration registers, it was able to change the subsystem-id from 0x50 to 0x10, so I was hoping it had calculated the base address of the PCI card correctly.
It could be anything really. You'll have to figure out where it THROWs from. Can you have it trace a bit? Just dumping the return stack inside THROW itself would be enough.
b(>resolve) ( 0x0b2 ) (unnamed-fcode) [0xddf]<————This calls the offset? 0xddf
This calls the fcode token number ddf, which is defined somewhere earlier in the fcode, with new-token probably.
new-token ( 0x0b5 ) 0xddf b(:) ( 0x0b7 ) b(lit) ( 0x010 ) 0x10 (unnamed-fcode) [0xdde] <——This calls the offset? 0xdde
This one :-) So that was Forth code:
: xddf 10 xdde ;
where xdde is another eralier word.
new-token ( 0x0b5 ) 0xdde b(:) ( 0x0b7 ) my-space ( 0x103 ) + ( 0x01e ) dup ( 0x047 ) (unnamed-fcode) [0xa08]<—— this calls 0xa08
... namely:
: xdde my-space + dup xa08 ;
new-token ( 0x0b5 ) 0xa08 b(:) ( 0x0b7 ) b(") ( 0x012 ) ( len=9 ) " config-l@" $call-parent ( 0x209 ) b(;) ( 0x0c2 )
: xa08 " config-l@" $call-parent ;
So in total:
: xa08 ( addr -- data ) " config-l@" $call-parent ; : xdde ( addr -- data ) my-space + dup xa08 ; : xddf ( -- data ) 10 xdde ;
so xddf reads from PCI BAR 0 of the PCI device the current node is for.
I’m sure I’m being too linear in my thinking, as you’ve already pointed out, my-space and config-l@ were called before my exception.
I just can’t figure out what is throwing the exception?
Yeah that kind of thing can be tricky. Add more tracing :-)
Segher