<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 29, 2018, at 3:57 PM, Segher Boessenkool <<a href="mailto:segher@kernel.crashing.org" class="">segher@kernel.crashing.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Thu, Mar 29, 2018 at 06:44:15AM -0400, Jd Lyons wrote:<br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">On Mar 19, 2018, at 8:58 PM, Segher Boessenkool <<a href="mailto:segher@kernel.crashing.org" class="">segher@kernel.crashing.org</a>> wrote:<br class="">On Mon, Mar 19, 2018 at 08:11:25PM -0400, James Lyons wrote:<br class=""><blockquote type="cite" class="">I tried:<br class=""><br class="">dev agp/@10<br class="">: open true ;<br class="">open-dev " agp/@10"<br class=""><br class="">ALLOC-MEM request too big!<br class=""><br class="">Did I do it correct?<br class=""></blockquote><br class="">You destroyed (well, made inaccessible) any "open" method there was.<br class="">That is certainly not going to help.<br class=""></blockquote><br class="">Segher, how would I properly call open?<br class=""></blockquote><br class="">You shouldn't do that   : open ...<br class="">If the node did not have an "open" method already, something else is<br class="">wrong (which you cannot fix _this_ way).<br class=""><br class=""><blockquote type="cite" class="">Also, does anyone know if Apple’s OF supports fcode-verbose?<br class=""></blockquote><br class="">It does afair.<br class=""><br class=""><blockquote type="cite" class="">What I am trying to do, load the Fcode Rom from a file may not be supported in Apple’s Open Firmware. Arti Irta never mentioned it could be done, so it’s maybe there was a reason for that.<br class=""></blockquote><br class="">It can be done.<br class=""><br class=""><br class="">Segher<br class=""><br class=""></div></div></blockquote><div><br class=""></div><div>Joe Van  Tunen gave me a look at how Apple’s OF implements the load command:</div><div><br class=""></div><div><b class="">The only information I could give is what you can get by disassembling the compiled fcode. The best result would probably come from a PowerMac G5 Quad Core (one of the last Macs to use Open Firmware and therefore has the latest Apple implementation of Open Firmware). Part of the disassembly looks like this:<br class=""><br class="">FF8905B5: b(:) \ [0x0b7] 0x1cf0 boot|load<br class="">FF8905C8: 967E FFFC                       stwu     r19,-4(r30)      <br class="">FF8905CC: 7E68 02A6                       mflr     r19              <br class="">FF8905D0: 4BFF F789     FF88FD58          bl       _reboot-command  <br class="">FF8905D4: 4BFB A4E5     FF84AAB8          bl       pack             <br class="">FF8905D8: 4BFB 8701     FF848CD8          bl       drop             <br class="">FF8905DC: 4BFD 29E5     FF862FC0          bl       security-mode?   <br class="">FF8905E0: 4BFB 6A49     FF847028          bl       (b?branch)       <br class="">FF8905E4: 4800 0020     FF890604          b        $+32             <br class="">FF8905E8: 4BFC 6251     FF856838          bl       carret           <br class="">FF8905EC: 4BFC C195     FF85C780          bl       word             <br class="">FF8905F0: 4BFB 86E9     FF848CD8          bl       drop             <br class="">FF8905F4: 4BFB 8B6D     FF849160          bl       0                <br class="">FF8905F8: 4BFB 8B69     FF849160          bl       0                <br class="">FF8905FC: 4BFF F68D     FF88FC88          bl       (load)           <br class="">FF890600: 4800 0014     FF890614          b        $+20             <br class="">FF890604: 4BFC 6235     FF856838          bl       carret           <br class="">FF890608: 4BFC C179     FF85C780          bl       word             <br class="">FF89060C: 4BFB 9BBD     FF84A1C8          bl       count            <br class="">FF890610: 4BFF F679     FF88FC88          bl       (load)           <br class="">FF890614: 4BFB 8B6D     FF849180          bl       1                <br class="">FF890618: 4BFC A659     FF85AC70          bl       oft              <br class="">FF89061C: 4BFC 5FC5     FF8565E0          bl       not              <br class="">FF890620: 4BFB 6A09     FF847028          bl       (b?branch)       <br class="">FF890624: 4800 0020     FF890644          b        $+32             <br class="">FF890628: 4BFB 6969     FF846F90          bl       b<">             <br class="">FF89062C: 0A ...                          dc.b     " load-size=" <br class="">FF890638: 4BFC 2381     FF8529B8          bl       type             <br class="">FF89063C: 4BFF EAB5     FF88F0F0          bl       load-size        <br class="">FF890640: 4BFC 6C91     FF8572D0          bl       u.               <br class="">FF890644: 4BFB 8B3D     FF849180          bl       1                <br class="">FF890648: 4BFC A629     FF85AC70          bl       oft              <br class="">FF89064C: 4BFC 5F95     FF8565E0          bl       not              <br class="">FF890650: 4BFB 69D9     FF847028          bl       (b?branch)       <br class="">FF890654: 4800 002C     FF890680          b        $+44             <br class="">FF890658: 4BFB 6939     FF846F90          bl       b<">             <br class="">FF89065C: 08 ...                          dc.b     " adler32=" <br class="">FF890668: 4BFC 2351     FF8529B8          bl       type             <br class="">FF89066C: 4BFB 8B15     FF849180          bl       1                <br class="">FF890670: 4BFB 77A1     FF847E10          bl       load_base        <br class="">FF890674: 4BFF EA7D     FF88F0F0          bl       load-size        <br class="">FF890678: 4BFC 60B1     FF856728          bl       adler32          <br class="">FF89067C: 4BFC 6C55     FF8572D0          bl       u.               <br class="">FF890680: 4BFB 8B01     FF849180          bl       1                <br class="">FF890684: 4BFC A5ED     FF85AC70          bl       oft              <br class="">FF890688: 4BFC 5F59     FF8565E0          bl       not              <br class="">FF89068C: 4BFB 699D     FF847028          bl       (b?branch)       <br class="">FF890690: 4800 0008     FF890698          b        $+8              <br class="">FF890694: 4BFC 2305     FF852998          bl       cr               <br class="">FF890698: 4BFB 5E08     FF8464A0          b        exit             <br class=""><br class=""><br class="">FF8906CD: b(:) \ [0x0b7] 0x1cf2 load<br class="">FF8906D8: 967E FFFC                       stwu     r19,-4(r30)       <br class="">FF8906DC: 7E68 02A6                       mflr     r19               <br class="">FF8906E0: 4BFB 68B1     FF846F90          bl       b<">              <br class="">FF8906E4: 05 ...                          dc.b     " load " <br class="">FF8906EC: 4BFF FEDD     FF8905C8          bl       boot|load         <br class="">FF8906F0: 4BFF FA19     FF890108          bl       (init-program)    <br class="">FF8906F4: 4BFB 5DAC     FF8464A0          b        exit              <br class=""><br class=""><br class="">FF890865: b(:) \ [0x0b7] 0x1cf8 boot<br class="">FF890870: 967E FFFC                       stwu     r19,-4(r30)       <br class="">FF890874: 7E68 02A6                       mflr     r19               <br class="">FF890878: 4BFB 6719     FF846F90          bl       b<">              <br class="">FF89087C: 05 ...                          dc.b     " boot " <br class="">FF890884: 4BFF FD45     FF8905C8          bl       boot|load         <br class="">FF890888: 4BFF F881     FF890108          bl       (init-program)    <br class="">FF89088C: 4BFF FEA5     FF890730          bl       go                <br class="">FF890890: 4BFB 5C10     FF8464A0          b        exit              <br class=""><br class="">It should be possible to decompile the compiled fcode in the same way that the Open Firmware "see" command does.<br class=""><br class="">Earlier Mac's (Old World Macs) may have tokenized fcode in their ROM that you can more easily detokenize but some of the words may be unnamed (headerless). I guess the G5 (and other New World Macs) has tokenized fcode somewhere but I don't know where it is - maybe it's compressed? The following is detokenized output from a Beige G3's tokenized fcode:<br class=""><br class="">: colon_definition_function_8b7         \ (8b7)             [0b5 0b7]<br class="">   buffer_8b4_8                        \ (8b4 8)           [8b4]<br class="">   pack                                \                   [083]<br class="">   drop                                \                   [046]<br class="">   ['] colon_definition_function_8b6   \ (8b6)             [011 8b6]<br class="">   to init-program                     \                   [0c3 8b3]<br class="">   carret                              \                   [625]<br class="">   word                                \                   [589]<br class="">   count                               \                   [084]<br class="">   colon_definition_function_8b2       \ (8b2)             [8b2]<br class="">   ;                                   \                   [0c2]<br class=""><br class="">: boot                                  \ (8bc)             [0ca 0b7]<br class="">   " boot "                            \                   [012]<br class="">   colon_definition_function_8b7       \ (8b7)             [8b7]<br class="">   init-program                        \                   [8b3]<br class="">   go                                  \                   [8b8]<br class="">   ;                                   \                   [0c2]<br class=""><br class=""><br class="">: load                                  \ (8b9)             [0ca 0b7]<br class="">   " load "                            \                   [012]<br class="">   colon_definition_function_8b7       \ (8b7)             [8b7]<br class="">   init-program                        \                   [8b3]<br class="">   ;                                   \                   [0c2]<br class=""><br class="">You'll need the full listing to be able to find the information you need. As you can see the G5 has many more named words than the Beige G3 (as well as more code). The B&W G3 (another New World Mac) is somewhere in between.<br class=""><br class=""><br class="">I don't see "fcode-verbose?" anywhere in the outputs of any Macs. The G5 seems to have some logger stuff but I don't know what that's all about. "oft" (seen above) is a flag in "logger-flags". Setting the flag adds some logging somehow. There are different flags to log different things.<br class=""><br class="">Besides logging there are "debug", "resume", "tracing", "stepping" commands.<br class=""><br class="">I still have some PowerMacs (8600, 9600, B&W G3, G5) but I haven't turned them on in a long while.</b></div><div><b class=""><br class=""></b></div><div>What jumps out at me, is both ‘load' and ‘boot’ one the G5 call ‘boatload’, would this be the reason that it is trying to execute the Option ROM when I try and ‘load’ it?</div><div><br class=""></div><div>Do I need to try and fix that so I can load the entire file, without clipping the PCI Header?</div><div><br class=""></div><div>Or is getting the current instance by calling " agp/@10" open-dev to my-self, enough that I don’t need the header?</div><div><br class=""></div><div>I’m not real sure how to proceed, just not exactly sure what is going wrong, how this differers from SLOF and Openbios. What seems to differ is:</div><div><br class=""></div><div>1. The load command tries to execute the file, rather than just loading it to the base address like OB/SLOF.</div><div>2. 1 byte-load returns ok, but doesn’t seem to do anything, tho it’s hard for me to tell without fcode-verbose.</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">-- <br class="">OpenBIOS                 <a href="http://openbios.org/" class="">http://openbios.org/</a><br class="">Mailinglist:  <a href="http://lists.openbios.org/mailman/listinfo" class="">http://lists.openbios.org/mailman/listinfo</a><br class="">Free your System - May the Forth be with you</div></div></blockquote></div><br class=""></body></html>