Port-ofppc archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ofwboot, why does it work?



On Thu, Sep 18, 2014 at 7:40 PM, Frank Wille <frank%phoenix.owl.de@localhost> 
wrote:
> Artyom Tarasenko wrote:

> I don't understand. Why should "copy-out" be used on 'buf'? AFAICS ofdev.c
> passes 'buf' to OF_read() to read a block from disk.

In my case it was crashing even before starting to read, on getting
the properties.
The 'buf' is used in in devopen for getting the properties and in OFW

ok dev /client-services
ok see getprop
: getprop
   find-node-property if
      >r r@ get r> decode copy-out
   else
      options? if
         get-env-var if
            2drop h# ffffffff
         else
            3 pick >r copy-out 1+ r> min
         then
      else
         2drop 2drop h# ffffffff
      then
   then
   (pop-package)
;

so, although just a few bytes is needed, the 'copy-out' word used by
'getprop' cleans the whole 'buf' before writing into it.

>> see copy-out
>
> "no such symbol in tables"
>
> This word doesn't exist in SmartFirmware.

Whops. I wasn't aware that Pegasos II is using SmartFirmware. Were
there also an alternative from FirmWorks, or is SmartFirmware the only
firmware for Pegasos II.

At least this explains why you was not affected by the problem.
Now it's only unclear why B50 was not affected as well.
Do you by any chance have more OF machines?

>> Well it could be that my firmware is eating the stack. At first I put
>> some printfs, and the more printfs I put, the earlier ofwboot died.
>
> That's not because it is eating the stack, but because the .text section
> gets larger and 'stack' is moving to a higher address, so other parts of
> the main program are destroyed when accessing 'buf'.

Right. This makes sense. Thanks for the explanation.

-- 
Regards,
Artyom Tarasenko

SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu


Home | Main Index | Thread Index | Old Index