> On Dec 29, 2017, at 12:14 AM, Tarl Neustaedter <tarl-b2(a)tarl.net> wrote:
>
> On 2017-Dec-29 00:00 , Jd Lyons wrote:
>>
>> Segher, do you think I maybe tripping over the “ config-l@“?
>>
>> Seems to be a few words called next, after the b(>resolve) I’m catching the exception on.
>>
>> config-l@
>> config-l!
>> config-w@
>> config-w!
>
> Those are words to read and write config space on pci cards. I'm pretty sure the words work (otherwise the vendor-id and product-id values wouldn't have been able to be fetched), the question is whether they are being called with unexpected values. The config-l@ must be called with a mod 4 values, the config-w@ must be called with a mod 2 value.
>
> The usual mode of accessing config space is adding your desired offset to my-space, and then call config-l@. That looks to be what you are in the middle of:
>
> 8010039 : (compile) [ 0x9bd ]
> 801003a : (compile) b(lit) [ 0x10 ]
> 801003f : (compile) and [ 0x23 ]
> 8010041 : (compile) my-space [ 0x103 ]
> 8010042 : (compile) + [ 0x1e ]
> 8010044 : (compile) [ 0xa08 ] <<<<<<< is this config-l@?
> 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.
>
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.
I’m really at a loss, never had to dive this deep into forth when hacking these Rom’s for card flashing. It seemed to me that:
b(>resolve) ( 0x0b2 )
(unnamed-fcode) [0xddf]<————This calls the offset? 0xddf
new-token ( 0x0b5 ) 0xddf
b(:) ( 0x0b7 )
b(lit) ( 0x010 ) 0x10
(unnamed-fcode) [0xdde] <——This calls the offset? 0xdde
new-token ( 0x0b5 ) 0xdde
b(:) ( 0x0b7 )
my-space ( 0x103 )
+ ( 0x01e )
dup ( 0x047 )
(unnamed-fcode) [0xa08]<—— this calls 0xa08
new-token ( 0x0b5 ) 0xa08
b(:) ( 0x0b7 )
b(") ( 0x012 ) ( len=9 )
" config-l@"
$call-parent ( 0x209 )
b(;) ( 0x0c2 )
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?