Annotation of qemu/pc-bios/slof.bin, revision 1.1.1.2

1.1.1.2 ! root        1: ��(headermagic123E�HEADqemu0 1��1c����������Ø&(stage1H?ޭ��@8|C�|  �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C���|     �8�N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C���|     �8�N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C���|     �8�N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��        `|      �8    N� A�|C�|  �|C�|�|C��
1.1       root        2: `|     �8
1.1.1.2 ! root        3: N� A�|C�| �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��
`|     �8
N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C��`|     �8N� A�|C�|     �|C�|�|C�� `|     �8 N� A�|C�|     �|C�|�|C��!`|     �8!N� A�|C�|     �|C�|�|C��"`|     �8"N� A�|C�|     �|C�|�|C��#`|     �8#N� A�|C�|     �|C�|�|C��$`|     �8$N� A�|C�|     �|C�|�|C��%`|     �8%N� A�|C�|     �|C�|�|C��&`|     �8&N� A�|C�|     �|C�|�|C��'`|     �8'N� A�|C�|     �|C�|�|C��(`|     �8(N� A�|C�|     �|C�|�|C��)`|     �8)N� A�|C�|     �|C�|�|C��*`|     �8*N� A�|C�|     �|C�|�|C��+`|     �8+N� A�|C�|     �|C�|�|C��,`|     �8,N� A�|C�|     �|C�|�|C��-`|     �8-N� A�|C�|     �|C�|�|C��.`|     �8.N� A�|C�|     �|C�|�|C��/`|     �8/N� A�|x}`�9��y���}kcx}`&dL&,8`
        !             4: H&&8`
H�8`
        !             5: H�8`SH�8`LH�8`OH�8`FH�H�[?25l **********************************************************************
1.1       root        6: QEMU Starting
1.1.1.2 ! root        7:  Build Date = Oct 13 2011 16:03:14
        !             8:  FW Version = dwg@(private build)
        !             9: |h�H�8`I|i�N�!xf��8`X8�8�&D"N� dwg@(private build)�b��#�A@�aH�P�X��`��h�&p�!x�A��a������������&��!��A��a������������&��!��A&�a&�&�&��& ��&(��&8}����&@}����&H}�� �/�|       ��&0�!8N� |)�< �!���A@�aH��P��X��`��h�&p�!x�A��a��������������&��!��A��a��������������&��!��A&�a&��&��&��& ��&(�&0}����8}����&8}����&@}�&��&H}����&PH��b��#|xH
        !            10: ���&8}����&@}����&H}�� ��&P}���A@�aH�P�X��`��h�&p�!x�A��a������������&��!��A��a������������&��!��A&�a&�&�&��& ��&(�!8|B�|     �|B�|�|B�L$���`N� 
1.1       root       11: 
                     12: 
E1001 - Boot ROM CRC failure
                     13: 

                     14: 
                     15: 
E1002 - Memory could not be initialized
                     16: 

                     17: 
                     18: 
E1003 - Firmware image incomplete
                     19: 
       internal FLS1-FFS-0.
                     20: 
                     21: 
E1004 - Unspecified Internal Firmware Error
                     22: 
       internal FLSX-SE-0.|x|�#x|�+x|�3x9@&s�
                     23: @�(��x|�J�|c#xH&���x;�|#�A�H�H}��|�#x8�|#8A�H�}B�,A�4Hx��}B�8�|'0A�8��|' 8`&A�P|�#x|qB���8�|' A�|����������|���(8� �� 8`~�x}��N� }��|�+x|�+xH9,&@�}��N� |��:��8����E&�P&B��~%�x}��N� }(�|�#x|jx|�#x8� |�+xHE,&@� �,|�*@���8`&}(�N� 8`�����|�B}(�N� 9J��9k���        ��     |-p9�&A�N� q��@���9�N� �!��|��&0��8��@��H|�+xK��Y�&0|����������H��@��88!PN� }�|ix�i,A�H     9)&K���}�N� }�|ixy#' pc,
                     24: A�8c8c0H&�y#F pc,
                     25: A�8c8c0H&�y#e pc,
                     26: A�8c8c0H&�y#� pc,
                     27: A�8c8c0H&�y#� pc,
                     28: A�8c8c0H&ey#� pc,
                     29: A�8c8c0H&Iy#� pc,
                     30: A�8c8c0H&-y#"pc,
                     31: A�8c8c0H&y#'pc,
                     32: A�8c8c0H�y#Fpc,
                     33: A�8c8c0H�y#epc,
                     34: A�8c8c0H�y#�pc,
                     35: A�8c8c0H�y#�pc,
                     36: A�8c8c0H�y#�pc,
                     37: A�8c8c0Hiy#�pc,
                     38: A�8c8c0HMy#pc,
1.1.1.2 ! root       39: A�8c8c0H1}�N� }�|ixK��}�|ixK��t}�|ixK���xf��8`X8�8�&D"N� |jx8`T8�D"|�#yA�x�F �jN� <``cxc�dc`cr0<�`�x��d�`�Q`T���A�8�|����    B��< `!x!�d!`!�8a�|��H58`��xH&9< `!x!�d!`!�8!��a|h�N� <@`BxB�dB`BØ8B@8B@N� |fx8`&8�&<�`�DLK���|�8�Tc0T�0|� PT���|��|l|�|�|�L&,8c�B��N� ``|`>p�"�|�x$|�&*N� ```8``cޭxc��`c��N� N� 8`N� ```|���������|�#y�a���&|{x���������!�&A�&�?���8�{��<�@��x;��H�`�"� �b�(8�       H�`�b�0��x��xK��I`|dy@�&��!�낀@��x8����x�iK��!`/�A���b�H��xHA`�b�P��x��xK���`|dy@�& <��4�&@�&,��`�a�;�p8���xH    �`�b�h肀p袀xH�`�&p�&xL&,|��A(�&p<�eP��x��x`�AP�a�8���x|  ��^N�!�A(L&,|�8!&�&�a��������|���������N� �����8`&He`�a�9 &}kJ9kU)0Uk0}iXPUk��}i�|Hl|�|O�|�L&,9)�B���b�P��x��xK���`|dyA����b�8H�`<��4�&A����b�X���HA`��K����b�H-`K���b�8H�`K��D&�`|�9 /��&�!���     /�@�|�"���b���Hy`|���b��|�#xx�"Ha`|���b��|�#xx�"HI`|�B��b��|�#xx�"H1`|�B��b��|�#xx�"H`HK��`K���&�`|��"��b���&�!��x`��x$�k})*/�A�8�     �A(| ��i�IN�!�A(8!p�&|�N� ``8!p�&|�K���&�|��&�����!��|?x|`x����x |xK��}`8?��&|�����N� &�&&|��&�����!�q|?x|ix���|�+x�?������p��/�&A���/�A�8Hx8�xHT�p| x�     x /�
        !            40: @�8`
K��9�p|      x�     x �?p9)&�?p|xK���x0&�x�?x���@A����xx |x8?��&|�����N� &�&&|��&�����!�q|?x|`x��K��`|`xx     �����| x��pH<�px |xK���`K���`|`x|�/�@����0������/�@���8?��&|�����N� &�&&|����p���x|�#x�&�&��|`x�!���A���!�&|x}CxK���`8!&�&���p���x�&��|��!���A��N� &�8���8���|�*��8��|�*��<�`�x��d�ib`�m,|�(P|�*�<�CP`�U0x��d�lo`�g|�(P|�*��8���|�*��8�|�*+�A�8�&|ex|�#x|�+xN� }�|dx8`8�/�A�8�|�#xH��&�0A�`�&/�@�`�&|�#xK��-/�A�`�|�;x}�N� }(�K���}(�/�|�#x@�|8`N� }(�8��|�28�Q8������8�@8�����8�&<�ib`�m,����<�CP`�U1x��d�lo`�g��|�3xH&]�f&}(�N� }�|gxHm8�Q8�����8�@8�����8�&<�ib`�m,����<�CP`�U0x��d�lo`�g��H��g&K��1|�;x8`&}�N� <�`�x��d�&`�x���|��8�<�`�x��d�`�|�)*8�B��N� <�`�x��d�`���x�&�8����0A�8�8�&��8���|�*�f@N� 8��|�"<�`�x��d�`����x�&�8����0A�8�8�&��8���|�*�f@N� |fx�f<�`�x��d�`�|�0�8�&|�x� �@+$@�8�&x� |�+xA���|�3xN� |��&�!���cm`E/�LFA�8!p8`���&|�N� �/�@���c8��T>+�&A��Сc8��T>+�&A����/�&A�$/�@���HI`8!p�&|�N� H�`8!p�&|�N� &�```|�=`E��������|�#x�&�!��akLF;�����XA�$8!���x�&��������|�N� `�;���/�@��Ԡ;���0��T>+�&A����;���0��T>+�&A�����/�&A�8/�@���8�H�`8!��~��x�&��������|�N� 8�H]`8!��~��x�&��������|�N� &�``|�= E�A���a��|�3x�&����a)LF|�#x��������|�;x|�+x�����!�a|x;�����HA�48!���x�&�A���a�����|������������N� `�;���/�@��Ġ;���0��T>+�&A����;���0��T>+�&A�����/�&A�t/�@���H`E�xf�x��P��x��xH1`��x���x��Hi`8!���x�&�A���a�����|������������N� He`E�xf�x��P��x��xH�`8!�����x�&�A�����a��|���������������N� &����,}C|./�&A�L�*9`}*BH ``�     }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A����H,```�,;�&�����*A����/�&@���/�A�&�?9��A�0��A(#�x|     ����|�\N�!�A(/�@�����|��#�xHy`��?8�|y|HPx H�`��/�A��XA��T��A(#�x;�&��| ��w�WN�!�A(�,���*@��4``8!��`��&��{c �����&��|��!���A��}�& �a�����}�� �����������N� `�?�{�P{�K���� � ��8}C|./�&A�L�69`}*BH ``�     }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|��!���A���&�a��|�#x��������;���������|x�!�Q�#(#�>�xH(```;�&�<;�@����A��/�@����>,�^(y)6d}9J{Z6dY��     x     ��A���� /�A����_ ��8;��z��8|�2|�2|P.}_R/�&�A��``�69`}*BH� }*Kx})B/�&A��9k&}k��8@���|0*x�"y+.�y)$})XP�ex� |i+�@|�#}+J}`�})�@���b��Hm`� �8����`@��x@����_ ���z��8|�2|�2|P.}_R/�&�@��@```|0*�*�@@��\�b��H�`� K���```�B��x�d|
        !            41: �}@R}I�N� ���X&���X���X&&d&P���X���X���X���h���h���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X&D&8���X&,���X���X���h���X���X���h���h���h���h&���X���X���X���X���X&���h���h���X���X���X���h���hU):�+K��\�+K��T�|��� K��@y)� �+K��4y)"�+K��(�+� K��y �y)��|        �K��y)��+K���``8!��&�!���A���a��|���������������N� &�``|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A�� ��H,```�8;�&�����6A����/�&@���/�A�&�?9��A�0��A(#�x|     ��(�|�\N�!�A(/�@�����$|��#�xH&y`� �?(8�|y|HPx H�`�(/�A��XA��T��A(#�x;�&��| ��w�WN�!�A(�8���6@��4``8!��}|{�&�������&��|��!���A��}�& �a�����}�� �����������N� ``�?�{�PK����     ,%M� 8���x� x� |ix8�&|����9)&B��N� ,%M� 8���|ixx� 8�&|��`�8�&� 9)&B��N� �@@�\|*�@A�P/�M� 9%��8���y) |�*9)&|�*})�9 `|H�|I�9)��B��N� ```/�M� 8���|ixx� 8�&|��`�8�&� 9)&B��N� |��&�!��|`x�b��������|x�������&��!��A�8��H&       `8!p�&|�N� &�|���������|~x�&�����!�q����Hm`��x|ex��xK��E`肀�8�|~x�K��-`8!����&�����������|�N� &�|ix9`8`�       /�M� ``�     &9k&}k�/�@���yc N� |���������|�+x|~x�&����|�#x8�&@�!�1;�p��xH�`��x|}x�~{� K��U`8!&���x�&�����������|�N� &�|��"������|�#x�&����8��|�+x��������T>|x�!�a+�
�I�)8�!p�AxA�X� @@�|�"���     /�A���c8-�8�c9k&�c� ��8&�=p�+�?9)&�?8!�|x�&����������|�����N� ``�+������x��PK��!���?8!�8&|x�}p�i�&�?������|�9)&�����?����N� ``�cK��T&�```|��a������}Cx|�;x�&����|�3x��������|~x|�+x�!�a|�#x8�
        !            42: 8�HQ`/�9 8&|c�A� `��9)&/�})�@���y  |�|��@�@|P|�/�@�0x �>|  �```���>9)&�>B��8!�8`�&�a��������|���������N� &�``|����p���x9�x9�0�&�&��:&��������:� �����&��|�#x|xx�!���A��; �a�������!���A���a�������������������!��;a&P;Ap:���{1�%/�A�8|P��@�,/�%A���#8�&�a&�8c&�a&��%/�@���8��a&�8!&P|xP�&���p|c����x�&��|��!���A���a�����������������&���!���A���a����������������N� `K�x|�+x8%�;�&|�P|
        !            43: ��/�dA��/�iA��/�uA��/�xA��/�XA��/�pA��/�cA��/�sA��/�%A�/�OA��/�o9k&@���9 o9j&}AR}k�}aZ�*p�+p�/�%@� 9#&��!&�8�&�a&�K���`�&q��:&/�0A�/�.:` ;�qA��</�A�P|�:��&�;�8        ��T>+�)@�D8 ��T>+�       A�}z�;�&{� �+�<&/�@���~&�xK��p```�b��x�|�}`Z}i�N� X������������������������������������������������������������������������&������������������������X��������X&h������������������������8�8�
        !            44: ~��x�?H=`x ��xK��}`�@@�D|c�Pxc!A�8/��!&�|i�A��A��```���!&�9)&�!&�B��;�H(`�!&�|��;�&{� �  �!&�8 &�&&���xK���`��@A���K��l``}:�~��x��x8�8� 9�)c�xK����!&�c�x��x8����!&�8     &�&&���&�!&�8 &�&&�K��]�<&K��}:�c�x~��x8�&8�
        !            45: 8� �)9K����!&����a&��<&8c&�a&�K���}:��b��z�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK��-c�x~D�x8�K��͍<&K��x}:��b��z�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK���c�x~D�x8�K��}�<&K��(�<&:�/�h@���<&:�&K��`V�88      ��}:�~6��x�)�9A�4�a&��"��z�$})8-��I�!&��a�8 &}r�8�&&�~E�x8�
1.1       root       46: ~g�x9~��xc�xK��9c�x~D�x8�
1.1.1.2 ! root       47: K��ٍ<&K���```�<&:�/�l@��hK��````:`0;�rK���`9 dK���``9 iK��|``9 uK��l9 xK��d9 XK��\9 pK��T9 cK��L9 sK��D9 OK��<8&|  �K�� &�,$|ixA�&@+�$�$@�H&`9)&�$�i/� /   ,�
1.1       root       48: A���/�
A���A���A���/�@��/�0A��8�
                     49: /�A��8``8��9K��T>UJ>+�    +
1.1.1.2 ! root       50: 9)&9K��|4@�$8��T>+�}@4@�M� 9k��}`4�(L� �$|c)҉i/�|`@���N� `/�@��|/�08�@��p�        &9I&/�x@��h9*&�$�j&K��P```8`N� �     &9I&/�x@��(9*&�$�j&K���8���K���&�P&&�PPERROR: Flatten device tree available! Press "s" to enter Open Firmware.
1.1       root       51: 
                     52: bootinfo  !!! roomfs lookup(bootinfo) = %d
                     53: xvectCannot find romfs file %s
1.1.1.2 ! root       54: ofw_mainERROR: Not enough memory for Open Firmware%s%s[?25h
1.1       root       55:  exception %llx 
                     56: SRR0 = %08llx%08llx  SRR1 = %08llx%08llx 
                     57: SPRG2 = %08llx%08llx  SPRG3 = %08llx%08llx 
1.1.1.2 ! root       58: 
        !            59: ELF relocation out of bounds!
        !            60: ERROR: Unhandled relocation (A) type %i
        !            61: 
        !            62: 0123456789ABCDEF������������������������������������AL&C�I�&C�J0&C�J`&C�J�&C�J�&C�J�&C�M&C�M�&C�N,&C�N|&C�Od&C�P&C�S�&C�T`&C�Up&C�W&C�W�&C�Y`&C�Y�&C�]�&C�_`&C�_�&C�_�&C�`�&C�a&C�a�&C�a�&C�b`&C�c�&C�d�&C�k@&C�&C�����m��m(mPm`m�m�m�m�oPm�m�nnÐn n8nPnh ě��S��n�[�n�l�l�n�n���gH��������?0?(xvect�`/�|i�8&N� |C�|    �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8�N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8�N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8�N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8    N� |C�|  �|C�|�|C��/�|     �8
        !            63: N� |C�| �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8
N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8N� |C�|     �|C�|�|C��/�|     �8 N� |C�|     �|C�|�|C��/�|     �8!N� |C�|     �|C�|�|C��/�|     �8"N� |C�|     �|C�|�|C��/�|     �8#N� |C�|     �|C�|�|C��/�|     �8$N� |C�|     �|C�|�|C��/�|     �8%N� |C�|     �|C�|�|C��/�|     �8&N� |C�|     �|C�|�|C��/�|     �8'N� |C�|     �|C�|�|C��/�|     �8(N� |C�|     �|C�|�|C��/�|     �8)N� |C�|     �|C�|�|C��/�|     �8*N� |C�|     �|C�|�|C��/�|     �8+N� |C�|     �|C�|�|C��/�|     �8,N� |C�|     �|C�|�|C��/�|     �8-N� |C�|     �|C�|�|C��/�|     �8.N� |C�|     �|C�|�|C��/�|     �8/N� 6�����������0ofw_mainELF&&&@e@8&@&&&&c��C�?��c��?��c���?�c����?�c����|�|�<``c�c�`/�H&�|1C�B�|(��!���A�a�� ��(��0��8�&@�!H�AP�aX��`��h��p��x�&��!��A��a��������������&��!��A��a�������������8`|x|B��&|B��&,        @�|��<�|�|&�&&|&��&&|B��&&|B��&&|��&& |��&&(|��&&0|��&&8B�
�>�|H��"|!8�&���!�&<@�q0|��Bq8L$|�B���}�|��}B��(|&x��H|x��h|x� �� |x�(��(|x�0��0|x�8��8|x�h��h|
x�p��p|x�x��x|x����|x���(�|x���H�|x���h�|x�����|x�����|x�����|x�����|x����|x���(�|x���H�|x���h�|x�����|x�����|x�����|x�����|x�&} &|� �(&�&(} �|&d|�L&,�(&(N� |��K��u|��8`N� |��|i�K��]N�!K��U|��8`��N� ``|�8�Tc0T�0|� PT���|��|l|�|�|�L&,8c�B��N� ``|������&|�3x��|      �N�!�������&|�N� &&`|��"�����|wx�&���p���x�&���!���A���a���������������&���!���A���a�������������������!��� /�@�<�B���(}+Kx9
1.1       root       64: 8�
                     65: 0�  ���B� ����*8&�       �iz���A��B��j8�
                     66: ��z��A��B��j8�
1.1.1.2 ! root       67: ��z���@�|z���A�'��B� �b�9);���j8�
        !            68: �+��:s&�:�p:�u;&v;`:&;���:�x��;A�;�&: ;!�>@&```}��N� z���8`A��"��i8���k�    8!P�&���p���x�&��|��!���A���a�����������������&���!���A���a����������������N� �b���       ��0�+��9I�K�   }��N� �b���       ��8�+��9I�K�   }��N� �b���       ��@�+��9I�K�   }��N� �b���       ��H�+��9I�K�   }��N� �b���       ��P�+��9I�K�   }��N� �b���       ��X�+��9I�K�   }��N� �b���       ��`�+��9I�K�   }��N� �b��B�h��   �+�
        !            69: ��9I�K�        }��N� �b��B�h��   �+�
        !            70: ��9I�K�        }��N� �b��B�p��   �+�
1.1       root       71: ��9I�K�        }��N� �b��B�x��   �+�
1.1.1.2 ! root       72: ��9I�K�        }��N� �b��B����   �+�
        !            73: ��9I�K�        }��N� �b��B����   �+�
1.1       root       74: ��9I�K�        }��N� �b� �+8     ���;�����}��N� �B� �b�8�*9 �
1.1.1.2 ! root       75: ���+��9I�K�        ����}��N� ����}��N� ����}��N� �b���+9I�K� ��   ��}��N� �b���+9I�K�       ��   ��}��N� �"���)�i|�       ��   ��}��N� �b�;��+8       �����   ��}��N� �b�;��+8       �����   ��}��N� �9>});�����}��N� ���9>�o�K/�@�})9k��;��o����}��N� �b� �+8       ���~~�x����}��N� �B��9>;��j9�
1.1       root       76: �����}��N� �B��9>;��j9�
1.1.1.2 ! root       77: �����}��N� �b���  �+��9I�   �K� }��N� �b���       �+��9I�   ���K� }��N� �"���       �)���       |�x$|     *�     }��N� �"���       �       ��0���     }��N� �"���       �)���i���   �     ���i}��N� �"��B� ��       �       �j��8��8������ }��N� �"� �B���   �       �j��8��8������ }��N� �"� �b���   �       �+��9I��K� }��N� �b���       �B���+��8   }JP�}Jt�I}��N� �"���       �b���I���
        !            78: 0��x$|�        }��N� �"� �b������       �I�+��|PP9I|t0&�K�       }��N� �"���       �B� ����i��8������0��x$|�
1.1       root       79: }��N� �"��b� ��  �)�k���   x$|�|*� }��N� �"���       �i���K���|
                     80: ����        0��� }��N� �"���       �i���K���|PP����       0��� }��N� �"���       �i���K���|
                     81: &�����        0��� }��N� �"���       �i���K���}@6����       0��� }��N� �"���       �i���K���}@6����       0��� }��N� �"���       �i���K���}@4����       0��� }��N� �"���       �i���K���}@8����       0��� }��N� �"���       �i���K���}@x����       0��� }��N� �"���       �i���K���}@x����       0��� }��N� �"���       �)���i��       }��N� �b���       �+��9       ���I� ����
                     82: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
                     83: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
                     84: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
                     85: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
1.1.1.2 ! root       86: }��N� �"���      �)���i���&�&�&p�       }��N� �B���       �j��}i[x�k�       ���&p9)��x��*��&�&}��N� �"���   �i���+9I&�       �&t� &��
1.1       root       87: &��
                     88: �&�&t�}��N� �B���  �*��}+Kx�)����&t9k��TF>�j�   9i&��     &��&�&�}��N� �"���       �i���K����|&T��|�|�����       0��� }��N� �"���       �i���K���|P|&����   0��� }��N� �"���       �)���       |�v� }��N� �"���       �i���K���}@x0��|&����       0��� }��N� �"���       �)���       0��|&�     }��N� ���B� ��   �h����9'����8�8�����k�i�}��N� �b�9>�K8���8����
                     89: ���
1.1.1.2 ! root       90: ���@�~A��B� �j8�������;���}��N� �"� �;��i�K9J&�K�i��K���PA�0���;���}��N� ���"� ��;��H�i8�����J��/��}HR�KA���I}KSx�J���}@PP9��|@P�P@@��9k���i��;���}��N� �b� �9>});��0�������}��N� �"��;��i9K���k�I/�A��"� ��        0��� ��;���}��N� �b� �+8 ���)�;�����}��N� �b� �+8 ���)�;�����}��N� �"��i8����� ��}��N� ����   �h��9K��8����+�H8���k�����J���}@[x|Kxx`/�A��/�A��/�@�t�P@A�d|�J|�J�8@9A�HL|@*9)��|A*/�9��@���K��h�B��*9i��8����   �j8���yE�|Cxx��|�x�)�����k����}*[xyJ`/�A� /�A��/�A��/�}+J}+HP})�@�`�9k&B����       ��}��N� ���O9j��9���
        !            91: �o9(��/��J����k���/@�T����@@A�@A� 4���}�@�,H```��&|�B|�P��8@A�A��4��@���8    ��i��   ��}��N� ���h9K��8����+�H8����k����}`Kx�J����|Sxx`/�A�$/�A��/�@�X�P@A�x|�J|�J�8@9A�H`|@*9)��|A*/�9��@����� ��}��N� ����     �O�9j��9+���
        !            92: �o8����J���/�A��������@�I��A�x�i��|x}��N� ����      �o��9+����//�A�����       ��9)���/}��N� ����       �/���iHJ`�/8       ��i}��N� ��   ��H!�`}��N� ����     ~��x�€�袀��/���iH"�`�/�&x�       �/8 ��i}��N� ����       ~��x�‰�€��/��8   �����i��H#I`�/�&x� �/8 ��i}��N� �"���       �����oH.y`�o}��N� �"��� �����oH.�`�o}��N� �"��� �����oH.�`�o}��N� �"��� �����oH.�`�o}��N� ���� �/�������iH.`�0���}��N� ����     �/�������iH.!`�0���}��N� ����     �/�������iH.=`�0���}��N� ����     �/������iH.Y`�0���}��N� ����     C�x8��/����H4!`�z�9+&+�&@���/�   �/8 ��i�/8 ��i}��N� ����       ��x�/�9I��9j�����Oy� ����o�&�HHa` ��8�x� |}rHH `8���C�xx� ��xH3q`�z�Z�&�9+&+�&@���/|x8   ��I�/8 ��i�/8 ��i}��N� ����       8���x|��8����9H��9j�����O8���8������o�J��������H }}HP|P��   8�&9)&|��B@l�8A����)K�������       �o��9+��9I���k�/8
        !            93: ������O����H4q`�//�8    �@�L��}��N� ��       ��H:q`}��N� �"���     8`&�i��8�����   H)�`}��N� �"���       ����8����       �o��H*m`�o��}��N� �"���       �i��8���k�       |c4H`}��N� �"���   �I��9j��9����i8�������       �k��� Hu`}��N� �"���       �i��9K��8
        !            94: ����I�k���        H5`}��N� �"���       �I��9j��9����i8�������       �k��� H`}��N� �"���       �i��9K��8
        !            95: �����I�k���        H`}��N� �"���       ����8�����       �o��H�`1��||����}��N� �"���   �i��8���k�       H(9`}��N� �"���       ����8�   H()`�o}��N� �"���   ����8�   H(-`�o}��N� �"���   8`��i��9���8����������       ����H'�`�o��}��N� �b���       ����+��9I�K�   }��N� ����       �/�8       �����/��)��A�����8`�ix��&��!��a�HD�`���&��!�4����a�|x9)&���|rx@����B���/xh|
        !            96: �    }n[x}��N� ��       �b��8�8�`����HC5`}��N� �� ��H*}`}��N� �� ��H+�`}��N� �� ����x���/���9i��8�����oy� ����HC&` ��8�x� |}rHB�`�/��x9i��8����o�i���H8�`|`yA�,�/9i�o�   �/�!�8     �HAa`�!�����i�/8 ���}��N� ����       #�x�/��9I��9j���   �Ox ����o�&�HB1`�&�8� ��|yx� HA�`�/��x9I��9j���     �Ox ����o�&�HA�`�&�8� ��|}x� HA�`�/��x&�x9i��8����o�i���H9m`,#A�
|�/8     ���}��N� ����       #�x�/�9I��9j�����Oy� ����o�&�HAA` ��8�x� |yrH@�`�/%�x9I��9j����O�i���oH>`�&�,#A���/|x8       ���}��N� ����       �/��9i��8����o�i���H(�`,#A�p�/8   ���}��N� ����       ��x�/��9I��9j���   �Ox ����o�&�H@M`�&�8� ��|}x� H?�`�/#�x9I��9j���     �Ox ����o�&�H@&`�&�8� ��|yx� H?�`�/%�x��x9i��8����o�i���H9�`,#A�h�/8     ���}��N� ����       �/��9i��8����o�i���H/y`,#A���/8   ���}��N� �b���       �+��8       ��i}��N� �b���       �+��8       �|��     }��N� �b���       �+��8       �|B��     }��N� �b���       �+��8       �|���     }��N� �b���       �+��8       �|B��     }��N� �b���       �+��8       �|
B��     }��N� �"���       �)���       |���b�9)���+}��N� �b���       �+��8       �|���     }��N� �"���       �)���       |K��b�9)���+}��N� �b���       �+��8       �|J��     }��N� �"���       �i���|C�9k���i}��N� �b��� �+��8       �|B��     }��N� �"���       �i���|C�9k���i}��N� �b��� �+��8       �|B��     }��N� �"���       �i���|C�9k���i}��N� �b��� �+��8       �|B��     }��N� �"���       �i���|C�9k���i}��N� �b��� �+��8       �|B��     }��N� �"���       �i���|K�9k���i}��N� �b��� �+��8       �|J��     }��N� �"���       �i���|K�9k���i}��N� �b��� �+��8       �|J��     }��N� �"���       �)���       |�|æL&,�b�9)���+}��N� �b���       �+��8       �|�|¦� }��N� �"���       �)���       |l|�|�|�L&,�b�9)���+}��N� �"���       �����oK���`�o}��N� H�"���     8��i��9���8��������o���       K����o��}��N� �"���       �I��9j��9���8�����������o���   K�۹�o��}��N� �B���       �*��9       ��8���i�
1.1       root       97: �)���
1.1.1.2 ! root       98: }kJ9kU)0Uk0}iXPUk��}i�|Hl|�|O�|�L&,9)�B��}��N� �"���      �i���|�9k���i}��N� �b��� �+��8       �|��     }��N� �b���       �+��9       ���I� ����
1.1       root       99: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
                    100: }��N� �"���      �)���i��       }��N� �b���       �+��9       ���I� ����
                    101: }��N� �"���      �i���|�|��|��|��|��|��|��|��9k���i}��N� �b���     �+��8       �|���     }��N� �"���       �)���       |��|��L&,�b�9)���+}��N� �b���       �+��8       �|���     }��N� �"���       �)���       |�|��L&,�b�9)���+}��N� �b���       �+��8       �|���     }��N� �"���       �)���       |���b�9)���+}��N� �b���       �+��8       �|���     }��N� �"���       �)���       |&d�b�9)���+}��N� �b���       �+��8       �|��     }��N� �"���       �)���       |��b�9)���+}��N� �b���       �+��8       ��i}��N� �"���       �)���i��       }��N� �b���       �+��9       ���I� ����
1.1.1.2 ! root      102: }��N� �"���      �)���i��       }��N� �b���       �+��8       ��i}��N� �b���       �+��8       ��i}��N� �b���       �+��8       ��I}��N� �b�;�&K��h|��|��C�x��xH'�`��z/�@���/8     ���}��N� 9I��x�/���y*��|Cx9J&}h[x@�9@&H�95J��9)��@���9I��}h[x/���y*��9J&@�9@&H�95J��9)��@���9I��y)�B/���9)&@�H&��9k5)��@���K���})ZK���/9I�O�i�/9i�o�     �/8 ��i}��N� �P@A�8}
        !           103: J�@@@�,}kJ9)&})�9 H|H�|I�9)��B��K��9)&|
        !           104: �})�B@�}*�
        !           105: 9J&}        Y�K����P@A��}
        !           106: J�@@@��}kJ9)&})�9 H|H�|I�9)��B��K����/8        ��i}��N� �/8 ��i}��N� �/8 ��i}��N� �/|x8     ��i}��N� 9)&})�9 B@ք|     �9)��}
        !           107: �}&�K����i}��N� �/8    ��i}��N� �:K��L9 &K��`�/���9i�o�     }��N� |     x���K����/|x8     ���}��N� �/��}��N� ����9 H`}i�9)��|jX��&��!��A��a�H4=`�a���|hx|dX��&�H4!`�&��&��!��A��@@�@9���/�@���|x}��N� 9H|P*9)��|Y*9/�@���K���/|x�i}��N� �P@A�|�J|�J�8@9A�49H|P.9)��|Y.9/�@���K��H|@.9)��|A./�9��@���K��,�P@A�|�J|�J�8@9A�49H|R.9)��|[.9/�@���K���|B.9)��|C./�9��@���K���8&K��8 �����   ��}��N� 8   �� ��   ��}��N� 9H|
        !           108: @*9)��|A*9/�@���K���P@A�|�J|�J�8@9A�49H|
        !           109: @.9)��|A.9/�@���K���|@.9)��|A./�9��@���K�Ӽ�P@A�|�J|�J�8@9A�49H|
        !           110: B.9)��|C.9/�@���K��||B.9)��|C./�9��@���K��`�i|
        !           111: x�K��89k���iK���&�`|�/��&�!��A�xc H!`8!p�&|�N� &�`|�8c����������|�+x+�&�&�����!�q@�,8!�8`�&�����������|�N� ``/�@���|�#x;�H,```;�&H�`;�&����@�H�/�
1.1       root      112: @���8`
;�&HY`���;�&HE`��A���```8!���x�&�����������|�N� &�`|��&�!��H&�`8!p�&|�N� &�}��|�#x8�|#8A�H�}B�,A�4Hx��}B�8�|'0A�8��|' 8`&A�P|�#x|qB���8�|' A�|����������|���(8� �� 8`~�x}��N� }��|�+x|�+xH9,&@�}��N� |��:��8����E&�P&B��~%�x}��N� }(�|�#x|jx|�#x8� |�+xHE,&@� �,|�*@���8`&}(�N� 8`�����|�B}(�N� 9J��9k���        ��     |-p9�&A�N� q��@���9�N� �!��|��&0��8��@��H|�+xK��Y�&0|����������H��@��88!PN� N� xf��8`X8�8�&D"N� |jx8`T8�D"|�#yA�x�F �jN� }�|ix�i,A�K���9)&K���}�N� }�|ixy#' pc,
                    113: A�8c8c0K��}y#F pc,
                    114: A�8c8c0K��ay#e pc,
                    115: A�8c8c0K��Ey#� pc,
                    116: A�8c8c0K��)y#� pc,
                    117: A�8c8c0K��
y#� pc,
                    118: A�8c8c0K���y#� pc,
                    119: A�8c8c0K���y#"pc,
                    120: A�8c8c0K���y#'pc,
                    121: A�8c8c0K���y#Fpc,
                    122: A�8c8c0K���y#epc,
                    123: A�8c8c0K��ey#�pc,
                    124: A�8c8c0K��Iy#�pc,
                    125: A�8c8c0K��-y#�pc,
                    126: A�8c8c0K��y#�pc,
                    127: A�8c8c0K���y#pc,
                    128: A�8c8c0K���}�N� }�|ixK��}�|ixK��t}�|ixK���|��H|��|��8��xxg�j|�8�|8N� }h�|ix8`CK���}#KxK��18`K���8`K���8`K���8`K���8`K���}h�N� }h�|ix|�#x|�+x8`
                    129: K���8`
K���}�cxK���}#KxK���8` K���}CSxK���8`
1.1.1.2 ! root      130: K��y8`
K��q}h�N� 8�EK���}h�K��1}h�8�W@���N� }h�8� K��}h�8�D@��tN� }h�|�#[email protected]���8`A�8`&}h�N� |��H|��8��Tpc|�2��|��N� N� `|��&�!���cm`E/�LFA�8!p8`���&|�N� �/�@���c8��T>+�&A��Сc8��T>+�&A����/�&A�$/�@���HI`8!p�&|�N� H�`8!p�&|�N� &�```|�=`E��������|�#x�&�!��akLF;�����XA�$8!���x�&��������|�N� `�;���/�@��Ԡ;���0��T>+�&A����;���0��T>+�&A�����/�&A�8/�@���8�H�`8!��~��x�&��������|�N� 8�H]`8!��~��x�&��������|�N� &�``|�= E�A���a��|�3x�&����a)LF|�#x��������|�;x|�+x�����!�a|x;�����HA�48!���x�&�A���a�����|������������N� `�;���/�@��Ġ;���0��T>+�&A����;���0��T>+�&A�����/�&A�t/�@���H`E�xf�x��P��x��xH1`��x���x��Hi`8!���x�&�A���a�����|������������N� He`E�xf�x��P��x��xH�`8!�����x�&�A�����a��|���������������N� &����,}C|./�&A�L�*9`}*BH ``�      }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A����H,```�,;�&�����*A����/�&@���/�A�&�?9��A�0��A(#�x|     ����|�\N�!�A(/�@�����|��#�xH$�`��?8�|y|HPx H#�`��/�A��XA��T��A(#�x;�&��| ��w�WN�!�A(�,���*@��4``8!��`��&��{c �����&��|��!���A��}�& �a�����}�� �����������N� `�?�{�P{�K���� � ��8}C|./�&A�L�69`}*BH ``�     }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|��!���A���&�a��|�#x��������;���������|x�!�Q�#(#�>�xH(```;�&�<;�@����A��/�@����>,�^(y)6d}9J{Z6dY��     x     ��A���� /�A����_ ��8;��z��8|�2|�2|P.}_R/�&�A��``�69`}*BH� }*Kx})B/�&A��9k&}k��8@���|0*x�"y+.�y)$})XP�ex� |i+�@|�#}+J}`�})�@���b��H#=`� �8����`@��x@����_ ���z��8|�2|�2|P.}_R/�&�@��@```|0*�*�@@��\�b��H"�`� K���```�B��x�d|
        !           131: �}@R}I�N� ���X&���X���X&&d&P���X���X���X���h���h���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X&D&8���X&,���X���X���h���X���X���h���h���h���h&���X���X���X���X���X&���h���h���X���X���X���h���hU):�+K��\�+K��T�|��� K��@y)� �+K��4y)"�+K��(�+� K��y �y)��|        �K��y)��+K���``8!��&�!���A���a��|���������������N� &�``|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A�� ��H,```�8;�&�����6A����/�&@���/�A�&�?9��A�0��A(#�x|     ��(�|�\N�!�A(/�@�����$|��#�xH�`� �?(8�|y|HPx H�`�(/�A��XA��T��A(#�x;�&��| ��w�WN�!�A(�8���6@��4``8!��}|{�&�������&��|��!���A��}�& �a�����}�� �����������N� ``�?�{�PK����     `|�����8�|�#x�&�!��|dx8`K���`��x8�8`K���`�����xH�`��x|dx8`K��i`8`8�8�K��U`8!�|c��&����|�N� &�&D"N� xf��8`X8�8�&D"N� }H�H-}H�,M� = �a)B��|dH�8�&��N� 8`��= �a)B����|0@L� 8`T8�D"= �a)B��8`�i(M� 8`������N� ���|dx8`&D"N� 9`}*Kx}     Cx|�;x|�3x|�+x|�#x|dx8`& D"N� +���8A��"��|     �|xN� ``+���M� �"��|��N� +���8A��"��| .|xN� ``+���M� �"��|�.N� +���8A��"��| .|xN� ``+���M� �"��|�.N� +���8A��"��| *|xN� ``+���M� �"��|�*N� <&�@�8`N� ```�b��<c&�/�@���8���8cN� �"��8=)&�     N� ���8�8``���<�&}Cx``x` }(�/�M� 9#&8�y) �(A�|�H�8�}h�8x� |     �|�;x+���9I&8A�|H�}`ZyI yk B��U`�>}`ZUk>�XL� +���M� |:./�M� T 6|`|c�� @��dN� ||��L� 9#&9`�}#Py) })�A�<= ��HA�0``x` 8c&+���A��"��}i&�|c�B��N� 8&| �K���`<&�B��9 |     �9````y  9)&})�}j&�B��N� ```8c��8�/�|��|i�A�8�|�J|��� @�Xxc 9@8&|c Pxc � |i�A�@<��A�4``y  9)&+���A��b��}K&�})�B��8`N� 8&| �K���|`y8`M� | �|�J|��� @�Tx 9@8&}k Pyk � }i�A�<<��A�0`y  9)&+���A��b��}K&�})�B��8`&N� 8&| �K���N� |��!���A��|zx�&�a��8|�+x��������T6|�#x�����&��|������!�Q|�3xK���|yxK���<&|P��A�&�{8 +���@�&4;�{� +���@�&;�;�{� H$9=&8&}{�A��B��}j�y= x c�xHm`+����@A���9&+���y 9 @��8|     �```+���9~&8A��B��|
        !           132: �} Jy~ y) B��+���@��8!�;9��9��:C�x�&�&���!���A��|��a����������������N� ```�"��})��K��d`�"���&p�&���.K���```�"�����;�{� +���A���K���`�b��U �>} J}+A�K��P```8!�8��C�x�A���&�&���!��|��a����������������N� &�`|��&�!��K���8�袀�8�`���|�0P8ap|��K����ap8!�0��|`�&|�N� &�``}�&|���������.$|�+x�&���!��; |xx�A���a��|�#xc9����������?`&-%��������;�-����&���!�A���?�:�;�8&8�x ��A�|��{� 98y |        �}8�} Cx``+���9I&8A�|H�}`ZyI yk B��U`�>}`ZUk>�X@��+���;�A��B.A��/�A�t@�|A��|�P9>| �y) ��x+���9I&8A�|H��yI 9k&B����x~�x8�H�`/�A�4W� 6������@��89 ��H(|8���@���K��|9=��8U) 6|�})�8!���8�x�&���&������|������!��}�& �A���a��}�& ������}�� ��������N� �
        !           133: ```|�� ��������|}x�����&|�#x|�+x�!�a@�(8!�8`�&�����������|�N� `8�8ap8�K����&x�p/���A���}>�P�A���{� {� 9d��}>�}k�})��HA��|� P9x� |��`y` 9k&+���A��B��}
        !           134: &�}k�B��{� �8P|J|��@�L9i&9@�}iPyk }i�A�&�=`��XA�&�y  9)&+���A��b��}K&�})�B��;���{� +���A��"����.K��I8!�8`&�&�����������|�N� `|iXP<&|c��A���袀�=�&�/�@���8    &9L�X|     XPx }HSx|     �}'KxA��<��A��``x� 8�&+���|��8A�|0��9&B��|� P9x� |��``y` 9k&+���A�}&�}k�B��{� }g�yk |cZ}k�|c��@�<|kPxc |i�``y` 9k&�
1.1       root      135: +���}k�A�}&�9J&B��8�K��H8&|    �K��88&|     �K��l&�```|��&�!��8&+�&8@�&px� `��}$y) }+��A�h}jX�}$HP=J&9)��8
1.1.1.2 ! root      136: &y) x |    �``y` 9k&+��9I&+���}k�9A����}�A����}I�yI B��89 `��a)��|�P|���H@�H89d&`���H|P9`x |     �A��x� 8�&+���A��"��}i&�|��B��8ap8�8�K��%�ap�!|9k��8     }i�|J|��@�Pyk 9K&}kP�yk }i�9@A�X=`��XA�Ly  9)&+���A��b��}K&�})�B��K��Q8&8!�|x�&|�N� 8&|     �K��<8&|     �K���&�|��a������|�#x|�+x�&����8�8���������|x|�3x�!�Q;�p��xK��1�!x�ap8 &+�&@�<9+��9@})�}iXPyk }i�y  9)&+���A��b��}K&�})�B����xd�x��x��xK��A�&x�p�A�;�;�K��U8!�������x�����&�a�����|��������N� &�`|��������������&�!�q��&���&�|dx��&���&��&&��!&��A&�;�p8�&���xHM`/�|}x@�0��x`�~8�;�&8�&K��A`|�P��A���8!&���x�&�����������|�N� &�|��A���a��9 9`�&����<&��������|     ������!�A�����x`y  9)&})�}&�B��;�p;�����?�ib��x�&tc�m,8�Q��x8��pK����a������x��x8�Q8��p�&t{{ K���!�+���A�8@|�.8x +���A�9`}.8x +���A�9`&}&.y) +���A�8@|K.8     x +���A�9`}.8 x +���A�9 &}?&.�b��K��袁��x8�p8��K���K��8!��&�A���a�����|������������N� &�``|��a������|�#x��������x~ |x�&������x{��!�a{���K���`��||x@�d;�H``}>�||x@�H;�&{� {� K��`/�|�9>&�@���/�A�}>�||xA���``;���8!���x�&�a��������|���������N� &�``|�,#��������|�+x�&�A���a�����������!�aA��낁|~�;�;@��x```{� ;�&K���`��/��|`y��xA�@A�<|��9?&{� }?�;�&��K��`/��|`y��x@���``\��H`d�x|ex��xHY`/?/�A�HA�;�K��l``8!�8`�&�A���a�����|������������N� `�/�=A��A��{� /�;{&9 |     �@�t<��@�Hd``;{&B@�9)&})�/�=@���8i&||8!��&�A���a�����|������������N� 8`&||K���9`&}i�K���&�|��A���a��|�#x�&����|�3x��������|~x�����!�a|�+x��K��       |}x��xH�`��P|zx��xH�`C�8`��;Z��;�@�$H�`|��|�;�&K���`{� ��xHe`{� 8&��@}#KxA���8�=|�;�K��`H|���;�&��{� K��`��xH`{� ;�&��@|xA���8`8!��&�A���a�����|������������N� &�|��a������8���������|�+x|~������&8�&;��!�a�b�;�&��xHq```{� ;�&K��`��/��|`y��xA�@};�A�8�       &{� ;�&��;�&��K��}`/��|`y��x@���`H`��x|ex��xHM`/?/�A� A�;�K��p```;���8!���x�&�a��������|���������N� &�``}�&|���������|y|�3x��������|�+x|�#x�&�!���A���a�ؑ��!�Q@�@8!�8`���&���!���A��|��a�����}�� �����������N� `K��A|{yA�&���xH&`��x8�&c�xx� H9`/�@�<8`8!��&���!���A��|��a�����}�� �����������N� ��x��xK�����x��x|{x��xK�����P|x����xK��&`|zyA��.@�@Y�x;�|}�;�&xc ��K��`���y;9&A���H`|�{� K��i`8��/�=@���;�&����xH`��|�;�&K��e`��xH�`|�P{� �8&}#KxA���8�|�K��1`@�H_�x��x```��{� ;�&;�&K��&`|�P����A�������C�xK��=`��@��x��x``{� ;�&8���K��`��A���8`K��H``8!���x��x��x��x�&���!���A��|��a�����}�� �����������K����|���������|y�&����8��|�#x�!���A���a�������!�A@�<8!�|x�&�!���A���a��|���������������N� ``��pK����p��x|~x��xK��y;���|yx��H`|�{� K��i`8��/�@���y�P{�c�xK��`/�|zx@��||x;�```|�;�&xc ��K��`���|;�&A���;�&_�x{� ```����x;�&;�&K��&`|�P{� ��A���;{&C�x��K��=`��x��K��`8!�8|x�&�!���A���a��|���������������N� &�`|ix9`8`� /�M� ``�     &9k&}k�/�@���yc N� ``,%|ix8`M� �I/�A�p�}KSx/�A�T8���x�!A�H�@@�@|��H$``�/�@A� B@@��i&8�&/�@��܈}`XP}c�N� �9`K���,%M� 8���x� x� |ix8�&|����9)&B��N� `,%M� 8���|ixx� 8�&|��`�8�&� 9)&B��N� ```�@@�\|*�@A�P/�M� 9%��8���y) |�*9)&|�*})�9 `|H�|I�9)��B��N� ```/�M� 8���|ixx� 8�&|��`�8�&� 9)&B��N� ```8��+�M� 8c |c�N� ```8��+�M� 8c��|c�N� ```|�|�+x�&�!��|�#x8���|xx�`Ha`8!p�&|�N� &�```|��&�!��|`x�b�������|x�������&��!��A�8��H)`8!p�&|�N� &�`|���������|�+x|~x�&����|�#x8�&@�!�1;�p��xH�`��x|}x�~{� K��i`8!&���x�&�����������|�N� &�`|��"�����|�#x�&����8��|�+x��������T>|x�!�a+�
�I�)8�!p�AxA�X� @@�|�"� �     /�A���c8-�8�c9k&�c� ��8&�=p�+�?9)&�?8!�|x�&����������|�����N� ``�+������x��PK��!���?8!�8&|x�}p�i�&�?������|�9)&�����?����N� ``�cK��T&�```|��a������}Cx|�;x�&����|�3x��������|~x|�+x�!�a|�#x8�
1.1       root      137: 8�HQ`/�9 8&|c�A� `��9)&/�})�@���y  |�|��@�@|P|�/�@�0x �>|  �```���>9)&�>B��8!�8`�&�a��������|���������N� &�``|����p���x9�x9�0�&�&��:&��������:� �����&��|�#x|xx�!���A��; �a�������!���A���a�������������������!��;a&P;Ap:���{1�%/�A�8|P��@�,/�%A���#8�&�a&�8c&�a&��%/�@���8��a&�8!&P|xP�&���p|c����x�&��|��!���A���a�����������������&���!���A���a����������������N� `K�x|�+x8%�;�&|�P|
1.1.1.2 ! root      138: ��/�dA��/�iA��/�uA��/�xA��/�XA��/�pA��/�cA��/�sA��/�%A�/�OA��/�o9k&@���9 o9j&}AR}k�}aZ�*p�+p�/�%@� 9#&��!&�8�&�a&�K���`�&q��:&/�0A�/�.:` ;�qA��</�A�P|�:��&�;�8        ��T>+�)@�D8 ��T>+�       A�}z�;�&{� �+�<&/�@���~&�xK��p```�b�(x�|�}`Z}i�N� X������������������������������������������������������������������������&������������������������X��������X&h������������������������8�8�
        !           139: ~��x�?H=`x ��xK���`�@@�D|c�Pxc!A�8/��!&�|i�A��A��```���!&�9)&�!&�B��;�H(`�!&�|��;�&{� �  �!&�8 &�&&���xK��
`��@A���K��l``}:�~��x��x8�8� 9�)c�xK����!&�c�x��x8����!&�8     &�&&���&�!&�8 &�&&�K��]�<&K��}:�c�x~��x8�&8�
        !           140: 8� �)9K����!&����a&��<&8c&�a&�K���}:��b�z�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK��-c�x~D�x8�K��͍<&K��x}:��b�z�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK���c�x~D�x8�K��}�<&K��(�<&:�/�h@���<&:�&K��`V�88      ��}:�~6��x�)�9A�4�a&��"�z�$})8-��I�!&��a�8 &}r�8�&&�~E�x8�
1.1       root      141: ~g�x9~��xc�xK��9c�x~D�x8�
                    142: K��ٍ<&K���```�<&:�/�l@��hK��````:`0;�rK���`9 dK���``9 iK��|``9 uK��l9 xK��d9 XK��\9 pK��T9 cK��L9 sK��D9 OK��<8&|  �K�� &�,$|ixA�&@+�$�$@�H&`9)&�$�i/� /   ,�
                    143: A���/�
A���A���A���/�@��/�0A��8�
                    144: /�A��8``8��9K��T>UJ>+�    +
1.1.1.2 ! root      145: 9)&9K��|4@�$8��T>+�}@4@�M� 9k��}`4�(L� �$|c)҉i/�|`@���N� `/�@��|/�08�@��p�        &9I&/�x@��h9*&�$�j&K��P```8`N� �     &9I&/�x@��(9*&�$�j&K���8���K�����P�����3���3���4���������;��;���<���>���?��@���AP��E��F���HP��H���H���H���H���I ��I@��Ip��I���I���J��J���KP��K���L@��L���L���O��Op��Q���T@��V��W��W���Y@��Z0��\��]@��^p��a@��c��cP��c���d0��d���e0��e`��e���e���f@��f���h��i��o���px������&�����&��������r�qw�CHxx8�BxPCPU0logCPU1logx`x��B0dHx��D�k�
        !           146: ELF relocation out of bounds!
        !           147: ERROR: Unhandled relocation (A) type %i
        !           148: elf-claim-segmentfree spaceCreating common NVRAM partition
        !           149: common0123456789ABCDEF��������������������������������������FORTH-WORDLIST  ���� LASTWORD �z�~ EVALUATE �~����{0�(�H�`�H�����~8���X�z�z�{{0{H&{`{�({�{��8{�8{0{H8{`{�{�|}X{hBP ��h      SEMICOLON�x&0
        !           150: ��RDEPTH!
���DUP���LITT��&=8{�0BRANCH
        !           151: �{�SWAPP��DROP0��BRANCH
        !           152: ��CLIENTINTERFACE        ��(PRINT-STATUS ��{0�H{�(�h����{�8{0�{`{�0������@{�P{0{H��������{`{�8������@{�{��H��z���QUIT �z�{�X����{H>����P{�P���~8��{0|{��������x{��������Hz��      INTERPRET    �z����H�{0{�P�@��{��h{�� {�����������z��PSAVE-SOURCE ��������(��������`������������z���-1
        !           153: ����������DOTO        ����({0�����(�Hz��      SOURCE-ID
        !           154: 0�p#IB
        !           155: ���&!�@SPAN
        !           156: ��`IB
        !           157: 0{8DOTICK���CATCH        ���������������H�������H��{�z�z�~�RESTORE-SOURCE ��������H���`�H�������(�H�������z���THROW ���{�`����{�����H��{����{���z�� NOOP �z��xBOOT-EXCEPTION-HANDLER ���EMIT ���((FIND)) �{0{�x����8�X����{������x����{��������p���z���(FIND) �� 2DROP �{�{�z��`(REVEAL) �{ OVER���&-X��EXITx�RDEPTH
xz�
        !           158: BREAKPOINT,��0<�8PICK��EPAPR-IMA-SIZE   T�JUMP-CLIENT)�PPRINT-EXCEPTION �{0{H��������{`{�8�����@��{��x{0{H&{`{�{��x�8z��HSPACE �����z�{P0=t��PRINT-STACK ��{�(����� ����z��@OK-STRok��ABORTED-STRAborted��COUNT �{0� {��Hz���TYPE ��`��(���H������������z���
        !           159: ABORT"-STR
        !           160: ���&@���CR        ��&' ���H�H���(��{�z��0&&[ ��@�(z���TERMINAL ��`����p���(�Hz���z��hDEPTH
��&. ����@�z�� REFILL ���H{�8�h�0z����H���x��{`{���x{He�z��PINTERPRET-WORD ���H{�({��������x���{� �@{H���������������z��X>IN
        !           161: ���
        !           162: PARSE-WORD   �������z��xSTATE
        !           163: �|COMPILE-WORD        ���H{�P��{� �������x�0���x���{� �@{H�����������{H�0�0��z��H&?LEAVE ��������0�(����(�H�0z���R>�{�>Rx�XCELLS+ ���z��CELL+ ���z���ACCEPT ��#TIB
        !           164: �&�0CATCHER
        !           165: �z�EXECUTE��h?DUP        �{0{�{0z���DEPTH!
H��STRING, ���H��������z��(DUMBER ��8���X{H&�8�pz���LINEFEED
        !           166: 
        !           167: ��2DUP ��H�Hz���R@���      LINK>NAME    ��(z�� NAME>STRING �� �z��P      STRING=CID��3DROP    �{�{�{�z���FALSE
        !           168: ��2OVER        �������z��pLATEST
        !           169: �{&+$�(DO?LEAVE,�HU<��`EPAPR-MAGIC        (��UNKNOWN-STRUndefined word��HW-EXCEPTION-HANDLER ��0LL-CR ���������z��xBL
        !           170:  ��NOSHOWSTACK        �z���z��SHOW-STACK?
        !           171: 0�.S        ��{0��{�{��xz���@����`�h�������������z��SPACES �z��������������z���CHAR+ ���z��8C@H��BOUNDS ��H��{�z���DO?DO��&I ����8{���z���DOLOOP8�`XOR��x
UNDEFINED-STRundefined word��$FIND ���{0{�0�X{0��{��H��z��DOABORT" �{�{�(���H{H���������{�z��8OFF ��{��Hz�TIB`�(RPICK
��P(U.) ������`z��((.) ���{0����z������(�8z��PEXPECT ��P�`�Hz��SOURCE ����(��z��hTRUE
        !           172: ����������NIP        �{�{�z���$NUMBER �{0�H{� {�{����x��{0���H{H-{`{0{�x��� ���h{0�H{�({�{�{����x����z�z����������H{�8{�{�{�����x{�{�{���z���SKIPWS ����`��{0����� {�p�H�������H���P{�(�����p{��������`{�{�z���PARSE ������������`�������`�����{�0��{0����{�{0���pz���&&\ ������h���H������z���
        !           173: IMMEDIATE?   ���(�@z���COMPILE, ��pz���&LEAVE ������@�0�(����(�H�0z���?COMP ��@��{��x{H�������z�z��0LEAVES
        !           174: ��h
        !           175: HASH-TABLE���CHARS+   ���z���NA+ �� ��z��@NA1+ �����z���KEY? ���ABORT ���z���ERASE �{H��z��SLITERAL ����({0{0�H��{H���������(��z��PLACE ���X� {����`��H{0�H���X� ��������������{�z���1+ �����z���CHARS ���z���ALLOT ������z��DAAR
        !           176: ���8C!l�0+!        �������{��Hz��xCARRET
        !           177: 
��TUCK        �{��Hz���CONTEXT
        !           178: 0����LINK>        ��X��z��8REVEAL ��p���X���(�p�����Hz���3DUP �������������z���&3
        !           179: �pDOLEAVE��&<�� 
        !           180: ROMFS-BASE��@ICBI(���
EXCEPTION-STRException #��        SHOWSTACK    ����z��X.H �����{�������Hz���1- ����`z���CA1+ ����z��(EVEN �����(z��8DODO��XALIGNED ����h�������(z��OR���&ABORT" ��������0z���(FIND-ORDER) ��{0�����`{����8���(������{�(������{��x����{��������@����z�z��@NAME> �� {0�H���h� z�yHEVAL �y`z��`COMP��U#> �{���{0�����`z���<# ���{0�Hz�� U#S ��0{0{�{���������z���#> �����{0�����`z���ABS �{0��{���z��p#S �����p{�{���������z���SIGN ���{�{H-��z�� NOT ��0z��P>NUMBER �{0�H{��x�H�H�����`{��{���{�����������{������h������z����� ���h{���������{�z��HNEGATE �z�{��`z��&> �{��Xz���<= �� �Hz�z�&1
        !           181: &��FINDCHAR        �{�z�����H�����H�H{0��{`{��P{�{`{�0���@�������x���������@{�{��z��P&&( �{H)����z��8
        !           182: 'IMMEDIATE
        !           183: &��AND\��0<>        �z���z���&, ���H����z��&+LOOP ��������0�h�(z��H&] �{H&�@�Hz���&REPEAT �����Pz��x
        !           184: CLEAN-HASH ���CELLS   �� z��CA+ �����z���XA+ �����z���/N* ����z��XA1+ ��H��z��8/N
        !           185: �XKEY        ���BLANK �{H ��z���FILL|�PALIGN �����h�({� z���{���������z���DO+LOOP���U* ��z�� CELL- ����`z��P/C* ���z��pCRASH)(��UNLOOP �����������z��BS
        !           186: ��SEARCH-ORDER
        !           187: �y�HEADER        ��������p�p�Hz����8�z�� LAST ��8�(z��p&2
        !           188: �HUNALIGNED-L!D�h     FDT-START���PMC1@(���.D    �����{��H����Hz��@BASE
        !           189: ��0HEX        ������Hz���/C
        !           190: &��2-        ����`z���XBFLIP ��@��{�����z��&C" ���{H"�������0{0���`��(���H�������������z��PU>= ����Hz�€PAD ��{H&��z�¸MU/MOD �{0���P��{���È��z���U# ������P{�����z��&# �������������z���HOLD ���{0���h��{��H�Xz���INVERT ���z��DIGIT ��H�H{0{HA{HZ��{�{H�`{H0�`{0��z�{��{� ����{�{��z�ňUM* �z��{H@z��Ř����������{�z��@ROT ���{���{�z��pD+ ���ƀ����z���D2/ ����`�8{H?ǐ�p��Ǩz��U> �{���z���      IMMEDIATE    ������({0�H��p{��Xz���CHAR ��{��Hz�ȈASHIFT(Ƞ0<= �z��Pz��@<> �{`�Hz���&LOOP ��������0�h�(z��RESOLVE-LOOP ��(����{�P{0��{���H�`{��H{�����������`�0�(�Hz��P-COMP ���@�p�@��{��x��x�X����ʀ��z�ʈ&WHILE �����{�z��0&AGAIN �����{��0�x�(z���&THEN ������(z��HASH �(LA+ ��h��z��X/X* ��H�z��P&*�̈LA1+ �����z�̸/X
        !           191: �8LCC        �{0{HA{HZ��{�{H ��z���XLFLIPS ��`��@���h̀��͸�H����������z���X, ��͸�H��z��`C, ���X���z��MIN ��� {�{�{�z��CHAR- ���`z��pCELL
        !           192: �P
        !           193: FLUSHCACHE)���&J   ��������8{���{���{���z���BELL
        !           194: x�CURRENT
        !           195: 0y�pUNALIGNED-L@�ΐHEAP-END�ΰMMCR0!(d��U.R        �{�������X{�(�H�`��{�{��@z���DECIMAL ������Hz��XH#10
        !           196: �xD#10
        !           197: 
        !           198: �X2+ �����z�ϠBXJOIN �����������z��0XLSPLIT �{0ϐ�({�ИȘz��pLBFLIP ���{��{���z��8LXJOIN �Иǐ�pz��p&&; �����z��0�`�Xz���U<= ����Hz���OCTAL ��h���Hz���TODIGIT �{0{H        � {�{H'��{H0��z���U/MOD  �z�{�Èz���UM/MOD �{H@z��������������{�{�z��x>>A ���z��&? ����z�ӠUPC �{0{Ha{Hz��{�{H �`z���BETWEEN ������z��PWITHIN ���{0��Ȱ{�����x� {���x��z���*' ���{0�����(��{��8ƀ��z���-ROT �{���{���z���CLEAR �z��z��pM+ �{���{0����{0������{��`z��UD2/ ����`�8{H?ǐ�p���`z�ԸU2/ ���Șz���LSHIFT��P2/ �����z���WORD �������{0�8�X�`��{0���8� ���H�H�X����������{�z�ǀRSHIFT���>= ��X�Hz�հ&?DO ��`�(�������0���(�Hz��0z��H+COMP ��@�����@�p{��x��X�Hʀ��� �z�� COMPILE ����({0���0��z���THERE
        !           199: ��`COMP-BUFFER(��&UNTIL        �����{��0�x�(z�ր&IF ��`��{��0�z��0z��`&BEGIN ��`�z���RESOLVE-DEST ���(�`�0z��RESOLVE-ORIG ���H�(�`{��Hz��      HASH-SIZE
        !           200: ��WA+        ��@��z��0/L* ����z���WA1+ ��p��z��`/L
        !           201: ׀XWFLIPS        ��`��@���hϰ��͸�H����������z��X@8��XLFLIP ��@{���z��XX!\�L, �������z��xMAX ���X{�{�{�z��X
        !           202: START-RTAS),�pUNALIGNED-W!�ؐ
        !           203: HEAP-STARTxذDEC!*��.R   �{�������X{�(�H�`��{�{��@z��&8
        !           204: � 
        !           205: H#FFFFFFFF
        !           206: �����@XWFLIP        �٠{��{��Pz���BLJOIN �� ��� ����z��HLWSPLIT �{0�0�({���Șz��pH#20
        !           207:  �(LBSPLIT        ��H���`���`z��2SWAP �������z�ڠLWFLIP ��H{���z���:NONAME ����� ��0�z��(0>= �z�Ȱz��XFM/MOD �{0���������h�H�@���({�0�h{�����{��x��{�z��/' ���{0�����(���H�8�`�p{�0�����p���8�`��z�ܠ>> �Șz���PACK �{0��{�����z��D- ����z�İD2* ����H���`������z���DABS �{0��{���z��H2* ���ǐz��`POCKET �ݠ�x��{H&����x������{0{H{`{�{�z��x�Hz��P&DO ��`�(�������0z��(�Hz�ݨ&.( �{H)���@z��0CISTACK˨&AHEAD ��`��{��0�z��0z��H&ENDOF ���������z��@ZCOUNT���/W* ��p�z��/W
        !           208: �XXBFLIPS        ��`��@���h�h��͸�H����������z���L!��W, ����p��z��CALL-C)hͨUNALIGNED-W@��hPAFLOF-STARTP�HDEC@*8�hU. ����@�z��&4
        !           209: ��H#FFFF
        !           210: ����WXJOIN        �����������z�ШXWSPLIT ��@���H���Hz��WLJOIN ���ǐ�pz��BWJOIN ��hǐ�pz��WBSPLIT �{0��({��hȘz���WBFLIP ��`{�� z��&: ���H�� ��0�z��00> �z�� z��xSM/REM ��H����Ԁ�8��È����{�������{� ��{���{�z��XM* ��������������h����{���z�ǘ<< �ǐz���MOVE��0DNEGATE ��0����{0�H��{��`z��`?PICK���WHICHPOCKET
        !           211: ��PPOCKETS���&."        ��@��{�(�(���@�0�x{H"���@z���CIREGS���&OF ����������H�0��{`�0����{��0��z��@&ELSE �����{��0�z��0{���z���RMOVE��LBFLIPS ��`��@���������������������z���L@��W!��HWRITE-LOG-BYTE-ENTRY ��h��z�� HSPRG1!(�S. ��z�ЈH#FF
        !           212: �وXBSPLIT        ��@��������z��@*/ ��P��z��PS>D �{0��z��2R@ ������8�H������{�z��&Z" ��(���z�{��X{�z���&S" ��@��{�(������0�x{H"��{0����{0��{�������z�݈EREGS���&ENDCASE �����{��0��{�(�h{��P{����������(z��LWFLIPS ��`��@�����H���������������z��HW@��HSPRG1@(<�*/MOD ����(���z���2R> �����������{�z���&CASE ��`z�z�� WBFLIPS ��`��@���ڰ����p����������z��pHSPRG0!'��MOD ���{�z��2>R �������{�����z���2! �{0���H���(�Hz��HSPRG0@'���&/ �����z��@/MOD ����@���z��0-ROLL �{0��{�H������{������`{�����������{�0��{����`{���������z���2@ �{0�(��{���z��XSPRG3!'t�pROLL �{0��{�0�������`{�����������{�0������`{���������z���<W@ ��{0{H�Ȱ{�{H&�`z���SPRG3@'���2ROT �����������z��ON ���{��Hz��SPRG2!'$�(SPRG2@'L�@SPRG1!&��XSPRG1@&��pSPRG0!&��SPRG0@&��HIOR!&0�HIOR@&\��DABR!%���DABR@&�TBU@%��TBL@%��0PIR@%d�HPVR@%<�`SDR1!,��xSDR1@%�MSR!,��MSR@,���HID5@,|��HID5!,P��HID4@,(�HID4!+�� HID1@+��8HID1!+��PHID0@+p�hHID0!+,�RX!+�RX@*��RL!*���RL@*���RW!*`��RW@-��RB!-l�(RB@-H�Hget-mbx-base-$�hget-flash-size-��get-flash-base-���get-nvram-size.��get-nvram-base$���internal-set-env#��internal-del-env"��@internal-add-env!��hinternal-get-env ��delete-nvram-partition$��erase-nvram-partition#`��increase-nvram-partition��new-nvram-partition\�@get-named-nvram-partition��hget-nvram-partition4�
        !           213: wipe-nvram ��nvram-debug ���internal-reset-nvram8��nvram-x!�nvram-x@<�0nvram-l!��Pnvram-l@�pnvram-w!��nvram-w@��nvram-c!d��nvram-c@���ELF-LOAD-FILE-TO-ADDRl�
ELF-LOAD-FILE �@bootmsg-checklevel��hbootmsg-nvupdate�bootmsg-setlevel��bootmsg-debugcp`��
bootmsg-error(�bootmsg-warning�� 
        !           214: bootmsg-cp��@hv-send-crq��`hv-free-crqP�
        !           215: hv-reg-crq��
        !           216: hv-haschart��
        !           217: hv-getcharH��
        !           218: hv-putchar�H&o#   ��������y`�����Hz��&h# ����������y`�����Hz��&d# ���������Hy`�����Hz��`&RECURSE ��p���0�0z���&      RECURSIVE    ��`z���BODY> ������`z��>BODY �������z��8BEHAVIOR ��(��z���&TO ���@��{�(����0�0�x�(�Hz��XFIND �{0��H{�H��{���{���{����x��xz���&['] �������0�0z���&[CHAR] ��`��z���&POSTPONE ���H�H���(�����H{�0�����0�0���0�0z��&LITERAL ���{H�0�0z���&      [COMPILE]    ���0z��hFIELD ���H��
        !           219: X�0�H�p���`z���
        !           220: END-STRUCT   �{�z���STRUCT �z�z�� ALIAS ���H�� ��0��0�`z���DEFER ���H�� ��0����0�`z���BUFFER: ���H��
        !           221: ��0���`z��PVARIABLE        ���H��
        !           222: ��0z��0�`z���VALUE        ���H��
        !           223: 0�0�0�`z��CONSTANT        ���H��
        !           224: �0�0�`z��@&DOES>        ����X�0z���DODOES> ����(�p���0�(�Hz���CREATE ����z��@$CREATE ��H�� ��0�����(�0�`z��xINCLUDE ����z���INCLUDED ���������`������8{����8�`�8{������{���{0��y`�������������X�����z���
        !           225: WRITE-FILE   �}HMAP-FILE ���
        !           226: UNMAP-FILE   ����NICEINIT ���{����������������({H��{Hd#�H�`��y`����z��8HERE
        !           227: 0�P��CLIENT-ENTRY-POINT
        !           228: q��x.WRITE-LOG-BYTE-ENTRY
        !           229: qx{�ROMFS-LOOKUP-ENTRY
        !           230: 6�hex
1.1       root      231: ' ll-cr to cr
                    232: get-flash-base VALUE flash-addr
                    233: get-nvram-base CONSTANT nvram-base
                    234: get-nvram-size CONSTANT nvram-size
                    235: ff8f9000 CONSTANT sec-nvram-base  \ save area from phype.... not really known
                    236: 2000 CONSTANT sec-nvram-size
                    237: nvram-base 20000 + CONSTANT nvram-log-be1-base
                    238: : hvterm-emit  hv-putchar ;
                    239: : hvterm-key?  hv-haschar ;
                    240: : hvterm-key   BEGIN hvterm-key? UNTIL hv-getchar ;
                    241: ' hvterm-emit to emit
                    242: ' hvterm-key  to key
                    243: ' hvterm-key? to key?
                    244: : serial-emit hvterm-emit ;
                    245: : serial-key? hvterm-key? ;
                    246: : serial-key  hvterm-key  ;
                    247: clean-hash
                    248: : hash-find ( str len head -- 0 | link )
                    249: >r 2dup 2dup hash                  ( str len str len hash          R: head )
                    250: dup >r @ dup                       ( str len str len *hash *hash   R: head hash )
                    251: IF                                 ( str len str len *hash         R: head hash )
                    252: link>name name>string string=ci ( str len true|false            R: head hash )
                    253: dup 0=
                    254: IF
                    255: THEN
                    256: ELSE
                    257: nip nip                         ( str len 0                     R: head hash )
                    258: THEN
                    259: IF                                 \ hash found
                    260: 2drop r> @ r> drop              (  *hash                        R: )
                    261: exit
                    262: THEN                               \ hash not found
                    263: r> r> swap >r ((find))             ( str len head                  R: hash=0 )
                    264: dup
                    265: IF
                    266: dup r> !                        ( link                          R: )
                    267: ELSE
                    268: r> drop                         ( 0                             R: )
                    269: THEN
                    270: ;
                    271: : hash-reveal  hash off ;
                    272: ' hash-reveal to (reveal)
                    273: ' hash-find to (find)
                    274: : >name ( xt -- nfa ) \ note: still has the "immediate" field!
                    275: BEGIN char- dup c@ UNTIL ( @lastchar )
                    276: dup dup aligned - cell+ char- ( @lastchar lenmodcell )
                    277: dup >r -
                    278: BEGIN dup c@ r@ <> WHILE
                    279: cell- r> cell+ >r
                    280: REPEAT
                    281: r> drop char-
                    282: ;
                    283: VARIABLE mask -1 mask !
                    284: VARIABLE huge-tftp-load 1 huge-tftp-load !
                    285: : sms-get-tftp-blocksize 598 ;
                    286: : default-hw-exception s" Exception #" type . ;
                    287: ' default-hw-exception to hw-exception-handler
                    288: : diagnostic-mode? false ;     \ 2B DOTICK'D later in envvar.fs
                    289: : memory-test-suite ( addr len -- fail? )
                    290: diagnostic-mode? IF
                    291: ." Memory test mask value: " mask @ . cr
                    292: ." No memory test suite currently implemented! " cr
                    293: THEN
                    294: false
                    295: ;
                    296: : 0.r  0 swap <# 0 ?DO # LOOP #> type ;
                    297: : cnt-bits  ( 64-bit-value -- #bits=1 )
                    298: dup IF
                    299: 41 1 DO dup 1- and dup 0= IF drop i LEAVE THEN LOOP
                    300: THEN
                    301: ;
                    302: : bcd-to-bin  ( bcd -- bin )
                    303: dup f and swap 4 rshift a * +
                    304: ;
                    305: : 2log ( n -- lb{n} )
                    306: 8 cells 0 DO 1 rshift dup 0= IF drop i LEAVE THEN LOOP
                    307: ;
                    308: : log2  ( n -- log2-n )
                    309: 1- 2log 1+
                    310: ;
                    311: : $find ( str len -- xt true | str len false )
                    312: 2dup $find
                    313: IF
                    314: drop nip nip TRUE
                    315: ELSE
                    316: FALSE
                    317: THEN
                    318: ;
                    319: CREATE $catpad 100 allot
                    320: : $cat ( str1 len1 str2 len2 -- str3 len3 )
                    321: >r >r dup >r $catpad swap move
                    322: r> dup $catpad + r> swap r@ move
                    323: r> + $catpad swap ;
                    324: : $cat-comma ( str2 len2 str1 len1 -- "str1, str2" len1+len2+2 )
                    325: 2dup + s" , " rot swap move 2+ 2swap $cat
                    326: ;
                    327: : $cat-space ( str2 len2 str1 len1 -- "str1 str2" len1+len2+1 )
                    328: 2dup + bl swap c! 1+ 2swap $cat
                    329: ;
                    330: : $cathex ( str len val -- str len' )
                    331: (u.) $cat
                    332: ;
1.1.1.2 ! root      333: : 2CONSTANT    CREATE , , DOES> [ here ] 2@ ;
        !           334: CONSTANT <2constant>
1.1       root      335: : $2CONSTANT  $CREATE , , DOES> 2@ ;
                    336: : 2VARIABLE    CREATE 0 , 0 ,  DOES> ;
                    337: : (is-user-word) ( name-str name-len xt -- ) -rot $CREATE , DOES> @ execute ;
                    338: : zplace ( str len buf -- )  2dup + 0 swap c! swap move ;
                    339: : rzplace ( str len buf -- )  2dup + 0 swap rb! swap rmove ;
                    340: : strdup ( str len -- dupstr len ) here over allot swap 2dup 2>r move 2r> ;
                    341: : str= ( str1 len1 str2 len2 -- equal? )
                    342: rot over <> IF 3drop false ELSE comp 0= THEN ;
                    343: : #aligned ( adr alignment -- adr' ) negate swap negate and negate ;
                    344: : #join  ( lo hi #bits -- x )  lshift or ;
                    345: : #split ( x #bits -- lo hi )  2dup rshift dup >r swap lshift xor r> ;
                    346: : /string ( str len u -- str' len' )
                    347: >r swap r@ chars + swap r> - ;
                    348: : skip ( str len c -- str' len' )
                    349: >r BEGIN dup WHILE over c@ r@ = WHILE 1 /string REPEAT THEN r> drop ;
                    350: : scan ( str len c -- str' len' )
                    351: >r BEGIN dup WHILE over c@ r@ <> WHILE 1 /string REPEAT THEN r> drop ;
                    352: : split ( str len char -- left len right len )
                    353: >r 2dup r> findchar IF >r over r@ 2swap r> 1+ /string ELSE 0 0 THEN ;
                    354: : rfindchar ( str len char -- offs true | false )
                    355: swap 1 - 0 swap do
                    356: over i + c@
                    357: over dup bl = if <= else = then if
                    358: 2drop i dup dup leave
                    359: then
                    360: -1 +loop =
                    361: ;
                    362: : rsplit ( str len char -- left len right len )
                    363: >r 2dup r> rfindchar IF >r over r@ 2swap r> 1+ /string ELSE 0 0 THEN ;
                    364: : left-parse-string ( str len char -- R-str R-len L-str L-len )
                    365: split 2swap ;
                    366: : replace-char ( str len chout chin -- )
                    367: >r -rot BEGIN 2dup 4 pick findchar WHILE tuck - -rot + r@ over c! swap REPEAT
                    368: r> 2drop 2drop
                    369: ;
                    370: : \-to-/ ( str len -- str' len ) strdup 2dup [char] \ [char] / replace-char ;
                    371: : //  dup >r 1- + r> / ; \ division, round up
                    372: : c@+ ( adr -- c adr' )  dup c@ swap char+ ;
                    373: : 2c@ ( adr -- c1 c2 )  c@+ c@ ;
                    374: : 4c@ ( adr -- c1 c2 c3 c4 )  c@+ c@+ c@+ c@ ;
                    375: : 8c@ ( adr -- c1 c2 c3 c4 c5 c6 c7 c8 )  c@+ c@+ c@+ c@+ c@+ c@+ c@+ c@ ;
                    376: : 4dup  ( n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2 n3 n4 )  2over 2over ;
                    377: : 4drop  ( n1 n2 n3 n4 -- )  2drop 2drop ;
                    378: : 6dup  ( 1 2 3 4 5 6 -- 1 2 3 4 5 6 1 2 3 4 5 6 )
                    379: 5 pick 5 pick 5 pick 5 pick 5 pick 5 pick
                    380: ;
                    381: : signed ( n1 -- n2 ) dup 80000000 and IF FFFFFFFF00000000 or THEN ;
                    382: : <l@ ( addr -- x ) l@ signed ;
                    383: : -leading  BEGIN dup WHILE over c@ bl <= WHILE 1 /string REPEAT THEN ;
                    384: : (parse-line)  skipws 0 parse ;
                    385: : hex-byte ( char0 char1 -- value true|false )
                    386: 10 digit IF
                    387: swap 10 digit IF
                    388: 4 lshift or true EXIT
                    389: ELSE
                    390: 2drop 0
                    391: THEN
                    392: ELSE
                    393: drop
                    394: THEN
                    395: false EXIT
                    396: ;
                    397: : parse-hexstring ( dst-adr -- dst-adr' )
                    398: [char] ) parse cr                 ( dst-adr str len )
                    399: bounds ?DO                        ( dst-adr )
                    400: i c@ i 1+ c@ hex-byte IF       ( dst-adr hex-byte )
                    401: >r dup r> swap c! 1+ 2      ( dst-adr+1 2 )
                    402: ELSE
                    403: drop 1                      ( dst-adr 1 )
                    404: THEN
                    405: +LOOP
                    406: ;
                    407: : add-specialchar ( dst-adr special -- dst-adr' )
                    408: over c! 1+                        ( dst-adr' )
                    409: 1 >in +!                          \ advance input-index
                    410: ;
                    411: : parse-" ( dst-adr -- dst-adr' )
                    412: [char] " parse dup 3 pick + >r    ( dst-adr str len R: dst-adr' )
                    413: >r swap r> move r>                ( dst-adr' )
                    414: ;
                    415: : (") ( dst-adr -- dst-adr' )
                    416: begin                             ( dst-adr )
                    417: parse-"                        ( dst-adr' )
                    418: >in @ dup span @ >= IF         ( dst-adr' >in-@ )
                    419: drop
                    420: EXIT
                    421: THEN
                    422: ib + c@
                    423: CASE
                    424: [char] ( OF parse-hexstring ENDOF
                    425: [char] " OF [char] " add-specialchar ENDOF
                    426: dup      OF EXIT ENDOF
                    427: ENDCASE
                    428: again
                    429: ;
                    430: CREATE "pad 100 allot
                    431: : " ( [text<">< >] -- text-str text-len )
                    432: state @ IF                        \ compile sliteral, pstr into dict
                    433: "pad dup (") over -            ( str len )
                    434: ['] sliteral compile, dup c,   ( str len )
                    435: bounds ?DO i c@ c, LOOP
                    436: align ['] count compile,
                    437: ELSE
                    438: pocket dup (") over -          \ Interpretation, put string
                    439: THEN                              \ in temp buffer
                    440: ; immediate
                    441: : $forget ( str len -- )
                    442: 2dup last @            ( str len str len last-bc )
                    443: BEGIN
                    444: dup >r             ( str len str len last-bc R: last-bc )
                    445: cell+ char+ count  ( str len str len found-str found-len R: last-bc )
                    446: string=ci IF       ( str len R: last-bc )
                    447: r> @ last ! 2drop clean-hash EXIT ( -- )
                    448: THEN
                    449: 2dup r> @ dup 0=   ( str len str len next-bc next-bc )
                    450: UNTIL
                    451: drop 2drop 2drop            \ clean hash table
                    452: ;
                    453: : forget ( "old-name<>" -- )
                    454: parse-word $forget
                    455: ;
                    456: : linked ( var -- )  here over @ , swap ! ;
                    457: HEX
                    458: VARIABLE wordlists  forth-wordlist wordlists !
                    459: : wordlist ( -- wid )  here wordlists linked 0 , ;
                    460: 10 CONSTANT max-in-search-order        \ should define elsewhere
                    461: : also ( -- )  clean-hash  context dup cell+ dup to context  >r @ r> ! ;
                    462: : previous ( -- )  clean-hash  context cell- to context ;
                    463: : only ( -- )  clean-hash  search-order to context  ( minimal-wordlist search-order ! ) ;
                    464: : seal ( -- )  clean-hash  context @  search-order dup to context  ! ;
                    465: : get-order ( -- wid_n .. wid_1 n )
                    466: context >r search-order BEGIN dup r@ u<= WHILE
                    467: dup @ swap cell+ REPEAT r> drop
                    468: search-order - cell / ;
                    469: : set-order ( wid_n .. wid_1 n -- )    \ XXX: special cases for 0, -1
                    470: clean-hash  1- cells search-order + dup to context
                    471: BEGIN dup search-order u>= WHILE
                    472: dup >r ! r> cell- REPEAT drop ;
                    473: : get-current ( -- wid )  current ;
                    474: : set-current ( wid -- )  to current ;
                    475: : definitions ( -- )  context @ set-current ;
                    476: : VOCABULARY ( C: "name" -- ) ( -- )  CREATE wordlist drop  DOES> clean-hash  context ! ;
                    477: : FORTH ( -- )  clean-hash  forth-wordlist context ! ;
                    478: : .voc ( wid -- ) \ display name for wid \ needs work ( body> or something like that )
                    479: dup cell- @ ['] vocabulary ['] forth within IF
                    480: 2 cells - >name name>string type ELSE u. THEN  space ;
                    481: : vocs ( -- ) \ display all wordlist names
                    482: cr wordlists BEGIN @ dup WHILE dup .voc REPEAT drop ;
                    483: : order ( -- )
                    484: cr ." context:  " get-order 0 ?DO .voc LOOP
                    485: cr ." current:  " get-current .voc ;
                    486: : voc-find ( wid -- 0 | link )
                    487: clean-hash  cell+ @ (find)  clean-hash ;
                    488: : (function) ;
                    489: defer (defer)
                    490: 0 value (value)
                    491: 0 constant (constant)
                    492: variable (variable)
                    493: create (create)
                    494: alias (alias) (function)
                    495: cell buffer: (buffer:)
                    496: ' (function) @        \ ( <colon> )
                    497: ' (function) cell + @ \ ( ... <semicolon> )
                    498: ' (defer) @           \ ( ... <defer> )
                    499: ' (value) @           \ ( ... <value> )
                    500: ' (constant) @       \ ( ... <constant> )
                    501: ' (variable) @        \ ( ... <variable> )
                    502: ' (create) @          \ ( ... <create> )
                    503: ' (alias) @           \ ( ... <alias> )
                    504: ' (buffer:) @         \ ( ... <buffer:> )
                    505: forget (function)
                    506: constant <buffer:>
                    507: constant <alias>
                    508: constant <create>
                    509: constant <variable>
                    510: constant <constant>
                    511: constant <value>
                    512: constant <defer>
                    513: constant <semicolon>
                    514: constant <colon>
                    515: ' lit      constant <lit>
                    516: ' sliteral constant <sliteral>
                    517: ' 0branch  constant <0branch>
                    518: ' branch   constant <branch>
                    519: ' doloop   constant <doloop>
                    520: ' dotick   constant <dotick>
                    521: ' doto     constant <doto>
                    522: ' do?do    constant <do?do>
                    523: ' do+loop  constant <do+loop>
                    524: ' do       constant <do>
                    525: ' exit     constant <exit>
                    526: ' doleave  constant <doleave>
                    527: ' do?leave  constant <do?leave>
                    528: 500 CONSTANT AVAILABLE-SIZE
                    529: 4000 CONSTANT MIN-RAM-RESERVE \ prevent from using first pages
1.1.1.2 ! root      530: : MIN-RAM-SIZE         \ Initially available memory size
        !           531: epapr-ima-size IF
        !           532: epapr-ima-size
        !           533: ELSE
        !           534: 10000000         \ assumed minimal memory size
        !           535: THEN
        !           536: ;
1.1       root      537: STRUCT
                    538: cell field available>address
                    539: cell field available>size
                    540: CONSTANT /available
                    541: CREATE available AVAILABLE-SIZE /available * allot available AVAILABLE-SIZE /available * erase
                    542: VARIABLE mem-pre-released 0 mem-pre-released !
                    543: : available>size@      available>size @ ;
                    544: : available>address@   available>address @ ;
                    545: : available>size!      available>size ! ;
                    546: : available>address!   available>address ! ;
                    547: : available! ( addr size available-ptr -- )
                    548: dup -rot available>size! available>address!
                    549: ;
                    550: : available@ ( available-ptr -- addr size )
                    551: dup available>address@ swap available>size@
                    552: ;
                    553: : (?available-segment<) ( start1 end1 start2 end2 -- true/false ) drop < nip ;
                    554: : (?available-segment>) ( start1 end1 start2 end2 -- true/false ) -rot 2drop > ;
                    555: : (?available-segment-#) ( start1 end1 start2 end2 -- true/false )
                    556: 2dup 5 roll -rot                ( e1 s2 e2 s1 s2 e2 )
                    557: between >r between r> and not
                    558: ;
                    559: : (find-available) ( addr addr+size-1 a-ptr a-size -- a-ptr' found )
                    560: ?dup 0= IF -rot 2drop false EXIT THEN  \ Not Found
                    561: 2dup 2/ dup >r /available * +
                    562: dup available>size@ 0= IF 2drop r> RECURSE EXIT THEN
                    563: dup >r available@
                    564: over + 1- 2>r 2swap
                    565: 2dup 2r@ (?available-segment>) IF
                    566: 2swap 2r> 2drop r>
                    567: /available + -rot r> - 1- nip RECURSE EXIT     \ Look Right
                    568: THEN
                    569: 2dup 2r@ (?available-segment<) IF
                    570: 2swap 2r> 2drop r>
                    571: 2drop r> RECURSE EXIT  \ Look Left
                    572: THEN
                    573: 2dup 2r@ (?available-segment-#) IF     \ Conflict - segments overlap
                    574: 2r> 2r> 3drop 3drop 2drop
                    575: 1212 throw
                    576: THEN
                    577: 2r> 3drop 3drop r> r> drop     ( a-ptr' -- )
                    578: dup available>size@ 0<>                ( a-ptr' found -- )
                    579: ;
                    580: : (find-available) ( addr size -- seg-ptr found )
                    581: over + 1- available AVAILABLE-SIZE ['] (find-available) catch IF
                    582: 2drop 2drop 0 false
                    583: THEN
                    584: ;
                    585: : dump-available ( available-ptr -- )
                    586: cr
                    587: dup available - /available / AVAILABLE-SIZE swap - 0 ?DO
                    588: dup available@ ?dup 0= IF
                    589: 2drop UNLOOP EXIT
                    590: THEN
                    591: swap . . cr
                    592: /available +
                    593: LOOP
                    594: dup
                    595: ;
                    596: : .available available dump-available ;
                    597: : (drop-available) ( available-ptr -- )
                    598: dup available - /available /   \ current element index
                    599: AVAILABLE-SIZE swap -          \ # of remaining elements
                    600: ( first nelements ) 1- 0 ?DO
                    601: dup /available + dup available@
                    602: ( current next next>address next>size ) ?dup 0= IF
                    603: 2drop LEAVE \ NULL element - goto last copy
                    604: THEN
                    605: 3 roll available!              ( next )
                    606: LOOP
                    607: 0 0 rot available!
                    608: ;
                    609: : (stick-to-previous-available) ( addr size available-ptr -- naddr nsize nptr success )
                    610: dup available = IF
                    611: false EXIT             \ This was the first available segment
                    612: THEN
                    613: dup /available - dup available@
                    614: + 4 pick = IF
                    615: nip    \ Drop available-ptr since we are going to previous one
                    616: rot drop       \ Drop start addr, we take the previous one
                    617: dup available@ 3 roll + rot true
                    618: ELSE
                    619: drop false
                    620: THEN
                    621: ;
                    622: : (insert-available) ( available-ptr -- available-ptr )
                    623: dup                            \ current element
                    624: dup available - /available /   \ current element index
                    625: AVAILABLE-SIZE swap -          \ # of remaining elements
                    626: dup 0<= 3 pick available>size@ 0= or IF
                    627: drop drop EXIT
                    628: THEN
                    629: over available@ rot
                    630: ( first        first/=current/ first>address first>size nelements ) 1- 0 ?DO
                    631: 2>r
                    632: /available + dup available@
                    633: 2r> 4 pick available! dup 0= IF
                    634: rot /available + available!
                    635: UNLOOP EXIT
                    636: THEN
                    637: LOOP
                    638: ( first next/=last/ last[0]>address last[0]>size ) ?dup 0<> IF
                    639: cr ." release error: available map overflow"
                    640: cr ." Dumping available property"
                    641: .available
                    642: cr ." No space for one before last entry:" cr swap . .
                    643: cr ." Dying ..." cr 123 throw
                    644: THEN
                    645: 2drop
                    646: ;
                    647: : insert-available ( addr size available-ptr -- addr size available-ptr )
                    648: dup available>address@ 0<> IF
                    649: dup available>address@ rot dup -rot -
                    650: 3 pick = IF    \ if (available>address@ - size == addr)
                    651: over available>size@ + swap
                    652: (stick-to-previous-available) IF
                    653: dup /available + (drop-available)
                    654: THEN
                    655: ELSE
                    656: swap (stick-to-previous-available)
                    657: not IF (insert-available) THEN
                    658: THEN
                    659: ELSE
                    660: (stick-to-previous-available) drop
                    661: THEN
                    662: ;
                    663: defer release
                    664: : drop-available ( addr size available-ptr -- addr )
                    665: dup >r available@
                    666: over 4 pick swap - ?dup 0<> IF
                    667: dup 3 roll swap r> available! -
                    668: over - ?dup 0= IF
                    669: drop
                    670: ELSE
                    671: swap 2 pick + swap release
                    672: THEN
                    673: ELSE
                    674: nip ( req_addr req_size segment_size )
                    675: over - ?dup 0= IF
                    676: drop r> (drop-available)
                    677: ELSE
                    678: -rot over + rot r> available!
                    679: THEN
                    680: THEN
                    681: ;
                    682: : pwr2roundup ( value -- pwr2value )
                    683: dup CASE
                    684: 0 OF EXIT ENDOF
                    685: 1 OF EXIT ENDOF
                    686: ENDCASE
                    687: dup 1 DO drop i dup +LOOP
                    688: dup +
                    689: ;
                    690: : (claim-best-fit) ( len align -- len base )
                    691: pwr2roundup 1- -1 -1
                    692: available AVAILABLE-SIZE /available * + available DO
                    693: i              \ Must be saved now, before we use Return stack
                    694: -rot >r >r swap >r
                    695: available@ ?dup 0= IF drop r> r> r> LEAVE THEN         \ EOL
                    696: 2 pick - dup 0< IF
                    697: 2drop                  \ Can't Fit: Too Small
                    698: ELSE
                    699: dup 2 pick r@ and - 0< IF
                    700: 2drop          \ Can't Fit When Aligned
                    701: ELSE
                    702: r> -rot dup r@ U< IF
                    703: 2r> 2drop
                    704: swap 2 pick + 2 pick invert and >r >r >r
                    705: ELSE
                    706: 2drop >r
                    707: THEN
                    708: THEN
                    709: THEN
                    710: r> r> r>
                    711: /available +LOOP
                    712: -rot 2drop     ( len best-fit-base/or -1 if none found/ )
                    713: ;
                    714: : (adjust-release0) ( 0 size -- addr' size' )
                    715: 2dup MIN-RAM-SIZE dup 3 roll + -rot -
                    716: dup 0< IF 2drop ELSE
                    717: 2swap 2drop 0 mem-pre-released !
                    718: THEN
                    719: ;
                    720: : claim ( [ addr ] len align -- base )
                    721: ?dup 0<> IF
                    722: (claim-best-fit) dup -1 = IF
                    723: 2drop cr ." claim error : aligned allocation failed" cr
                    724: ." available:" cr .available
                    725: 321 throw EXIT
                    726: THEN
                    727: swap
                    728: THEN
                    729: 2dup (find-available) not IF
                    730: drop
                    731: 2drop
                    732: 321 throw EXIT
                    733: THEN
                    734: ( req_addr req_size available-ptr ) drop-available
                    735: ;
                    736: : .release ( addr len -- )
                    737: over 0= mem-pre-released @ and IF (adjust-release0) THEN
                    738: 2dup (find-available) IF
                    739: drop swap
                    740: cr ." release error: region " . ." , " . ." already released" cr
                    741: ELSE
                    742: ?dup 0= IF
                    743: swap 
                    744: cr ." release error: Bad/conflicting region " . ." , " .
                    745: ." or available list full " cr
                    746: ELSE
                    747: ( addr size available-ptr ) insert-available
                    748: ( addr size available-ptr ) available!
                    749: THEN
                    750: THEN
                    751: ;
                    752: ' .release to release
                    753: 0 MIN-RAM-SIZE release 1 mem-pre-released !
                    754: 0 MIN-RAM-RESERVE 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
1.1.1.2 ! root      755: paflof-start ffff not and 1f00000 0 ' claim CATCH IF
        !           756: ." claim failed!" cr 2drop
        !           757: THEN drop
1.1       root      758: heap-end heap-start - log2 1+ CONSTANT (max-heads#)
                    759: CREATE heads (max-heads#) cells allot
                    760: heads (max-heads#) cells erase
                    761: : size>head  ( size -- headptr )  log2 3 max cells heads + ;
                    762: : alloc-mem  ( len -- a-addr )
                    763: dup 0= IF EXIT THEN
                    764: 1 over log2 3 max                   ( len 1 log_len )
                    765: dup (max-heads#) >= IF cr ." Out of internal memory." cr 3drop 0 EXIT THEN
                    766: lshift >r                           ( len  R: 1<<log_len )
                    767: size>head dup @ IF
                    768: dup @ dup >r @ swap ! r> r> drop EXIT
                    769: THEN                                ( headptr  R: 1<<log_len)
                    770: r@ 2* recurse dup                   ( headptr a-addr2 a-addr2  R: 1<<log_len)
                    771: dup 0= IF r> 2drop 2drop 0 EXIT THEN
                    772: r> + >r 0 over ! swap ! r>
                    773: ;
                    774: : free-mem  ( a-addr len -- )
                    775: dup 0= IF 2drop EXIT THEN size>head 2dup @ swap ! !
                    776: ;
                    777: : #links  ( a -- n )
                    778: @ 0 BEGIN over WHILE 1+ swap @ swap REPEAT nip
                    779: ;
                    780: : .free  ( -- )
                    781: 0 (max-heads#) 0 DO
                    782: heads i cells + #links dup IF
                    783: cr dup . ." * " 1 i lshift dup . ." = " * dup .
                    784: THEN
                    785: +
                    786: LOOP
                    787: cr ." Total " .
                    788: ;
                    789: heap-start heap-end heap-start - free-mem
                    790: VARIABLE device-tree
                    791: VARIABLE current-node
                    792: : get-node  current-node @ dup 0= ABORT" No active device tree node" ;
                    793: STRUCT
                    794: cell FIELD node>peer
                    795: cell FIELD node>parent
                    796: cell FIELD node>child
                    797: cell FIELD node>properties
                    798: cell FIELD node>words
                    799: cell FIELD node>instance
                    800: cell FIELD node>instance-size
                    801: cell FIELD node>space?
                    802: cell FIELD node>space
                    803: cell FIELD node>addr1
                    804: cell FIELD node>addr2
                    805: cell FIELD node>addr3
1.1.1.2 ! root      806: cell FIELD node>extending?
1.1       root      807: END-STRUCT
                    808: : find-method ( str len phandle -- false | xt true )
                    809: node>words @ voc-find dup IF link> true THEN ;
                    810: 0 VALUE my-self
                    811: : >instance
                    812: my-self 0= ABORT" No instance!"
                    813: my-self +
                    814: ;
                    815: : (create-instance-var) ( initial-value -- )
                    816: get-node ?dup 0= ABORT" Instance word outside device context!"
1.1.1.2 ! root      817: dup node>extending? @ 0=
        !           818: my-self 0<> AND ABORT" INSTANCE word can not be used while node is opened!"
1.1       root      819: dup node>instance @      ( iv phandle tmp-ihandle )
                    820: swap node>instance-size dup @     ( iv tmp-ih *instance-size instance-size )
                    821: dup ,                             \ compile current instance ptr
                    822: swap 1 cells swap +!              ( iv tmp-ih instance-size )
                    823: + !
                    824: ;
                    825: : create-instance-var ( "name" initial-value -- )
                    826: CREATE (create-instance-var) PREVIOUS ;
                    827: VOCABULARY instance-words  ALSO instance-words DEFINITIONS
1.1.1.2 ! root      828: : VARIABLE  0 create-instance-var DOES> [ here ] @ >instance ;
        !           829: : VALUE       create-instance-var DOES> [ here ] @ >instance @ ;
        !           830: : DEFER     0 create-instance-var DOES> [ here ] @ >instance @ execute ;
1.1       root      831: PREVIOUS DEFINITIONS
1.1.1.2 ! root      832: CONSTANT <instancedefer>
        !           833: CONSTANT <instancevalue>
        !           834: CONSTANT <instancevariable>
1.1       root      835: : (instance?) ( xt -- xt true|false )
                    836: dup @ <create> = IF
                    837: dup cell+ @ cell+ @ ['] >instance =
                    838: ELSE
                    839: false
                    840: THEN
                    841: ;
                    842: : (doito) ( value R:*CFA -- )
                    843: r> cell+ dup >r
                    844: @ cell+ cell+ @ >instance !
                    845: ;
                    846: : to ( value wordname<> -- )
                    847: ' (instance?)
                    848: state @ IF
                    849: IF ['] (doito) ELSE ['] DOTO THEN
                    850: , , EXIT
                    851: THEN
                    852: IF
                    853: cell+ cell+ @ >instance ! \ interp mode instance value
                    854: ELSE
                    855: cell+ !                   \ interp mode normal value
                    856: THEN
                    857: ; IMMEDIATE
                    858: : INSTANCE  ALSO instance-words ;
                    859: STRUCT
                    860: /n FIELD instance>node
                    861: /n FIELD instance>parent
                    862: /n FIELD instance>args
                    863: /n FIELD instance>args-len
                    864: CONSTANT /instance-header
                    865: : my-parent  my-self instance>parent @ ;
                    866: : my-args    my-self instance>args 2@ ;
                    867: : set-my-args   ( old-addr len -- )
                    868: dup IF                             \ IF len > 0                    ( old-addr len )
                    869: dup alloc-mem                   \ | allocate space for new args ( old-addr len new-addr )
                    870: swap 2dup                       \ | write the new address       ( old-addr new-addr len new-addr len )
                    871: my-self instance>args 2!        \ | into the instance table     ( old-addr new-addr len )
                    872: move                            \ | and copy the args           ( -- )
                    873: ELSE                               \ ELSE                          ( old-addr len )
                    874: my-self instance>args 2!        \ | set new args to zero, too   ( )
                    875: THEN                               \ FI
                    876: ;
                    877: : create-instance-data ( -- instance )
                    878: get-node dup node>instance @ swap node>instance-size @  ( instance instance-size )
                    879: dup alloc-mem dup >r swap move r>
                    880: ;
                    881: : create-instance ( -- )
                    882: my-self create-instance-data
                    883: dup to my-self instance>parent !
                    884: get-node my-self instance>node !
                    885: ;
                    886: : destroy-instance ( instance -- )
                    887: dup @ node>instance-size @ free-mem
                    888: ;
                    889: : ihandle>phandle ( ihandle -- phandle )
                    890: dup 0= ABORT" no current instance" instance>node @
                    891: ;
                    892: : push-my-self ( ihandle -- )  r> my-self >r >r to my-self ;
                    893: : pop-my-self ( -- )  r> r> to my-self >r ;
                    894: : call-package  push-my-self execute pop-my-self ;
                    895: : $call-static ( ... str len node -- ??? )
                    896: find-method IF execute ELSE -1 throw THEN
                    897: ;
                    898: : $call-my-method  ( str len -- ) my-self ihandle>phandle $call-static ;
                    899: : $call-method  push-my-self $call-my-method pop-my-self ;
                    900: : $call-parent  my-parent $call-method ;
                    901: 1000 CONSTANT max-instance-size
                    902: 3000000 CONSTANT space-code-mask
                    903: : create-node ( parent -- new )
1.1.1.2 ! root      904: max-instance-size alloc-mem        ( parent instance-mem )
        !           905: dup max-instance-size erase >r     ( parent  R: instance-mem )
        !           906: align wordlist >r wordlist >r      ( parent  R: instance-mem wl wl )
        !           907: here                               ( parent new  R: instance-mem wl wl )
        !           908: 0 , swap , 0 ,                     \ Set node>peer, node>parent & node>child
        !           909: r> , r> ,                          \ Set node>properties & node>words to wl
        !           910: r> , /instance-header ,            \ Set node>instance & node>instance-size
        !           911: FALSE , 0 ,                        \ Set node>space? and node>space
        !           912: 0 , 0 , 0 ,                        \ Set node>addr*
        !           913: TRUE ,                             \ Set node>extending?
        !           914: ;
1.1       root      915: : peer    node>peer   @ ;
                    916: : parent  node>parent @ ;
                    917: : child   node>child  @ ;
                    918: : peer  dup IF peer ELSE drop device-tree @ THEN ;
                    919: : link ( new head -- ) \ link a new node at the end of a linked list
                    920: BEGIN dup @ WHILE @ REPEAT ! ;
                    921: : link-node ( parent child -- )
                    922: swap dup IF node>child link ELSE drop device-tree ! THEN ;
                    923: : set-node ( phandle -- )
                    924: current-node @ IF previous THEN
                    925: dup current-node !
                    926: ?dup IF node>words @ also context ! THEN
                    927: definitions ;
                    928: : get-parent  get-node parent ;
                    929: : new-node ( -- phandle ) \ active node becomes new node's parent;
                    930: current-node @ dup create-node
                    931: tuck link-node dup set-node ;
                    932: : finish-node ( -- )
                    933: get-node parent set-node ;
                    934: : device-end ( -- )  0 set-node ;
                    935: CREATE $indent 100 allot  VARIABLE indent 0 indent !
                    936: true value encode-first?
                    937: : decode-int  over >r 4 /string r> 4c@ swap 2swap swap bljoin ;
                    938: : decode-64 decode-int -rot decode-int -rot 2swap swap lxjoin ;
                    939: : decode-string ( prop-addr1 prop-len1 -- prop-addr2 prop-len2 str len )
                    940: dup 0= IF 2dup EXIT THEN \ string properties with zero lenght
                    941: over BEGIN dup c@ 0= IF 1+ -rot swap 2 pick over - rot over - -rot 1-
                    942: EXIT THEN 1+ AGAIN ;
                    943: : (prune) ( name len head -- )
                    944: dup >r (find) ?dup IF r> BEGIN dup @ WHILE 2dup @ = IF
                    945: >r @ r> ! EXIT THEN @ REPEAT 2drop ELSE r> drop THEN ;
                    946: : prune ( name len -- )  last (prune) ;
                    947: : set-property ( data dlen name nlen phandle -- )
                    948: true to encode-first?
                    949: get-current >r  node>properties @ set-current
                    950: 2dup prune  $2CONSTANT  r> set-current ;
                    951: : delete-property ( name nlen -- )
                    952: get-node get-current >r  node>properties @ set-current
                    953: prune r> set-current ;
                    954: : property ( data dlen name nlen -- )  get-node set-property ;
                    955: : get-property ( str len phandle -- true | data dlen false )
                    956: ?dup 0= IF cr cr cr ." get-property for " type ."  on zero phandle"
                    957: cr cr true EXIT THEN
                    958: node>properties @ voc-find dup IF link> execute false ELSE drop true THEN ;
                    959: : get-package-property ( str len phandle -- true | data dlen false )
                    960: get-property ;
                    961: : get-my-property ( str len -- true | data dlen false )
                    962: my-self ihandle>phandle get-property ;
                    963: : get-parent-property ( str len -- true | data dlen false )
                    964: my-parent ihandle>phandle get-property ;
                    965: : get-inherited-property ( str len -- true | data dlen false )
                    966: my-self ihandle>phandle
                    967: BEGIN 3dup get-property 0=
                    968: IF  \ Property found
                    969: rot drop rot drop rot drop false EXIT
                    970: THEN
                    971: parent 0=
                    972: IF
                    973: nip nip true EXIT
                    974: THEN
                    975: AGAIN ;
                    976: 20 CONSTANT indent-prop
                    977: : .prop-int ( str len -- )
                    978: space
                    979: 400 min 0
                    980: ?DO
                    981: i over + dup                                 ( str act-addr act-addr )
                    982: c@ 2 0.r 1+ dup c@ 2 0.r 1+ dup c@ 2 0.r 1+ c@ 2 0.r ( str )
                    983: i c and c = IF                           \ check for multipleof 16 bytes
                    984: cr indent @ indent-prop + 1+ 0        \ linefeed + indent
                    985: DO
                    986: space                              \ print spaces
                    987: LOOP
                    988: ELSE
                    989: space space                           \ print two spaces
                    990: THEN
                    991: 4 +LOOP
                    992: drop
                    993: ;
                    994: : .prop-bytes ( str len -- )
                    995: 2dup -4 and .prop-int                       ( str len )
                    996: dup 3 and dup IF                            ( str len len%4 )
                    997: >r -4 and + r>                           ( str' len%4 )
                    998: bounds                                   ( str' str'+len%4 )
                    999: DO
                   1000: i c@ 2 0.r                            \ Print last 3 bytes
                   1001: LOOP
                   1002: ELSE
                   1003: 3drop
                   1004: THEN
                   1005: ;
                   1006: : .prop-string ( str len )
                   1007: 2dup space type
                   1008: cr indent @ indent-prop + 0 DO space LOOP   \ Linefeed
                   1009: .prop-bytes
                   1010: ;
                   1011: : .propbytes ( xt -- )
                   1012: execute dup
                   1013: IF
                   1014: over cell- @ execute
                   1015: ELSE
                   1016: 2drop
                   1017: THEN
                   1018: ;
                   1019: : .property ( lfa -- )
                   1020: cr indent @ 0
                   1021: ?DO
                   1022: space
                   1023: LOOP
                   1024: link> dup >name name>string 2dup type nip ( len )
                   1025: indent-prop swap -                        ( xt 20-len )
                   1026: dup 0< IF drop 0 THEN 0                   ( xt number-of-space 0 )
                   1027: ?DO
                   1028: space
                   1029: LOOP
                   1030: .propbytes
                   1031: ;
                   1032: : (.properties) ( phandle -- )
                   1033: node>properties @ cell+ @ BEGIN dup WHILE dup .property @ REPEAT drop ;
                   1034: : .properties ( -- )
                   1035: get-node (.properties) ;
                   1036: : next-property ( str len phandle -- false | str' len' true )
                   1037: ?dup 0= IF device-tree @ THEN  \ XXX: is this line required?
                   1038: node>properties @
                   1039: >r 2dup 0= swap 0= or IF 2drop r> cell+ ELSE r> voc-find THEN
                   1040: @ dup IF link>name name>string true THEN ;
                   1041: : encode-start ( -- prop 0 )
                   1042: ['] .prop-int compile,
                   1043: false to encode-first?
                   1044: here 0
                   1045: ;
                   1046: : encode-int ( val -- prop prop-len )
                   1047: encode-first? IF
                   1048: ['] .prop-int compile,             \ Execution token for print
                   1049: false to encode-first?
                   1050: THEN
                   1051: here swap lbsplit c, c, c, c, /l
                   1052: ;
                   1053: : encode-bytes ( str len -- prop-addr prop-len )
                   1054: encode-first? IF
                   1055: ['] .prop-bytes compile,           \ Execution token for print
                   1056: false to encode-first?
                   1057: THEN
                   1058: here over 2dup 2>r allot swap move 2r>
                   1059: ;
                   1060: : encode-string ( str len -- prop-addr prop-len )
                   1061: encode-first? IF
                   1062: ['] .prop-string compile,          \ Execution token for print
                   1063: false to encode-first?
                   1064: THEN
                   1065: encode-bytes 0 c, char+
                   1066: ;
                   1067: : encode+ ( prop1-addr prop1-len prop2-addr prop2-len -- prop-addr prop-len )
                   1068: nip + ;
                   1069: : encode-int+  encode-int encode+ ;
                   1070: : encode-64    xlsplit encode-int rot encode-int+ ;
                   1071: : encode-64+   encode-64 encode+ ;
                   1072: : device-name  encode-string s" name"        property ;
                   1073: : device-type  encode-string s" device_type" property ;
                   1074: : model        encode-string s" model"       property ;
                   1075: : compatible   encode-string s" compatible"  property ;
                   1076: : #address-cells  s" #address-cells" rot parent get-property
                   1077: ABORT" parent doesn't have a #address-cells property!"
                   1078: decode-int nip nip
                   1079: ;
                   1080: : my-#address-cells  ( -- #address-cells )
                   1081: get-node #address-cells
                   1082: ;
                   1083: : child-#address-cells  ( -- #address-cells )
                   1084: s" #address-cells" get-node get-property
                   1085: ABORT" node doesn't have a #address-cells property!"
                   1086: decode-int nip nip
                   1087: ;
                   1088: : child-#size-cells  ( -- #address-cells )
                   1089: s" #size-cells" get-node get-property
                   1090: ABORT" node doesn't have a #size-cells property!"
                   1091: decode-int nip nip
                   1092: ;
                   1093: : encode-phys  ( phys.hi ... phys.low -- prop len )
                   1094: encode-first?  IF  encode-start  ELSE  here 0  THEN
                   1095: my-#address-cells 0 ?DO rot encode-int+ LOOP
                   1096: ;
                   1097: : encode-child-phys  ( phys.hi ... phys.low -- prop len )
                   1098: encode-first?  IF  encode-start  ELSE  here 0  THEN
                   1099: child-#address-cells 0 ?DO rot encode-int+ LOOP
                   1100: ;
                   1101: : encode-child-size  ( size.hi ... size.low -- prop len )
                   1102: encode-first? IF  encode-start  ELSE  here 0  THEN
                   1103: child-#size-cells 0 ?DO rot encode-int+ LOOP
                   1104: ;
                   1105: : decode-phys
                   1106: my-#address-cells BEGIN dup WHILE 1- >r decode-int r> swap >r REPEAT drop
                   1107: my-#address-cells BEGIN dup WHILE 1- r> swap REPEAT drop ;
                   1108: : decode-phys-and-drop
                   1109: my-#address-cells BEGIN dup WHILE 1- >r decode-int r> swap >r REPEAT 3drop
                   1110: my-#address-cells BEGIN dup WHILE 1- r> swap REPEAT drop ;
                   1111: : reg  >r encode-phys r> encode-int+ s" reg" property ;
                   1112: : >space    node>space @ ;
                   1113: : >space?   node>space? @ ;
                   1114: : >address  dup >r #address-cells dup 3 > IF r@ node>addr3 @ swap THEN
                   1115: dup 2 > IF r@ node>addr2 @ swap THEN
                   1116: 1 > IF r@ node>addr1 @ THEN r> drop ;
                   1117: : >unit     dup >r >address r> >space ;
1.1.1.2 ! root     1118: : (my-phandle)  ( -- phandle )
        !          1119: my-self ?dup IF
        !          1120: ihandle>phandle
        !          1121: ELSE
        !          1122: get-node dup 0= ABORT" no active node"
        !          1123: THEN
        !          1124: ;
1.1       root     1125: : my-space ( -- phys.hi )
1.1.1.2 ! root     1126: (my-phandle) >space
        !          1127: ;
        !          1128: : my-address  (my-phandle) >address ;
        !          1129: : my-unit     (my-phandle) >unit ;
1.1       root     1130: : my-unit-64 ( -- phys.lo+1|phys.lo )
                   1131: my-unit                                ( phys.lo ... phys.hi )
1.1.1.2 ! root     1132: (my-phandle) #address-cells            ( phys.lo ... phys.hi #ad-cells )
1.1       root     1133: CASE
                   1134: 1   OF EXIT ENDOF
                   1135: 2   OF lxjoin EXIT ENDOF
                   1136: 3   OF drop lxjoin EXIT ENDOF
                   1137: dup OF 2drop lxjoin EXIT ENDOF
                   1138: ENDCASE
                   1139: ;
                   1140: : set-space    get-node dup >r node>space ! true r> node>space? ! ;
                   1141: : set-address  my-#address-cells 1 ?DO
                   1142: get-node node>space i cells + ! LOOP ;
                   1143: : set-unit     set-space set-address ;
                   1144: : set-unit-64 ( phys.lo|phys.hi -- )
                   1145: my-#address-cells 2 <> IF
                   1146: ." set-unit-64: #address-cells <> 2 " abort
                   1147: THEN
                   1148: xlsplit set-unit
                   1149: ;
                   1150: : set-args ( arg-str len unit-str len -- )
                   1151: s" decode-unit" get-parent $call-static set-unit set-my-args ;
                   1152: : $cat-unit  dup parent 0= IF drop EXIT THEN
                   1153: dup >space? not IF drop EXIT THEN
                   1154: dup >r >unit s" encode-unit" r> parent $call-static dup IF
                   1155: dup >r here swap move s" @" $cat here r> $cat
                   1156: ELSE 2drop THEN ;
                   1157: : node>name  dup >r s" name" rot get-property IF r> (u.) ELSE 1- r> drop THEN ;
                   1158: : node>qname dup node>name rot ['] $cat-unit CATCH IF drop THEN ;
                   1159: : node>path  here 0 rot  BEGIN dup WHILE dup parent REPEAT 2drop
                   1160: dup 0= IF [char] / c, THEN
                   1161: BEGIN dup WHILE [char] / c, node>qname here over allot swap move
                   1162: REPEAT drop here 2dup - allot over - ;
                   1163: : interposed? ( ihandle -- flag )
                   1164: dup instance>parent @ dup 0= IF 2drop false EXIT THEN
                   1165: ihandle>phandle swap ihandle>phandle parent <> ;
                   1166: : instance>qname  dup >r interposed? IF s" %" ELSE 0 0 THEN
                   1167: r@ ihandle>phandle node>qname $cat  r> instance>args 2@
                   1168: dup IF 2>r s" :" $cat 2r> $cat ELSE 2drop THEN ;
                   1169: : instance>qpath \ With interposed nodes.
                   1170: here 0 rot BEGIN dup WHILE dup instance>parent @ REPEAT 2drop
                   1171: dup 0= IF [char] / c, THEN
                   1172: BEGIN dup WHILE [char] / c, instance>qname here over allot swap move
                   1173: REPEAT drop here 2dup - allot over - ;
                   1174: : instance>path \ Without interposed nodes.
                   1175: here 0 rot BEGIN dup WHILE
                   1176: dup interposed? 0= IF dup THEN instance>parent @ REPEAT 2drop
                   1177: dup 0= IF [char] / c, THEN
                   1178: BEGIN dup WHILE [char] / c, instance>qname here over allot swap move
                   1179: REPEAT drop here 2dup - allot over - ;
                   1180: : .node  node>path type ;
                   1181: : pwd  get-node .node ;
                   1182: : .instance instance>qpath type ;
                   1183: : .chain    dup instance>parent @ ?dup IF recurse THEN
                   1184: cr dup . instance>qname type ;
                   1185: defer find-node
                   1186: : set-alias ( alias-name len device-name len -- )
                   1187: encode-string
                   1188: 2swap s" /aliases" find-node ?dup IF
                   1189: set-property
                   1190: ELSE
                   1191: 4drop
                   1192: THEN
                   1193: ;
                   1194: : find-alias ( alias-name len -- false | dev-path len )
                   1195: s" /aliases" find-node dup IF
                   1196: get-property 0= IF 1- dup 0= IF nip THEN ELSE false THEN
                   1197: THEN ;
                   1198: : .alias ( alias-name len -- )
                   1199: find-alias dup IF type ELSE ." no alias available" THEN ;
                   1200: : (.print-alias) ( lfa -- )
                   1201: link> dup >name name>string
                   1202: 2dup s" name" string=ci IF 2drop drop
                   1203: ELSE cr type space ." : " execute type
                   1204: THEN ;
                   1205: : (.list-alias) ( phandle -- )
                   1206: node>properties @ cell+ @ BEGIN dup WHILE dup (.print-alias) @ REPEAT drop ;
                   1207: : list-alias ( -- )
                   1208: s" /aliases" find-node dup IF (.list-alias) THEN ;
                   1209: : devalias ( "{alias-name}<>{device-specifier}<cr>" -- )
                   1210: parse-word parse-word dup IF set-alias
                   1211: ELSE 2drop dup IF .alias
                   1212: ELSE 2drop list-alias THEN THEN ;
                   1213: : sub-alias ( arg-str arg-len -- arg' len' | false )
                   1214: 2dup
                   1215: 2dup [char] / findchar ?dup IF ELSE 2dup [char] : findchar THEN
                   1216: ( a l a l [p] -1|0 ) IF nip dup ELSE 2drop 0 THEN >r
                   1217: find-alias ?dup IF ( a l a' p' -- R:p | a' l' -- R:0 )
                   1218: r@ IF 2swap r@ - swap r> + swap $cat strdup ( a" l-p+p' -- )
                   1219: ELSE ( a' l' -- R:0 ) r> drop ( a' l' -- ) THEN
                   1220: ELSE ( a l -- R:p | -- R:0 ) r> IF 2drop THEN false ( 0 -- ) THEN
                   1221: ;
                   1222: : de-alias ( arg-str arg-len -- arg' len' )
                   1223: BEGIN over c@ [char] / <> dup IF drop 2dup sub-alias ?dup THEN
                   1224: WHILE 2swap 2drop REPEAT
                   1225: ;
                   1226: : +indent ( not-last? -- )
                   1227: IF s" |   " ELSE s"     " THEN $indent indent @ + swap move 4 indent +! ;
                   1228: : -indent ( -- )  -4 indent +! ;
                   1229: : ls-node ( node -- )
                   1230: cr $indent indent @ type
                   1231: dup peer IF ." |-- " ELSE ." +-- " THEN node>qname type ;
                   1232: : (ls) ( node -- )
                   1233: child BEGIN dup WHILE dup ls-node dup child IF
                   1234: dup peer +indent dup recurse -indent THEN peer REPEAT drop ;
                   1235: : ls ( -- )  get-node dup cr node>path type (ls) 0 indent ! ;
                   1236: : show-devs ( {device-specifier}<eol> -- )
                   1237: skipws 0 parse dup IF de-alias ELSE 2drop s" /" THEN   ( str len )
                   1238: find-node dup 0= ABORT" No such device path" (ls)
                   1239: ;
                   1240: VARIABLE interpose-node
                   1241: 2VARIABLE interpose-args
                   1242: : interpose ( arg len phandle -- )  interpose-node ! interpose-args 2! ;
                   1243: : open-node ( arg len phandle -- ihandle | 0 )
                   1244: current-node @ >r set-node create-instance set-my-args
                   1245: s" open" ['] $call-my-method CATCH IF 2drop true THEN
                   1246: 0= IF my-self destroy-instance 0 to my-self THEN
                   1247: my-self my-parent to my-self r> set-node
                   1248: interpose-node @ IF my-self >r to my-self
                   1249: interpose-args 2@ interpose-node @
                   1250: interpose-node off recurse  r> to my-self THEN ;
                   1251: : close-node ( ihandle -- )
                   1252: my-self >r to my-self
                   1253: s" close" ['] $call-my-method CATCH IF 2drop THEN
                   1254: my-self destroy-instance r> to my-self ;
                   1255: : close-dev ( ihandle -- )
                   1256: my-self >r to my-self
                   1257: BEGIN my-self WHILE my-parent my-self close-node to my-self REPEAT
                   1258: r> to my-self ;
                   1259: : new-device ( -- )
                   1260: my-self new-node node>instance @ dup to my-self instance>parent !
                   1261: get-node my-self instance>node ! ;
                   1262: : finish-device ( -- )
1.1.1.2 ! root     1263: FALSE get-node node>extending? !
        !          1264: finish-node my-parent my-self max-instance-size free-mem to my-self
        !          1265: ;
1.1       root     1266: : split ( str len char -- left len right len )
                   1267: >r 2dup r> findchar IF >r over r@ 2swap r> 1+ /string ELSE 0 0 THEN ;
                   1268: : generic-decode-unit ( str len ncells -- addr.lo ... addr.hi )
                   1269: dup >r -rot BEGIN r@ WHILE r> 1- >r [char] , split 2swap
                   1270: $number IF 0 THEN r> swap >r >r REPEAT r> 3drop
                   1271: BEGIN dup WHILE 1- r> swap REPEAT drop ;
                   1272: : generic-encode-unit ( addr.lo ... addr.hi ncells -- str len )
                   1273: 0 0 rot ?dup IF 0 ?DO rot (u.) $cat s" ," $cat LOOP 1- THEN ;
                   1274: : hex-decode-unit ( str len ncells -- addr.lo ... addr.hi )
                   1275: base @ >r hex generic-decode-unit r> base ! ;
                   1276: : hex-encode-unit ( addr.lo ... addr.hi ncells -- str len )
                   1277: base @ >r hex generic-encode-unit r> base ! ;
                   1278: : handle-leading-/ ( path len -- path' len' )
                   1279: dup IF over c@ [char] / = IF 1 /string device-tree @ set-node THEN THEN ;
                   1280: : match-name ( name len node -- match? )
                   1281: over 0= IF 3drop true EXIT THEN
                   1282: s" name" rot get-property IF 2drop false EXIT THEN
                   1283: 1- string=ci ; \ XXX should use decode-string
                   1284: 0 VALUE #search-unit   CREATE search-unit 4 cells allot
                   1285: : match-unit ( node -- match? )
                   1286: node>space search-unit #search-unit 0 ?DO 2dup @ swap @ <> IF
                   1287: 2drop false UNLOOP EXIT THEN cell+ swap cell+ swap LOOP 2drop true ;
                   1288: : match-node ( name len node -- match? )
                   1289: dup >r match-name r> match-unit and ; \ XXX e3d
                   1290: : find-kid ( name len -- node|0 )
                   1291: dup -1 = IF \ are we supposed to stay in the same node? -> resolve-relatives
                   1292: 2drop get-node
                   1293: ELSE
                   1294: get-node child >r BEGIN r@ WHILE 2dup r@ match-node
                   1295: IF 2drop r> EXIT THEN r> peer >r REPEAT
                   1296: r> 3drop false
                   1297: THEN ;
                   1298: : set-search-unit ( unit len -- )
                   1299: dup 0= IF to #search-unit drop EXIT THEN
                   1300: s" #address-cells" get-node get-property THROW
                   1301: decode-int to #search-unit 2drop
                   1302: s" decode-unit" get-node $call-static
                   1303: #search-unit 0 ?DO search-unit i cells + ! LOOP ;
                   1304: : resolve-relatives ( path len -- path' len' )
                   1305: 2dup 2 = swap s" .." comp 0= and IF
                   1306: get-node parent ?dup IF
                   1307: set-node drop -1
                   1308: ELSE
                   1309: s" Already in root node." type
                   1310: THEN
                   1311: THEN
                   1312: 2dup 1 = swap c@ [CHAR] . = and IF
                   1313: drop -1
                   1314: THEN
                   1315: ;
                   1316: : find-component ( path len -- path' len' args len node|0 )
                   1317: [char] / split 2swap ( path'. component. )
                   1318: [char] : split 2swap ( path'. args. node-addr. )
                   1319: [char] @ split ['] set-search-unit CATCH IF 2drop 2drop 0 EXIT THEN
                   1320: resolve-relatives find-kid ;
                   1321: : .find-node ( path len -- phandle|0 )
                   1322: current-node @ >r
                   1323: handle-leading-/ current-node @ 0= IF 2drop r> set-node 0 EXIT THEN
                   1324: BEGIN dup WHILE \ handle one component:
                   1325: find-component ( path len args len node ) dup 0= IF
                   1326: 3drop 2drop r> set-node 0 EXIT THEN
                   1327: set-node 2drop REPEAT 2drop
                   1328: get-node r> set-node ;
                   1329: ' .find-node to find-node
                   1330: : find-node ( path len -- phandle|0 ) de-alias find-node ;
                   1331: : delete-node ( phandle -- )
                   1332: dup node>parent @ node>child @ ( phandle 1st peer )
                   1333: 2dup = IF
                   1334: node>peer @ swap node>parent @ node>child !
                   1335: EXIT
                   1336: THEN
                   1337: dup node>peer @
                   1338: BEGIN 2 pick 2dup <> WHILE
                   1339: drop
                   1340: nip dup node>peer @
                   1341: dup 0= IF 2drop drop unloop EXIT THEN
                   1342: REPEAT
                   1343: drop
                   1344: node>peer @    swap node>peer !
                   1345: drop
                   1346: ;
                   1347: : open-dev ( path len -- ihandle|0 )
                   1348: de-alias current-node @ >r
                   1349: handle-leading-/ current-node @ 0= IF 2drop r> set-node 0 EXIT THEN
                   1350: my-self >r 0 to my-self
                   1351: 0 0 >r >r BEGIN dup WHILE \ handle one component:
                   1352: ( arg len ) r> r> get-node open-node to my-self
                   1353: find-component ( path len args len node ) dup 0= IF
                   1354: 3drop 2drop my-self close-dev r> to my-self r> set-node 0 EXIT THEN
                   1355: set-node >r >r REPEAT 2drop
                   1356: r> r> get-node open-node to my-self
                   1357: my-self r> to my-self r> set-node ;
                   1358: : select-dev  open-dev dup to my-self ihandle>phandle set-node ;
                   1359: : find-device ( str len -- ) \ set as active node
                   1360: find-node dup 0= ABORT" No such device path" set-node ;
                   1361: : dev  skipws 0 parse find-device ;
                   1362: : (lsprop) ( node --)
                   1363: dup cr $indent indent @ type ."     node: " node>qname type
                   1364: false +indent (.properties) cr -indent ;
                   1365: : (show-children) ( node -- )
                   1366: child BEGIN dup WHILE
                   1367: dup (lsprop) dup child IF false +indent dup recurse -indent THEN peer
                   1368: REPEAT drop
                   1369: ;
                   1370: : lsprop ( {device-specifier}<eol> -- )
                   1371: skipws 0 parse dup IF de-alias ELSE 2drop s" /" THEN
                   1372: find-device get-node dup dup
                   1373: cr ." node: " node>path type (.properties) cr (show-children) 0 indent ! ;
                   1374: : (node>path) node>path ;
                   1375: : node>path ( phandle -- str len )
                   1376: node>path dup allot
                   1377: ;
                   1378: 0 VALUE packages
                   1379: : find-package  ( name len -- false | phandle true )
                   1380: 0 >r packages child BEGIN dup WHILE dup >r node>name 2over string=ci r> swap
                   1381: IF r> drop dup >r THEN peer REPEAT 3drop r> dup IF true THEN ;
                   1382: : open-package ( arg len phandle -- ihandle | 0 )  open-node ;
                   1383: : close-package ( ihandle -- )  close-node ;
                   1384: : $open-package ( arg len name len -- ihandle | 0 )
                   1385: find-package IF open-package ELSE 2drop false THEN ;
                   1386: : pci-address-type  ( node address prop_type -- type )
                   1387: -rot 2 pick ( prop_type node address prop_type )
                   1388: 0= IF
                   1389: swap s" reg" rot get-property  ( prop_type address data dlen false )
                   1390: ELSE
                   1391: swap s" assigned-addresses" rot get-property  ( prop_type address data dlen false )
                   1392: THEN
                   1393: IF  2drop -1  EXIT  THEN  4 / 5 /
                   1394: 0 DO
                   1395: dup l@ FF AND 0<> ( prop_type address data cfgspace_offset? )
                   1396: 3 pick 0= ( prop_type address data cfgspace_offset? reg_prop? )
                   1397: AND NOT IF 
                   1398: 2dup 8 + ( prop_type address data address data' )
                   1399: 2dup l@ 2 pick 8 + l@ + <= -rot l@  >= and  IF
                   1400: l@ 03000000 and 18 rshift nip
                   1401: dup 3 = IF  1-  THEN
                   1402: swap drop ( type )
                   1403: UNLOOP EXIT
                   1404: THEN
                   1405: THEN
                   1406: 4 5 * +
                   1407: LOOP
                   1408: 3drop -1
                   1409: ;
                   1410: : (range-read-cells)  ( range-addr #cells -- range-value )
                   1411: 1 =  IF  l@  ELSE  @  THEN
                   1412: ;
                   1413: : (map-one-range)  ( type range pnac nsc nac address -- address true | address false )
                   1414: over 3 = 5 pick l@ 3000000 and 18 rshift 7 pick <> and  IF
                   1415: >r 2drop 3drop r> false EXIT
                   1416: THEN
                   1417: 4 pick 4 pick 3 pick + 4 * +
                   1418: 3 pick
                   1419: (range-read-cells)
                   1420: 5 pick 3 pick 3 =  IF
                   1421: 4 +
                   1422: THEN
                   1423: 3 pick
                   1424: (range-read-cells)
                   1425: dup >r dup 3 pick > >r + over <= r> or  IF
                   1426: >r 2drop 3drop r> r> drop false EXIT
                   1427: THEN
                   1428: dup r> -
                   1429: 5 pick 5 pick 3 =  IF
                   1430: 4 +
                   1431: THEN
                   1432: 3 pick 4 * +
                   1433: 5 pick
                   1434: (range-read-cells)
                   1435: + >r 3drop 3drop r> true
                   1436: ;
                   1437: : translate-address  ( node address -- address )
                   1438: 2dup 1 pci-address-type  ( node address type )
                   1439: dup -1 = IF
                   1440: drop 2dup 0 pci-address-type ( node address type )
                   1441: THEN
                   1442: rot parent BEGIN
                   1443: dup parent 0=  IF  2drop EXIT  THEN
                   1444: s" #address-cells" 2 pick get-property 2drop l@ >r        \ nac
                   1445: s" #size-cells" 2 pick get-property 2drop l@ >r           \ nsc
                   1446: s" #address-cells" 2 pick parent get-property 2drop l@ >r \ pnac
                   1447: -rot ( node address type )
                   1448: s" ranges" 4 pick get-property  IF
                   1449: 3drop
                   1450: ABORT" no ranges property; not translatable"
                   1451: THEN
                   1452: r> r> r> 3 roll
                   1453: 4 / >r 3dup + + >r 5 roll r> r> swap / 0 ?DO
                   1454: 6dup (map-one-range) IF
                   1455: nip leave
                   1456: THEN
                   1457: nip
                   1458: 4 roll
                   1459: 4 pick 4 pick 4 pick + + 4 * + 4 -roll
                   1460: LOOP
                   1461: >r 2drop 2drop r> ( node type address )
                   1462: swap rot parent ( address type node )
                   1463: dup 0=
                   1464: UNTIL
                   1465: ;
                   1466: : translate-my-address  ( address -- address' )
                   1467: get-node swap translate-address
                   1468: ;
                   1469: : find-substr ( basestr-ptr basestr-len substr-ptr substr-len -- pos )
                   1470: dup 0 = IF
                   1471: 2drop 2drop 0 exit THEN
                   1472: dup 3 pick <= IF
                   1473: 2 pick over - 1+ 0 DO dup 0 DO
                   1474: over i + c@ 4 pick j + i + c@ = IF
                   1475: dup i 1+ = IF
                   1476: 2drop 2drop j unloop unloop exit THEN
                   1477: ELSE leave THEN
                   1478: LOOP LOOP
                   1479: THEN
                   1480: 2drop nip
                   1481: ;
                   1482: : find-isubstr ( basestr-ptr basestr-len substr-ptr substr-len -- pos )
                   1483: dup 0 = IF
                   1484: 2drop 2drop 0 exit THEN
                   1485: dup 3 pick <= IF
                   1486: 2 pick over - 1+ 0 DO dup 0 DO
                   1487: over i + c@ lcc 4 pick j + i + c@ lcc = IF
                   1488: dup i 1+ = IF
                   1489: 2drop 2drop j unloop unloop exit THEN
                   1490: ELSE leave THEN
                   1491: LOOP LOOP
                   1492: THEN
                   1493: 2drop nip
                   1494: ;
                   1495: : find-nextline ( str-ptr str-len -- pos )
                   1496: dup 0 ?DO over i + c@ CASE
                   1497: 0a OF
                   1498: dup 1- i = IF
                   1499: 2drop i 1+ unloop exit THEN
                   1500: over i 1+ + c@ 0d = IF
                   1501: 2drop i 2+ ELSE
                   1502: 2drop i 1+ THEN
                   1503: unloop exit
                   1504: ENDOF
                   1505: 0d OF
                   1506: dup 1- i = IF
                   1507: 2drop i 1+ unloop exit THEN
                   1508: over i 1+ + c@ 0a = IF
                   1509: 2drop i 2+ ELSE
                   1510: 2drop i 1+ THEN
                   1511: unloop exit
                   1512: ENDOF
                   1513: ENDCASE LOOP nip
                   1514: ;
                   1515: : string-at ( str1-ptr str1-len pos -- str2-ptr str2-len )
                   1516: -rot 2 pick - -rot swap chars + swap
                   1517: ;
                   1518: : string-cat ( addr1 len1 addr2 len2 -- addr1 len1+len2 )
                   1519: rot dup >r over + -rot
                   1520: 3 pick r> chars + -rot
                   1521: 0 ?DO
                   1522: 2dup c@ swap c!
                   1523: char+ swap char+ swap
                   1524: LOOP 2drop
                   1525: ;
                   1526: : char-cat ( addr len character -- addr len+1 )
                   1527: -rot 2dup >r >r 1+ rot r> r> chars + c!
                   1528: ;
                   1529: : overlap ( src dest size -- true|false )
                   1530: 3dup over + within IF 3drop true ELSE rot tuck + within THEN
                   1531: ;
                   1532: : parse-2int ( str len -- val.lo val.hi )
                   1533: [char] , split ?dup IF eval ELSE drop 0 THEN
                   1534: -rot ?dup IF eval ELSE drop 0 THEN
                   1535: ;
                   1536: : cpeek ( addr -- false | byte true ) c@ true ;
                   1537: : cpoke ( byte addr -- success? ) c! true ;
                   1538: : wpeek ( addr -- false | word true ) w@ true ;
                   1539: : wpoke ( word addr -- success? ) w! true ;
                   1540: : lpeek ( addr -- false | lword true ) l@ true ;
                   1541: : lpoke ( lword addr -- success? ) l! true ;
                   1542: defer reboot ( -- )
                   1543: defer halt ( -- )
                   1544: defer disable-watchdog ( -- )
                   1545: defer reset-watchdog ( -- )
                   1546: defer set-watchdog ( +n -- )
                   1547: defer set-led ( type instance state -- status )
                   1548: defer get-flashside ( -- side )
                   1549: defer set-flashside ( side -- status )
                   1550: defer read-bootlist ( -- )
                   1551: defer furnish-boot-file ( -- adr len )
                   1552: defer set-boot-file ( adr len -- )
                   1553: defer mfg-mode? ( -- flag )
                   1554: defer of-prompt? ( -- flag )
                   1555: defer debug-boot? ( -- flag )
                   1556: defer bmc-version ( -- adr len )
                   1557: defer cursor-on ( -- )
                   1558: defer cursor-off ( -- )
                   1559: : nop-reboot ( -- ) ." reboot not available" abort ;
                   1560: : nop-halt ( -- ) ." halt not available" abort ;
                   1561: : nop-disable-watchdog ( -- )  ;
                   1562: : nop-reset-watchdog ( -- )  ;
                   1563: : nop-set-watchdog ( +n -- ) drop ;
                   1564: : nop-set-led ( type instance state -- status ) drop drop drop ;
                   1565: : nop-get-flashside ( -- side ) ." Cannot get flashside" cr ABORT ;
                   1566: : nop-set-flashside ( side -- status ) ." Cannot set flashside" cr ABORT ;
                   1567: : nop-read-bootlist ( -- ) ;
                   1568: : nop-furnish-bootfile ( -- adr len ) s" net:" ;
                   1569: : nop-set-boot-file ( adr len -- ) 2drop ;
                   1570: : nop-mfg-mode? ( -- flag ) false ;
                   1571: : nop-of-prompt? ( -- flag ) false ;
                   1572: : nop-debug-boot? ( -- flag ) false ;
                   1573: : nop-bmc-version ( -- adr len ) s" XXXXX" ;
                   1574: : nop-cursor-on ( -- ) ;
                   1575: : nop-cursor-off ( -- ) ;
                   1576: ' nop-reboot to reboot
                   1577: ' nop-halt to halt
                   1578: ' nop-disable-watchdog to disable-watchdog
                   1579: ' nop-reset-watchdog   to reset-watchdog
                   1580: ' nop-set-watchdog     to set-watchdog
                   1581: ' nop-set-led          to set-led
                   1582: ' nop-get-flashside    to get-flashside
                   1583: ' nop-set-flashside    to set-flashside
                   1584: ' nop-read-bootlist    to read-bootlist
                   1585: ' nop-furnish-bootfile to furnish-boot-file
                   1586: ' nop-set-boot-file    to set-boot-file
                   1587: ' nop-mfg-mode?        to mfg-mode?
                   1588: ' nop-of-prompt?       to of-prompt?
                   1589: ' nop-debug-boot?      to debug-boot?
                   1590: ' nop-bmc-version      to bmc-version
                   1591: ' nop-cursor-on        to cursor-on
                   1592: ' nop-cursor-off       to cursor-off
                   1593: : reset-all reboot ;
                   1594: 10000000 value load-base
                   1595: 2000000 value flash-load-base
                   1596: : xt>name ( xt -- str len )
                   1597: BEGIN
                   1598: cell - dup c@ 0 2 within IF
                   1599: dup 2+ swap 1+ c@ exit
                   1600: THEN
                   1601: AGAIN
                   1602: ;
                   1603: cell -1 * CONSTANT -cell
                   1604: : cell- ( n -- n-cell-size )
                   1605: [ cell -1 * ] LITERAL +
                   1606: ;
                   1607: : find-xt-addr ( addr -- xt )
                   1608: BEGIN
                   1609: dup @ <colon> = IF
                   1610: EXIT
                   1611: THEN
                   1612: cell-
                   1613: AGAIN
                   1614: ;
                   1615: : (.immediate) ( xt -- )
                   1616: xt>name drop 2 - c@ \ skip len and flags
                   1617: immediate? IF
                   1618: ."  IMMEDIATE"
                   1619: THEN
                   1620: ;
                   1621: : (.xt) ( xt -- )
                   1622: xt>name type
                   1623: ;
                   1624: : trace-back (  )
                   1625: 1
                   1626: BEGIN
                   1627: cr dup dup . ."  : " rpick dup . ."  : "
                   1628: ['] tib here within IF
                   1629: dup rpick find-xt-addr (.xt)
                   1630: THEN
                   1631: 1+ dup rdepth 5 - >= IF cr drop EXIT THEN
                   1632: AGAIN
                   1633: ;
                   1634: VARIABLE see-my-type-column
                   1635: : (see-my-type) ( indent limit xt str len -- indent limit xt )
                   1636: dup see-my-type-column @ + dup 50 >= IF
                   1637: -rot over "  " comp 0= IF
                   1638: 2drop see-my-type-column !
                   1639: ELSE
                   1640: rot drop                      ( indent limit xt str len )
                   1641: 2 pick (u.) dup -rot cr type  ( indent limit xt str len xt-len )
                   1642: " :" type 1+                  ( indent limit xt str len prefix-len )
                   1643: 5 pick dup spaces +           ( indent limit xt str len prefix-len )
                   1644: over + see-my-type-column !   ( indent limit xt str len )
                   1645: type
                   1646: THEN                          ( indent limit xt )
                   1647: ELSE
                   1648: see-my-type-column ! type     ( indent limit xt )
                   1649: THEN
                   1650: ;
                   1651: : (see-my-type-init) ( -- )
                   1652: ffff see-my-type-column !        \ just enforce a new line
                   1653: ;
                   1654: : (see-colon-body) ( indent limit xt -- indent limit xt )
                   1655: (see-my-type-init)                              \ enforce new line
                   1656: BEGIN                                           ( indent limit xt )
                   1657: cell+ 2dup <>
                   1658: over @
                   1659: dup <semicolon> <>
                   1660: rot and                                           ( indent limit xt @xt flag )
                   1661: WHILE                                           ( indent limit xt @xt )
                   1662: xt>name (see-my-type) "  " (see-my-type)
                   1663: dup @                                        ( indent limit xt @xt)
                   1664: CASE
                   1665: <0branch>  OF cell+ dup @
                   1666: over + cell+ dup >r
                   1667: (u.) (see-my-type) r>          ( indent limit xt target)
                   1668: 2dup < IF
                   1669: over 4 pick 3 + -rot recurse
                   1670: nip nip nip cell-           ( indent limit xt )
                   1671: ELSE
                   1672: drop                        ( indent limit xt )
                   1673: THEN
                   1674: (see-my-type-init) ENDOF       \ enforce new line
                   1675: <branch>   OF cell+ dup @ over + cell+ (u.)
                   1676: (see-my-type) "  " (see-my-type) ENDOF
                   1677: <do?do>    OF cell+ dup @ (u.) (see-my-type)
                   1678: "  " (see-my-type) ENDOF
                   1679: <lit>      OF cell+ dup @ (u.) (see-my-type)
                   1680: "  " (see-my-type) ENDOF
                   1681: <dotick>   OF cell+ dup @ xt>name (see-my-type)
                   1682: "  " (see-my-type) ENDOF
                   1683: <doloop>   OF cell+ dup @ (u.) (see-my-type)
                   1684: "  " (see-my-type) ENDOF
                   1685: <doleave>  OF cell+ dup @ over + cell+ (u.)
                   1686: (see-my-type) "  " (see-my-type) ENDOF
                   1687: <do?leave> OF cell+ dup @ over + cell+ (u.)
                   1688: (see-my-type) "  " (see-my-type) ENDOF
                   1689: <sliteral> OF cell+ " """ (see-my-type) dup count dup >r
                   1690: (see-my-type) " """ (see-my-type)
                   1691: "  " (see-my-type)
                   1692: r> -cell and + ENDOF
                   1693: ENDCASE
                   1694: REPEAT
                   1695: drop
                   1696: ;
                   1697: : (see-colon) ( xt -- )
                   1698: (see-my-type-init)
                   1699: 1 swap 0 swap                                    ( indent limit xt )
                   1700: " : " (see-my-type) dup xt>name (see-my-type)
                   1701: rot drop 4 -rot (see-colon-body)                 ( indent limit xt )
                   1702: rot drop 1 -rot (see-my-type-init) " ;" (see-my-type)
                   1703: 3drop 
                   1704: ;
                   1705: : (see-create) ( xt -- )
                   1706: dup cell+ @
                   1707: CASE
                   1708: <2constant> OF
                   1709: dup cell+ cell+ dup @ swap cell+ @ . .  ." 2CONSTANT "
                   1710: ENDOF
                   1711: <instancevalue> OF
                   1712: dup cell+ cell+ @ . ." INSTANCE VALUE "
                   1713: ENDOF
                   1714: <instancevariable> OF
                   1715: ." INSTANCE VARIABLE "
                   1716: ENDOF
                   1717: dup OF
                   1718: ." CREATE "
                   1719: ENDOF
                   1720: ENDCASE
                   1721: (.xt)
                   1722: ;
                   1723: : (see) ( xt -- )
                   1724: cr dup dup @
                   1725: CASE
                   1726: <variable> OF ." VARIABLE " (.xt) ENDOF
                   1727: <value>    OF dup execute . ." VALUE " (.xt) ENDOF
                   1728: <constant> OF dup execute . ." CONSTANT " (.xt) ENDOF
                   1729: <defer>    OF dup cell+ @ swap ." DEFER " (.xt) ."  is " (.xt) ENDOF
                   1730: <alias>    OF dup cell+ @ swap ." ALIAS " (.xt) ."  " (.xt) ENDOF
                   1731: <buffer:>  OF ." BUFFER: " (.xt) ENDOF
                   1732: <create>   OF (see-create) ENDOF
                   1733: <colon>    OF (see-colon)  ENDOF
                   1734: dup        OF ." ??? PRIM " (.xt) ENDOF
                   1735: ENDCASE
                   1736: (.immediate) cr
                   1737: ;
                   1738: : see ( "old-name<>" -- )
                   1739: ' (see)
                   1740: ;
                   1741: 0    value forth-ip
                   1742: true value trace>stepping?
                   1743: true value trace>print?
                   1744: true value trace>up?
                   1745: 0    value trace>depth
                   1746: 0    value trace>rdepth
                   1747: 0    value trace>recurse
                   1748: : trace-depth+ ( -- ) trace>depth 1+ to trace>depth ;
                   1749: : trace-depth- ( -- ) trace>depth 1- to trace>depth ;
                   1750: : stepping ( -- )
                   1751: true to trace>stepping?
                   1752: ;
                   1753: : tracing ( -- )
                   1754: false to trace>stepping?
                   1755: ;
                   1756: : trace-print-on ( -- )
                   1757: true to trace>print?
                   1758: ;
                   1759: : trace-print-off ( -- )
                   1760: false to trace>print?
                   1761: ;
                   1762: : fip-add ( n -- )
                   1763: forth-ip + to forth-ip
                   1764: ;
                   1765: 0 value debug-last-xt
                   1766: 0 value debug-last-xt-content
                   1767: : trace-print ( -- )
                   1768: forth-ip cr u. ." : "
                   1769: forth-ip @ 
                   1770: dup ['] breakpoint = IF drop debug-last-xt-content THEN
                   1771: xt>name type ."  "
                   1772: ."     ( " .s  ."  )  | "
                   1773: ;
                   1774: : trace-interpret ( -- )
                   1775: rdepth 1- to trace>rdepth
                   1776: BEGIN
                   1777: depth . [char] > dup emit emit space
                   1778: source expect                        ( str len )
                   1779: ['] interpret catch print-status
                   1780: AGAIN
                   1781: ;
                   1782: : trace-xt ( xt -- )
                   1783: trace>recurse IF
                   1784: r> drop                                \ Drop return of 'trace-xt call
                   1785: cell+                                  \ Step over ":"
                   1786: ELSE
                   1787: debug-last-xt-content <colon> = IF
                   1788: ['] breakpoint @ debug-last-xt !    \ Re-arm break point
                   1789: r> drop                             \ Drop return of 'trace-xt call
                   1790: cell+                               \ Step over ":"
                   1791: ELSE
                   1792: ['] breakpoint debug-last-xt !      \ Re-arm break point
                   1793: 2r> 2drop
                   1794: THEN
                   1795: THEN
                   1796: to forth-ip
                   1797: true to trace>print?
                   1798: BEGIN
                   1799: trace>print? IF trace-print THEN
                   1800: forth-ip                                              ( ip )
                   1801: trace>stepping? IF
                   1802: BEGIN
                   1803: key
                   1804: CASE
                   1805: [char] d OF dup @ @ <colon> = IF             \ recurse only into colon definitions
                   1806: trace-depth+
                   1807: 1 to trace>recurse
                   1808: dup >r @ recurse
                   1809: THEN true ENDOF
                   1810: [char] u OF trace>depth IF tracing trace-print-off true ELSE false THEN ENDOF
                   1811: [char] f OF drop cr trace-interpret ENDOF      \ quit trace and start interpreter FIXME rstack
                   1812: [char] c OF tracing true ENDOF
                   1813: [char] t OF trace-back false ENDOF
                   1814: [char] q OF drop cr quit ENDOF
                   1815: 20       OF true ENDOF
                   1816: dup      OF cr ." Press d:       Down into current word" cr
                   1817: ." Press u:       Up to caller" cr
                   1818: ." Press f:       Switch to forth interpreter, 'resume' will continue tracing" cr
                   1819: ." Press c:       Switch to tracing" cr
                   1820: ." Press <space>: Execute current word" cr
                   1821: ." Press q:       Abort execution, switch to interpreter" cr
                   1822: false ENDOF
                   1823: ENDCASE
                   1824: UNTIL
                   1825: THEN                                                 ( ip' )
                   1826: dup to forth-ip @                                      ( xt )
                   1827: dup ['] breakpoint = IF drop debug-last-xt-content THEN
                   1828: dup                                                    ( xt xt )
                   1829: CASE
                   1830: <sliteral>  OF drop forth-ip cell+ dup dup c@ + -cell and to forth-ip ENDOF
                   1831: <dotick>    OF drop forth-ip cell+ @ cell fip-add ENDOF
                   1832: <lit>       OF drop forth-ip cell+ @ cell fip-add ENDOF
                   1833: <doto>      OF drop forth-ip cell+ @ cell+ ! cell fip-add ENDOF
                   1834: <0branch>   OF drop IF
                   1835: cell fip-add
                   1836: ELSE
                   1837: forth-ip cell+ @ cell+ fip-add THEN
                   1838: ENDOF
                   1839: <do?do>     OF drop 2dup <> IF
                   1840: swap >r >r cell fip-add
                   1841: ELSE
                   1842: forth-ip cell+ @ cell+ fip-add 2drop THEN
                   1843: ENDOF
                   1844: <branch>    OF drop forth-ip cell+ @ cell+ fip-add ENDOF
                   1845: <doleave>   OF drop r> r> 2drop forth-ip cell+ @ cell+ fip-add ENDOF           
                   1846: <do?leave>  OF drop IF
                   1847: r> r> 2drop forth-ip cell+ @ cell+ fip-add
                   1848: ELSE
                   1849: cell fip-add
                   1850: THEN
                   1851: ENDOF          
                   1852: <doloop>    OF drop r> 1+ r> 2dup = IF
                   1853: 2drop cell fip-add
                   1854: ELSE >r >r
                   1855: forth-ip cell+ @ cell+ fip-add THEN
                   1856: ENDOF
                   1857: <do+loop>   OF drop r> + r> 2dup >= IF
                   1858: 2drop cell fip-add
                   1859: ELSE >r >r
                   1860: forth-ip cell+ @ cell+ fip-add THEN
                   1861: ENDOF
                   1862: <semicolon> OF trace>depth 0> IF
                   1863: trace-depth- 1 to trace>recurse
                   1864: stepping drop r> recurse
                   1865: ELSE
                   1866: drop exit THEN
                   1867: ENDOF
                   1868: <exit>      OF trace>depth 0> IF
                   1869: trace-depth- stepping drop r> recurse
                   1870: ELSE
                   1871: drop exit THEN
                   1872: ENDOF
                   1873: dup         OF execute ENDOF
                   1874: ENDCASE
                   1875: forth-ip cell+ to forth-ip
                   1876: AGAIN
                   1877: ;
                   1878: : resume ( -- )
                   1879: trace>rdepth rdepth!
                   1880: forth-ip cell - trace-xt
                   1881: ;
                   1882: : debug-off ( -- )
                   1883: debug-last-xt IF
                   1884: debug-last-xt-content debug-last-xt !  \ Restore overwriten token
                   1885: 0 to debug-last-xt
                   1886: THEN
                   1887: ;
                   1888: : (break-entry) ( -- )
                   1889: debug-last-xt dup @ ['] breakpoint <> swap  ( debug-addr? debug-last-xt )
                   1890: debug-last-xt-content swap !                \ Restore overwriten token
                   1891: r> drop                                     \ Don't return to bp, but to caller
                   1892: debug-last-xt-content <colon> <> and IF     \ Execute non colon definition
                   1893: debug-last-xt cr u. ." : "
                   1894: debug-last-xt xt>name type ."  "
                   1895: ."     ( " .s  ."  )  | "
                   1896: key drop
                   1897: debug-last-xt execute
                   1898: ELSE
                   1899: debug-last-xt 0 to trace>depth 0 to trace>recurse trace-xt   \ Trace colon definition
                   1900: THEN
                   1901: ;
                   1902: ' (break-entry) to BP
                   1903: : debug-address ( addr --  )
                   1904: debug-off                       ( xt )  \ Remove active breakpoint
                   1905: dup to debug-last-xt            ( xt )  \ Save token for later debug
                   1906: dup @ to debug-last-xt-content  ( xt )  \ Save old value
                   1907: ['] breakpoint swap !
                   1908: ;
                   1909: : (debug ( xt --  )
                   1910: debug-off                       ( xt )  \ Remove active breakpoint
                   1911: dup to debug-last-xt            ( xt )  \ Save token for later debug
                   1912: dup @ to debug-last-xt-content  ( xt )  \ Save old value
                   1913: ['] breakpoint @ swap !
                   1914: ;
                   1915: : debug ( "old-name<>" -- )
                   1916: parse-word $find IF                       \ Get xt for old-name
                   1917: (debug
                   1918: ELSE
                   1919: ." undefined word " type cr
                   1920: THEN
                   1921: ;
                   1922: : words
                   1923: last @
                   1924: BEGIN ?dup WHILE
                   1925: dup cell+ char+ count type space @
                   1926: REPEAT
                   1927: ;
                   1928: : .calls    ( xt -- )
                   1929: current-node @ >r 0 set-node    \ only search commands, according too IEEE1275
                   1930: last BEGIN @ ?dup WHILE    ( xt currxt )
                   1931: dup cell+ char+         ( xt currxt name* )
                   1932: dup dup c@ + 1+ aligned ( xt currxt name* CFA )
                   1933: dup @ <colon> = IF      ( xt currxt name* CFA )
                   1934: BEGIN
                   1935: cell+ dup @ ['] semicolon <>
                   1936: WHILE                ( xt currxt *name pos )
                   1937: dup @ 4 pick = IF ( xt currxt *name pos )
                   1938: over count type space
                   1939: BEGIN cell+ dup @ ['] semicolon = UNTIL cell - \ eat up other occurences
                   1940: THEN
                   1941: REPEAT
                   1942: THEN
                   1943: 2drop ( xt currxt )
                   1944: REPEAT
                   1945: drop
                   1946: r> set-node               \ restore node
                   1947: ;
                   1948: 0 value #sift-count
                   1949: false value sift-compl-only
                   1950: : $inner-sift ( text-addr text-len LFA -- ... word-addr word-len true | false )
                   1951: dup cell+ char+ count           \ get word name
                   1952: 2dup 6 pick 6 pick find-isubstr \ is there a partly match?
                   1953: sift-compl-only IF 0= ELSE over < THEN
                   1954: IF
                   1955: #sift-count 1+ to #sift-count \ count completions
                   1956: true
                   1957: ELSE
                   1958: 2drop false
                   1959: THEN
                   1960: ;
                   1961: : $sift    ( text-addr text-len -- )
                   1962: current-node @ >r 0 set-node   \ only search commands, according too IEEE1275
                   1963: sift-compl-only >r false to sift-compl-only \ all substrings, not only compl.
                   1964: last BEGIN @ ?dup WHILE        \ walk the whole dictionary
                   1965: $inner-sift IF type space THEN
                   1966: REPEAT
                   1967: 2drop
                   1968: 0 to #sift-count          \ we don't need completions here.
                   1969: r> to sift-compl-only    \ restore previous sifting mode
                   1970: r> set-node               \ restore node
                   1971: ;
                   1972: : sifting    ( "text< >" -- )
                   1973: parse-word $sift
                   1974: ;
                   1975: defer '(r@)
                   1976: defer '(r!)
                   1977: 1 VALUE /(r)
                   1978: : (rfill) ( addr size pattern 'r! /r -- )
                   1979: to /(r) to '(r!) ff and
                   1980: dup 8 lshift or dup 10 lshift or dup 20 lshift or
                   1981: -rot bounds ?do dup i '(r!) /(r) +loop drop
                   1982: ;
                   1983: : (fwrmove) ( src dest size -- )
                   1984: >r 0 -rot r> bounds ?do + dup '(r@) i '(r!) /(r) dup +loop 2drop
                   1985: ;
                   1986: : mrmove ( src dest size -- )
                   1987: 3dup or or 7 AND CASE
                   1988: 0 OF ['] x@ ['] rx! /x ENDOF
                   1989: 4 OF ['] l@ ['] rl! /l ENDOF
                   1990: 2 OF ['] w@ ['] rw! /w ENDOF
                   1991: dup OF ['] c@ ['] rb! /c ENDOF
                   1992: ENDCASE
                   1993: to /(r) to '(r!) to '(r@) (fwrmove)
                   1994: ;
                   1995: : rfill ( addr size pattern -- )
                   1996: 3dup drop or 7 AND CASE
                   1997: 0 OF ['] rx! /x ENDOF
                   1998: 4 OF ['] rl! /l ENDOF
                   1999: 2 OF ['] rw! /w ENDOF
                   2000: dup OF ['] rb! /c ENDOF
                   2001: ENDCASE (rfill)
                   2002: ;
                   2003: : ([IF])
                   2004: BEGIN
                   2005: BEGIN parse-word dup 0= WHILE
                   2006: 2drop refill
                   2007: REPEAT
                   2008: 2dup s" [IF]" str= IF 1 throw THEN
                   2009: 2dup s" [ELSE]" str= IF 2 throw THEN
                   2010: 2dup s" [THEN]" str= IF 3 throw THEN
                   2011: s" \" str= IF linefeed parse 2drop THEN
                   2012: AGAIN
                   2013: ;
                   2014: : [IF] ( flag -- )
                   2015: IF exit THEN
                   2016: 1 BEGIN
                   2017: ['] ([IF]) catch 
                   2018: CASE
                   2019: 1 OF 1+ ENDOF
                   2020: 2 OF dup 1 = if 1- then ENDOF
                   2021: 3 OF 1- ENDOF
                   2022: ENDCASE
                   2023: dup 0 <=
                   2024: UNTIL drop
                   2025: ; immediate
                   2026: : [ELSE] 0 [COMPILE] [IF] ; immediate
                   2027: : [THEN] ; immediate
                   2028: : $dnumber base @ >r decimal $number r> base ! ;
                   2029: : (.d) base @ >r decimal (.) r> base ! ;
                   2030: : (ipaddr) ( "a.b.c.d" -- FALSE | n1 n2 n3 n4 TRUE )
                   2031: base @ >r decimal
                   2032: over s" 000.000.000.000" comp 0= IF 2drop false r> base ! EXIT THEN
                   2033: [char] . left-parse-string $number IF 2drop false r> base ! EXIT THEN -rot
                   2034: [char] . left-parse-string $number IF 2drop false r> base ! EXIT THEN -rot
                   2035: [char] . left-parse-string $number IF 2drop false r> base ! EXIT THEN -rot
                   2036: $number IF false r> base ! EXIT THEN
                   2037: true r> base !
                   2038: ;
                   2039: : (ipformat)  ( n1 n2 n3 n4 -- str len )
                   2040: base @ >r decimal
                   2041: 0 <# # # # [char] . hold drop # # # [char] . hold
                   2042: drop # # # [char] . hold drop # # #s #>
                   2043: r> base !
                   2044: ;
                   2045: : ipformat  ( n1 n2 n3 n4 -- ) (ipformat) type ;
1.1.1.2 ! root     2046: paflof-start 1 rshift fff not and to load-base
1.1       root     2047: deadbeef here l!
                   2048: here c@ de = CONSTANT ?bigendian
                   2049: here c@ ef = CONSTANT ?littleendian
                   2050: ?bigendian [IF]
                   2051: : l!-le  >r lbflip r> l! ;
                   2052: : l@-le  l@ lbflip ;
                   2053: : w!-le  >r wbflip r> w! ;
                   2054: : w@-le  w@ wbflip ;
                   2055: : rl!-le  >r lbflip r> rl! ;
                   2056: : rl@-le  rl@ lbflip ;
                   2057: : rw!-le  >r wbflip r> rw! ;
                   2058: : rw@-le  rw@ wbflip ;
                   2059: : l!-be  l! ;
                   2060: : l@-be  l@ ;
                   2061: : w!-be  w! ;
                   2062: : w@-be  w@ ;
                   2063: : rl!-be  rl! ;
                   2064: : rl@-be  rl@ ;
                   2065: : rw!-be  rw! ;
                   2066: : rw@-be  rw@ ;
                   2067: [ELSE]
                   2068: : l!-le  l! ;
                   2069: : l@-le  l@ ;
                   2070: : w!-le  w! ;
                   2071: : w@-le  w@ ;
                   2072: : rl!-le  rl! ;
                   2073: : rl@-le  rl@ ;
                   2074: : rw!-le  rw! ;
                   2075: : rw@-le  rw@ ;
                   2076: : l!-be  >r lbflip r> l! ;
                   2077: : l@-be  l@ lbflip ;
                   2078: : w!-be  >r wbflip r> w! ;
                   2079: : w@-be  w@ wbflip ;
                   2080: : rl!-be  >r lbflip r> rl! ;
                   2081: : rl@-be  rl@ lbflip ;
                   2082: : rw!-be  >r wbflip r> rw! ;
                   2083: : rw@-be  rw@ wbflip ;
                   2084: [THEN]
                   2085: : #join  ( lo hi #bits -- x )  lshift or ;
                   2086: : #split ( x #bits -- lo hi )  2dup rshift dup >r swap lshift xor r> ;
                   2087: : blink ;
                   2088: : reset-dual-emit ;
                   2089: : console-clean-fifo ;
                   2090: : bootmsg-nvupdate ;
                   2091: : asm-cout 2drop drop ;
                   2092: defer nvramlog-write-byte
                   2093: : .nvramlog-write-byte ( byte -- )
                   2094: drop
                   2095: ;
                   2096: ' .nvramlog-write-byte to nvramlog-write-byte
                   2097: : nvramlog-write-string ( str len -- )
                   2098: dup 0> IF
                   2099: 0 DO dup c@ 
                   2100: nvramlog-write-byte char+ LOOP
                   2101: ELSE
                   2102: drop
                   2103: THEN drop ;
                   2104: : nvramlog-write-number ( number format -- )
                   2105: 0 swap <# 0 ?DO # LOOP #> 
                   2106: nvramlog-write-string ;
                   2107: : nvramlog-write-string-cr ( str len -- )
                   2108: nvramlog-write-string
                   2109: a nvramlog-write-byte d nvramlog-write-byte ;
                   2110: : log-string ( str len -- ) type ;
                   2111: : log-string 2drop ;
                   2112: create debugstr 255 allot
                   2113: 0 VALUE debuglen
                   2114: : cp ( checkpoint -- )
                   2115: bootmsg-cp ;
                   2116: : (warning) ( id level ptr len -- )
                   2117: dup TO debuglen
                   2118: debugstr swap move           \ copy into buffer
                   2119: 0 debuglen debugstr + c!     \ terminate '\0'
                   2120: debugstr bootmsg-warning
                   2121: ;
                   2122: : warning" ( id level [text<">] -- )
                   2123: postpone s" state @
                   2124: IF
                   2125: ['] (warning) compile,
                   2126: ELSE
                   2127: (warning)
                   2128: THEN
                   2129: ; immediate
                   2130: : (debug-cp) ( id level ptr len -- )
                   2131: dup TO debuglen
                   2132: debugstr swap move           \ copy into buffer
                   2133: 0 debuglen debugstr + c!     \ terminate '\0'
                   2134: debugstr bootmsg-debugcp
                   2135: ;
                   2136: : debug-cp" ( id level [text<">] -- )
                   2137: postpone s" state @
                   2138: IF
                   2139: ['] (debug-cp) compile,
                   2140: ELSE
                   2141: (debug-cp)
                   2142: THEN
                   2143: ; immediate
                   2144: : (error) ( id ptr len -- )
                   2145: dup TO debuglen
                   2146: debugstr swap move           \ copy into buffer
                   2147: 0 debuglen debugstr + c!     \ terminate '\0'
                   2148: debugstr bootmsg-error
                   2149: ;
                   2150: : error" ( id level [text<">] -- )
                   2151: postpone s" state @
                   2152: IF
                   2153: ['] (error) compile,
                   2154: ELSE
                   2155: (error)
                   2156: THEN
                   2157: ; immediate
                   2158: bootmsg-nvupdate
                   2159: 000 cp
                   2160: STRUCT
                   2161: cell FIELD >r0   cell FIELD >r1   cell FIELD >r2   cell FIELD >r3
                   2162: cell FIELD >r4   cell FIELD >r5   cell FIELD >r6   cell FIELD >r7
                   2163: cell FIELD >r8   cell FIELD >r9   cell FIELD >r10  cell FIELD >r11
                   2164: cell FIELD >r12  cell FIELD >r13  cell FIELD >r14  cell FIELD >r15
                   2165: cell FIELD >r16  cell FIELD >r17  cell FIELD >r18  cell FIELD >r19
                   2166: cell FIELD >r20  cell FIELD >r21  cell FIELD >r22  cell FIELD >r23
                   2167: cell FIELD >r24  cell FIELD >r25  cell FIELD >r26  cell FIELD >r27
                   2168: cell FIELD >r28  cell FIELD >r29  cell FIELD >r30  cell FIELD >r31
                   2169: cell FIELD >cr   cell FIELD >xer  cell FIELD >lr   cell FIELD >ctr
                   2170: cell FIELD >srr0 cell FIELD >srr1 cell FIELD >dar  cell FIELD >dsisr
                   2171: CONSTANT ciregs-size
                   2172: : .16  10 0.r 3 spaces ;
                   2173: : .8   8 spaces 8 0.r 3 spaces ;
                   2174: : .4regs  cr 4 0 DO dup @ .16 8 cells+ LOOP drop ;
                   2175: : .fixed-regs
                   2176: cr ."     R0 .. R7           R8 .. R15         R16 .. R23         R24 .. R31"
                   2177: dup 8 0 DO dup .4regs cell+ LOOP drop
                   2178: ;
                   2179: : .special-regs
                   2180: cr ."     CR / XER           LR / CTR          SRR0 / SRR1        DAR / DSISR"
                   2181: cr dup >cr  @ .8   dup >lr  @ .16  dup >srr0 @ .16  dup >dar @ .16
                   2182: cr dup >xer @ .16  dup >ctr @ .16  dup >srr1 @ .16    >dsisr @ .8
                   2183: ;
                   2184: : .regs
                   2185: cr .fixed-regs
                   2186: cr .special-regs
                   2187: cr cr
                   2188: ;
                   2189: : .hw-exception ( reason-code exception-nr -- )
                   2190: ." ( " dup . ." ) "
                   2191: CASE
                   2192: 200 OF ." Machine Check" ENDOF
                   2193: 300 OF ." Data Storage" ENDOF
                   2194: 380 OF ." Data Segment" ENDOF
                   2195: 400 OF ." Intruction Storage" ENDOF
                   2196: 480 OF ." Instruction Segment" ENDOF
                   2197: 500 OF ." External" ENDOF
                   2198: 600 OF ." Alignment" ENDOF
                   2199: 700 OF ." Program" ENDOF
                   2200: 800 OF ." Floating-point unavailable" ENDOF
                   2201: 900 OF ." Decrementer" ENDOF
                   2202: 980 OF ." Hypervisor Decrementer" ENDOF
                   2203: C00 OF ." System Call" ENDOF
                   2204: D00 OF ." Trace" ENDOF
                   2205: F00 OF ." Performance Monitor" ENDOF
                   2206: F20 OF ." VMX Unavailable" ENDOF
                   2207: 1200 OF ." System Error" ENDOF
                   2208: 1600 OF ." Maintenance" ENDOF
                   2209: 1800 OF ." Thermal" ENDOF
                   2210: dup OF ." Unknown" ENDOF
                   2211: ENDCASE
                   2212: ."  Exception [ " . ." ]"
                   2213: ;
                   2214: : .sw-exception ( exception-nr -- )
                   2215: ."  Exception [ " . ." ] triggered by boot firmware."
                   2216: ;
                   2217: : be-hw-exception ( [reason-code] exception-nr -- )
                   2218: cr cr
                   2219: dup 0> IF .hw-exception ELSE .sw-exception THEN
                   2220: cr eregs .regs
                   2221: ;
                   2222: ' be-hw-exception to hw-exception-handler
                   2223: : (boot-exception-handler) ( x1...xn exception-nr -- x1...xn)
                   2224: dup IF
                   2225: dup 0 > IF
                   2226: negate cp 9 emit ." : " type
                   2227: ELSE
                   2228: CASE
                   2229: -6d OF cr ." W3411: Client application returned." cr ENDOF
                   2230: -6c OF cr ." E3400: It was not possible to boot from any device "
                   2231: ." specified in the VPD." cr
                   2232: ENDOF
                   2233: -6b OF cr ." E3410: Boot list successfully read from VPD "
                   2234: ." but no useful information received." cr
                   2235: ENDOF
                   2236: -6a OF cr ." E3420: Boot list could not be read from VPD." cr
                   2237: ENDOF
                   2238: -69 OF
                   2239: cr ." E3406: Client application returned an error"
                   2240: abort"-str @ count dup IF
                   2241: ." :    " type cr
                   2242: ELSE
                   2243: ." ." cr
                   2244: 2drop
                   2245: THEN
                   2246: ENDOF
                   2247: -68 OF cr ." E3405: No such device" cr ENDOF
                   2248: -67 OF cr ." E3404: Not a bootable device!" cr ENDOF
                   2249: -66 OF cr ." E3408: Failed to claim memory for the executable" cr
                   2250: ENDOF
                   2251: -65 OF cr ." E3407: Load failed" cr ENDOF
                   2252: -64 OF cr ." E3403: Bad executable:   " abort"-str @ count type cr
                   2253: ENDOF
                   2254: -63 OF cr ." E3409: Unknown FORTH Word" cr ENDOF
                   2255: -2 OF cr ." E3401: Aborting boot,  " abort"-str @ count type cr
                   2256: ENDOF
                   2257: dup OF ." E3402: Aborting boot, internal error" cr ENDOF
                   2258: ENDCASE
                   2259: THEN
                   2260: ELSE
                   2261: drop
                   2262: THEN
                   2263: ;
                   2264: ' (boot-exception-handler) to boot-exception-handler
                   2265: : throw-error ( error-code "error-string" -- )
                   2266: skipws 0a parse rot throw
                   2267: ;
                   2268: : enable-ext-int ( -- )
                   2269: msr@ 8000 or msr!
                   2270: ;
                   2271: : disable-ext-int ( -- )
                   2272: msr@ 8000 not and msr!
                   2273: ;
                   2274: : gen-ext-int ( -- )
                   2275: 7fffffff dec!               \ Reset decrementer
                   2276: enable-ext-int              \ Enable interrupt
                   2277: FF 20000508418 rx!          \ Interrupt priority mask
                   2278: 10 20000508410 rx!          \ Interrupt priority
                   2279: ;
                   2280: : mm-log-warning 2drop ;
                   2281: : write-mm-log ( data length type -- status )
                   2282: 3drop 0
                   2283: ;
                   2284: 080 cp
                   2285: 100 cp
                   2286: : beep  bell emit ;
                   2287: : TABLE-EXECUTE
                   2288: CREATE DOES> swap cells+ @ ?dup IF execute ELSE beep THEN ;
                   2289: 0 VALUE accept-adr
                   2290: 0 VALUE accept-max
                   2291: 0 VALUE accept-len
                   2292: 0 VALUE accept-cur
                   2293: : esc  1b emit ;
                   2294: : csi  esc 5b emit ;
                   2295: : move-cursor ( -- )
                   2296: esc ." 8" accept-cur IF
                   2297: csi base @ decimal accept-cur 0 .r base ! ." C"
                   2298: THEN
                   2299: ;
                   2300: : redraw-line ( -- )
                   2301: accept-cur accept-len = IF EXIT THEN
                   2302: move-cursor
                   2303: accept-adr accept-len accept-cur /string type
                   2304: csi ." K" move-cursor
                   2305: ;
                   2306: : full-redraw-line ( -- )
                   2307: accept-cur 0 to accept-cur move-cursor
                   2308: accept-adr accept-len type
                   2309: csi ." K" to accept-cur move-cursor
                   2310: ;
                   2311: : redraw-prompt ( -- )
                   2312: cr depth . [char] > emit
                   2313: ;
                   2314: : insert-char ( char -- )
                   2315: accept-len accept-max = IF drop beep EXIT THEN
                   2316: accept-cur accept-len <> IF csi ." @" dup emit
                   2317: accept-adr accept-cur + dup 1+ accept-len accept-cur - move
                   2318: ELSE dup emit THEN
                   2319: accept-adr accept-cur + c!
                   2320: accept-cur 1+ to accept-cur
                   2321: accept-len 1+ to accept-len redraw-line
                   2322: ;
                   2323: : delete-char ( -- )
                   2324: accept-cur accept-len = IF beep EXIT THEN
                   2325: accept-len 1- to accept-len
                   2326: accept-adr accept-cur + dup 1+ swap accept-len accept-cur - move
                   2327: csi ." P" redraw-line
                   2328: ;
                   2329: STRUCT
                   2330: cell FIELD his>next
                   2331: cell FIELD his>prev
                   2332: cell FIELD his>len
                   2333: 0 FIELD his>buf
                   2334: CONSTANT /his
                   2335: 0 VALUE his-head
                   2336: 0 VALUE his-tail
                   2337: 0 VALUE his-cur
                   2338: : add-history ( -- )
                   2339: accept-len 0= IF EXIT THEN
                   2340: /his accept-len + alloc-mem
                   2341: his-tail IF dup his-tail his>next ! ELSE dup to his-head THEN
                   2342: his-tail over his>prev !  0 over his>next !  dup to his-tail
                   2343: accept-len over his>len !  accept-adr swap his>buf accept-len move
                   2344: ;
                   2345: : history  ( -- )
                   2346: his-head BEGIN dup WHILE
                   2347: cr dup his>buf over his>len @ type
                   2348: his>next @ REPEAT drop
                   2349: ;
                   2350: : select-history ( his -- )
                   2351: dup to his-cur dup IF
                   2352: dup his>len @ accept-max min dup to accept-len to accept-cur
                   2353: his>buf accept-adr accept-len move ELSE
                   2354: drop 0 to accept-len 0 to accept-cur THEN
                   2355: full-redraw-line
                   2356: ;
                   2357: 0 value ?tab-pressed
                   2358: 0 value tab-last-adr
                   2359: 0 value tab-last-len
                   2360: : $same-string ( addr-1 len-1 addr-2 len-2 -- addr-1 len-1' )
                   2361: dup 0= IF    \ The second parameter is not a string.
                   2362: 2drop EXIT \ bail out
                   2363: THEN
                   2364: rot min 0 0 -rot ( addr1 addr2 0 len' 0 )
                   2365: DO ( addr1 addr2 len-1' )
                   2366: 2 pick i + c@ lcc
                   2367: 2 pick i + c@ lcc
                   2368: = IF 1 + ELSE leave THEN
                   2369: LOOP
                   2370: nip
                   2371: ;
                   2372: : $tab-sift-words    ( text-addr text-len -- sift-count )
                   2373: sift-compl-only >r true to sift-compl-only \ save sifting mode
                   2374: last BEGIN @ ?dup WHILE \ loop over all words
                   2375: $inner-sift IF \ any completions possible?
                   2376: 2dup bounds DO I c@ lcc I c! LOOP
                   2377: ?tab-pressed IF 2dup type space THEN  \ <tab><tab> prints possibilities
                   2378: tab-last-adr tab-last-len $same-string \ find matching substring ...
                   2379: to tab-last-len to tab-last-adr       \ ... and save it
                   2380: THEN
                   2381: repeat
                   2382: 2drop
                   2383: #sift-count 0 to #sift-count   \ how many words were found?
                   2384: r> to sift-compl-only          \ restore sifting completion mode
                   2385: ;
                   2386: 0 value current-stack
                   2387: : new-stack ( cells <>name -- )
                   2388: create >r here    ( here R: cells )
                   2389: dup r@ 2 + cells  ( here here bytes R: cells )
                   2390: dup allot erase   ( here R: cells)
                   2391: cell+ r>          ( here+1cell cells )
                   2392: swap !            ( )
                   2393: DOES> to current-stack
                   2394: ;
                   2395: : reset-stack ( -- )
                   2396: 0 current-stack !
                   2397: ;
                   2398: : stack-depth ( -- depth )
                   2399: current-stack @
                   2400: ;
                   2401: : push ( value -- )
                   2402: current-stack @
                   2403: current-stack cell+ @ over <= ABORT" Stack overflow"
                   2404: cells
                   2405: 1 current-stack +!
                   2406: current-stack 2 cells + + !
                   2407: ;
                   2408: : pop ( -- value )
                   2409: current-stack @ 0= ABORT" Stack underflow"
                   2410: current-stack @ cells
                   2411: current-stack + cell+ @
                   2412: -1 current-stack +!
                   2413: ;
                   2414: 10 new-stack device-stack
                   2415: : (next-dev) ( node -- node' addr len )
                   2416: device-stack
                   2417: dup (node>path) rot
                   2418: dup child IF dup push child -rot EXIT THEN
                   2419: dup peer IF peer -rot EXIT THEN
                   2420: drop
                   2421: BEGIN
                   2422: stack-depth
                   2423: WHILE
                   2424: pop peer ?dup IF -rot EXIT THEN
                   2425: REPEAT
                   2426: 0 -rot
                   2427: ;
                   2428: : $inner-sift-nodes ( text-addr text-len node -- ... path-addr path-len true | false )
                   2429: (next-dev) ( text-addr text-len node' path-addr path-len )
                   2430: dup 0= IF drop false EXIT THEN
                   2431: 2dup 6 pick 6 pick find-isubstr ( text-addr text-len node' path-addr path-len pos )
                   2432: 0= IF
                   2433: #sift-count 1+ to #sift-count \ count completions
                   2434: true
                   2435: ELSE
                   2436: 2drop false
                   2437: THEN
                   2438: ;
                   2439: : .nodes ( -- )
                   2440: s" /" find-node BEGIN dup WHILE
                   2441: (next-dev)
                   2442: type cr
                   2443: REPEAT
                   2444: drop
                   2445: reset-stack
                   2446: ;
                   2447: create sift-node-buffer 1000 allot
                   2448: 0 value sift-node-num
                   2449: : sift-node-buffer
                   2450: sift-node-buffer sift-node-num 100 * +
                   2451: sift-node-num 1+ dup 10 = IF drop 0 THEN
                   2452: to sift-node-num
                   2453: ;
                   2454: : $tab-sift-nodes    ( text-addr text-len -- sift-count )
                   2455: s" /" find-node BEGIN dup WHILE
                   2456: $inner-sift-nodes IF \ any completions possible?
                   2457: sift-node-buffer swap 2>r 2r@ move 2r> \ make an almost permanent copy without strdup
                   2458: ?tab-pressed IF 2dup type space THEN  \ <tab><tab> prints possibilities
                   2459: tab-last-adr tab-last-len $same-string \ find matching substring ...
                   2460: to tab-last-len to tab-last-adr       \ ... and save it
                   2461: THEN
                   2462: REPEAT
                   2463: 2drop drop
                   2464: #sift-count 0 to #sift-count   \ how many words were found?
                   2465: reset-stack
                   2466: ;
                   2467: : $tab-sift    ( text-addr text-len -- sift-count )
                   2468: ?tab-pressed IF beep space THEN \ cosmetical fix for <tab><tab>
                   2469: dup IF bl rsplit dup IF 2swap THEN ELSE 0 0 THEN >r >r
                   2470: 0 dup to tab-last-len to tab-last-adr  \ reset last possible match
                   2471: current-node @ IF                      \ if we are in a node?
                   2472: 2dup 2>r                               \ save text
                   2473: $tab-sift-words to #sift-count \ search in current node first
                   2474: 2r>                            \ fetch text to complete, again
                   2475: THEN
                   2476: 2dup 2>r
                   2477: current-node @ >r 0 set-node           \ now search in global words
                   2478: $tab-sift-words to #sift-count
                   2479: r> set-node
                   2480: 2r> $tab-sift-nodes
                   2481: r> r> dup IF s"  " $cat THEN tab-last-adr tab-last-len $cat
                   2482: to tab-last-len to tab-last-adr  \ ... and save the whole string
                   2483: ;
                   2484: : handle-^A
                   2485: 0 to accept-cur move-cursor ;
                   2486: : handle-^B
                   2487: accept-cur ?dup IF 1- to accept-cur ( csi ." D" ) move-cursor THEN ;
                   2488: : handle-^D
                   2489: delete-char ( redraw-line ) ;
                   2490: : handle-^E
                   2491: accept-len to accept-cur move-cursor ;
                   2492: : handle-^F
                   2493: accept-cur accept-len <> IF accept-cur 1+ to accept-cur csi ." C" THEN ;
                   2494: : handle-^H
                   2495: accept-cur 0= IF beep EXIT THEN
                   2496: handle-^B delete-char
                   2497: ;
                   2498: : handle-^I
                   2499: accept-adr accept-len
                   2500: $tab-sift 0 > IF
                   2501: ?tab-pressed IF
                   2502: redraw-prompt full-redraw-line
                   2503: false to ?tab-pressed
                   2504: ELSE
                   2505: tab-last-adr accept-adr tab-last-len move    \ copy matching substring
                   2506: tab-last-len dup to accept-len to accept-cur \ len and cursor position
                   2507: full-redraw-line               \ redraw new string
                   2508: true to ?tab-pressed   \ second tab will print possible matches
                   2509: THEN
                   2510: THEN
                   2511: ;
                   2512: : handle-^K
                   2513: BEGIN accept-cur accept-len <> WHILE delete-char REPEAT ;
                   2514: : handle-^L
                   2515: history redraw-prompt full-redraw-line ;
                   2516: : handle-^N
                   2517: his-cur IF his-cur his>next @ ELSE his-head THEN
                   2518: dup to his-cur select-history
                   2519: ;
                   2520: : handle-^P
                   2521: his-cur IF his-cur his>prev @ ELSE his-tail THEN
                   2522: dup to his-cur select-history
                   2523: ;
                   2524: : handle-^Q  \ Does not handle terminal formatting yet.
                   2525: key insert-char ;
                   2526: : handle-^R
                   2527: full-redraw-line ;
                   2528: : handle-^U
                   2529: 0 to accept-len 0 to accept-cur full-redraw-line ;
                   2530: : handle-fn
                   2531: key drop beep
                   2532: ;
                   2533: TABLE-EXECUTE handle-CSI
                   2534: 0 , ' handle-^P , ' handle-^N , ' handle-^F ,
                   2535: ' handle-^B , 0 , 0 , 0 ,
                   2536: ' handle-^A , 0 , 0 , ' handle-^E ,
                   2537: 0 , 0 , 0 , 0 ,
                   2538: 0 , 0 , 0 , 0 ,
                   2539: 0 , 0 , 0 , 0 ,
                   2540: 0 , 0 , 0 , 0 ,
                   2541: 0 , 0 , 0 , 0 ,
                   2542: TABLE-EXECUTE handle-meta
                   2543: 0 , 0 , 0 , 0 ,
                   2544: 0 , 0 , 0 , 0 ,
                   2545: 0 , 0 , 0 , 0 ,
                   2546: 0 , 0 , 0 , ' handle-fn ,
                   2547: 0 , 0 , 0 , 0 ,
                   2548: 0 , 0 , 0 , 0 ,
                   2549: 0 , 0 , 0 , ' handle-CSI ,
                   2550: 0 , 0 , 0 , 0 ,
                   2551: : handle-ESC-O
                   2552: key
                   2553: dup 48 = IF
                   2554: handle-^A
                   2555: ELSE
                   2556: dup 46 = IF
                   2557: handle-^E
                   2558: THEN
                   2559: THEN drop
                   2560: ;
                   2561: : handle-ESC-5b
                   2562: key
                   2563: dup 31 = IF \ HOME
                   2564: key drop ( drops closing 7e ) handle-^A
                   2565: ELSE
                   2566: dup 33 = IF \ DEL
                   2567: key drop handle-^D
                   2568: ELSE
                   2569: dup 34 = IF \ END
                   2570: key drop handle-^E
                   2571: ELSE
                   2572: dup 1f and handle-CSI
                   2573: THEN
                   2574: THEN
                   2575: THEN drop
                   2576: ;
                   2577: : handle-ESC
                   2578: key
                   2579: dup 5b = IF
                   2580: handle-ESC-5b
                   2581: ELSE
                   2582: dup 4f = IF
                   2583: handle-ESC-O
                   2584: ELSE
                   2585: dup 1f and handle-meta
                   2586: THEN
                   2587: THEN drop
                   2588: ;
                   2589: TABLE-EXECUTE handle-control
                   2590: 0 , \ ^@:
                   2591: ' handle-^A ,
                   2592: ' handle-^B ,
                   2593: 0 , \ ^C:
                   2594: ' handle-^D ,
                   2595: ' handle-^E ,
                   2596: ' handle-^F ,
                   2597: 0 , \ ^G:
                   2598: ' handle-^H ,
                   2599: ' handle-^I , \ tab
                   2600: 0 , \ ^J:
                   2601: ' handle-^K ,
                   2602: ' handle-^L ,
                   2603: 0 , \ ^M: enter: handled in main loop
                   2604: ' handle-^N ,
                   2605: 0 , \ ^O:
                   2606: ' handle-^P ,
                   2607: ' handle-^Q ,
                   2608: ' handle-^R ,
                   2609: 0 , \ ^S:
                   2610: 0 , \ ^T:
                   2611: ' handle-^U ,
                   2612: 0 , \ ^V:
                   2613: 0 , \ ^W:
                   2614: 0 , \ ^X:
                   2615: 0 , \ ^Y: insert save buffer
                   2616: 0 , \ ^Z:
                   2617: ' handle-ESC ,
                   2618: 0 , \ ^\:
                   2619: 0 , \ ^]:
                   2620: 0 , \ ^^:
                   2621: 0 , \ ^_:
                   2622: : (accept) ( adr len -- len' )
                   2623: cursor-on
                   2624: to accept-max to accept-adr
                   2625: 0 to accept-len 0 to accept-cur
                   2626: 0 to his-cur
                   2627: 1b emit 37 emit
                   2628: BEGIN
                   2629: key dup 0d <>
                   2630: WHILE
                   2631: dup 9 <> IF 0 to ?tab-pressed THEN \ reset state machine
                   2632: dup 7f = IF drop 8 THEN \ Handle DEL as if it was BS. ??? bogus
                   2633: dup bl < IF handle-control ELSE
                   2634: dup 80 and IF
                   2635: dup a0 < IF 7f and handle-meta ELSE drop beep THEN
                   2636: ELSE
                   2637: insert-char
                   2638: THEN
                   2639: THEN
                   2640: REPEAT
                   2641: drop add-history
                   2642: accept-len to accept-cur
                   2643: move-cursor space
                   2644: accept-len
                   2645: cursor-off
                   2646: ;
                   2647: ' (accept) to accept
                   2648: 120 cp
                   2649: 1 VALUE /dump
                   2650: ' c@ VALUE 'dump
                   2651: 0 VALUE dump-first
                   2652: 0 VALUE dump-last
                   2653: 0 VALUE dump-cur
                   2654: : .char ( c -- )  dup bl 7f within 0= IF drop [char] . THEN emit ;
                   2655: : dump-line ( -- )
                   2656: cr dump-cur dup 8 0.r [char] : emit 10 /dump / 0 DO
                   2657: space dump-cur dump-first dump-last within IF
                   2658: dump-cur 'dump execute /dump 2* 0.r ELSE
                   2659: /dump 2* spaces THEN dump-cur /dump + to dump-cur LOOP
                   2660: /dump 1 <> IF drop EXIT THEN
                   2661: to dump-cur 2 spaces
                   2662: 10 0 DO dump-cur dump-first dump-last within IF
                   2663: dump-cur 'dump execute .char ELSE space THEN dump-cur 1+ to dump-cur LOOP ;
                   2664: : (dump) ( addr len reader size -- )
                   2665: to /dump to 'dump bounds /dump negate and to dump-first to dump-last
                   2666: dump-first f invert and to dump-cur
                   2667: base @ hex BEGIN dump-line dump-cur dump-last >= UNTIL base ! ;
                   2668: : du ( -- )  dump-last 100 'dump /dump (dump) ;
                   2669: : dump     ['] c@      1 (dump) ;
                   2670: : wdump    ['] w@      2 (dump) ;
                   2671: : ldump    ['] l@      4 (dump) ;
                   2672: : xdump    ['] x@      8 (dump) ;
                   2673: : rdump    ['] rb@     1 (dump) ;
                   2674: cistack ciregs >r1 ! \ kernel wants a stack :-)
                   2675: STRUCT
                   2676: cell field romfs>file-header
                   2677: cell field romfs>data
                   2678: cell field romfs>data-size
                   2679: cell field romfs>flags
                   2680: CONSTANT /romfs-lookup-control-block
                   2681: CREATE romfs-lookup-cb /romfs-lookup-control-block allot
                   2682: romfs-lookup-cb /romfs-lookup-control-block erase
                   2683: : create-filename ( string -- string\0 )
                   2684: here >r dup 8 + allot
                   2685: r@ over 8 + erase
                   2686: r@ zplace r> ;
                   2687: : romfs-lookup ( fn-str fn-len -- data size | false )
                   2688: create-filename romfs-base
                   2689: romfs-lookup-cb romfs-lookup-entry call-c
                   2690: 0= IF romfs-lookup-cb dup romfs>data @ swap romfs>data-size @ ELSE
                   2691: false THEN ;
                   2692: : ibm,romfs-lookup ( fn-str fn-len -- data-high data-low size | 0 0 false )
                   2693: romfs-lookup dup
                   2694: 0= if drop 0 0 false else
                   2695: swap dup 20 rshift swap ffffffff and then ;
                   2696: : romfs-lookup-client ibm,romfs-lookup ;
                   2697: STRUCT
                   2698: cell field romfs>next-off
                   2699: cell field romfs>size
                   2700: cell field romfs>flags
                   2701: cell field romfs>data-off
                   2702: cell field romfs>name
                   2703: CONSTANT /romfs-cb
                   2704: : romfs-map-file ( fn-str fn-len -- file-addr file-size )
                   2705: romfs-base >r
                   2706: BEGIN 2dup r@ romfs>name zcount string=ci not WHILE
                   2707: ( fn-str fn-len ) ( R: rom-cb-file-addr )
                   2708: r> romfs>next-off dup @ dup 0= IF 1 THROW THEN + >r REPEAT
                   2709: ( fn-str fn-len ) ( R: rom-cb-file-addr )
                   2710: 2drop r@ romfs>data-off @ r@ + r> romfs>size @ ;
                   2711: : flash-header ( -- address | false )
                   2712: get-flash-base 28 +         \ prepare flash header file address
                   2713: dup rx@                     \ fetch "magic123"
                   2714: 6d61676963313233 <> IF      \ IF flash is not valid
                   2715: drop                     \ | forget address
                   2716: false                    \ | return false
                   2717: THEN                        \ FI
                   2718: ;
                   2719: CREATE bdate-str 10 allot
                   2720: : bdate2human ( -- addr len )
                   2721: flash-header 40 + rx@ (.)
                   2722: drop dup 0 + bdate-str 6 + 4 move
                   2723: dup 4 + bdate-str 0 + 2 move
                   2724: dup 6 + bdate-str 3 + 2 move
                   2725: dup 8 + bdate-str b + 2 move
                   2726: a + bdate-str e + 2 move
                   2727: 2d bdate-str 2 + c!
                   2728: 2d bdate-str 5 + c!
                   2729: 20 bdate-str a + c!
                   2730: 3a bdate-str d + c!
                   2731: bdate-str 10
                   2732: ;
                   2733: : included  ( fn fn-len -- )
                   2734: 2dup >r >r romfs-lookup dup IF
                   2735: r> drop r> drop evaluate
                   2736: ELSE
                   2737: drop ." Cannot open file : " r> r> type cr
                   2738: THEN
                   2739: ;
                   2740: : include  ( " fn " -- )
                   2741: parse-word included
                   2742: ;
                   2743: : ?include  ( flag " fn " -- )
                   2744: parse-word rot IF included ELSE 2drop THEN
                   2745: ;
                   2746: : include?  ( nargs flag " fn " -- )
                   2747: parse-word rot IF
                   2748: rot drop included
                   2749: ELSE
                   2750: 2drop 0 ?DO drop LOOP
                   2751: THEN
                   2752: ;
                   2753: : (print-romfs-file-info)  ( file-addr -- )
                   2754: 9 emit  dup b 0.r  2 spaces  dup 8 + @ 6 0.r  2 spaces  20 + zcount type cr
                   2755: ;
                   2756: : romfs-list  ( -- )
                   2757: romfs-base 0 cr BEGIN + dup (print-romfs-file-info) dup @ dup 0= UNTIL 2drop
                   2758: ;
                   2759: 140 cp
                   2760: 200 cp
                   2761: 201 cp
                   2762: : .slof-logo
                   2763: cr ."         ..`. ..     .......  ..           ......      ......."
                   2764: cr ."     ..`...`''.`'. .''``````..''.       .`''```''`.  `''``````"
                   2765: cr ."        .`` .:' ': `''.....  .''.       ''`     .''..''......."
                   2766: cr ."          ``.':.';. ``````''`.''.      .''.      ''``''`````'`"
                   2767: cr ."          ``.':':`   .....`''.`'`...... `'`.....`''.`'`       "
                   2768: cr ."         .`.`'``   .'`'`````.  ``''''''  ``''`'''`. `'`       "
                   2769: ;
                   2770: : banner
                   2771: cr ."   Type 'boot'  and press return  to  continue  booting  the system."
                   2772: s" /packages/sms" find-node IF
                   2773: cr ."   Type 'sms-start' and press return to enter the configuration menu."
                   2774: THEN
                   2775: cr ."   Type 'reset-all'  and  press  return  to   reboot   the   system."
                   2776: cr cr
                   2777: ;
                   2778: : .banner banner console-clean-fifo ;
                   2779: : .banner .slof-logo .banner ;
                   2780: 220 cp
                   2781: DEFER find-boot-sector ( -- )
                   2782: 240 cp
                   2783: d# 512000000 VALUE tb-frequency   \ default value - needed for "ms" to work
                   2784: -1 VALUE cpu-frequency
                   2785: : slof-build-id  ( -- str len )
                   2786: flash-header 10 + a
                   2787: ;
                   2788: : slof-revision s" 001" ;
                   2789: : read-version-and-date
                   2790: flash-header 0= IF
                   2791: s"  " encode-string
                   2792: ELSE
                   2793: flash-header 10 + 10
                   2794: here swap rmove
                   2795: here 10
                   2796: s" , " $cat
                   2797: bdate2human $cat encode-string THEN
                   2798: ;
                   2799: : from-cstring ( addr - len )  
                   2800: dup dup BEGIN c@ 0 <> WHILE 1 + dup REPEAT
                   2801: swap -
                   2802: ;
                   2803: 260 cp
                   2804: : tb@  ( -- tb )
                   2805: BEGIN tbu@ tbl@ tbu@ rot over <> WHILE 2drop REPEAT
                   2806: 20 lshift swap ffffffff and or
                   2807: ;
                   2808: : milliseconds ( -- ms ) tb@ d# 1000 * tb-frequency / ;
                   2809: : microseconds ( -- us ) tb@ d# 1000000 * tb-frequency / ;
                   2810: : ms ( ms-to-wait -- ) milliseconds + BEGIN milliseconds over >= UNTIL drop ;
                   2811: : get-msecs ( -- n ) milliseconds ;
                   2812: : us  ( us-to-wait -- )  microseconds +  BEGIN microseconds over >= UNTIL  drop ;
                   2813: 280 cp
                   2814: 2c0 cp
                   2815: 2e0 cp
                   2816: 10 CONSTANT quiesce-xt#
                   2817: CREATE quiesce-xts quiesce-xt# cells allot
                   2818: quiesce-xts quiesce-xt# cells erase
                   2819: : add-quiesce-xt  ( xt -- )
                   2820: quiesce-xt# 0 DO
                   2821: quiesce-xts I cells +    ( xt arrayptr )
                   2822: dup @ 0=                 ( xt arrayptr true|false )
                   2823: IF
                   2824: ! UNLOOP EXIT
                   2825: ELSE                     ( xt arrayptr )
                   2826: over swap             ( xt xt arrayptr )
                   2827: @ =                   \ xt already stored ?
                   2828: IF
                   2829: drop UNLOOP EXIT
                   2830: THEN                  ( xt )
                   2831: THEN
                   2832: LOOP
                   2833: drop                        ( xt -- )
                   2834: ." Warning: quiesce xt list is full." cr
                   2835: ;
                   2836: : quiesce  ( -- )
                   2837: quiesce-xt# 0 DO
                   2838: quiesce-xts I cells +    ( arrayptr )
                   2839: @ dup IF                 ( xt )
                   2840: EXECUTE
                   2841: ELSE
                   2842: drop UNLOOP EXIT
                   2843: THEN
                   2844: LOOP
                   2845: ;
                   2846: 300 cp
                   2847: 0 VALUE usb-debug-flag
                   2848: false VALUE scan-time?
                   2849: VARIABLE ihandle-bulk-tran
                   2850: 0 VALUE uDOC-present       \ device present and working?
                   2851: : usb-debug-print  ( str len -- )
                   2852: usb-debug-flag  IF type cr ELSE 2drop THEN
                   2853: ;
                   2854: : usb-debug-print-val  ( str len val -- )
                   2855: usb-debug-flag  IF -ROT type . cr ELSE drop 2drop THEN
                   2856: ;
                   2857: 0 VALUE proceed-char
                   2858: : show-proceed ( -- )
                   2859: scan-time?              \ are we on usb-scan ?
                   2860: IF
                   2861: proceed-char
                   2862: CASE
                   2863: 0   OF 2d ENDOF   \ show '-'
                   2864: 1   OF 5c ENDOF   \ show '\'
                   2865: 2   OF 7c ENDOF   \ show '|'
                   2866: dup OF 2f ENDOF   \ show '/'
                   2867: ENDCASE
                   2868: emit 8 emit
                   2869: proceed-char 1 + 3 AND to proceed-char
                   2870: THEN
                   2871: ;
                   2872: : wait-proceed ( nl -- )
                   2873: show-proceed
                   2874: BEGIN
                   2875: dup d# 100 >         ( nl true|false )
                   2876: WHILE
                   2877: 100 - show-proceed
                   2878: 100 ms               \ do it in steps of 100ms
                   2879: REPEAT
                   2880: ms                      \ rest delay
                   2881: ;
                   2882: : do-alias-setting ( num name-str name-len )
                   2883: rot $cathex strdup            \ create alias name
                   2884: get-node node>path            \ get path string
                   2885: set-alias                     \ and set the alias
                   2886: ;
                   2887: 0 VALUE ohci-alias-num
                   2888: : set-ohci-alias  ( -- )
                   2889: ohci-alias-num dup 1+ TO ohci-alias-num    ( num )
                   2890: s" ohci"
                   2891: do-alias-setting
                   2892: ;
                   2893: 0 VALUE cdrom-alias-num
                   2894: 0 VALUE disk-alias-num        \ shall start with: pci-disk-num
                   2895: FALSE VALUE ext-disk-alias    \ first external disk: not yet assigned
                   2896: : set-drive-alias  ( --  )
                   2897: space 5b emit
                   2898: s" cdrom" drop                ( name-str )
                   2899: get-node node>name comp 0=    ( true|false )
                   2900: IF                            \ is this a cdrom ?
                   2901: cdrom-alias-num dup 1+ TO cdrom-alias-num    ( num )
                   2902: s" cdrom"                  \ yes, alias = cdrom
                   2903: ELSE
                   2904: s" sbc-dev" drop           \ is this a scsi-block-device?
                   2905: get-node node>name comp 0= ( true|false )
                   2906: IF
                   2907: disk-alias-num dup 1 + to disk-alias-num
                   2908: s" disk"                \ all block devices will be named "disk"
                   2909: s" usb" drop            \ parent = usb controller ? (not hub)
                   2910: get-node node>parent @ node>name
                   2911: comp 0=                 \ parent node starts with 'usb' ?
                   2912: IF                      ( true|false )
                   2913: 1 s" hdd"            \ add extra alias hdd1 for IntFlash
                   2914: 2dup type 2 pick .
                   2915: 8 emit 2f emit
                   2916: do-alias-setting
                   2917: uDOC-present 1 and
                   2918: IF
                   2919: uDOC-present 2 or to uDOC-present \ present and ready
                   2920: THEN
                   2921: ELSE
                   2922: ext-disk-alias not   \ flag for first ext. disk already assigned
                   2923: IF
                   2924: TRUE to ext-disk-alias
                   2925: 2 s" hdd"         \ add extra alias hdd2 for first USB disk
                   2926: 2dup type 2 pick .
                   2927: 8 emit 2f emit
                   2928: do-alias-setting
                   2929: THEN
                   2930: THEN
                   2931: ELSE
                   2932: 0 s" ??? "              \ unknown device
                   2933: THEN
                   2934: THEN     ( num name-str name-len )
                   2935: 2dup type 2 pick .
                   2936: 8 emit 5d emit cr
                   2937: do-alias-setting
                   2938: ;
                   2939: : usb-create-alias-name ( num -- str len )
                   2940: >r s" ohciX" 2dup + 1-           ( str len last-char-ptr  R: num )
                   2941: r> [char] 0 + swap c!            ( str len  R: )
                   2942: ;
                   2943: : uDOC-check   ( -- )
                   2944: ;
                   2945: : uDOC-failure?   ( -- )
                   2946: uDOC-present 80 and 0<>                \ is ModFD actual beeing processed?
                   2947: IF
                   2948: uDOC-present 04 or to uDOC-present  \ set Warning flag
                   2949: THEN
                   2950: ;
                   2951: : usb-scan
                   2952: space ." Scan USB... " cr
                   2953: true to scan-time?            \ show proceeding signs
                   2954: 0 to uDOC-present             \ mark as not present
                   2955: 0 to disk-alias-num           \ start with disk0
                   2956: s" pci-disk-num" $find        \ previously detected disks ?
                   2957: IF
                   2958: execute to disk-alias-num  \ overwrite start number
                   2959: ELSE
                   2960: 2drop
                   2961: THEN
                   2962: 0 >r                             \ Counter for alias
                   2963: BEGIN
                   2964: r@ usb-create-alias-name
                   2965: find-alias ?dup               ( false | str len len  R: num )
                   2966: WHILE
                   2967: usb-debug-flag IF
                   2968: ." * Scanning hub " 2dup type ." ..." cr
                   2969: THEN
                   2970: open-dev ?dup IF              ( ihandle  R: num )
                   2971: dup to my-self
                   2972: dup ihandle>phandle dup set-node
                   2973: child ?dup IF
                   2974: delete-node s" Deleting node" usb-debug-print
                   2975: THEN
                   2976: >r s" enumerate" r@ $call-method   \ Scan host controller
                   2977: r> close-dev  0 set-node 0 to my-self
                   2978: THEN                          ( R: num )
                   2979: r> 1+ >r                      ( R: num+1 )
                   2980: REPEAT   r> drop
                   2981: 0 TO ohci-alias-num
                   2982: 0 TO cdrom-alias-num
                   2983: s" cdrom0" find-alias            ( false | dev-path len )
                   2984: dup IF
                   2985: s" cdrom" 2swap              ( alias-name len' dev-path len )
                   2986: set-alias                    ( -- )
                   2987: ELSE 
                   2988: drop                         ( -- )
                   2989: THEN
                   2990: uDOC-check  \ check if uDOC-device is present and working (ELBA only)
                   2991: false to scan-time?                 \ suppress proceeding signs
                   2992: ;
                   2993: : usb-probe
                   2994: usb-scan
                   2995: cdrom-alias-num 0= IF
                   2996: ." Not found CDROM! " cr
                   2997: THEN
                   2998: ." CDROM found " cdrom-alias-num . cr 
                   2999: ;
                   3000: : usb-dev-test ( -- TRUE )
                   3001: s" USB Device Test " usb-debug-print
                   3002: 1 usb-create-alias-name
                   3003: find-alias ?dup IF
                   3004: ." * open " 2dup type . cr
                   3005: ELSE
                   3006: s" can't found alias " usb-debug-print
                   3007: THEN
                   3008: open-dev ?dup IF
                   3009: dup to my-self
                   3010: dup ihandle>phandle dup set-node
                   3011: s" bulk" $open-package ihandle-bulk-tran !
                   3012: s" close all " usb-debug-print
                   3013: close-dev 0 set-node 0 to my-self
                   3014: ihandle-bulk-tran close-package
                   3015: ELSE
                   3016: s" can't open usb hub" usb-debug-print
                   3017: THEN
                   3018: TRUE
                   3019: ;
                   3020: 320 cp
                   3021: : .ansi-attr-off 1b emit ." [0m"  ;    \ ESC Sequence: all terminal atributes off
                   3022: : .ansi-blue     1b emit ." [34m" ;    \ ESC Sequence: foreground-color = blue
                   3023: : .ansi-green    1b emit ." [32m" ;    \ ESC Sequence: foreground-color = green
                   3024: : .ansi-red      1b emit ." [31m" ;    \ ESC Sequence: foreground-color = green
                   3025: : .ansi-bold     1b emit ." [1m"  ;    \ ESC Sequence: foreground-color bold
                   3026: false VALUE scsi-supp-present?
                   3027: : scsi-xt-err ." SCSI-ERROR (Intern) " ;
                   3028: ' scsi-xt-err VALUE scsi-open-xt        \ preset with an invalid token
                   3029: : .wordlists      ( -- )
                   3030: .ansi-red
                   3031: get-order      ( -- wid1 .. widn n )
                   3032: dup space 28 emit .d ." word lists : "
                   3033: 0 DO
                   3034: . 08 emit 2c emit
                   3035: LOOP
                   3036: 08 emit                 \ 'bs'
                   3037: 29 emit                 \ ')'
                   3038: cr space 28 emit
                   3039: ." Context: " context dup .
                   3040: @ 5b emit . 8 emit 5d emit
                   3041: space
                   3042: ." / Current: " current .
                   3043: .ansi-attr-off
                   3044: cr
                   3045: ;
                   3046: : .context  ( num -- )
                   3047: .ansi-red
                   3048: space
                   3049: 5b emit
                   3050: 23 emit . 3a emit
                   3051: context @
                   3052: . 8 emit 5d emit space
                   3053: .ansi-attr-off
                   3054: ;
                   3055: : scsi-open  ( -- )
                   3056: scsi-supp-present? NOT
                   3057: IF
                   3058: s" scsi-support.fs" included  ( xt-open )
                   3059: to scsi-open-xt               (  )
                   3060: true to scsi-supp-present?
                   3061: THEN
                   3062: scsi-open-xt execute
                   3063: ;
                   3064: 340 cp
                   3065: 360 cp
                   3066: 0 VALUE fdt-debug
                   3067: fdt-start 0 = IF -1 throw THEN
                   3068: struct
                   3069: 4 field >fdth_magic
                   3070: 4 field >fdth_tsize
                   3071: 4 field >fdth_struct_off
                   3072: 4 field >fdth_string_off
                   3073: 4 field >fdth_rsvmap_off
                   3074: 4 field >fdth_version
                   3075: 4 field >fdth_compat_vers
                   3076: 4 field >fdth_boot_cpu
                   3077: 4 field >fdth_string_size
                   3078: 4 field >fdth_struct_size
                   3079: drop
                   3080: h# d00dfeed constant OF_DT_HEADER
                   3081: h#        1 constant OF_DT_BEGIN_NODE
                   3082: h#        2 constant OF_DT_END_NODE
                   3083: h#        3 constant OF_DT_PROP
                   3084: h#        4 constant OF_DT_NOP
                   3085: h#        9 constant OF_DT_END
                   3086: fdt-start
                   3087: dup dup >fdth_struct_off l@ + value fdt-struct
                   3088: dup dup >fdth_string_off l@ + value fdt-strings
                   3089: drop
                   3090: : fdt-check-header ( -- )
                   3091: fdt-start dup 0 = IF
                   3092: ." No flat device tree !" cr drop -1 throw EXIT THEN
                   3093: hex
                   3094: fdt-debug IF
                   3095: ." Flat device tree header at 0x" dup . s" :" type cr
                   3096: ."  magic            : 0x" dup >fdth_magic l@ . cr
                   3097: ."  total size       : 0x" dup >fdth_tsize l@ . cr
                   3098: ."  offset to struct : 0x" dup >fdth_struct_off l@ . cr
                   3099: ."  offset to strings: 0x" dup >fdth_string_off l@ . cr
                   3100: ."  offset to rsvmap : 0x" dup >fdth_rsvmap_off l@ . cr
                   3101: ."  version          : " dup >fdth_version l@ decimal . hex cr
                   3102: ."  last compat vers : " dup >fdth_compat_vers l@ decimal . hex cr
                   3103: dup >fdth_version l@ 2 >= IF
                   3104: ."  boot CPU         : 0x" dup >fdth_boot_cpu l@ . cr
                   3105: THEN
                   3106: dup >fdth_version l@ 3 >= IF
                   3107: ."  strings size     : 0x" dup >fdth_string_size l@ . cr
                   3108: THEN
                   3109: dup >fdth_version l@ 17 >= IF
                   3110: ."  struct size      : 0x" dup >fdth_struct_size l@ . cr
                   3111: THEN
                   3112: THEN
                   3113: dup >fdth_magic l@ OF_DT_HEADER <> IF
                   3114: ." Flat device tree has incorrect magic value !" cr
                   3115: drop -1 throw EXIT
                   3116: THEN
                   3117: dup >fdth_version l@ 10 < IF
                   3118: ." Flat device tree has usupported version !" cr
                   3119: drop -1 throw EXIT
                   3120: THEN
                   3121: drop
                   3122: ;
                   3123: fdt-check-header
                   3124: : fdt-next-tag ( addr -- nextaddr tag )
                   3125: 0                              ( dummy tag on stack for loop )
                   3126: BEGIN
                   3127: drop                   ( drop previous tag )
                   3128: dup l@                 ( read new tag )
                   3129: swap 4 + swap          ( increment addr )
                   3130: dup OF_DT_NOP <> UNTIL         ( loop until not nop )
                   3131: ;
                   3132: : fdt-fetch-unit ( addr -- addr $name )
                   3133: dup from-cstring              \  get string size
                   3134: 2dup + 1 + 3 + fffffffc and -rot
                   3135: ;
                   3136: : fdt-fetch-string ( index -- $string)  
                   3137: fdt-strings + dup from-cstring
                   3138: ;
                   3139: : fdt-create-dec  s" decode-unit" $CREATE , DOES> @ hex-decode-unit ;
                   3140: : fdt-create-enc  s" encode-unit" $CREATE , DOES> @ hex-encode-unit ;
                   3141: : fdt-unflatten-node ( start -- end )
                   3142: recursive
                   3143: fdt-next-tag dup OF_DT_BEGIN_NODE <> IF
                   3144: s" Weird tag 0x" type . " at start of node" type cr
                   3145: -1 throw
                   3146: THEN drop
                   3147: new-device
                   3148: fdt-fetch-unit
                   3149: dup 0 = IF drop drop " /" THEN
                   3150: 40 left-parse-string
                   3151: device-name
                   3152: dup IF
                   3153: " #address-cells" get-parent get-package-property IF
                   3154: 2drop
                   3155: ELSE
                   3156: decode-int nip nip
                   3157: hex-decode-unit
                   3158: set-unit
                   3159: THEN
                   3160: ELSE 2drop THEN
                   3161: BEGIN
                   3162: fdt-next-tag dup OF_DT_END_NODE <>
                   3163: WHILE
                   3164: dup OF_DT_PROP = IF
                   3165: drop dup                       ( drop tag, dup addr     : a1 a1 )
                   3166: dup l@ dup rot 4 +     ( fetch size, stack is   : a1 s s a2)
                   3167: dup l@ swap 4 +                ( fetch nameid, stack is : a1 s s i a3 )
                   3168: rot                       ( we now have: a1 s i a3 s )
                   3169: encode-bytes rot               ( a1 s pa ps i)
                   3170: fdt-fetch-string               ( a1 s pa ps $pn )
                   3171: property
                   3172: + 8 + 3 + fffffffc and
                   3173: ELSE dup OF_DT_BEGIN_NODE = IF
                   3174: drop                   ( drop tag )
                   3175: 4 -
                   3176: fdt-unflatten-node
                   3177: ELSE
                   3178: drop -1 throw
                   3179: THEN THEN
                   3180: REPEAT drop \ drop tag
                   3181: " #address-cells" get-node get-package-property IF ELSE
                   3182: decode-int dup fdt-create-dec fdt-create-enc 2drop
                   3183: THEN
                   3184: finish-device  
                   3185: ;
                   3186: : fdt-unflatten-tree
                   3187: fdt-debug IF
                   3188: ." Unflattening device tree..." cr THEN
                   3189: fdt-struct fdt-unflatten-node drop
                   3190: fdt-debug IF
                   3191: ." Done !" cr THEN
                   3192: ;
                   3193: fdt-unflatten-tree
                   3194: : fdt-parse-memory
                   3195: " /memory" find-device
                   3196: " reg" get-node get-package-property IF throw -1 THEN
                   3197: decode-phys 2drop decode-phys
                   3198: my-#address-cells 1 > IF 20 << or THEN
                   3199: fdt-debug IF
                   3200: dup ." Memory size: " . cr
                   3201: THEN
1.1.1.2 ! root     3202: MIN-RAM-SIZE swap MIN-RAM-SIZE - release
1.1       root     3203: 2drop device-end
                   3204: ;
                   3205: fdt-parse-memory
                   3206: : fdt-claim-reserve
                   3207: fdt-start
                   3208: dup dup >fdth_tsize l@ 0 claim drop
                   3209: dup >fdth_rsvmap_off l@ +
                   3210: BEGIN
                   3211: dup dup x@ swap 8 + x@
                   3212: dup 0 <>
                   3213: WHILE
                   3214: fdt-debug IF
                   3215: 2dup swap ." Reserve map entry: " . ." : " . cr
                   3216: THEN
                   3217: 0 claim drop
                   3218: 10 +
                   3219: REPEAT drop drop drop
                   3220: ;
                   3221: fdt-claim-reserve 
                   3222: defer (client-exec)
                   3223: defer client-exec
                   3224: defer callback
                   3225: defer continue-client
                   3226: : set-chosen ( prop len name len -- )
                   3227: s" /chosen" find-node set-property ;
                   3228: : get-chosen ( name len -- [ prop len ] success )
                   3229: s" /chosen" find-node get-property 0= ;
                   3230: " /" find-device
                   3231: new-device
                   3232: s" aliases" device-name
                   3233: finish-device
                   3234: new-device
                   3235: s" options" device-name
                   3236: finish-device
                   3237: new-device
                   3238: s" openprom" device-name
                   3239: s" BootROM" device-type
                   3240: finish-device
                   3241: new-device 
                   3242: s" packages" device-name
                   3243: get-node to packages
                   3244: new-device
                   3245: s" deblocker" device-name
                   3246: INSTANCE VARIABLE offset
                   3247: INSTANCE VARIABLE block-size
                   3248: INSTANCE VARIABLE max-transfer
                   3249: INSTANCE VARIABLE my-block
                   3250: INSTANCE VARIABLE adr
                   3251: INSTANCE VARIABLE len
                   3252: : open
                   3253: s" block-size" ['] $call-parent CATCH IF 2drop false EXIT THEN
                   3254: block-size !
                   3255: s" max-transfer" ['] $call-parent CATCH IF 2drop false EXIT THEN
                   3256: max-transfer !
                   3257: block-size @ alloc-mem my-block !
                   3258: 0 offset !
                   3259: true ;
                   3260: : close  my-block @ block-size @ free-mem ;
                   3261: : seek ( lo hi -- status ) \ XXX: perhaps we should fail if the underlying
                   3262: lxjoin offset !  0 ;
                   3263: : block+remainder ( -- block# remainder )  offset @ block-size @ u/mod swap ;
                   3264: : read-blocks ( addr block# #blocks -- actual )  s" read-blocks" $call-parent ;
                   3265: : read ( addr len -- actual )
                   3266: dup >r  len ! adr !
                   3267: block+remainder dup IF ( block# offset-in-block )
                   3268: >r my-block @ swap 1 read-blocks drop
                   3269: my-block @ r@ + adr @ block-size @ r> - len @ min dup >r move
                   3270: r> dup negate len +! dup adr +! offset +! ELSE 2drop THEN
                   3271: BEGIN len @ block-size @ >= WHILE
                   3272: adr @ block+remainder drop len @ max-transfer @ min block-size @ / read-blocks
                   3273: block-size @ * dup negate len +! dup adr +! offset +! REPEAT
                   3274: len @ IF my-block @ block+remainder drop 1 read-blocks drop
                   3275: my-block @ adr @ len @ move THEN
                   3276: r> ;
                   3277: finish-device
                   3278: new-device
                   3279: false VALUE debug-disk-label?
                   3280: d# 16384 value max-prep-partition-blocks
                   3281: s" disk-label" device-name
                   3282: 0 INSTANCE VALUE partition
                   3283: 0 INSTANCE VALUE part-offset
                   3284: 0 INSTANCE VALUE part-start
                   3285: 0 INSTANCE VALUE lpart-start
                   3286: 0 INSTANCE VALUE part-size
                   3287: 0 INSTANCE VALUE dos-logical-partitions
                   3288: 0 INSTANCE VALUE block-size
                   3289: 0 INSTANCE VALUE block
                   3290: 0 INSTANCE VALUE args
                   3291: 0 INSTANCE VALUE args-len
                   3292: INSTANCE VARIABLE block#  \ variable to store logical sector#
                   3293: INSTANCE VARIABLE hit#    \ partition counter
                   3294: INSTANCE VARIABLE success-flag
                   3295: 0ff constant END-OF-DESC
                   3296: 3 constant  PARTITION-ID
                   3297: 48 constant VOL-PART-LOC
                   3298: STRUCT
                   3299: 1b8 field mbr>boot-loader
                   3300: /l field mbr>disk-signature
                   3301: /w field mbr>null
                   3302: 40 field mbr>partition-table
                   3303: /w field mbr>magic
                   3304: CONSTANT /mbr
                   3305: STRUCT
                   3306: /c field part-entry>active
                   3307: /c field part-entry>start-head
                   3308: /c field part-entry>start-sect
                   3309: /c field part-entry>start-cyl
                   3310: /c field part-entry>id
                   3311: /c field part-entry>end-head
                   3312: /c field part-entry>end-sect
                   3313: /c field part-entry>end-cyl
                   3314: /l field part-entry>sector-offset
                   3315: /l field part-entry>sector-count
                   3316: CONSTANT /partition-entry
                   3317: : offset ( d.rel -- d.abs )
                   3318: part-offset 0 d+
                   3319: ;
                   3320: : seek  ( pos.lo pos.hi -- status )
                   3321: offset
                   3322: debug-disk-label? IF 2dup ." seek-parent: pos.hi=0x" u. ." pos.lo=0x" u. THEN
                   3323: s" seek" $call-parent
                   3324: debug-disk-label? IF dup ." status=" . cr THEN
                   3325: ;
                   3326: : read ( addr len -- actual )
                   3327: debug-disk-label? IF 2dup swap ." read-parent: addr=0x" u. ." len=" .d THEN
                   3328: s" read" $call-parent
                   3329: debug-disk-label? IF dup ." actual=" .d cr THEN
                   3330: ;
                   3331: : read-sector ( sector-number -- )
                   3332: block-size * 0 seek drop      \ seek to sector
                   3333: block block-size read drop    \ read sector
                   3334: ;
                   3335: : (.part-entry) ( part-entry )
                   3336: cr ." part-entry>active:        " dup part-entry>active c@ .d
                   3337: cr ." part-entry>start-head:    " dup part-entry>start-head c@ .d
                   3338: cr ." part-entry>start-sect:    " dup part-entry>start-sect c@ .d
                   3339: cr ." part-entry>start-cyl:     " dup part-entry>start-cyl  c@ .d
                   3340: cr ." part-entry>id:            " dup part-entry>id c@ .d
                   3341: cr ." part-entry>end-head:      " dup part-entry>end-head c@ .d
                   3342: cr ." part-entry>end-sect:      " dup part-entry>end-sect c@ .d
                   3343: cr ." part-entry>end-cyl:       " dup part-entry>end-cyl c@ .d
                   3344: cr ." part-entry>sector-offset: " dup part-entry>sector-offset l@-le .d
                   3345: cr ." part-entry>sector-count:  " dup part-entry>sector-count l@-le .d
                   3346: cr
                   3347: ;
                   3348: : (.name) r@ begin cell - dup @ <colon> = UNTIL xt>name cr type space ;
                   3349: : init-block ( -- )
                   3350: s" block-size" ['] $call-parent CATCH IF ABORT" parent has no block-size." THEN
                   3351: to block-size
                   3352: d# 2048 alloc-mem
                   3353: dup d# 2048 erase
                   3354: to block
                   3355: debug-disk-label? IF
                   3356: ." init-block: block-size=" block-size .d ." block=0x" block u. cr
                   3357: THEN
                   3358: ;
                   3359: : no-mbr? ( -- true|false )
                   3360: 0 read-sector block mbr>magic w@-le aa55 <>
                   3361: ;
                   3362: : pc-extended-partition? ( part-entry-addr -- true|false )
                   3363: part-entry>id c@      ( id )
                   3364: dup 5 = swap          ( true|false id )
                   3365: dup f = swap          ( true|false true|false id )
                   3366: 85 =                  ( true|false true|false true|false )
                   3367: or or                 ( true|false )
                   3368: ;
                   3369: : partition>part-entry ( partition -- part-entry )
                   3370: 1- /partition-entry * block mbr>partition-table +
                   3371: ;
                   3372: : partition>start-sector ( partition -- sector-offset )
                   3373: partition>part-entry part-entry>sector-offset l@-le
                   3374: ;
                   3375: : count-dos-logical-partitions ( -- #logical-partitions )
                   3376: no-mbr? IF 0 EXIT THEN
                   3377: 0 5 1 DO                                ( current )
                   3378: i partition>part-entry               ( current part-entry )
                   3379: dup pc-extended-partition? IF
                   3380: part-entry>sector-offset l@-le    ( current sector )
                   3381: dup to part-start to lpart-start  ( current )
                   3382: BEGIN
                   3383: part-start read-sector          \ read EBR
                   3384: 1 partition>start-sector IF
                   3385: 1+
                   3386: THEN \ another logical partition
                   3387: 2 partition>start-sector
                   3388: ?dup IF lpart-start + to part-start false ELSE true THEN
                   3389: UNTIL
                   3390: ELSE
                   3391: drop
                   3392: THEN
                   3393: LOOP
                   3394: ;
                   3395: : (get-dos-partition-params) ( ext-part-start part-entry -- offset count active? id )
                   3396: dup part-entry>sector-offset l@-le rot + swap ( offset part-entry )
                   3397: dup part-entry>sector-count l@-le swap        ( offset count part-entry )
                   3398: dup part-entry>active c@ 80 = swap            ( offset count active? part-entry )
                   3399: part-entry>id c@                              ( offset count active? id )
                   3400: ;
                   3401: : find-dos-partition ( partition# -- false | offset count active? id true )
                   3402: to partition 0 to part-start 0 to part-offset
                   3403: partition 0<= IF 0 to partition false EXIT THEN
                   3404: no-mbr? IF 0 to partition false EXIT THEN
                   3405: partition 4 <= IF \ Is this a primary partition?
                   3406: 0 partition partition>part-entry
                   3407: (get-dos-partition-params)
                   3408: true EXIT
                   3409: ELSE
                   3410: partition 4 - 0 5 1 DO                      ( logical-partition current )
                   3411: i partition>part-entry                   ( log-part current part-entry )
                   3412: dup pc-extended-partition? IF
                   3413: part-entry>sector-offset l@-le        ( log-part current sector )
                   3414: dup to part-start to lpart-start      ( log-part current )
                   3415: BEGIN
                   3416: part-start read-sector             \ read EBR
                   3417: 1 partition>start-sector IF        \ first partition entry
                   3418: 1+ 2dup = IF                    ( log-part current )
                   3419: 2drop
                   3420: part-start 1 partition>part-entry
                   3421: (get-dos-partition-params)
                   3422: true UNLOOP EXIT
                   3423: THEN
                   3424: 2 partition>start-sector
                   3425: ?dup IF lpart-start + to part-start false ELSE true THEN
                   3426: ELSE
                   3427: true
                   3428: THEN
                   3429: UNTIL
                   3430: ELSE
                   3431: drop
                   3432: THEN
                   3433: LOOP
                   3434: 2drop false
                   3435: THEN
                   3436: ;
                   3437: : try-dos-partition ( -- okay? )
                   3438: no-mbr? IF cr ." No DOS disk-label found." cr false EXIT THEN
                   3439: count-dos-logical-partitions TO dos-logical-partitions
                   3440: debug-disk-label? IF
                   3441: ." Found " dos-logical-partitions .d ." logical partitions" cr
                   3442: ." Partition = " partition .d cr
                   3443: THEN
                   3444: partition 1 5 dos-logical-partitions +
                   3445: within 0= IF
                   3446: cr ." Partition # not 1-" 4 dos-logical-partitions + . cr false EXIT
                   3447: THEN
                   3448: partition find-dos-partition IF
                   3449: 2drop drop
                   3450: block-size * to part-offset
                   3451: true
                   3452: ELSE
                   3453: false
                   3454: THEN
                   3455: ;
                   3456: : has-iso9660-filesystem  ( -- TRUE|FALSE )
                   3457: 10 800 * 0 seek drop      \ seek to sector
                   3458: block 800 read drop       \ read sector
                   3459: block c@ 1 =
                   3460: block 1+ 5 s" CD001"  str=
                   3461: and
                   3462: dup IF 800 to block-size THEN
                   3463: ;
                   3464: : load-from-dos-boot-partition ( addr -- size )
                   3465: no-mbr? IF FALSE EXIT THEN  \ read MBR and check for DOS disk-label magic
                   3466: count-dos-logical-partitions TO dos-logical-partitions
                   3467: debug-disk-label? IF
                   3468: ." Found " dos-logical-partitions .d ." logical partitions" cr
                   3469: ." Partition = " partition .d cr
                   3470: THEN
                   3471: 5 dos-logical-partitions + 1 DO
                   3472: i find-dos-partition IF        ( addr offset count active? id )
                   3473: 41 = and                    ( addr offset count prep-boot-part? )
                   3474: IF                          ( addr offset count )
                   3475: max-prep-partition-blocks min  \ reduce load size
                   3476: swap                     ( addr count offset )
                   3477: block-size * to part-offset
                   3478: 0 0 seek drop            ( addr offset )
                   3479: block-size * read        ( size )
                   3480: UNLOOP EXIT
                   3481: ELSE
                   3482: 2drop                    ( addr )
                   3483: THEN
                   3484: THEN
                   3485: LOOP
                   3486: drop 0
                   3487: ;
                   3488: : load-from-boot-partition ( addr -- size )
                   3489: load-from-dos-boot-partition
                   3490: ;
                   3491: : parse-bootinfo-txt  ( addr len -- str len )
                   3492: 2dup s" <boot-script>" find-substr       ( addr len pos1 )
                   3493: 2dup = IF
                   3494: 3drop 0 0 EXIT
                   3495: THEN
                   3496: dup >r - swap r> + swap                  ( addr1 len1 )
                   3497: 2dup [char] \ findchar drop              ( addr1 len1 pos2 )
                   3498: dup >r - swap r> + swap                  ( addr2 len2 )
                   3499: 2dup s" </boot-script>" find-substr nip  ( addr2 len3 )
                   3500: ;
                   3501: : load-chrp-boot-file ( addr -- size )
                   3502: my-self parent ihandle>phandle node>path
                   3503: s" :\ppc\bootinfo.txt" $cat strdup       ( addr str len )
                   3504: open-dev dup 0= IF 2drop 0 EXIT THEN
                   3505: >r dup                                   ( addr addr R:ihandle )
                   3506: dup s" load" r@ $call-method             ( addr addr size R:ihandle )
                   3507: r> close-dev                             ( addr addr size )
                   3508: parse-bootinfo-txt                       ( addr fnstr fnlen )
                   3509: dup 0= IF 3drop 0 EXIT THEN
                   3510: my-self parent ihandle>phandle node>path ( addr fnstr fnlen nstr nlen )
                   3511: s" :" $cat 2swap $cat strdup             ( addr str len )
                   3512: 2dup encode-string s" bootpath" set-chosen
                   3513: open-dev dup 0= IF ." failed to load CHRP boot loader." 2drop 0 EXIT THEN
                   3514: >r s" load" r@ $call-method              ( size R:ihandle )
                   3515: r> close-dev                             ( size )
                   3516: ;
                   3517: : parse-partition ( -- okay? )
                   3518: 0 to partition
                   3519: 0 to part-offset
                   3520: my-args to args-len to args
                   3521: args-len 1 = IF args c@ [char] 0 = IF 0 to args-len THEN THEN
                   3522: my-args [char] , findchar 0= IF true EXIT THEN drop \ no comma
                   3523: my-args [char] , split to args-len to args
                   3524: dup 0= IF 2drop true EXIT THEN \ no first argument
                   3525: base @ >r decimal $number r> base !
                   3526: IF cr ." Not a partition #" false EXIT THEN
                   3527: to partition
                   3528: true
                   3529: ;
                   3530: : (interpose-filesystem) ( str len -- )
                   3531: find-package IF args args-len rot interpose THEN
                   3532: ;
                   3533: : try-dos-files ( -- found? )
                   3534: no-mbr? IF false EXIT THEN
                   3535: block c@ e9 <> IF
                   3536: block c@ eb <>
                   3537: block 2+ c@ 90 <> or
                   3538: IF false EXIT THEN
                   3539: THEN
                   3540: s" fat-files" (interpose-filesystem)
                   3541: true
                   3542: ;
                   3543: : try-ext2-files ( -- found? )
                   3544: 2 read-sector               \ read first superblock
                   3545: block d# 56 + w@-le         \ fetch s_magic
                   3546: ef53 <> IF false EXIT THEN  \ s_magic found?
                   3547: s" ext2-files" (interpose-filesystem)
                   3548: true
                   3549: ;
                   3550: : try-iso9660-files
                   3551: has-iso9660-filesystem 0= IF false exit THEN
                   3552: s" iso-9660" (interpose-filesystem)
                   3553: true
                   3554: ;
                   3555: : try-files ( -- found? )
                   3556: args-len 0= IF true EXIT THEN
                   3557: try-dos-files IF true EXIT THEN
                   3558: try-ext2-files IF true EXIT THEN
                   3559: try-iso9660-files IF true EXIT THEN
                   3560: false
                   3561: ;
                   3562: : try-partitions ( -- found? )
                   3563: try-dos-partition IF try-files EXIT THEN
                   3564: false
                   3565: ;
                   3566: : close ( -- )
                   3567: debug-disk-label? IF ." Closing disk-label: block=0x" block u. ." block-size=" block-size .d cr THEN
                   3568: block d# 2048 free-mem
                   3569: ;
                   3570: : open ( -- true|false )
                   3571: init-block
                   3572: parse-partition 0= IF
                   3573: close
                   3574: false EXIT
                   3575: THEN
                   3576: partition IF
                   3577: try-partitions
                   3578: ELSE
                   3579: try-files
                   3580: THEN
                   3581: dup 0= IF debug-disk-label? IF ." not found." cr THEN close THEN \ free memory again
                   3582: ;
                   3583: : load ( addr -- size )
                   3584: debug-disk-label? IF
                   3585: ." load: " dup u. cr
                   3586: THEN
                   3587: args-len IF
                   3588: TRUE ABORT" Load done w/o filesystem"
                   3589: ELSE
                   3590: partition IF
                   3591: 0 0 seek drop
                   3592: 200000 read
                   3593: ELSE
                   3594: has-iso9660-filesystem IF
                   3595: dup load-chrp-boot-file ?dup 0 > IF nip EXIT THEN
                   3596: THEN
                   3597: load-from-boot-partition
                   3598: dup 0= ABORT" No boot partition found"
                   3599: THEN
                   3600: THEN
                   3601: ;
                   3602: finish-device
                   3603: new-device
                   3604: s" fat-files" device-name
                   3605: INSTANCE VARIABLE bytes/sector
                   3606: INSTANCE VARIABLE sectors/cluster
                   3607: INSTANCE VARIABLE #reserved-sectors
                   3608: INSTANCE VARIABLE #fats
                   3609: INSTANCE VARIABLE #root-entries
                   3610: INSTANCE VARIABLE total-#sectors
                   3611: INSTANCE VARIABLE media-descriptor
                   3612: INSTANCE VARIABLE sectors/fat
                   3613: INSTANCE VARIABLE sectors/track
                   3614: INSTANCE VARIABLE #heads
                   3615: INSTANCE VARIABLE #hidden-sectors
                   3616: INSTANCE VARIABLE fat-type
                   3617: INSTANCE VARIABLE bytes/cluster
                   3618: INSTANCE VARIABLE fat-offset
                   3619: INSTANCE VARIABLE root-offset
                   3620: INSTANCE VARIABLE cluster-offset
                   3621: INSTANCE VARIABLE #clusters
                   3622: : seek  s" seek" $call-parent ;
                   3623: : read  s" read" $call-parent ;
                   3624: INSTANCE VARIABLE data
                   3625: INSTANCE VARIABLE #data
                   3626: : free-data
                   3627: data @ ?dup IF #data @ free-mem  0 data ! THEN ;
                   3628: : read-data ( offset size -- )
                   3629: free-data  dup #data ! alloc-mem data !
                   3630: xlsplit seek            -2 and ABORT" fat-files read-data: seek failed"
                   3631: data @ #data @ read #data @ <> ABORT" fat-files read-data: read failed" ;
                   3632: CREATE fat-buf 8 allot
                   3633: : read-fat ( cluster# -- data )
                   3634: fat-buf 8 erase
                   3635: 1 #split fat-type @ * 2/ 2/ fat-offset @ +
                   3636: xlsplit seek -2 and ABORT" fat-files read-fat: seek failed"
                   3637: fat-buf 8 read 8 <> ABORT" fat-files read-fat: read failed"
                   3638: fat-buf 8c@ bxjoin fat-type @ dup >r 2* #split drop r> #split
                   3639: rot IF swap THEN drop ;
                   3640: INSTANCE VARIABLE next-cluster
                   3641: : read-cluster ( cluster# -- )
                   3642: dup bytes/cluster @ * cluster-offset @ + bytes/cluster @ read-data
                   3643: read-fat dup #clusters @ >= IF drop 0 THEN next-cluster ! ;
                   3644: : read-dir ( cluster# -- )
                   3645: ?dup 0= IF root-offset @ #root-entries @ 20 * read-data 0 next-cluster !
                   3646: ELSE read-cluster THEN ;
                   3647: : .time ( x -- )
                   3648: base @ >r decimal
                   3649: b #split 2 0.r [char] : emit  5 #split 2 0.r [char] : emit  2* 2 0.r
                   3650: r> base ! ;
                   3651: : .date ( x -- )
                   3652: base @ >r decimal
                   3653: 9 #split 7bc + 4 0.r [char] - emit  5 #split 2 0.r [char] - emit  2 0.r
                   3654: r> base ! ;
                   3655: : .attr ( attr -- )
                   3656: 6 0 DO dup 1 and IF s" RHSLDA" drop i + c@ ELSE bl THEN emit u2/ LOOP drop ;
                   3657: : .dir-entry ( adr -- )
                   3658: dup 0b + c@ 8 and IF drop EXIT THEN \ volume label, not a file
                   3659: dup c@ e5 = IF drop EXIT THEN \ deleted file
                   3660: cr
                   3661: dup 1a + 2c@ bwjoin [char] # emit 4 0.r space \ starting cluster
                   3662: dup 18 + 2c@ bwjoin .date space
                   3663: dup 16 + 2c@ bwjoin .time space
                   3664: dup 1c + 4c@ bljoin base @ decimal swap a .r base ! space \ size in bytes
                   3665: dup 0b + c@ .attr space
                   3666: dup 8 BEGIN 2dup 1- + c@ 20 = over and WHILE 1- REPEAT type
                   3667: dup 8 + 3 BEGIN 2dup 1- + c@ 20 = over and WHILE 1- REPEAT dup IF
                   3668: [char] . emit type ELSE 2drop THEN
                   3669: drop ;
                   3670: : .dir-entries ( adr n -- )
                   3671: 0 ?DO dup i 20 * + dup c@ 0= IF drop LEAVE THEN .dir-entry LOOP drop ;
                   3672: : .dir ( cluster# -- )
                   3673: read-dir BEGIN data @ #data @ 20 / .dir-entries next-cluster @ WHILE
                   3674: next-cluster @ read-cluster REPEAT ;
                   3675: : str-upper ( str len adr -- ) \ Copy string to adr, uppercase
                   3676: -rot bounds ?DO i c@ upc over c! char+ LOOP drop ;
                   3677: CREATE dos-name b allot
                   3678: : make-dos-name ( str len -- )
                   3679: dos-name b bl fill
                   3680: 2dup [char] . findchar IF
                   3681: 3dup 1+ /string 3 min dos-name 8 + str-upper nip THEN
                   3682: 8 min dos-name str-upper ;
                   3683: : (find-file) ( -- cluster file-len is-dir? true | false )
                   3684: data @ BEGIN dup data @ #data @ + < WHILE
                   3685: dup dos-name b comp WHILE 20 + REPEAT
                   3686: dup 1a + 2c@ bwjoin swap dup 1c + 4c@ bljoin swap 0b + c@ 10 and 0<> true
                   3687: ELSE drop false THEN ;
                   3688: : find-file ( dir-cluster name len -- cluster file-len is-dir? true | false )
                   3689: make-dos-name read-dir BEGIN (find-file) 0= WHILE next-cluster @ WHILE
                   3690: next-cluster @ read-cluster REPEAT false ELSE true THEN ;
                   3691: : find-path ( dir-cluster name len -- cluster file-len true | false )
                   3692: dup 0= IF 3drop false ."  empty name " EXIT THEN
                   3693: over c@ [char] \ = IF 1 /string ."  slash " RECURSE EXIT THEN
                   3694: [char] \ split 2>r find-file 0= IF 2r> 2drop false ."  not found " EXIT THEN
                   3695: r@ 0<> <> IF 2drop 2r> 2drop false ."  no dir<->file match " EXIT THEN
                   3696: r@ 0<> IF drop 2r> ."  more... " RECURSE EXIT THEN
                   3697: 2r> 2drop true ."  got it " ;
                   3698: : do-super ( -- )
                   3699: 0 200 read-data
                   3700: data @ 0b + 2c@ bwjoin bytes/sector !
                   3701: data @ 0d + c@ sectors/cluster !
                   3702: bytes/sector @ sectors/cluster @ * bytes/cluster !
                   3703: data @ 0e + 2c@ bwjoin #reserved-sectors !
                   3704: data @ 10 + c@ #fats !
                   3705: data @ 11 + 2c@ bwjoin #root-entries !
                   3706: data @ 13 + 2c@ bwjoin total-#sectors !
                   3707: data @ 15 + c@ media-descriptor !
                   3708: data @ 16 + 2c@ bwjoin sectors/fat !
                   3709: data @ 18 + 2c@ bwjoin sectors/track !
                   3710: data @ 1a + 2c@ bwjoin #heads !
                   3711: data @ 1c + 2c@ bwjoin #hidden-sectors !
                   3712: total-#sectors @ 0= IF data @ 20 + 4c@ bljoin total-#sectors ! THEN
                   3713: sectors/fat @ 0= IF data @ 24 + 4c@ bljoin sectors/fat ! THEN
                   3714: total-#sectors @ #reserved-sectors @ - sectors/fat @ #fats @ * -
                   3715: #root-entries @ 20 * bytes/sector @ // - sectors/cluster @ /
                   3716: dup #clusters !
                   3717: dup ff5 < IF drop c ELSE fff5 < IF 10 ELSE 20 THEN THEN fat-type !
                   3718: cr ." FAT" base @ decimal fat-type @ . base !
                   3719: #reserved-sectors @ bytes/sector @ * fat-offset !
                   3720: #fats @ sectors/fat @ * bytes/sector @ * fat-offset @ + root-offset !
                   3721: #root-entries @ 20 * bytes/sector @ tuck // * root-offset @ +
                   3722: bytes/cluster @ 2* - cluster-offset ! ;
                   3723: INSTANCE VARIABLE file-cluster
                   3724: INSTANCE VARIABLE file-len
                   3725: INSTANCE VARIABLE current-pos
                   3726: INSTANCE VARIABLE pos-in-data
                   3727: : seek ( lo hi -- status )
                   3728: lxjoin dup current-pos ! file-cluster @ read-cluster
                   3729: BEGIN dup #data @ >= WHILE #data @ - next-cluster @ dup 0= IF
                   3730: 2drop true EXIT THEN read-cluster REPEAT pos-in-data ! false ;
                   3731: : read ( adr len -- actual )
                   3732: file-len @ current-pos @ - min \ can't go past end of file
                   3733: #data @ pos-in-data @ - min >r \ length for this transfer
                   3734: data @ pos-in-data @ + swap r@ move \ move the data
                   3735: r@ pos-in-data +!  r@ current-pos +!  pos-in-data @ #data @ = IF
                   3736: next-cluster @ ?dup IF read-cluster 0 pos-in-data ! THEN THEN r> ;
                   3737: : read ( adr len -- actual )
                   3738: dup >r BEGIN dup WHILE 2dup read dup 0= ABORT" fat-files: read failed"
                   3739: /string ( tuck - >r + r> ) REPEAT 2drop r> ;
                   3740: : load ( adr -- len )
                   3741: file-len @ read dup file-len @ <> ABORT" fat-files: failed loading file" ;
                   3742: : close  free-data ;
                   3743: : open
                   3744: do-super
                   3745: 0 my-args find-path 0= IF close false EXIT THEN
                   3746: file-len !  file-cluster !  0 0 seek 0= ;
                   3747: finish-device
                   3748: new-device
                   3749: s" rom-files" device-name
                   3750: INSTANCE VARIABLE length
                   3751: INSTANCE VARIABLE next-file
                   3752: INSTANCE VARIABLE buffer
                   3753: INSTANCE VARIABLE buffer-size
                   3754: INSTANCE VARIABLE file
                   3755: INSTANCE VARIABLE file-size
                   3756: INSTANCE VARIABLE found
                   3757: : open  true 
                   3758: 100 dup buffer-size ! alloc-mem buffer ! false found ! ;
                   3759: : close buffer @ buffer-size @ free-mem ;
                   3760: : read ( addr len -- actual ) s" read" $call-parent ;
                   3761: : seek ( lo hi -- status ) s" seek" $call-parent ;
                   3762: : .read-file-name ( offset -- str len )
                   3763: 0 seek drop 
                   3764: buffer @ buffer-size @ read drop
                   3765: buffer-size @ 1 - buffer @ + 0 swap c!
                   3766: buffer @ zcount ;
                   3767: : .print-info ( offset -- )
                   3768: dup 2 spaces 6 0.r 2 spaces dup
                   3769: 8 + 0 seek drop length 8 read drop
                   3770: 6 length @ swap 0.r 2 spaces
                   3771: 20 + .read-file-name type cr ;
                   3772: : .list-header cr
                   3773: s" --offset---size-----file-name----" type cr ;
                   3774: : list
                   3775: .list-header
                   3776: 0 0 BEGIN + dup 
                   3777: .print-info dup 0 seek drop
                   3778: next-file 8 read drop next-file @
                   3779: dup 0= UNTIL 2drop ;
                   3780: : (find-file)  ( name len -- offset | -1 )
                   3781: 0 0 seek drop false found !
                   3782: file-size ! file ! 0 0 BEGIN + dup
                   3783: 20 + .read-file-name file @ file-size @
                   3784: str= IF true found ! THEN
                   3785: dup 0 seek drop
                   3786: next-file 8 read drop next-file @
                   3787: dup 0= found @ or UNTIL drop found @ 0=
                   3788: IF drop -1 THEN ;
                   3789: : load  ( addr -- size )
                   3790: my-parent instance>args 2@ [char] \ left-parse-string 2drop
                   3791: (find-file) dup -1 = IF 2drop 0 ELSE
                   3792: 0 0 seek drop
                   3793: dup 8 + 0 seek drop
                   3794: here 8 read drop here @  ( dest-addr offset file-size )
                   3795: over 18 + 0 seek drop
                   3796: here 8 read drop here @  ( dest-addr offset file-size data-offset )
                   3797: rot + 0 seek drop  ( dest-addr file-size )
                   3798: read 
                   3799: THEN
                   3800: ;
                   3801: finish-device
                   3802: new-device
                   3803: s" ext2-files" device-name
                   3804: INSTANCE VARIABLE first-block
                   3805: INSTANCE VARIABLE block-size
                   3806: INSTANCE VARIABLE inodes/group
                   3807: INSTANCE VARIABLE group-descriptors
                   3808: : seek  s" seek" $call-parent ;
                   3809: : read  s" read" $call-parent ;
                   3810: INSTANCE VARIABLE data
                   3811: INSTANCE VARIABLE #data
                   3812: : free-data
                   3813: data @ ?dup IF #data @ free-mem  0 data ! THEN ;
                   3814: : read-data ( offset size -- )
                   3815: free-data  dup #data ! alloc-mem data !
                   3816: xlsplit seek            -2 and ABORT" ext2-files read-data: seek failed"
                   3817: data @ #data @ read #data @ <> ABORT" ext2-files read-data: read failed" ;
                   3818: : read-block ( block# -- )
                   3819: block-size @ * block-size @ read-data ;
                   3820: INSTANCE VARIABLE inode
                   3821: INSTANCE VARIABLE file-len
                   3822: INSTANCE VARIABLE blocks
                   3823: INSTANCE VARIABLE #blocks
                   3824: INSTANCE VARIABLE ^blocks
                   3825: INSTANCE VARIABLE #blocks-left
                   3826: : blocks-read ( n -- )  dup negate #blocks-left +! 4 * ^blocks +! ;
                   3827: : read-indirect-blocks ( indirect-block# -- )
                   3828: read-block data @ data off
                   3829: dup #blocks-left @ 4 * block-size @ min dup >r ^blocks @ swap move
                   3830: r> 2 rshift blocks-read block-size @ free-mem ;
                   3831: : read-double-indirect-blocks ( double-indirect-block# -- )
                   3832: ;
                   3833: : read-triple-indirect-blocks ( triple-indirect-block# -- )
                   3834: ;
                   3835: : read-block#s ( -- )
                   3836: blocks @ ?dup IF #blocks @ 4 * free-mem THEN
                   3837: inode @ 4 + l@-le file-len !
                   3838: file-len @ block-size @ // #blocks !
                   3839: #blocks @ 4 * alloc-mem blocks !
                   3840: blocks @ ^blocks !  #blocks @ #blocks-left !
                   3841: #blocks-left @ c min \ # direct blocks
                   3842: inode @ 28 + over 4 * ^blocks @ swap move blocks-read
                   3843: #blocks-left @ IF inode @ 58 + l@-le read-indirect-blocks THEN
                   3844: #blocks-left @ IF inode @ 5c + l@-le read-double-indirect-blocks THEN
                   3845: #blocks-left @ IF inode @ 60 + l@-le read-triple-indirect-blocks THEN ;
                   3846: : read-inode ( inode# -- )
                   3847: 1- inodes/group @ u/mod \ # in group, group #
                   3848: 20 * group-descriptors @ + 8 + l@-le block-size @ * \ # in group, inode table
                   3849: swap 80 * + xlsplit seek drop  inode @ 80 read drop ;
                   3850: : .rwx ( bits last-char-if-special special? -- )
                   3851: rot dup 4 and IF ." r" ELSE ." -" THEN
                   3852: dup 2 and IF ." w" ELSE ." -" THEN
                   3853: swap IF 1 and 0= IF upc THEN emit ELSE
                   3854: 1 and IF ." x" ELSE ." -" THEN drop THEN ;
                   3855: CREATE mode-chars 10 allot s" ?pc?d?b?-?l?s???" mode-chars swap move
                   3856: : .mode ( mode -- )
                   3857: dup c rshift f and mode-chars + c@ emit
                   3858: dup 6 rshift 7 and over 800 and 73 swap .rwx
                   3859: dup 3 rshift 7 and over 400 and 73 swap .rwx
                   3860: dup          7 and swap 200 and 74 swap .rwx ;
                   3861: : .inode ( -- )
                   3862: base @ >r decimal
                   3863: inode @      w@-le .mode \ file mode
                   3864: inode @ 1a + w@-le 5 .r \ link count
                   3865: inode @ 02 + w@-le 9 .r \ uid
                   3866: inode @ 18 + w@-le 9 .r \ gid
                   3867: inode @ 04 + l@-le 9 .r \ size
                   3868: r> base ! ;
                   3869: : do-super ( -- )
                   3870: 400 400 read-data
                   3871: data @ 14 + l@-le first-block !
                   3872: 400 data @ 18 + l@-le lshift block-size !
                   3873: data @ 28 + l@-le inodes/group !
                   3874: first-block @ 1+ read-block data @ group-descriptors ! data off ;
                   3875: INSTANCE VARIABLE current-pos
                   3876: : read ( adr len -- actual )
                   3877: file-len @ current-pos @ - min \ can't go past end of file
                   3878: current-pos @ block-size @ u/mod 4 * blocks @ + l@-le read-block
                   3879: block-size @ over - rot min >r ( adr off r: len )
                   3880: data @ + swap r@ move r> dup current-pos +! ;
                   3881: : read ( adr len -- actual )
                   3882: dup >r BEGIN dup WHILE 2dup read dup 0= ABORT" ext2-files: read failed"
                   3883: /string REPEAT 2drop r> ;
                   3884: : seek ( lo hi -- status )
                   3885: lxjoin dup file-len @ > IF drop true EXIT THEN current-pos ! false ;
                   3886: : load ( adr -- len )
                   3887: file-len @ read dup file-len @ <> ABORT" ext2-files: failed loading file" ;
                   3888: : .name ( adr -- )  dup 8 + swap 6 + c@ type ;
                   3889: : read-dir ( inode# -- adr )
                   3890: read-inode read-block#s file-len @ alloc-mem
                   3891: 0 0 seek ABORT" ext2-files read-dir: seek failed"
                   3892: dup file-len @ read file-len @ <> ABORT" ext2-files read-dir: read failed" ;
                   3893: : .dir ( inode# -- )
                   3894: read-dir dup BEGIN 2dup file-len @ - > over l@-le tuck and WHILE
                   3895: cr dup 8 0.r space read-inode .inode space space dup .name
                   3896: dup 4 + w@-le + REPEAT 2drop file-len @ free-mem ;
                   3897: : (find-file) ( adr name len -- inode#|0 )
                   3898: 2>r dup BEGIN 2dup file-len @ - > over l@-le and WHILE
                   3899: dup 8 + over 6 + c@ 2r@ str= IF 2r> 2drop nip l@-le EXIT THEN
                   3900: dup 4 + w@-le + REPEAT 2drop 2r> 2drop 0 ;
                   3901: : find-file ( inode# name len -- inode#|0 )
                   3902: 2>r read-dir dup 2r> (find-file) swap file-len @ free-mem ;
                   3903: : find-path ( inode# name len -- inode#|0 )
                   3904: dup 0= IF 3drop 0 ."  empty name " EXIT THEN
                   3905: over c@ [char] \ = IF 1 /string ."  slash " RECURSE EXIT THEN
                   3906: [char] \ split 2>r find-file ?dup 0= IF
                   3907: 2r> 2drop false ."  not found " EXIT THEN
                   3908: r@ 0<> IF 2r> ."  more... " RECURSE EXIT THEN
                   3909: 2r> 2drop ."  got it " ;
                   3910: : close ;
                   3911: : open
                   3912: do-super
                   3913: 80 alloc-mem inode !
                   3914: my-args nip 0= IF 0 0 ELSE
                   3915: 2 my-args find-path ?dup 0= IF close false EXIT THEN THEN
                   3916: read-inode read-block#s 0 0 seek 0= ;
                   3917: finish-device
                   3918: new-device
                   3919: s" obp-tftp" device-name
                   3920: INSTANCE VARIABLE ciregs-buffer
                   3921: : open ( -- okay? ) 
                   3922: ciregs-size alloc-mem ciregs-buffer ! 
                   3923: true
                   3924: ;
                   3925: : load ( addr -- size )
                   3926: ciregs ciregs-buffer @ ciregs-size move
                   3927: s" bootargs" get-chosen 0= IF 0 0 THEN >r >r
                   3928: s" bootpath" get-chosen 0= IF 0 0 THEN >r >r
                   3929: my-parent ihandle>phandle node>path encode-string
                   3930: s" bootpath" set-chosen
                   3931: (u.) s" netboot " 2swap $cat s"  60000000 " $cat
                   3932: 6B8 alloc-mem dup >r (u.) $cat s"  " $cat
                   3933: huge-tftp-load @ IF s"  1 " ELSE s"  0 " THEN $cat
                   3934: s" 1432 " $cat
                   3935: my-args $cat
                   3936: (client-exec) dup 0< IF drop 0 THEN
                   3937: ciregs-buffer @ ciregs ciregs-size move
                   3938: r>
                   3939: r> r> over IF s" bootpath" set-chosen ELSE 2drop THEN
                   3940: r> r> over IF s" bootargs" set-chosen ELSE 2drop THEN
                   3941: s" /chosen" select-dev
                   3942: dup 6B8 encode-bytes s" bootp-response" property
                   3943: device-end
                   3944: 6B8 free-mem
                   3945: ;
                   3946: : close ( -- )
                   3947: ciregs-buffer @ ciregs-size free-mem 
                   3948: ;
                   3949: : ping  ( -- )
                   3950: s" ping " my-args $cat (client-exec)
                   3951: ;
                   3952: finish-device
                   3953: new-device
                   3954: s" iso-9660" device-name
                   3955: 0 VALUE iso-debug-flag
                   3956: : iso-debug-print ( str len -- )  iso-debug-flag IF type cr ELSE 2drop THEN  ;
                   3957: 0 VALUE  path-tbl-size
                   3958: 0 VALUE  path-tbl-addr
                   3959: 0 VALUE  root-dir-size
                   3960: 0 VALUE  vol-size
                   3961: 0 VALUE  logical-blk-size
                   3962: 0 VALUE  path-table
                   3963: 0 VALUE  count
                   3964: INSTANCE VARIABLE dir-addr
                   3965: INSTANCE VARIABLE data-buff
                   3966: INSTANCE VARIABLE #data
                   3967: INSTANCE VARIABLE ptable
                   3968: INSTANCE VARIABLE file-loc
                   3969: INSTANCE VARIABLE file-size
                   3970: INSTANCE VARIABLE cur-file-offset
                   3971: INSTANCE VARIABLE self
                   3972: INSTANCE VARIABLE index
                   3973: : seek  ( pos.lo pos.hi -- status )  s" seek" $call-parent  ;
                   3974: : read  ( addr len -- actual )  s" read" $call-parent  ;
                   3975: : free-data ( -- )
                   3976: data-buff @                              ( data-buff )
                   3977: ?DUP  IF  #data @  free-mem  0 data-buff ! THEN
                   3978: ;
                   3979: : read-data ( offset size -- )
                   3980: free-data  DUP                     ( offset size size )
                   3981: #data !  alloc-mem   data-buff !   (  offset )
                   3982: xlsplit                            ( pos.lo pos.hi )
                   3983: seek   -2 and ABORT" seek failed."
                   3984: data-buff  @  #data @  read        ( actual )
                   3985: #data @  <> ABORT" read failed."
                   3986: ;
                   3987: : extract-vol-info  (  --  )
                   3988: 10  800 * 800 read-data
                   3989: data-buff @  88  + l@-be  to path-tbl-size   \ read path table size
                   3990: data-buff @  94  + l@-be  to path-tbl-addr   \ read big-endian  path table
                   3991: data-buff @  a2  + l@-be   dir-addr !        \ gather of root directory info
                   3992: data-buff @  0aa + l@-be  to root-dir-size   \ get volume info
                   3993: data-buff @  54  + l@-be  to vol-size        \ size in blocks
                   3994: data-buff @  82  + l@-be  to logical-blk-size
                   3995: path-tbl-size alloc-mem dup  TO path-table path-tbl-size erase
                   3996: path-tbl-addr 800 *  xlsplit seek  drop
                   3997: path-table  path-tbl-size  read  drop     \ pathtable in-system-memory copy
                   3998: ;
                   3999: : file-name  ( str len --  str' len' )
                   4000: 2dup  [char] ; findchar  IF
                   4001: nip                 \ Omit the trailing ";1" revision of ISO9660 file name
                   4002: 2dup + 1-           ( str newlen endptr )
                   4003: c@ [CHAR] . = IF
                   4004: 1-               ( str len' )    \ Remove trailing dot
                   4005: THEN
                   4006: THEN
                   4007: ;
                   4008: : dup3  ( num  -- num num num ) dup dup dup  ;
                   4009: : get-next-record  ( rec-addr -- next-rec-offset )
                   4010: dup3               ( rec-addr rec-addr rec-addr rec-addr )
                   4011: self @ 1 +  self ! ( rec-addr rec-addr rec-addr rec-addr )
                   4012: c@  1 AND  IF      ( rec-addr rec-addr rec-addr )
                   4013: c@ +  9         ( rec-addr rec-addr' rec-len )
                   4014: ELSE
                   4015: c@ +  8         ( rec-addr rec-addr' rec-len )
                   4016: THEN
                   4017: + swap  -          ( next-rec-offset )
                   4018: ;
                   4019: : path-table-search ( str len -- TRUE | FALSE )
                   4020: path-table path-tbl-size +  path-table ptable @ +  DO ( str len )
                   4021: 2dup  I 6 + w@-be index @ =                        ( str len str len )
                   4022: -rot  I 8 +  I c@  string=ci and  IF               ( str len )
                   4023: s" Directory Matched!!  "   iso-debug-print     ( str len )
                   4024: self @   index !                                ( str len )
                   4025: I 2 + l@-be   dir-addr ! I  dup                 ( str len rec-addr )
                   4026: get-next-record + path-table -   ptable !       ( str len )
                   4027: 2drop  TRUE UNLOOP EXIT                         ( TRUE )
                   4028: THEN
                   4029: I get-next-record                           ( str len next-rec-offset )
                   4030: +LOOP
                   4031: 2drop
                   4032: FALSE                                          ( FALSE )
                   4033: s" Invalid path / directory "  iso-debug-print
                   4034: ;
                   4035: : search-file-dir ( str len  -- TRUE | FALSE )
                   4036: dir-addr @  800 *  dir-addr !             ( str len )
                   4037: dir-addr @ 100 read-data                  ( str len )
                   4038: data-buff @  0e + l@-be  dup >r           ( str len rec-len )
                   4039: 100 >  IF                                 ( str len )
                   4040: s" size dir record"  iso-debug-print   ( str len )
                   4041: dir-addr @ r@  read-data               ( str len )
                   4042: THEN
                   4043: r> data-buff @  + data-buff @  DO         ( str len )
                   4044: I 19 + c@  2 and 0=  IF                ( str len )
                   4045: 2dup                                ( str len  str len )
                   4046: I 21 + I 20 + c@                    ( str len  str len  str' len' )
                   4047: file-name  string=ci  IF            ( str len )
                   4048: s" File found!"  iso-debug-print ( str len )
                   4049: I 6 + l@-be 800 *                ( str len file-loc )
                   4050: file-loc !                       ( str len )
                   4051: I 0e + l@-be  file-size !        ( str len )
                   4052: 2drop
                   4053: TRUE                             ( TRUE )
                   4054: UNLOOP
                   4055: EXIT
                   4056: THEN
                   4057: THEN
                   4058: I c@ dup 0=  IF                        ( str len len )
                   4059: s" file not found"   iso-debug-print
                   4060: drop  2drop FALSE                   ( FALSE )
                   4061: UNLOOP
                   4062: EXIT
                   4063: THEN
                   4064: +LOOP
                   4065: 2drop
                   4066: FALSE                                     ( FALSE )
                   4067: s" file not found"   iso-debug-print
                   4068: ;
                   4069: : search-path ( str len -- FALSE|TRUE )
                   4070: 0  ptable !
                   4071: 1  self !
                   4072: 1  index !
                   4073: dup                                             ( str len len )
                   4074: 0=  IF
                   4075: 3drop FALSE                                  ( FALSE )
                   4076: s"  Empty path name "  iso-debug-print  EXIT ( FALSE )
                   4077: THEN
                   4078: OVER c@                                         ( str len char )
                   4079: [char] \ =  IF                                  ( str len )
                   4080: swap 1 + swap 1 -  BEGIN                     ( str len )
                   4081: [char] \  split                           ( str len  str' len ' )
                   4082: dup 0 =   IF                              ( str len  str' len ' )
                   4083: 2drop search-file-dir EXIT             ( TRUE | FALSE )
                   4084: ELSE
                   4085: 2swap path-table-search  invert  IF    ( str' len ' )
                   4086: 2drop FALSE  EXIT                   ( FALSE )
                   4087: THEN
                   4088: THEN
                   4089: AGAIN
                   4090: ELSE   BEGIN
                   4091: [char] \  split   dup 0 =   IF               ( str len str' len' )
                   4092: 2drop search-file-dir EXIT                ( TRUE | FALSE )
                   4093: ELSE
                   4094: 2swap path-table-search  invert  IF       ( str' len ' )
                   4095: 2drop FALSE  EXIT                      ( FALSE )
                   4096: THEN
                   4097: THEN
                   4098: AGAIN
                   4099: THEN
                   4100: ;
                   4101: 0 VALUE loc
                   4102: : load ( addr -- len )
                   4103: dup to loc                     ( addr )
                   4104: file-loc @  xlsplit seek drop
                   4105: file-size @  read              ( file-size )
                   4106: iso-debug-flag IF s" Bytes returned from read:" type dup . cr THEN
                   4107: dup file-size @  <> ABORT" read failed!"
                   4108: ;
                   4109: : close ( -- )
                   4110: free-data   count 1 - dup to count  0 =  IF
                   4111: path-table path-tbl-size free-mem
                   4112: 0 TO path-table
                   4113: THEN
                   4114: ;
                   4115: : open ( -- TRUE | FALSE )
                   4116: 0 data-buff !
                   4117: 0 #data !
                   4118: 0 ptable !
                   4119: 0 file-loc !
                   4120: 0 file-size !
                   4121: 0 cur-file-offset !
                   4122: 1 self !
                   4123: 1 index !
                   4124: count 0 =  IF
                   4125: s" extract-vol-info called "   iso-debug-print
                   4126: extract-vol-info
                   4127: THEN
                   4128: count  1 + to count
                   4129: my-args search-path  IF
                   4130: file-loc @  xlsplit seek drop
                   4131: TRUE    ( TRUE )
                   4132: ELSE
                   4133: close
                   4134: FALSE   ( FALSE )
                   4135: THEN
                   4136: 0 cur-file-offset !
                   4137: s" opened ISO9660 package" iso-debug-print
                   4138: ;
                   4139: : seek ( pos.lo pos.hi -- status )
                   4140: lxjoin dup  cur-file-offset !  ( offset )
                   4141: file-loc @  + xlsplit          ( pos.lo pos.hi )
                   4142: s" seek" $call-parent          ( status )
                   4143: ;
                   4144: : read ( addr len -- actual )
                   4145: file-size @ cur-file-offset @ -             ( addr len remainder-of-file )
                   4146: min                                         ( addr len|remainder-of-file )
                   4147: s" read" $call-parent                       ( actual )
                   4148: dup cur-file-offset @ +  cur-file-offset !  ( actual )
                   4149: cur-file-offset @                           ( offset actual )
                   4150: xlsplit seek drop                           ( actual )
                   4151: ;
                   4152: finish-device
                   4153: new-device
                   4154: s" bulk" device-name
                   4155: : open  true  ;
                   4156: : close ;
                   4157: 8 chars alloc-mem VALUE setup-packet
                   4158: 0 VALUE cbw-addr
                   4159: : build-cbw ( address tag transfer-len direction lun command-len -- )
                   4160: 5 pick TO cbw-addr  ( address tag transfer-len direction lun command-len )
                   4161: cbw-addr 0f erase   ( address tag transfer-len direction lun command-len )
                   4162: cbw-addr e + c!     ( address tag transfer-len direction lun )
                   4163: cbw-addr d + c!     ( address tag transfer-len direction )
                   4164: cbw-addr c + c!     ( address tag transfer-len )
                   4165: cbw-addr 8 + l!-le  ( address tag )
                   4166: cbw-addr 4 + l!-le  ( address )
                   4167: 43425355 cbw-addr l!-le ( address )
                   4168: drop  ;
                   4169: 0 VALUE csw-addr
                   4170: : analyze-csw ( address -- residue tag true|reason false )
                   4171: TO csw-addr
                   4172: csw-addr l@-le 53425355 =  IF
                   4173: csw-addr c + c@ dup 0=  IF ( reason )
                   4174: drop
                   4175: csw-addr 8 + l@-le ( residue )
                   4176: csw-addr 4 + l@-le ( residue tag ) \ command  block tag
                   4177: TRUE               ( residue tag TRUE )
                   4178: ELSE
                   4179: FALSE              ( reason FALSE )
                   4180: THEN
                   4181: ELSE
                   4182: FALSE                 ( FALSE )
                   4183: THEN
                   4184: csw-addr 0c erase
                   4185: ;
                   4186: : bulk-reset-recovery-procedure ( bulk-out-endp bulk-in-endp usb-addr -- )
                   4187: s" bulk-reset-recovery-procedure" $call-parent
                   4188: ;
                   4189: finish-device
                   4190: finish-device
                   4191: : open true ;
                   4192: : close ;
                   4193: device-end
                   4194: 370 cp
                   4195: : strequal ( str1 len1 str2 len2 -- flag )
                   4196: rot dup rot = IF comp 0= ELSE 2drop drop 0 THEN ; 
                   4197: 400 cp
                   4198: 0 value puid
                   4199: 440 cp
                   4200: 480 cp
                   4201: " /" find-device
                   4202: " QEMU" encode-string s" model" property
                   4203: 2 encode-int s" #address-cells" property
                   4204: 2 encode-int s" #size-cells" property
                   4205: s" chrp" device-type
                   4206: new-device
                   4207: s" mmu" 2dup device-name device-type
                   4208: 0 0 s" translations" property
                   4209: : open  true ;
                   4210: : close ;
                   4211: finish-device
                   4212: device-end
                   4213: 4c0 cp
                   4214: : fixup-tbfreq
                   4215: " /cpus/@0" find-device
                   4216: " timebase-frequency" get-node get-package-property IF
                   4217: 2drop
                   4218: ELSE
                   4219: decode-int to tb-frequency 2drop
                   4220: THEN
                   4221: device-end
                   4222: ;
                   4223: fixup-tbfreq
                   4224: 4d0 cp
                   4225: 4d0 cp
                   4226: STRUCT
                   4227: /l field rtas>token
                   4228: /l field rtas>nargs
                   4229: /l field rtas>nret
                   4230: /l field rtas>args0
                   4231: /l field rtas>args1
                   4232: /l field rtas>args2
                   4233: /l field rtas>args3
                   4234: /l field rtas>args4
                   4235: /l field rtas>args5
                   4236: /l field rtas>args6
                   4237: /l field rtas>args7
                   4238: /l C * field rtas>args
                   4239: /l field rtas>bla
                   4240: CONSTANT /rtas-control-block
                   4241: CREATE rtas-cb /rtas-control-block allot
                   4242: rtas-cb /rtas-control-block erase
                   4243: 0 VALUE rtas-base
                   4244: 0 VALUE rtas-size
                   4245: 0 VALUE rtas-entry
                   4246: 0 VALUE rtas-node
                   4247: 4d1 cp
                   4248: : find-qemu-rtas ( -- )
                   4249: " /rtas" find-device get-node to rtas-node
                   4250: " linux,rtas-base" rtas-node get-package-property IF
                   4251: device-end EXIT THEN
                   4252: drop l@ to rtas-base
                   4253: " linux,rtas-base" delete-property
                   4254: " rtas-size" rtas-node get-package-property IF
                   4255: device-end EXIT THEN
                   4256: drop l@ to rtas-size
                   4257: " linux,rtas-entry" rtas-node get-package-property IF
                   4258: rtas-base to rtas-entry
                   4259: ELSE
                   4260: drop l@ to rtas-entry
                   4261: " linux,rtas-entry" delete-property
                   4262: THEN
                   4263: device-end
                   4264: ;
                   4265: find-qemu-rtas
                   4266: 4d2 cp
                   4267: : enter-rtas ( -- )
                   4268: rtas-cb rtas-base 0 rtas-entry call-c drop
                   4269: ;
                   4270: : rtas-get-token ( str len -- token | 0 )
                   4271: rtas-node get-package-property IF 0 ELSE drop l@ THEN
                   4272: ;
                   4273: : rtas-start-cpu  ( pid loc r3 -- status )
                   4274: " start-cpu" rtas-get-token rtas-cb rtas>token l!
                   4275: 3  rtas-cb rtas>nargs l!
                   4276: 1  rtas-cb rtas>nret l!
                   4277: rtas-cb rtas>args2 l!
                   4278: rtas-cb rtas>args1 l!
                   4279: rtas-cb rtas>args0 l!
                   4280: 0 rtas-cb rtas>args3 l!
                   4281: enter-rtas
                   4282: rtas-cb rtas>args3 l@
                   4283: ;
                   4284: : rtas-set-tce-bypass ( unit enable -- )
                   4285: " ibm,set-tce-bypass" rtas-get-token rtas-cb rtas>token l!
                   4286: 2 rtas-cb rtas>nargs l!
                   4287: 0 rtas-cb rtas>nret l!
                   4288: rtas-cb rtas>args1 l!
                   4289: rtas-cb rtas>args0 l!
                   4290: enter-rtas
                   4291: ;
                   4292: : rtas-quiesce ( -- )
                   4293: " quiesce" rtas-get-token rtas-cb rtas>token l!
                   4294: 0 rtas-cb rtas>nargs l!
                   4295: 0 rtas-cb rtas>nret l!
                   4296: enter-rtas
                   4297: ;
                   4298: : of-start-cpu rtas-start-cpu ;
                   4299: rtas-node set-node
                   4300: : open true ;
                   4301: : close ;
                   4302: : instantiate-rtas ( adr -- entry )
                   4303: dup rtas-base swap rtas-size move
                   4304: rtas-entry rtas-base - +
                   4305: ;
                   4306: device-end
                   4307: 4d8 cp
                   4308: 500 cp
                   4309: : populate-vios ( -- )
                   4310: ." Populating /vdevice methods" cr
                   4311: " /vdevice" find-device get-node child
                   4312: BEGIN
                   4313: dup 0 <>
                   4314: WHILE
                   4315: dup set-node
                   4316: dup " compatible" rot get-package-property 0 = IF
                   4317: drop dup from-cstring
                   4318: 2dup " hvterm1" strequal IF
                   4319: " vio-hvterm.fs" included
                   4320: THEN
                   4321: 2dup " IBM,v-scsi" strequal IF
                   4322: " vio-vscsi.fs" included
                   4323: THEN
                   4324: 2dup " IBM,l-lan" strequal IF
                   4325: " vio-veth.fs" included
                   4326: THEN
                   4327: 2drop
                   4328: THEN
                   4329: peer
                   4330: REPEAT drop
                   4331: device-end
                   4332: ;
                   4333: populate-vios
                   4334: 580 cp
                   4335: 5a0 cp
                   4336: 600 cp
                   4337: ' rtas-quiesce add-quiesce-xt
                   4338: 640 cp
                   4339: 690 cp
                   4340: 6a0 cp
                   4341: 6a8 cp
                   4342: 6b0 cp
                   4343: 6b8 cp
                   4344: 6c0 cp
                   4345: s" /cpus/@0" open-dev encode-int s" cpu" set-chosen
                   4346: s" /memory" open-dev encode-int s" memory" set-chosen
                   4347: 6e0 cp
                   4348: 700 cp
                   4349: s" /openprom" find-device
                   4350: s" SLOF," slof-build-id here swap rmove here slof-build-id nip $cat encode-string s" model" property
                   4351: 0 0 s" relative-addressing" property
                   4352: device-end
                   4353: s" /aliases" find-device
                   4354: : open  true ;
                   4355: : close ;
                   4356: device-end
                   4357: s" /mmu" open-dev encode-int s" mmu" set-chosen
                   4358: VARIABLE chosen-memory-ih 0 chosen-memory-ih !
                   4359: : (chosen-memory-ph) ( -- phandle )
                   4360: chosen-memory-ih @ ?dup 0= IF
                   4361: s" memory" get-chosen IF
                   4362: decode-int nip nip dup chosen-memory-ih !
                   4363: ihandle>phandle
                   4364: ELSE 0 THEN
                   4365: ELSE ihandle>phandle THEN
                   4366: ;
                   4367: : (set-available-prop) ( prop plen -- )
                   4368: s" available"
                   4369: (chosen-memory-ph) ?dup 0<> IF set-property ELSE
                   4370: cr ." Can't find chosen memory node - "
                   4371: ." no available property created" cr
                   4372: 2dup 2dup
                   4373: THEN
                   4374: ;
                   4375: : update-available-property ( available-ptr -- )
                   4376: dup >r available>size@
                   4377: 0= r@ available AVAILABLE-SIZE /available * + >= or IF
                   4378: available r> available - encode-bytes (set-available-prop)
                   4379: ELSE
                   4380: r> /available + RECURSE
                   4381: THEN
                   4382: ;
                   4383: : update-available-property available update-available-property ;
                   4384: : claim ( [ addr ] len align -- base ) claim update-available-property ;
                   4385: : release ( addr len -- ) release update-available-property ;
                   4386: update-available-property
                   4387: : input  ( dev-str dev-len -- )
                   4388: open-dev ?dup IF
                   4389: s" stdin" get-chosen IF
                   4390: decode-int nip nip ?dup IF close-dev THEN
                   4391: THEN
                   4392: encode-int s" stdin"  set-chosen
                   4393: THEN
                   4394: ;
                   4395: : output  ( dev-str dev-len -- )
                   4396: open-dev ?dup IF
                   4397: s" stdout" get-chosen IF
                   4398: decode-int nip nip ?dup IF close-dev THEN
                   4399: THEN
                   4400: encode-int s" stdout" set-chosen
                   4401: THEN
                   4402: ;
                   4403: : io  ( dev-str dev-len -- )
                   4404: 2dup input output
                   4405: ;
                   4406: 1 BUFFER: (term-io-char-buf)
                   4407: : term-io-key  ( -- char )
                   4408: s" stdin" get-chosen IF
                   4409: decode-int nip nip dup 0= IF 0 EXIT THEN
                   4410: >r BEGIN
                   4411: (term-io-char-buf) 1 s" read" r@ $call-method
                   4412: 0 >
                   4413: UNTIL
                   4414: (term-io-char-buf) c@
                   4415: r> drop
                   4416: THEN
                   4417: ;
                   4418: ' term-io-key to key
                   4419: : term-io-key?  ( -- true|false )
                   4420: s" stdin" get-chosen IF
                   4421: decode-int nip nip dup 0= IF drop 0 EXIT THEN \ return false and exit if no stdin set
                   4422: >r \ store ihandle on return stack
                   4423: s" device_type" r@ ihandle>phandle ( propstr len phandle )
                   4424: get-property ( true | data dlen false )
                   4425: IF
                   4426: false
                   4427: ELSE
                   4428: 1 - \ remove 1 from length to ignore null-termination char
                   4429: 2dup s" serial" str= IF
                   4430: 2drop serial-key? r> drop EXIT
                   4431: THEN \ call serial-key, cleanup return-stack, exit
                   4432: 2dup s" keyboard" str= IF 
                   4433: 2drop ( )
                   4434: s" key-available?" r@ ihandle>phandle find-method IF 
                   4435: drop s" key-available?" r@ $call-method  
                   4436: ELSE 
                   4437: false 
                   4438: THEN
                   4439: r> drop EXIT \ cleanup return-stack, exit
                   4440: THEN
                   4441: 2drop r> drop false EXIT \ unknown device_type cleanup return-stack, return false
                   4442: THEN
                   4443: ELSE
                   4444: false
                   4445: THEN
                   4446: ;
                   4447: ' term-io-key? to key?
                   4448: " hvterm" find-alias IF drop
                   4449: " hvterm" io
                   4450: THEN
                   4451: 800 cp
                   4452: 51 CONSTANT nvram-partition-type-cpulog
                   4453: 60 CONSTANT nvram-partition-type-sas
                   4454: 61 CONSTANT nvram-partition-type-sms
                   4455: 6e CONSTANT nvram-partition-type-debug
                   4456: 6f CONSTANT nvram-partition-type-history
                   4457: 70 CONSTANT nvram-partition-type-common
                   4458: 7f CONSTANT nvram-partition-type-freespace
                   4459: a0 CONSTANT nvram-partition-type-linux
                   4460: : rztype ( str len -- ) \ stop at zero byte, read with nvram-c@
                   4461: 0 DO
                   4462: dup i + nvram-c@ ?dup IF ( str char )
                   4463: emit
                   4464: ELSE                     ( str )
                   4465: drop UNLOOP EXIT
                   4466: THEN
                   4467: LOOP
                   4468: ;
                   4469: create tmpStr 500 allot
                   4470: : rzcount ( zstr -- str len )
                   4471: dup tmpStr >r BEGIN
                   4472: dup nvram-c@ dup r> dup 1+ >r c!
                   4473: WHILE
                   4474: char+
                   4475: REPEAT
                   4476: r> drop over - swap drop tmpStr swap
                   4477: ;
                   4478: : calc-header-cksum ( offset -- cksum )
                   4479: dup nvram-c@
                   4480: 10 2 DO
                   4481: over I + nvram-c@ +
                   4482: LOOP
                   4483: wbsplit + nip
                   4484: ;
                   4485: : bad-header? ( offset -- flag )
                   4486: dup 2+ nvram-w@        ( offset length )
                   4487: 0= IF                  ( offset )
                   4488: drop true EXIT      ( )
                   4489: THEN
                   4490: dup calc-header-cksum  ( offset checksum' )
                   4491: swap 1+ nvram-c@       ( checksum ' checksum )
                   4492: <>                     ( flag )
                   4493: ;
                   4494: : .header ( offset -- )
                   4495: cr                         ( offset )
                   4496: dup bad-header? IF         ( offset )
                   4497: ."   BAD HEADER -- trying to print it anyway" cr
                   4498: THEN
                   4499: space                      ( offset )
                   4500: dup nvram-c@ 2 0.r         ( offset )
                   4501: space space                ( offset )
                   4502: dup 2+ nvram-w@ 10 * 5 .r  ( offset )
                   4503: space space                ( offset )
                   4504: 4 + 0c rztype              ( )
                   4505: ;
                   4506: : .headers ( -- )
                   4507: cr cr ." Type  Size  Name"
                   4508: cr ." ========================"
                   4509: 0 BEGIN                      ( offset )
                   4510: dup nvram-c@              ( offset type )
                   4511: WHILE
                   4512: dup .header               ( offset )
                   4513: dup 2+ nvram-w@ 10 * +    ( offset offset' )
                   4514: dup nvram-size < IF       ( offset )
                   4515: ELSE
                   4516: drop EXIT              ( )
                   4517: THEN
                   4518: REPEAT
                   4519: drop                         ( )
                   4520: cr cr
                   4521: ;
                   4522: : reset-nvram ( -- )
                   4523: internal-reset-nvram
                   4524: ;
                   4525: : dump-partition     ['] nvram-c@      1 (dump) ;
                   4526: : type-no-zero ( addr len -- )
                   4527: 0 DO
                   4528: dup I + dup nvram-c@ 0= IF drop ELSE nvram-c@ emit THEN
                   4529: LOOP
                   4530: drop
                   4531: ;
                   4532: : type-no-zero-part ( from-str cnt-str addr len )
                   4533: 0 DO
                   4534: dup i + dup nvram-c@ 0= IF
                   4535: drop
                   4536: ELSE
                   4537: 3 pick 0= 3 pick 0 > AND IF
                   4538: dup 1 type-no-zero
                   4539: THEN
                   4540: nvram-c@ a = IF
                   4541: 2 pick 0= IF
                   4542: over 1- 0 max
                   4543: rot drop swap
                   4544: THEN
                   4545: 2 pick 1- 0 max
                   4546: 3 roll drop rot rot
                   4547: THEN
                   4548: THEN
                   4549: LOOP
                   4550: drop
                   4551: ;
                   4552: : (dmesg-prepare) ( base-addr -- base-addr' addr len act-off )
                   4553: 10 - \ go back to header
                   4554: dup 14 + nvram-l@ dup >r
                   4555: ( base-addr act-off ) ( R: act-off )
                   4556: over over over + swap 10 + nvram-w@ + >r
                   4557: ( base-addr act-off ) ( R:  act-off nvram-act-addr )
                   4558: over 2 + nvram-w@ 10 * swap - over swap
                   4559: ( base-addr base-addr start-size ) ( R:  act-off nvram-act-addr )
                   4560: r> swap rot 10 + nvram-w@ - r>
                   4561: ;
                   4562: : .dmesg ( base-addr -- )
                   4563: (dmesg-prepare) >r
                   4564: cr type-no-zero
                   4565: ( base-addr ) ( R: act-off )
                   4566: dup 10 + nvram-w@ + r> type-no-zero
                   4567: ;
                   4568: : .dmesg-part ( from-str cnt-str base-addr -- )
                   4569: (dmesg-prepare) >r
                   4570: >r >r -rot r> r>
                   4571: cr type-no-zero-part rot
                   4572: ( base-addr ) ( R: act-off )
                   4573: dup 10 + nvram-w@ + r> type-no-zero-part
                   4574: ;
                   4575: : dmesg-part ( from-str cnt-str -- left-from-str left-cnt-str )
                   4576: 2dup
                   4577: s" ibm,BE0log" get-named-nvram-partition IF
                   4578: s" ibm,CPU0log" get-named-nvram-partition IF
                   4579: 2drop EXIT
                   4580: THEN
                   4581: THEN
                   4582: drop .dmesg-part nip nip
                   4583: ;
                   4584: : dmesg2 ( -- )
                   4585: s" ibm,BE1log" get-named-nvram-partition IF
                   4586: s" ibm,CPU1log" get-named-nvram-partition IF
                   4587: ." No log partition." cr EXIT
                   4588: THEN
                   4589: THEN
                   4590: drop .dmesg
                   4591: ;
                   4592: : dmesg ( -- )
                   4593: s" ibm,BE0log" get-named-nvram-partition IF
                   4594: s" ibm,CPU0log" get-named-nvram-partition IF
                   4595: ." No log partition." cr EXIT
                   4596: THEN
                   4597: THEN
                   4598: drop .dmesg
                   4599: ;
                   4600: 880 cp
                   4601: wordlist CONSTANT envvars
                   4602: : listenv  ( -- )
                   4603: get-current envvars set-current  words  set-current
                   4604: ;
                   4605: : create-env ( "name" -- )
                   4606: get-current  envvars set-current  CREATE  set-current
                   4607: ;
                   4608: : env-int     ( n -- )  1 c, align , DOES> char+ aligned @ ;
                   4609: : env-bytes   ( a len -- )
                   4610: 2 c, align dup , here swap dup allot move
                   4611: DOES> char+ aligned dup @ >r cell+ r>
                   4612: ;
                   4613: : env-string  ( str len -- )  3 c, string, DOES> char+ count ;
                   4614: : env-flag    ( f -- )  4 c, c, DOES> char+ c@ 0<> ;
                   4615: : env-secmode ( sm -- )  5 c, c, DOES> char+ c@ ;
                   4616: : default-int     ( n "name" -- )      create-env env-int ;
                   4617: : default-bytes   ( a len "name" -- )  create-env env-bytes ;
                   4618: : default-string  ( a len "name" -- )  create-env env-string ;
                   4619: : default-flag    ( f "name" -- )      create-env env-flag ;
                   4620: : default-secmode ( sm "name" -- )     create-env env-secmode ;
                   4621: : set-option ( option-name len option len -- )
                   4622: 2swap encode-string
                   4623: 2swap s" /options" find-node dup IF set-property ELSE drop 2drop 2drop THEN
                   4624: ;
                   4625: : findenv ( name len -- adr def-adr type | 0 )
                   4626: 2dup envvars voc-find dup 0<> IF ( ABORT" not a configuration variable" )
                   4627: link> >body char+ >r (find-order) link> >body dup char+ swap c@ r> swap
                   4628: ELSE
                   4629: nip nip
                   4630: THEN
                   4631: ;
                   4632: : test-flag ( param len -- true | false )
                   4633: 2dup s" true" string=ci -rot s" false" string=ci or
                   4634: ;
                   4635: : test-secmode ( param len -- true | false )
                   4636: 2dup s" none" string=ci -rot 2dup s" command" string=ci -rot s" full"
                   4637: string=ci or or
                   4638: ;
                   4639: : isdigit ( char -- true | false )
                   4640: 30 39 between
                   4641: ;
                   4642: : test-int ( param len -- true | false )
                   4643: drop c@ isdigit if true else false then ;
                   4644: : test-string ( param len -- true | false )
                   4645: 0 ?DO
                   4646: dup i + c@                     \ Get character / byte at current index
                   4647: dup 20 <  swap 7e >  OR IF     \ Is it out of range 32 to 126 (=ASCII)
                   4648: drop FALSE UNLOOP EXIT      \ FALSE means: No ASCII string
                   4649: THEN
                   4650: LOOP
                   4651: drop TRUE    \ Only ASCII found --> it is a string
                   4652: ;
                   4653: : findtype ( param len name len -- param len name len type )
                   4654: 2dup findenv dup 0= \ try to find type of envvar
                   4655: IF             \ no type found
                   4656: drop 2swap
                   4657: 2dup test-flag if 4 -rot else
                   4658: 2dup test-secmode if 5 -rot else
                   4659: 2dup test-int if 1 -rot else
                   4660: 2dup test-string IF 3 ELSE 2 THEN  \ 3 = string, 2 = default to bytes
                   4661: -rot then then then
                   4662: rot
                   4663: >r 2swap r>
                   4664: else           \ take type from default value
                   4665: nip nip
                   4666: THEN
                   4667: ;
                   4668: : $setenv ( param len name len -- )
                   4669: 4dup set-option
                   4670: findtype dup 0=
                   4671: IF
                   4672: true ABORT" not a configuration variable"
                   4673: ELSE
                   4674: -rot $CREATE CASE
                   4675: 1 OF evaluate env-int ENDOF \ XXX: wants decimal and 0x...
                   4676: 2 OF
                   4677: 2dup                    ( param len param len )
                   4678: depth >r                ( param len param len  R: depth-before )
                   4679: ['] evaluate CATCH IF   \ Catch 'unknown Forth words'...
                   4680: 2drop  r> drop
                   4681: env-string           \ and encode 'unknown word' as string
                   4682: ELSE
                   4683: depth r> = IF env-bytes ELSE env-int THEN
                   4684: 2drop
                   4685: THEN
                   4686: ENDOF
                   4687: 3 OF env-string ENDOF
                   4688: 4 OF evaluate env-flag ENDOF
                   4689: 5 OF evaluate env-secmode ENDOF \ XXX: recognize none, command, full
                   4690: ENDCASE
                   4691: THEN
                   4692: ;
                   4693: : (printenv) ( adr type -- )
                   4694: CASE
                   4695: 1 OF aligned @ . ENDOF
                   4696: 2 OF aligned dup cell+ swap @ dup IF dump ELSE 2drop THEN ENDOF
                   4697: 3 OF count type ENDOF
                   4698: 4 OF c@ IF ." true" ELSE ." false" THEN ENDOF
                   4699: 5 OF c@ . ENDOF \ XXX: print symbolically
                   4700: ENDCASE
                   4701: ;
                   4702: : .printenv-header ( -- )
                   4703: cr
                   4704: s" ---environment variable--------current value-------------default value------"
                   4705: type cr
                   4706: ;
                   4707: DEFER old-emit
                   4708: 0 VALUE emit-counter
                   4709: : emit-and-count emit-counter 1 + to emit-counter old-emit ;
                   4710: : .enable-emit-counter
                   4711: 0 to emit-counter
                   4712: ['] emit behavior to old-emit
                   4713: ['] emit-and-count to emit
                   4714: ;
                   4715: : .disable-emit-counter
                   4716: ['] old-emit behavior to emit
                   4717: ;
                   4718: : .spaces
                   4719: dup 0 > IF spaces ELSE
                   4720: drop space THEN
                   4721: ;
                   4722: : .print-one-env
                   4723: 3 .spaces
                   4724: 2dup dup -rot type 1c swap - .spaces
                   4725: findenv rot over
                   4726: .enable-emit-counter
                   4727: (printenv) .disable-emit-counter
                   4728: 1a emit-counter - .spaces
                   4729: (printenv)
                   4730: ;
                   4731: : .print-all-env
                   4732: .printenv-header
                   4733: envvars cell+ BEGIN @ dup WHILE dup link> >name
                   4734: name>string .print-one-env cr REPEAT drop
                   4735: ;
                   4736: : printenv
                   4737: parse-word dup 0= IF
                   4738: 2drop .print-all-env ELSE findenv dup 0=
                   4739: ABORT" not a configuration variable"
                   4740: rot over cr ." Current: " (printenv)
                   4741: cr ." Default: " (printenv) THEN
                   4742: ;
                   4743: : (set-default)  ( def-xt -- )
                   4744: dup >name name>string $CREATE dup >body c@ >r execute r> CASE
                   4745: 1 OF env-int ENDOF
                   4746: 2 OF env-bytes ENDOF
                   4747: 3 OF env-string ENDOF
                   4748: 4 OF env-flag ENDOF
                   4749: 5 OF env-secmode ENDOF ENDCASE
                   4750: ;
                   4751: true default-flag auto-boot?
                   4752: s" " default-string boot-device
                   4753: s" " default-string boot-file
                   4754: s" boot" default-string boot-command
                   4755: s" " default-string diag-device
                   4756: s" " default-string diag-file
                   4757: false default-flag diag-switch?
                   4758: true default-flag fcode-debug?
                   4759: s" " default-string input-device
                   4760: s" " default-string nvramrc
                   4761: s" " default-string oem-banner
                   4762: false default-flag oem-banner?
                   4763: 0 0 default-bytes oem-logo
                   4764: false default-flag oem-logo?
                   4765: s" " default-string output-device
                   4766: 200 default-int screen-#columns
                   4767: 200 default-int screen-#rows
                   4768: 0 default-int security-#badlogins
                   4769: 0 default-secmode security-mode
                   4770: s" " default-string security-password
                   4771: 0 default-int selftest-#megs
                   4772: false default-flag use-nvramrc?
                   4773: false default-flag direct-serial?
                   4774: true default-flag real-mode?
                   4775: true default-flag use-axon-ddr?
                   4776: VARIABLE nvoff \ offset in envvar partition
                   4777: : (nvupdate-one) ( adr type -- "value" )
                   4778: CASE
                   4779: 1 OF aligned @ (.) ENDOF
                   4780: 2 OF drop s" 0 0" ENDOF
                   4781: 3 OF count ENDOF
                   4782: 4 OF c@ IF s" true" ELSE s" false" THEN ENDOF
                   4783: 5 OF c@ (.) ENDOF \ XXX: print symbolically
                   4784: ENDCASE
                   4785: ;
                   4786: : nvupdate-one   ( def-xt -- )
                   4787: >r nvram-partition-type-common get-nvram-partition       ( part.addr part.len FALSE|TRUE R: def-xt )
                   4788: ABORT" No valid NVRAM." r>      ( part.addr part.len def-xt )
                   4789: >name name>string               ( part.addr part.len var.a var.l )
                   4790: 2dup findenv nip (nvupdate-one)
                   4791: internal-add-env
                   4792: drop
                   4793: ;
                   4794: : (nvupdate) ( -- )
                   4795: nvram-partition-type-common get-nvram-partition ABORT" No valid NVRAM."
                   4796: erase-nvram-partition drop
                   4797: envvars cell+
                   4798: BEGIN @ dup WHILE dup link> nvupdate-one REPEAT
                   4799: drop
                   4800: ;
                   4801: : nvupdate ( -- )
                   4802: ." nvupdate is obsolete." cr
                   4803: ;
                   4804: : set-default
                   4805: parse-word envvars voc-find
                   4806: dup 0= ABORT" not a configuration variable" link> (set-default)
                   4807: ;
                   4808: : (set-defaults)
                   4809: envvars cell+
                   4810: BEGIN @ dup WHILE dup link> (set-default) REPEAT
                   4811: drop
                   4812: ;
                   4813: (set-defaults)
                   4814: : set-defaults
                   4815: (set-defaults) (nvupdate)
                   4816: ;
                   4817: : setenv  parse-word ( skipws ) 0d parse -leading 2swap $setenv (nvupdate) ;
                   4818: : get-nv  ( -- )
                   4819: nvram-partition-type-common get-nvram-partition ( addr offset not-found | not-found ) \ find partition header
                   4820: IF
                   4821: ." No NVRAM common partition, re-initializing..." cr
                   4822: internal-reset-nvram
                   4823: (nvupdate)
                   4824: nvram-partition-type-common get-nvram-partition IF ." NVRAM seems to be broken." cr EXIT THEN
                   4825: THEN
                   4826: drop ( addr )           \ throw away offset
                   4827: BEGIN
                   4828: dup rzcount  dup     \ make string from offset and make condition
                   4829: WHILE                   ( offset offset length )
                   4830: 2dup [char] = split  \ Split string at equal sign (=)
                   4831: 2swap                ( offset offset length param len name len )
                   4832: $setenv              \ Set envvar
                   4833: nip                  \ throw away old string begin
                   4834: + 1+                 \ calc new offset
                   4835: REPEAT
                   4836: 2drop drop              \ cleanup
                   4837: ;
                   4838: get-nv
                   4839: : check-for-nvramrc  ( -- )
                   4840: use-nvramrc?  IF
                   4841: s" Executing following code from nvramrc: "
                   4842: s" nvramrc" evaluate $cat
                   4843: nvramlog-write-string-cr
                   4844: s" (!) Executing code specified in nvramrc" type
                   4845: cr s"  SLOF Setup = " type
                   4846: .enable-emit-counter
                   4847: s" nvramrc" evaluate ['] evaluate  CATCH  IF
                   4848: 2drop
                   4849: emit-counter 0  DO  8 emit  LOOP
                   4850: s" (!) Code in nvramrc triggered exception. "
                   4851: 2dup nvramlog-write-string
                   4852: type cr 12 spaces s" Aborting nvramrc execution" 2dup
                   4853: nvramlog-write-string-cr type cr
                   4854: s"  SLOF Setup = " type
                   4855: THEN
                   4856: .disable-emit-counter
                   4857: THEN
                   4858: ;
                   4859: : (nv-findalias) ( alias-ptr alias-len -- pos )
                   4860: here 0
                   4861: s" devalias " string-cat
                   4862: 3 pick 3 pick string-cat
                   4863: s"  " string-cat
                   4864: s" nvramrc" evaluate
                   4865: 2swap find-substr
                   4866: nip nip
                   4867: ;
                   4868: : (nv-build-real-entry) ( name-ptr name-len dev-ptr dev-len -- str-ptr str-len )
                   4869: 2swap here 0
                   4870: s" devalias " string-cat
                   4871: 2swap string-cat
                   4872: s"  " string-cat
                   4873: 2swap string-cat
                   4874: 0d char-cat
                   4875: 0a char-cat
                   4876: ;
                   4877: : (nv-build-null-entry) ( name-ptr name-len dev-ptr dev-len -- str-ptr str-len )
                   4878: 4drop here 0
                   4879: ;
                   4880: : (nv-build-nvramrc) ( name-str name-len dev-str dev-len xt-build-entry -- )
                   4881: 4 pick 4 pick (nv-findalias)
                   4882: dup s" nvramrc" evaluate nip >= IF
                   4883: drop execute
                   4884: s" nvramrc" evaluate string-cat
                   4885: dup allot
                   4886: s" nvramrc" $setenv
                   4887: ELSE  \ if our alias is still defined in nvramrc
                   4888: 5 pick 5 pick 5 pick 5 pick 5 pick execute nip over +
                   4889: s" nvramrc" evaluate 3 pick string-at
                   4890: 2dup find-nextline string-at nip +
                   4891: alloc-mem 0
                   4892: s" nvramrc" evaluate drop 3 pick string-cat
                   4893: rot >r >r >r execute r> r> 2swap string-cat
                   4894: ( mem, len ) ( R: alias-pos )
                   4895: s" nvramrc" evaluate r> string-at
                   4896: 2dup find-nextline string-at string-cat
                   4897: 2dup s" nvramrc" $setenv free-mem
                   4898: THEN
                   4899: ;
                   4900: : $nvalias ( name-str name-len dev-str dev-len -- )
                   4901: 4dup ['] (nv-build-real-entry) (nv-build-nvramrc)
                   4902: set-alias
                   4903: s" true" s" use-nvramrc?" $setenv
                   4904: (nvupdate)
                   4905: ;
                   4906: : nvalias ( "alias-name< >device-specifier<eol>" -- )
                   4907: parse-word parse-word dup 0<> IF
                   4908: $nvalias
                   4909: ELSE
                   4910: 2drop 2drop
                   4911: cr
                   4912: "    Usage: nvalias (""alias-name< >device-specifier<eol>"" -- )" type
                   4913: cr
                   4914: THEN    
                   4915: ;
                   4916: : $nvunalias ( name-str name-len -- )
                   4917: s" " ['] (nv-build-null-entry) (nv-build-nvramrc)
                   4918: (nvupdate)
                   4919: ;
                   4920: : nvunalias ( "alias-name< >" -- )
                   4921: parse-word $nvunalias
                   4922: ;
                   4923: : diagnostic-mode? ( -- diag-switch? ) diag-switch? ;
                   4924: check-for-nvramrc
                   4925: 890 cp
                   4926: defer set-boot-device
                   4927: defer add-boot-device
                   4928: : qemu-read-bootlist ( -- )
                   4929: 0 0 set-boot-device
                   4930: " boot-device" evaluate swap drop 0 <> IF EXIT THEN   
                   4931: " qemu,boot-device" get-chosen not IF EXIT THEN
                   4932: 0 ?DO
                   4933: dup i + c@ CASE
                   4934: 0        OF ENDOF
                   4935: [char] a OF ENDOF
                   4936: [char] b OF ENDOF
                   4937: [char] c OF " disk"  add-boot-device ENDOF
                   4938: [char] d OF " cdrom" add-boot-device ENDOF
                   4939: [char] n OF " net"   add-boot-device ENDOF
                   4940: ENDCASE cr
                   4941: LOOP
                   4942: drop
                   4943: ;
                   4944: ' qemu-read-bootlist to read-bootlist
                   4945: 8a0 cp
                   4946: VOCABULARY client-voc \ We store all client-interface callable words here.
                   4947: 6789  CONSTANT  sc-exit
                   4948: 4711  CONSTANT  sc-yield
                   4949: VARIABLE  client-callback \ Address of client's callback function
                   4950: : client-data  ciregs >r3 @ ;
                   4951: : nargs  client-data la1+ l@ ;
                   4952: : nrets  client-data la1+ la1+ l@ ;
                   4953: : client-data-to-stack
                   4954: client-data 3 la+ nargs 0 ?DO dup l@ swap la1+ LOOP drop ;
                   4955: : stack-to-client-data
                   4956: client-data nargs nrets + 2 + la+ nrets 0 ?DO tuck l! /l - LOOP drop ;
                   4957: : call-client ( args len client-entry -- )
                   4958: >r  ciregs >r7 !  ciregs >r6 !  client-entry-point @ ciregs >r5 !
                   4959: cistack ciregs >r1 !
                   4960: r> jump-client drop
                   4961: BEGIN
                   4962: client-data-to-stack
                   4963: client-data l@ zcount
                   4964: ALSO client-voc $find PREVIOUS
                   4965: dup 0= >r IF 
                   4966: CATCH
                   4967: ?dup IF
                   4968: dup CASE
                   4969: sc-exit OF drop r> drop EXIT ENDOF
                   4970: sc-yield OF drop r> drop EXIT ENDOF
                   4971: ENDCASE
                   4972: THROW
                   4973: THEN
                   4974: stack-to-client-data
                   4975: ELSE
                   4976: cr type ."  NOT FOUND"
                   4977: THEN
                   4978: r> ciregs >r3 !  ciregs >r4 @ jump-client 
                   4979: UNTIL ;
                   4980: : flip-stack ( a1 ... an n -- an ... a1 )  ?dup IF 1 ?DO i roll LOOP THEN ;
                   4981: : (callback) ( "service-name<>" "arguments<cr>" -- )
                   4982: client-callback @  \ client-callback points to the function prolog
                   4983: dup 8 + @ ciregs >r2 !  \ Set up the TOC pointer (???)
                   4984: @ call-client ;  \ Resolve the function's address from the prolog
                   4985: ' (callback) to callback
                   4986: : (continue-client)
                   4987: s" "  \ make call-client happy, client won't use the string anyways.
                   4988: ciregs >r4 @ call-client ;
                   4989: ' (continue-client) to continue-client
                   4990: : string-to-buffer ( str len buf len -- len' )
                   4991: 2dup erase rot min dup >r move r> ;
                   4992: ALSO client-voc DEFINITIONS
                   4993: : exit  sc-exit THROW ;
                   4994: : yield  sc-yield THROW ;
                   4995: : test ( zstr -- missing? )
                   4996: zcount 
1.1.1.2 ! root     4997: ALSO client-voc $find PREVIOUS IF
        !          4998: drop FALSE
        !          4999: ELSE
        !          5000: 2drop TRUE
        !          5001: THEN 
1.1       root     5002: ;
                   5003: : finddevice ( zstr -- phandle )
                   5004: zcount find-node dup 0= IF drop -1 THEN ;
                   5005: : getprop ( phandle zstr buf len -- len' )
                   5006: >r >r zcount rot get-property
                   5007: 0= IF r> swap dup r> min swap >r move r>
                   5008: ELSE r> r> 2drop -1 THEN ;
                   5009: : getproplen ( phandle zstr -- len )
                   5010: zcount rot get-property 0= IF nip ELSE -1 THEN ;
                   5011: : setprop ( phandle zstr buf len -- size|-1 )
                   5012: dup >r            \ save len
                   5013: encode-bytes      ( phandle zstr prop-addr prop-len )
                   5014: 2swap zcount rot  ( prop-addr prop-len name-addr name-len phandle )
                   5015: current-node @ >r \ save current node
                   5016: set-node          \ change to specified node
                   5017: property          \ set property
                   5018: r> set-node       \ restore original node
                   5019: r>                \ always return size, because we can not fail.
                   5020: ;
                   5021: : canon ( zstr buf len -- len' )
                   5022: over >r move r> zcount nip ;
                   5023: : nextprop ( phandle zstr buf -- flag ) \ -1 invalid, 0 end, 1 ok
                   5024: >r zcount rot next-property IF r> zplace 1 ELSE r> drop 0 THEN ; 
                   5025: : open ( zstr -- ihandle )  zcount open-dev ;
                   5026: : close ( ihandle -- )  close-dev ;
                   5027: : write ( ihandle str len -- len' )      rot s" write" rot
                   5028: ['] $call-method CATCH IF 2drop 3drop -1 THEN ;
                   5029: : read  ( ihandle str len -- len' )      rot s" read"  rot
                   5030: ['] $call-method CATCH IF 2drop 3drop -1 THEN ;
                   5031: : seek  ( ihandle hi lo -- status  ) swap rot s" seek" rot
                   5032: ['] $call-method CATCH IF 2drop 3drop -1 THEN ;
                   5033: : claim  ( addr len align -- base )
                   5034: dup  IF  rot drop
                   5035: ['] claim CATCH  IF  2drop -1  THEN
                   5036: ELSE
                   5037: ['] claim CATCH  IF  3drop -1  THEN
                   5038: THEN
                   5039: ;
                   5040: : release ( addr len -- ) release ;
                   5041: : instance-to-package ( ihandle -- phandle )
                   5042: ihandle>phandle ;
                   5043: : package-to-path ( phandle buf len -- len' )
                   5044: 2>r node>path 2r> string-to-buffer ;
                   5045: : instance-to-path ( ihandle buf len -- len' )
                   5046: 2>r instance>path 2r> string-to-buffer ;
                   5047: : instance-to-interposed-path ( ihandle buf len -- len' )
                   5048: 2>r instance>qpath 2r> string-to-buffer ;
                   5049: : call-method ( str ihandle arg ... arg -- result return ... return )
                   5050: nargs flip-stack zcount rot ['] $call-method CATCH
                   5051: nrets 0= IF drop ELSE \ if called with 0 return args do not return the catch result
                   5052: dup IF nrets 1 ?DO -444 LOOP THEN
                   5053: nrets flip-stack 
                   5054: THEN ;
                   5055: : test-method ( phandle str -- missing? )
                   5056: zcount rot find-method dup IF nip THEN 0= ;
                   5057: : milliseconds  milliseconds ;
                   5058: : start-cpu ( phandle addr r3 -- )
                   5059: >r >r 
                   5060: s" reg" rot get-property 0= IF drop l@ 
                   5061: ELSE true ABORT" start-cpu called with invalid phandle" THEN 
                   5062: r> r> of-start-cpu drop
                   5063: ;
                   5064: : quiesce  ( -- )
                   5065: quiesce
                   5066: ;
                   5067: : interpret ( ... zstr -- result ... )
                   5068: zcount ['] evaluate CATCH ;
                   5069: : set-callback ( newfunc -- oldfunc )
                   5070: client-callback @ swap client-callback ! ;
                   5071: PREVIOUS DEFINITIONS
                   5072: false value elf-claim?
                   5073: 0     value last-claim
1.1.1.2 ! root     5074: 0 VALUE cur-brk
        !          5075: : elf-claim-segment ( addr size -- errorcode )
        !          5076: 2dup
1.1       root     5077: elf-claim? IF
                   5078: >r
                   5079: here last-claim , to last-claim                \ Setup ptr to last claim
1.1.1.2 ! root     5080: dup , r> dup , ( addr size )
        !          5081: 0 ['] claim CATCH IF
        !          5082: ." Memory for ELF file is already in use!" cr
        !          5083: true ABORT" Memory for ELF file already in use "
1.1       root     5084: THEN
1.1.1.2 ! root     5085: drop
1.1       root     5086: ELSE
1.1.1.2 ! root     5087: 2drop
1.1       root     5088: THEN
1.1.1.2 ! root     5089: + to cur-brk
        !          5090: 0 
1.1       root     5091: ;
1.1.1.2 ! root     5092: : elf-load-claim ( file-addr destaddr -- claim-list entry imagetype )
1.1       root     5093: true to elf-claim?
                   5094: 0 to last-claim
1.1.1.2 ! root     5095: dup -1 = IF             \ If destaddr == -1 then load to addr from ELF header
        !          5096: drop ['] elf-load-file CATCH IF false to elf-claim? ABORT THEN
        !          5097: ELSE
        !          5098: ['] elf-load-file-to-addr CATCH IF false to elf-claim? ABORT THEN
        !          5099: THEN
        !          5100: >r
1.1       root     5101: last-claim swap
                   5102: false to elf-claim?
1.1.1.2 ! root     5103: r>
1.1       root     5104: ;
                   5105: : elf-release ( claim-list -- )
                   5106: BEGIN
                   5107: dup cell+                   ( claim-list claim-list-addr )
                   5108: dup @ swap cell+ @          ( claim-list claim-list-addr claim-list-sz )
                   5109: release                     ( claim-list )
                   5110: @ dup 0=                    ( Next-element )
                   5111: UNTIL
                   5112: drop
                   5113: ;
                   5114: CREATE bootdevice 2 cells allot bootdevice 2 cells erase
                   5115: CREATE bootargs 2 cells allot bootargs 2 cells erase
                   5116: CREATE load-list 2 cells allot load-list 2 cells erase
                   5117: : start-elf ( arg len entry -- )
                   5118: msr@ 7fffffffffffffff and 2000 or ciregs >srr1 ! call-client
                   5119: ;
                   5120: : start-elf64 ( arg len entry -- )
                   5121: msr@ 2000 or ciregs >srr1 !
                   5122: dup 8 + @ ciregs >r2 ! @ call-client \ entry point is pointer to .opd
                   5123: ;
                   5124: : set-bootpath
                   5125: s" disk" find-alias
                   5126: dup IF ELSE drop s" boot-device" evaluate find-alias THEN
                   5127: dup IF strdup ELSE 0 THEN
                   5128: encode-string s" bootpath" set-chosen
                   5129: ;
                   5130: : set-netbootpath
                   5131: s" net" find-alias
                   5132: ?dup IF strdup encode-string s" bootpath" set-chosen THEN
                   5133: ;
                   5134: : set-bootargs
                   5135: skipws 0 parse dup 0= IF
                   5136: 2drop s" boot-file" evaluate
                   5137: THEN
                   5138: encode-string s" bootargs" set-chosen
                   5139: ;
                   5140: : .(client-exec) ( arg len -- rc )
1.1.1.2 ! root     5141: s" snk" romfs-lookup 0<> IF
        !          5142: paflof-start f00000 +
        !          5143: elf-load-file-to-addr drop start-elf64 client-data
        !          5144: ELSE
        !          5145: 2drop false
        !          5146: THEN
1.1       root     5147: ;
                   5148: ' .(client-exec) to (client-exec)
                   5149: : .client-exec ( arg len -- rc ) set-bootargs (client-exec) ;
                   5150: ' .client-exec to client-exec
                   5151: : netflash ( -- rc ) s" netflash 2000000 " (parse-line) $cat set-netbootpath
                   5152: client-exec
                   5153: ;
                   5154: : netsave  ( "addr len {filename}[,params]" -- rc )
                   5155: (parse-line) dup 0> IF
                   5156: s" netsave " 2swap $cat set-netbootpath client-exec
                   5157: ELSE
                   5158: cr
                   5159: ." Usage: netsave addr len [bootp|dhcp,]filename[,siaddr][,ciaddr][,giaddr][,bootp-retries][,tftp-retries][,use_ci]"
                   5160: cr 2drop
                   5161: THEN
                   5162: ;
                   5163: : ping  ( "{device-path:[device-args,]server-ip,[client-ip],[gateway-ip][,timeout]}" -- )
                   5164: my-self >r current-node @ >r  \ Save my-self
                   5165: (parse-line) open-dev dup  IF
                   5166: dup to my-self dup ihandle>phandle set-node
                   5167: s" ping" rot ['] $call-method CATCH  IF
                   5168: cr
                   5169: ." Not a pingable device"
                   5170: cr 3drop
                   5171: THEN
                   5172: ELSE
                   5173: cr
                   5174: ." Usage: ping device-path:[device-args,]server-ip,[client-ip],[gateway-ip][,timeout]"
                   5175: cr drop
                   5176: THEN
                   5177: r> set-node r> to my-self  \ Restore my-self
                   5178: ;
                   5179: 8b0 cp
1.1.1.2 ! root     5180: romfs-base 400000 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
1.1       root     5181: 8ff cp
                   5182: : (boot) ( -- )
                   5183: s" Executing following boot-command: "
                   5184: boot-command $cat nvramlog-write-string-cr
                   5185: s" boot-command" evaluate      \ get boot command
                   5186: ['] evaluate catch ?dup IF     \ and execute it
                   5187: ." boot attempt returned: "
                   5188: abort"-str @ count type cr
                   5189: nip nip                     \ drop string from 1st evaluate
                   5190: throw
                   5191: THEN
                   5192: ;
                   5193: : (function-key) ( -- n )
                   5194: key? IF
                   5195: key CASE
                   5196: 50  OF 1 ENDOF
                   5197: 7e  OF 1 ENDOF
                   5198: dup OF 0 ENDOF
                   5199: ENDCASE
                   5200: THEN
                   5201: ;
                   5202: : (esc-sequence) ( -- n )
                   5203: key? IF
                   5204: key CASE
                   5205: 4f  OF (function-key) ENDOF
                   5206: 5b  OF
                   5207: key key drop (function-key) ENDOF
                   5208: dup OF 0 ENDOF
                   5209: ENDCASE
                   5210: THEN
                   5211: ;
                   5212: : (s-pressed) ( -- )
                   5213: s" An 's' has been pressed. Entering Open Firmware Prompt"
                   5214: nvramlog-write-string-cr
                   5215: ;
                   5216: : (boot?) ( -- )
                   5217: of-prompt? not auto-boot? and IF
                   5218: (boot)
                   5219: THEN
                   5220: ;
                   5221: false VALUE (sms-loaded?)
                   5222: false value (sms-available?)
                   5223: s" sms.fs" romfs-lookup IF true to (sms-available?) drop THEN
                   5224: (sms-available?) [IF]
                   5225: s" /packages" find-device
                   5226: new-device
                   5227: s" sms" device-name
                   5228: : open true ;
                   5229: : close ;
                   5230: finish-device
                   5231: device-end \ leave /packages
                   5232: : sms-init-nvram ( -- )
                   5233: nvram-partition-type-sms get-nvram-partition IF
                   5234: cr ." Could not find SMS partition in NVRAM - "
                   5235: nvram-partition-type-sms s" SMS" d# 1024 new-nvram-partition
                   5236: ABORT" Failed to create SMS NVRAM partition"
                   5237: 2dup erase-nvram-partition drop
                   5238: 2dup s" lang"                    s" 1" internal-set-env drop
                   5239: 2dup s" tftp-retries"            s" 5" internal-set-env drop
                   5240: 2dup s" tftp-blocksize"                s" 512" internal-set-env drop
                   5241: 2dup s" bootp-retries"         s" 255" internal-set-env drop
                   5242: 2dup s" client"            s" 000.000.000.000" internal-set-env drop
                   5243: 2dup s" server"       s" 000.000.000.000" internal-set-env drop
                   5244: 2dup s" gateway"      s" 000.000.000.000" internal-set-env drop
                   5245: 2dup s" netmask"      s" 255.255.255.000" internal-set-env drop
                   5246: 2dup s" net-protocol"            s" 0" internal-set-env drop
                   5247: 2dup s" net-flags"               s" 0" internal-set-env drop
                   5248: 2dup s" net-device"              s" 0" internal-set-env drop
                   5249: 2dup s" net-client-name"                  s" " internal-set-env drop
                   5250: 2dup s" scsi-spinup"             s" 6" internal-set-env drop
                   5251: 2dup s" scsi-id-0"               s" 7" internal-set-env drop
                   5252: 2dup s" scsi-id-1"               s" 7" internal-set-env drop
                   5253: 2dup s" scsi-id-2"               s" 7" internal-set-env drop
                   5254: 2dup s" scsi-id-3"               s" 7" internal-set-env drop
                   5255: ." created" cr
                   5256: THEN
                   5257: s" sms-nvram-partition" $2constant
                   5258: ;
                   5259: sms-init-nvram
                   5260: : sms-add-env ( "name" "value" -- ) sms-nvram-partition 2rot 2rot internal-add-env drop ;
                   5261: : sms-set-env ( "name" "value" -- ) sms-nvram-partition 2rot 2rot internal-set-env drop ;
                   5262: : sms-get-env ( "name" -- "value" TRUE | FALSE) sms-nvram-partition 2swap internal-get-env ;
                   5263: : sms-get-net-device ( -- n )  s" net-device" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
                   5264: : sms-set-net-device ( n -- )  (.d) s" net-device" 2swap sms-set-env ;
                   5265: : sms-get-net-flags ( -- n )   s" net-flags" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
                   5266: : sms-set-net-flags ( n -- )   (.d) s" net-flags" 2swap sms-set-env ;
                   5267: : sms-get-net-protocol ( -- n )        s" net-protocol" sms-get-env IF $dnumber IF 0 THEN ELSE 0 THEN ;
                   5268: : sms-set-net-protocol ( n -- )        (.d) s" net-protocol" 2swap sms-set-env ;
                   5269: : sms-get-lang ( -- n )        s" lang" sms-get-env IF $dnumber IF 1 THEN ELSE 1 THEN ;
                   5270: : sms-set-lang ( n -- )        (.d) s" lang" 2swap sms-set-env ;
                   5271: : sms-get-bootp-retries ( -- n ) s" bootp-retries" sms-get-env IF $dnumber IF 255 THEN ELSE 255 THEN ;
                   5272: : sms-set-bootp-retries ( n -- ) (.d) s" bootp-retries" 2swap sms-set-env ;
                   5273: : sms-get-tftp-retries ( -- n )        s" tftp-retries" sms-get-env IF $dnumber IF 5 THEN ELSE 5 THEN ;
                   5274: : sms-set-tftp-retries ( n -- ) (.d) s" tftp-retries" 2swap sms-set-env ;
                   5275: : sms-get-tftp-blocksize ( -- n ) s" tftp-blocksize" sms-get-env IF $dnumber IF 5 THEN ELSE 5 THEN ;
                   5276: : sms-set-tftp-blocksize ( n -- ) (.d) s" tftp-blocksize" 2swap sms-set-env ;
                   5277: : sms-get-client ( -- FALSE | n1 n2 n3 n4 TRUE ) s" client" sms-get-env IF (ipaddr) ELSE false THEN ;
                   5278: : sms-set-client ( n1 n2 n3 n4 -- ) (ipformat) s" client" 2swap sms-set-env ;
                   5279: : sms-get-server ( -- FALSE | n1 n2 n3 n4 TRUE ) s" server" sms-get-env IF (ipaddr) ELSE false THEN ;
                   5280: : sms-set-server ( n1 n2 n3 n4 -- ) (ipformat) s" server" 2swap sms-set-env ;
                   5281: : sms-get-gateway ( -- FALSE | n1 n2 n3 n4 TRUE ) s" gateway" sms-get-env IF (ipaddr) ELSE false THEN ;
                   5282: : sms-set-gateway ( n1 n2 n3 n4 -- ) (ipformat) s" gateway" 2swap sms-set-env ;
                   5283: : sms-get-subnet ( -- FALSE | n1 n2 n3 n4 TRUE ) s" netmask" sms-get-env IF (ipaddr) ELSE false THEN ;
                   5284: : sms-set-subnet ( n1 n2 n3 n4 -- ) (ipformat) s" netmask" 2swap sms-set-env ;
                   5285: : sms-get-client-name ( -- FALSE | addr len TRUE ) s" net-client-name" sms-get-env ;
                   5286: : sms-set-client-name ( addr len -- ) s" net-client-name" 2swap sms-set-env ;
                   5287: : sms-get-scsi-spinup ( -- n ) s" scsi-spinup" sms-get-env IF $dnumber IF 6 THEN ELSE 6 THEN ;
                   5288: : sms-set-scsi-spinup ( n -- ) (.d) s" scsi-spinup" 2swap sms-set-env ;
                   5289: : sms-get-scsi-id ( n -- id )  s" scsi-id-" rot (.) $cat sms-get-env IF $dnumber IF 6 THEN ELSE 6 THEN ;
                   5290: : sms-set-scsi-id ( id n -- ) swap (.d) rot s" scsi-id-" rot (.) $cat sms-set-env ;
                   5291: : sms-get-net-boot-file ( -- addr len )
                   5292: s" net" sms-get-net-device (.) $cat
                   5293: s" :dhcp," $cat
                   5294: sms-get-server IF (ipformat) $cat THEN
                   5295: s" ," $cat
                   5296: sms-get-client-name IF $cat THEN
                   5297: s" ," $cat
                   5298: sms-get-client IF (ipformat) $cat THEN
                   5299: s" ," $cat
                   5300: sms-get-gateway IF (ipformat) $cat THEN
                   5301: s" ," $cat
                   5302: sms-get-bootp-retries dup ff <> IF (.) $cat ELSE drop THEN
                   5303: s" ," $cat
                   5304: sms-get-tftp-retries (.) $cat
                   5305: dup IF
                   5306: strdup ( s" :" 2swap $cat strdup )
                   5307: THEN
                   5308: ;
                   5309: ' sms-get-net-boot-file to furnish-boot-file
                   5310: : $sms-node s" /packages/sms" ;
                   5311: : (sms-init-package) ( -- true|false )
                   5312: (sms-loaded?) ?dup IF EXIT THEN
                   5313: $sms-node ['] find-device catch IF 2drop false EXIT THEN
                   5314: s" sms.fs" [COMPILE] included
                   5315: device-end
                   5316: true dup to (sms-loaded?)
                   5317: ;
                   5318: : (sms-evaluate) ( addr len -- )
                   5319: (sms-init-package) not IF
                   5320: cr ." SMS is not available." cr 2drop exit
                   5321: THEN
                   5322: s" Entering SMS ..." type
                   5323: disable-watchdog
                   5324: reset-dual-emit
                   5325: 2>r $sms-node find-device
                   5326: 2r> evaluate
                   5327: device-end
                   5328: vpd-boot-import
                   5329: ;
                   5330: : sms-start ( -- ) s" sms-start" (sms-evaluate) ;
                   5331: : sms-fru-replacement ( -- ) s" sms-fru-replacement" (sms-evaluate) ;
                   5332: [ELSE]
                   5333: : sms-start ( -- ) cr ." SMS is not available." cr ;
                   5334: : sms-fru-replacement ( -- ) cr ." SMS FRU replacement is not available." cr ;
                   5335: [THEN]
                   5336: TRUE VALUE use-load-watchdog?
                   5337: : start-it ( -- )
                   5338: key? IF
                   5339: key CASE
                   5340: [char] s  OF (s-pressed) ENDOF
                   5341: 1b        OF
                   5342: (esc-sequence) CASE
                   5343: 1   OF console-clean-fifo sms-start (boot) ENDOF
                   5344: dup OF (boot?) ENDOF
                   5345: ENDCASE
                   5346: ENDOF
                   5347: dup OF (boot?) ENDOF
                   5348: ENDCASE
                   5349: ELSE
                   5350: (boot?)
                   5351: THEN
                   5352: disable-watchdog  FALSE to use-load-watchdog?
                   5353: .banner
                   5354: ;
                   5355: ."      "   \ Clear last checkpoint
                   5356: 0 VALUE load-size
                   5357: 0 VALUE go-entry
                   5358: VARIABLE state-valid false state-valid !
                   5359: CREATE go-args 2 cells allot go-args 2 cells erase
                   5360: : $bootargs
                   5361: bootargs 2@ ?dup IF
                   5362: ELSE s" diagnostic-mode?" evaluate and IF s" diag-file" evaluate
                   5363: ELSE s" boot-file" evaluate THEN THEN
                   5364: ;
                   5365: : $bootdev ( -- device-name len )
                   5366: bootdevice 2@ dup IF s"  " $cat THEN
                   5367: s" diagnostic-mode?" evaluate IF
                   5368: s" diag-device" evaluate
                   5369: ELSE
                   5370: s" boot-device" evaluate
                   5371: THEN
                   5372: $cat \ prepend bootdevice setting from vpd-bootlist
                   5373: strdup
                   5374: ?dup 0= IF
                   5375: disable-watchdog
                   5376: drop true ABORT" No boot device!"
                   5377: THEN
                   5378: ;
                   5379: : set-boot-args ( str len -- ) dup IF strdup ELSE nip dup THEN bootargs 2! ;
                   5380: : (set-boot-device) ( str len -- )
                   5381: ?dup IF 1+ strdup 1- ELSE drop 0 0 THEN bootdevice 2!
                   5382: ;
                   5383: ' (set-boot-device) to set-boot-device
                   5384: : (add-boot-device) ( str len -- )     \ Concatenate " str" to "bootdevice"
                   5385: bootdevice 2@ ?dup IF $cat-space ELSE drop THEN set-boot-device
                   5386: ;
                   5387: ' (add-boot-device) to add-boot-device
                   5388: 0 value claim-list
                   5389: : no-go ( -- ) -64 boot-exception-handler ABORT ;
                   5390: defer go ( -- )
                   5391: : go-32 ( -- )
                   5392: state-valid @ IF
                   5393: 0 ciregs >r3 ! 0 ciregs >r4 !
                   5394: go-args 2@ go-entry start-elf client-data
                   5395: claim-list elf-release 0 to claim-list
                   5396: THEN
                   5397: -6d boot-exception-handler ABORT
                   5398: ;
                   5399: : go-64 ( -- )
                   5400: state-valid @ IF
                   5401: 0 ciregs >r3 ! 0 ciregs >r4 !
                   5402: go-args 2@ go-entry start-elf64 client-data
                   5403: claim-list elf-release 0 to claim-list
                   5404: THEN
                   5405: -6d boot-exception-handler ABORT
                   5406: ;
                   5407: : load-elf-init ( arg len file-addr -- success )
                   5408: false state-valid !                            \ Not valid anymore ...
                   5409: claim-list IF                                    \ Release claimed mem
                   5410: claim-list elf-release 0 to claim-list        \ from last load
                   5411: THEN
1.1.1.2 ! root     5412: true swap -1                       ( arg len true file-addr -1 )
        !          5413: elf-load-claim                     ( arg len true claim-list entry elftype )
1.1       root     5414: CASE
1.1.1.2 ! root     5415: 1  OF ['] go-32 ENDOF           ( arg len true claim-list entry go )
        !          5416: 2  OF ['] go-64 ENDOF           ( arg len true claim-list entry go )
        !          5417: dup OF ['] no-go to go
        !          5418: 2drop 3drop false EXIT   ENDOF                   ( false )
1.1       root     5419: ENDCASE
                   5420: to go to go-entry to claim-list
                   5421: dup state-valid ! -rot
                   5422: 2 pick IF
                   5423: go-args 2!
                   5424: ELSE
                   5425: 2drop
                   5426: THEN
                   5427: ;
                   5428: : init-program ( -- )
                   5429: $bootargs LOAD-BASE ['] load-elf-init CATCH ?dup IF
                   5430: boot-exception-handler
                   5431: 2drop 2drop false          \ Could not claim
                   5432: ELSE IF
                   5433: 0 ciregs 2dup >r3 ! >r4 !  \ Valid (ELF ) Image
                   5434: THEN
                   5435: THEN
                   5436: ;
                   5437: : do-load ( devstr len -- img-size )   \ Device method wrapper
                   5438: use-load-watchdog? IF
                   5439: 4ec set-watchdog
                   5440: THEN
                   5441: my-self >r current-node @ >r         \ Save my-self
                   5442: ." Trying to load: " $bootargs type ."  from: " 2dup type ."  ... "
                   5443: 2dup open-dev dup IF
                   5444: dup to my-self
                   5445: dup ihandle>phandle set-node
                   5446: -rot                              ( ihandle devstr len )
                   5447: my-args nip 0= IF
                   5448: 2dup 1- + c@ [char] : <> IF    \ Add : to device path if missing
                   5449: 1+ strdup 2dup 1- + [char] : swap c!
                   5450: THEN
                   5451: THEN
                   5452: encode-string s" bootpath" set-chosen
                   5453: $bootargs encode-string s" bootargs" set-chosen
                   5454: LOAD-BASE s" load" 3 pick ['] $call-method CATCH IF
                   5455: -67 boot-exception-handler 3drop drop false
                   5456: ELSE
                   5457: dup 0> IF
                   5458: init-program
                   5459: ELSE
                   5460: false state-valid !
                   5461: drop 0                                     \ Could not load
                   5462: THEN
                   5463: THEN
                   5464: swap close-dev device-end dup to load-size
                   5465: ELSE -68 boot-exception-handler 3drop false THEN
                   5466: r> set-node r> to my-self                           \ Restore my-self
                   5467: ;
                   5468: : parse-load ( "{devlist}" -- success )        \ Parse-execute boot-device list
                   5469: cr BEGIN parse-word dup WHILE
                   5470: ( de-alias ) do-load dup 0< IF drop 0 THEN IF
                   5471: state-valid @ IF ."   Successfully loaded" cr THEN
                   5472: true 0d parse strdup load-list 2! EXIT
                   5473: THEN
                   5474: REPEAT 2drop 0 0 load-list 2! false
                   5475: ;
                   5476: : load ( "{params}<eol>"} -- success ) \ Client interface to load
                   5477: parse-word 0d parse -leading 2swap ?dup IF
                   5478: de-alias
                   5479: set-boot-device
                   5480: ELSE
                   5481: drop
                   5482: THEN
                   5483: set-boot-args s" parse-load " $bootdev $cat strdup evaluate
                   5484: ;
                   5485: : load-next ( -- success )     \ Continue after go failed
                   5486: load-list 2@ ?dup IF s" parse-load " 2swap $cat strdup evaluate
                   5487: ELSE drop false THEN
                   5488: ;
                   5489: : noload false ;
                   5490: ' no-go to go
                   5491: : (go-and-catch)  ( -- )
                   5492: ['] go behavior CATCH IF -69 boot-exception-handler THEN
                   5493: ;
                   5494: read-bootlist
                   5495: : boot
                   5496: load 0= IF -65 boot-exception-handler EXIT THEN
                   5497: disable-watchdog (go-and-catch)
                   5498: BEGIN load-next WHILE
                   5499: disable-watchdog (go-and-catch)
                   5500: REPEAT
                   5501: .banner
                   5502: ;
                   5503: : load load 0= IF -65 boot-exception-handler THEN ;
                   5504: : yaboot ." Use 'boot disk' instead " ;
                   5505: : netboot ( -- rc ) ." Use 'boot net' instead " ;
                   5506: : netboot-arg ( arg-string -- rc )
                   5507: s" boot net " 2swap $cat (parse-line) $cat
                   5508: evaluate
                   5509: ;
                   5510: : netload ( -- rc ) (parse-line)
                   5511: load-base >r FLASH-LOAD-BASE to load-base
                   5512: s" load net:" strdup 2swap $cat strdup evaluate
                   5513: r> to load-base
                   5514: load-size
                   5515: ;
                   5516: : neteval ( -- ) FLASH-LOAD-BASE netload evaluate ;
                   5517: cr .(   Welcome to Open Firmware)
                   5518: cr
                   5519: cr .(   Copyright (c) char ) emit .(  2004, 2011 IBM Corporation All rights reserved.)
                   5520: cr .(   This program and the accompanying materials are made available)
                   5521: cr .(   under the terms of the BSD License available at)
                   5522: cr .(   http://www.opensource.org/licenses/bsd-license.php)
                   5523: cr cr
                   5524: ' start-it CATCH drop
                   5525: cr ." Ready!"
1.1.1.2 ! root     5526: &�D8P&&�D�PGCC: (GNU) 4.4.5.symtab.strtab.shstrtab.rela.slof.loader.rela.text.rela.opd.rela.got.rela.data.comment.branch_lt.bss &&&L&x�&2&n�-y.h=&qq�8�hpG&v�v�&0B��`Q&w�w��L�8&7X   W&0d�d�&&`&d�d�kpd����d�p&&iP  �             s�&qv�     w�
p&&d�d�&q0.v(\vD9(&
� 5tHCt`�a:�q;�u���s@ �q��t�&��u&@�
���
 ��u�D�r���u�$�r�(&6&v��&
�&+v�&\&3��&>q�&&Lq�&�&b6�&os��&�6�&�tx&�&�sp &�q�&�q`�&���&&�6�&�s((&�t
�
�'sXP8u��@r� Q
� br�(r
�~r�(�9��G��:��r &��rh&��
��
��u�<t��
�"�/ ��D���PLrt`
�cG�nHz9��Gp� d#�s �G��:��
��:,�u8�� dH �:�&
�&     :�
�%r� 6�Js�|Vqx0kuP&�suhHzu�$�t�&��r8t�rP��qH<�7$�Gh�v@|�
��s�D�t��engineprintfvsprintfio_printhex16the_data_stackget_partitionincrease_nvram_partition_sizebootmsg_warningbootmsg_nvupdatememmovenvram_write_qwordcall_clientreset_nvramadd_envhash_tablethe_client_stackmemcpyelf_forth_claimtolowernvram_read_dwordromfs_lookupvsnprintfthe_pocketsstrtoul_slof_textelf_load_fileelf_load_file_to_addrwriteLogByteclear_nvram_partitionc_romfs_lookupdelete_nvram_partitionfree_nvram_bufferclient_entry_pointwrite_start_OFio_putcharnvram_read_qwordnvram_debugepapr_ima_sizethe_comp_bufferget_nvram_bufferstrncmpnvram_write_bytethe_return_stacknvram_read_wordepapr_magicnvram_read_bytebootmsg_cp.hv_hascharbootmsg_checklevelelf_load_segments32elf_load_segments64the_exception_framethe_heapmemsetnew_nvram_partitionfdt_start.call_client_binary_OF_fsi_startthe_memelf_get_base_addr32rphv_hascharhv_send_crqGET_WRNG_LVLhv_putchar_binary_OF_fsi_endnvram_write_dwordhv_getcharbootmsg_debugcpdpprint_msgset_envstdout_databootmsg_errorthe_tibbootmsg_setlevelromfs_basenvram_write_word.client_entry_pointerase_nvramwriteLogByte_wrapperdel_envstrlentoupperget_envelf_get_base_addr64elf_relocate64asm_coutio_printhv_genericvfprintfthe_client_framewipe_nvramnvramlog_printf&A&A&V&V&6&6&&/&*/&:!&>!&&=&,��* . 96 9He,�?�?�?(?? ?:?V?z? ~?�?b?j?0�?�?8�?�?@�?�?H?
        !          5527: ?P*?2?XR?Z?`z?~?h�?�?h�?�?p�? ?x *? .?� V? Z?� �?  �?  �?
        !          5528: 
        !          5529: ?
        !          5530: 2?
        !          5531: Z?
        !          5532: �?
        !          5533: �?
        !          5534: �?.? V?�?�?�??2?R?z?~? �? �?�? �?
?
"?�
J?
R?�
z? 
~?
�?�
�?
�? 
�?�
�?
�? &?Z?�?�?�?*?^?�?�?�??J?n?�?�?�??:?^?�?�?�?F?�?�??:?v?�?�? �?? :? �?�? �? .?R? z? �? �?�?~??�?F?�?�?�\
        !          5535: 
        !          5536: "?.?�2?�@"
        !          5537: n?z?�~?��#
        !          5538: �?�7
        !          5539: �?5
        !          5540: ?(
        !          5541: >?P-
        !          5542: f?|3
        !          5543: �?�W
        !          5544: �?�L
        !          5545: ?
        !          5546: 6?P
        !          5547: �?�
        !          5548: �?
        !          5549: 
        !          5550: ^?�?
        !          5551: @
        !          5552: R?pc
        !          5553: �?�H
        !          5554: �?�8
        !          5555: �?
        !          5556: *?PS
        !          5557: b?�N
        !          5558: �?�U
        !          5559: �?�:
        !          5560: ?8J
        !          5561: J?`M
        !          5562: v?�G
        !          5563: �?�c
        !          5564: �?�?� ? T
        !          5565:  �?� �?� �?
        !          5566:  �f
        !          5567:  �.
        !          5568: !?!0
        !          5569: !H?
        !          5570: !p^
        !          5571: !�\
        !          5572: !�?"
        !          5573: "?
        !          5574: "L
        !          5575: "h?
        !          5576: "�
        !          5577: "�?"�
        !          5578: #?
        !          5579: #0[
        !          5580: #b?#�%
        !          5581: #�?#�
        !          5582: $?
        !          5583: $0
        !          5584: $L?
        !          5585: $xQ
        !          5586: $�?$�'
        !          5587: $�?%?%>?%f?%�?%�?%�?%�?&
        !          5588: ?&2?&J?&^?&�?&�?&�?&�?'&?'N?'v?'�?'�?'�?(?(>?(f?(�?(�?(�?(�?)?)
        !          5589: ).?)X
        !          5590: )j?)�
        !          5591: )�?*?*:?*b?*�?*�?*�?+?+.?+r?+�?+�?+�?+�?,?,*?,R?,j?,~?,�?,�?,�?,�?-?-&?-J?-n?-�?-�?-�?.?.*?.D@
        !          5592: 0�?�1$]
        !          5593: 1@]
        !          5594: 3�,
        !          5595: 4d,
        !          5596: 4�,
        !          5597: 4�,
        !          5598: 4�$
        !          5599: 54
        !          5600: 5�
        !          5601: 6�
        !          5602: 78,
        !          5603: 7l,
        !          5604: 7�,
        !          5605: 7�,
        !          5606: 7�,
        !          5607: 7�,
        !          5608: 7�,
        !          5609: 8,
        !          5610: 80,
        !          5611: 8L,
        !          5612: 8h,
        !          5613: 8�,
        !          5614: 8�,
        !          5615: 8�,
        !          5616: 8�,
        !          5617: 8�,
        !          5618: 9,
        !          5619: 9�,
        !          5620: 9�
        !          5621: :,
        !          5622: :,
        !          5623: :,
        !          5624: :,
        !          5625: : ,
        !          5626: :@,
        !          5627: :H,
        !          5628: :P,
        !          5629: :X
        !          5630: :`,
        !          5631: :hb
        !          5632: :p,
        !          5633: :x,
        !          5634: :�P
        !          5635: :�I
        !          5636: :�P:�I
        !          5637: :�P:�I
        !          5638: ;�_
        !          5639: ;�E
        !          5640: <x<
        !          5641: <�;
        !          5642: =�_
        !          5643: =�<
        !          5644: =�`
        !          5645: >E
        !          5646: >8;
        !          5647: ?�
        !          5648: @?
        !          5649: B�?�B�
        !          5650: 
        !          5651: C?�C
        !          5652: 
        !          5653: C2?�E�
        !          5654: F?
        !          5655: F�    
        !          5656: G    
        !          5657: G?�G\
        !          5658: G(    
        !          5659: G<    
        !          5660: G�9
        !          5661: G���G���G���G���G���G���H^?�H�?�H�?�H�?�H�?�I*?�IN?�Iz?�I�?�I�?�J?�K"?�KV?�L?�L�?�M(
        !          5662: �M0
        !          5663: �M�?�M�\
        !          5664: M�?�NR?�Nb?�N�?�N�?�O
        !          5665: �O&?�O<
        !          5666: O�?�P�2
        !          5667: Q�
        !          5668: RB?�R�?�R�?�R�
        !          5669: 0S?�T�?�T�?�U2?�UL
        !          5670: U�?�U�
        !          5671: 0V@
        !          5672: V�?�V�
        !          5673: V�
        !          5674: 0WD
        !          5675: Wpa
        !          5676: W�?�X?�X0
        !          5677: X:?�XX
        !          5678: X�?�X�g
        !          5679: X�?&X�
        !          5680: Y
        !          5681: 0Y|7
        !          5682: Y�7
        !          5683: Zb?&Z�7
        !          5684: Z�7
        !          5685: Z�\
        !          5686: Z�2
        !          5687: \8
        !          5688: �\D\
        !          5689: \X\
        !          5690: \�3
        !          5691: \�\
        !          5692: \�3
        !          5693: \�3
        !          5694: \�\
        !          5695: ]v?&]�?
        !          5696: ]�7
        !          5697: ]�7
        !          5698: ]�\
        !          5699: ^2
        !          5700: ^�^
        !          5701: _\
        !          5702: _2
        !          5703: _h
        !          5704: �_|
        !          5705:  _�1
        !          5706: _�7
        !          5707: _�7
        !          5708: `3
        !          5709: `(\
        !          5710: `P3
        !          5711: `�3
        !          5712: `�(
        !          5713: `�3
        !          5714: a0
        !          5715: a�
        !          5716: �a�
        !          5717:  a�7
        !          5718: b1
        !          5719: b@7
        !          5720: b�3
        !          5721: b�(
        !          5722: b�Y
        !          5723: e�
        !          5724: e�?&fd
        !          5725: fp
        !          5726: f�*
        !          5727: f�?&g?& g�
        !          5728: XhP 
        !          5729: k�?&(ld 
        !          5730: lt\
        !          5731: l�\
        !          5732: m0
        !          5733: pmd
        !          5734: Xm�
        !          5735: pm�?&m�
        !          5736: pm�
        !          5737: Xn?&n4
        !          5738: pnD
        !          5739: Xn�?&n�
        !          5740: pn�
        !          5741: Xq�X&q�3q�B&q�3q&&q3q&&Pq 3q0&&�q83qH&&1�qP3q`&&1�qh3qx&&2�q�3q�&&9q�3q�&&9�q�3q�&&:�q�3r&&<�r3r &&=r(3r8&&>�r@3rP&&?PrX3rh&&Crp3r�&&D�r�3r�&&FPr�3r�&&F�r�3r�&&F�r�3r�&&F�r�3r�&&F�s3s&&G s3s(&&G@s03s@&&GpsH3sX&&G�s`3sp&&G�sx3s�&&Hs�3s�&&H�s�3s�&&IPs�3s�&&I�s�3s�&&J@s�3t&&J�t3t&&J�t 3t0&&Mt83tH&&MptP3t`&&O�th3tx&&R@t�3t�&&Tt�3t�&&Ut�3t�&&U�t�3t�&&W@t�3t�&&X0t�3u&&Zu3u &&[@u(3u8&&\pu@3uP&&_@uX3uh&&aup3u�&&aPu�3u�&&a�u�3u�&&b0u�3u�&&b�u�3u�&&c0u�3u�&&c`v3v&&c�v3v(&&c�v03v@&&d@vH3vX&&d�v`3vp&&fvx3v�&&gv�3v�&&m�v�3v�&v�&&v�O&v�
&��������v�F&v�&&�v�T&v�&v�=&we&w&�w0&w+&w &�(w(A&w0V&w86&w@/&wH
&wP4&wX&w`&wh&wp&wx&&AHw�& w�&Pw�&��w�&hw�&xw�&�w�&��0w�R&w�&�w�&���w�&&i�x�&
        !          5742: �y&&�y&
        !          5743: �y &�8y8&&�y@&�yH&8y`&&�yh&yp&�yx&�y�& y�&Hy�&@y�&`y�&xy�&`y�&�y�&�y�&�y�&Py�&�y�&        py�&
        !          5744: y�&�y�&y�&0z&Hz&`z&xz &�z0&�z8&�z@&�PzH&�zX&Hz`&`zp&xzx&�z�&z�&0z�&pz�&�z�&&�z�&�z�&&�z�&�z�&&{&�{&&�{ &�{0&&        �{8&�{H&& T{P&�{`&&8{h&�{�&&�{�&�{�&&
        !          5745: P{�&�{�&&
        !          5746: 0{�&
{�&&�{�&
 {�&&�|&
@|&&�| &0|(&H|0&`|8&�|H&�|P&�|X&�|`&�|p&H|x&�|�&x|�&�|�&�|�&|�&|�&X|�&�|�&H|�&`|�&x|�&�|�&�}&�}&}&X}&�} &�}0&
`}8&�}@&�}H&}X&&�}`&}h&0}p&p}x&�}�&}�&0}�&`}�&}�&0}�&h}�&�}�&0}�&�}�&P}�&�}�&H}�&0}�&�~&�~&�~ & ~8&&�~@&~H&�~P&`~X& ~`&H~h&�~x&X~�&�~�&�~�&�~�&�~�&8~�&�~�&~�&�~�&h~�&&�~�&�&�&&@&� &(& 0&8&x@&�H&P&�X&�`&h&p&�x&��&&�&�&&��&��&@�&H�&�&��&@�&`�&��&0�&&0�&��(&&��8&��H&&�P&X�`&&��p&x��&&0��&P��&&        ���&���&&���&��&��&���&���&��&���&���&`�&��&��&��&`� &��(&��0&�8&��@&��X&&��`&��h&��p&��x&`��&���&x��&`��&���&���& ��&���&@��&`��&���&���&���&��&���&��&&��&��&�� &��(&��0&0�8&��@&��H&`�P&��X&��`&�h&0�p&��x&���&���&8��&&���&���&���&&���&���&&���&��&&��&H� &��0&�8& �@&P�H&p�P&��X&��`&��p&�x&���&���&���&���&���&���&(��&���&���&&���&8��&&���&��&��&��&x�(&&��8&8�H&& ��P&��`&&X�h&��x&&x��& ��&&x��&���&& ,��&���&&��&P��&&
        !          5747: ��&��&&T�&�0� &&'�(&h�H&&��P&H�X&`�h&x�p&���&���& ��&��&X��&���&���&���&H��&`��&x��&���&���&���&P�&��&`�&&�� &��(&�0&��8&h�H&&t�P&��h&&��p&�x&���&��&��&8��&���&���&���&        X��&���&��&&��&H�&8�&�� &`�(&��0&��@&&��H&x�P&��`&��h&`�p&�x&��&���&���&&���&��&&
���&
        !          5748: ���&&���&(�&&��& �&`�&`� &��(&@�0&��8&��@&��H&H�X&&��`&X�h&@�p&��x&���&&���&x��&���&���&���&���&@��&`��&��&���& ��&���&��&&�&��&&�� &��(&X�0&0�8&��@&8�P&&��X& �`&`�h&��x&���&H��&��&���&`��&���&���& ��&���&x��&���&(��&���&`��&
        !          5749: �&��&h� &&��(& �0&`�8&��H&��P&��X&��`&��h&��p& �x&��&���&X��&`��&
        !          5750: ��&��&��&���&���&p��&&���& ��&&��& ��&�� &!��(&��0&"��@&&��P&�h&&��p& �x&`��&���&#��&���&���&���&���&���&#H��&��&���& ��&��&��&X�&`�&
        !          5751: � &��(&`�0&#H�8&#H�@&�H&��P&#`�`&&��h&#��p&��x&���&#H��&$@��&���&� ��&$@��&`��&#H��&���&���&&
        !          5752: ���&���&&
        !          5753: x��&$p�&&��&$��&��&(�(&&��0&$��8&��@&$��P&&��`&%�p&&���&%H��&&���&���&&���&%���&&���&H��&���&H�&��&�&&H� &%��8&&��@&� �H&`�P&&��X&&��`&'�h&&�p&��x&'@��&&���&'P��&���&'p��&`��&'P��&'���&���&'���&&��&'��&&��&`�&`� &��(&��8&&
        !          5754: ��@&(�X&&��`&@�h&��p&(8��&&���&8��&��&���&(h��&&D��&���&&���&���&���&���&��&��&&� &(��0&&��8&)0�@&��H&)0�P&��X&��`&��p&&���&��&&$��&)@��&&,��&)`��&&���&)x��&&(��&)��&�8&&��H&H�X&&��`&'��h&�p&�x&��&���&���&&��&)���&&���&��&���&��&���&0�&&0�&*� &&��(&�0&H�8&��@&��P&��X&��`&�h&��x&��&���&x��&*���&���&0��&��&���& ��&&���&��&���&0��&�&��&$�� &&��(&*��0&��8&P�H&&H�P&*��`&&��h&`�p&��x&���&���&+��&&���&+ ��&&���&���&P��&���&��&���&���&&8��&+x�&&
��&+��8&+��H&&��P&+��X&H�`&��p&p�x&H��&,���&���&`��&���&���&-(��&&���&���&���&���&`��&`�&
        !          5755: �&��&��&-P�(&&��0&(�8&��@&`�H&��`&&`�h&@�x&&���&-h��&&���&-���&.��&-x��&���&.@��&&���&-���&H��&��&.���&��&.��&��&/@�&.P�&�� &h�0&&��8&h�@&x�H&`�P&��X&�h&&��p&��x&@��&���&���&/���&&��&���&&���&���&���&���&/���&&��&H�&`�&�� &��(&��0&��8&��@&�H&H�P&�X&`�`&`�p&x�x&H��&���&���&8��&���&*���&H��&`��&���&���&���&���&���&���&�&�&�&�&�� &��(&/��0&��8&`�@&��P&��X&��`&��p&1�x&(��&���&���&���&���&���&���&!���&&���&���&x��&���&H��&���&���&18�&��&`�&�� &��(&��0&`�8&��@&1h�H&��X&1��`&��h&'��p&���&���&���&���&1���&&���&��&���&���&���&���&x��&���&���&���&x�& �&��&1��&��(&��0&H�8&1��@&��H&��X&H�`&��h&'��p&��x&2���&&���&���&���&*���&���&`��&��&!���&��&���&3��&&���&3 �&3@�&3X�&��&#��0&&��8&3��@&��H&3��X&&��`&#��h&��p&)X�x&#H��&$@��&���&� ��&$@��&`��&#H��&���&4��&&���&X��&���&���&���&`�&
        !          5756: �&��&4H�(&&��8&4��P&&��X&4��h&&��p&4��x&���&4���&&���&58��&���&���&5X��&&���&5���&���&���&5���&&��&
        !          5757: �&&��&�� &
        !          5758: �(&��0&5��@&&��H&`�X&6�`&��h&���&&���&���&@��&H��&H��&`��&���&`��&3@��&��&���&6��&&���& �&'p�&8�&��&&�� &x�(&��8&H�@&`�H&��P&'p�X&8�`&1��h&&��p&6���&���&���&6���&&���&1���&���&���&6���&&���&7��&���&���&&��&� �&��&��&� � &��(&70�8&&��H&P�X&&l�`&7H�p&&��x&'���&���&���&���&`��&���&7���&&��&���&&���&���&`��&���&7��&&0�&7�� &,��0&&��8&p�@&,��H&��P&8P�`&&��h&��p&��x&p��&���&@��&���&���&8���&`��&���&��&&���&9��&���&9��&���&9��&��&��&8��&&�(&6��@&&��H&9�X&&��`&98�x&&���&9X��&&&���&���&��&&���&���&���&��&��&9p�&&��&9�� &��(&��0&9��8&0�@&9��H&`�P&��X&&��h&&��p&1��x&x��&���&$���&&���&:0��&���&���&:@��&&���&&���&���&3@��&���&P�&&��&:p� &&��(&5��0&*��8&��@&5��H&1�P&3@�X&��`&30�p&&
��x&���&&���&:���&���&���&#H��&���&��&&���&((��&H��&��&7���&;x�&��& �&P� &��(&@�0&��8&��@&��H&��X&��`&��h&��p&��x&���&���&6���&���&���&���&��&���&X��&&���&8��&H��&`��&&���&$��&+8�&��&&`� &&��(&&x�0&��8&'x�H&&�P&-��`&&��h&��p&;��x&H��&���&'���&x��&���&;���&&���&;���&H��&`��&���&<8��&&���&<H��&H�&��&�� &��(&.��8&&��@&�H&;��P&H�X&��`&'��h&x�p&��x&0���&&���&H��&���&���&1��&���&<���&&���&<���& ��&+���&��&��&��&<��(&&��0&��8&��H&`�X&<��`&��h&=8�x&&���&=H��&���&=h��&&���&H��&`��&���&���&`��&`��&9���&���&=x�&��&��&� &��(&�0&�8&9��@&��H&6��P&��X&9��`&��h&>��p&>��x&���&���&��&?0��&���&8��&���&*���&���&���&���&?`��&&���&��&��&x�&��&� &&��(&��0&)p�8&��@&?��P&&��X&18�`&`�h&��p&���&&��&?���&&���&���&��&���&`��&���&���&`��&`��&H�&��&x�&�� &1h�(&��8&x�@&��P&��X&7X�`&��h&��p&��x&���&��&���&���&(��&���&@h��&&���&`��&!���&��&���&P�&&�&@��(&&
\�0&@��@&&��H&�P&@��X&��`&'�p&&��x&� ��&`��&5���&'��&���&A��&&���&#���&���&6���&#H��&A���&B@��&���&`�&&��&`�&X� &`�(&��0&B��@&&��H&#��P&C�X&Ch�`&��h&C���&&���&&���&&���&58��&���&5(��&&���&7��&���&���&C���&&���&C��&��&��&C�� &&��(&5��0&D�8&��@&D �P&&��X&D`�`&��h&��p&DP��&&��&Dp��&&���&6��&&���&`��&6��&���&D���&&|�&Eh�&&��&� � &5��(&*��0&3@�8&��H&�P&E��X&��h&��p&���&&���&E���&&���&D��&���&F8��&&���&5���&x��&���&Fh��&&��&:0�&D�&��&F��(&&'(�0&F��@&&��H&��P&��X&��`&�h&�p&��x&G��&&��&8���&&���&&(�8&(�H&&��P&6(�X&� �`&8��h&��p&3��x&���&`��&��&E���&P��&6(��&���&G8��&&���&GP��&@��&���&1���&&�&G`�&&D� &G��8&&��@&G��P&&&��X&G��h&&��p&9��x&���&���&H`��&0��&9���&`��&���&X��&&���&HH��&&���&H���&9���&`�&��&H��&&�(&H��8&&��@&9�H&x�P&��X&H��h&&��p&IX�x&I���&���&I���&I���&���&J��&&���&#���&`��&!���&���&%���&#H��&H��&E��&x�&��&�� &`�(&E��0&�@&6(�H&��P&Jh�`&&��h&��p&`�x&���&J���&&���&� ��&`��&���&���&J���&&���&H��&��&Kh��&���&��&�&K��&��&�� &��0&&��8&9��@&��H&Kh�P&��X&J��`&<��h&��p&/0��&&���&9���&���&;���&>���&J���&<���&���&-���&&���&;���&H��&���&*���&'��&��&`�&'p�&�� &K��0&&��8&��@& �H&��P&L �`&&��h&`�p&L`�x&H��&`��&`��&L���&���&`��&x��&`��&x��&H��&>���&�&��&M�&�� &��(&��0&��@&��H&(�P&��X&M��h&&��p&�x&N(��&`��&��&+��&M���&��&���&���&NX��&&���&��&���&���&��&��&N��&&�� &�(&N��0&��8&��@&��H&O�X&&��`&�h&Ox�p&P�x&`��&O���&+���&���&O���&���&1(��&&���&���&���&���&"���&&��&8��&��&@�&H� &`�(&3 �0&+��8&��@&'p�H&��P&O��`&&��h& �p&��x&`��&���&P���&&
(��&P���&&���&��&1h��&���&1X��&&���&x��&`��&��&P��&&��&#�� &��(&�0&#H�8&A��@&B@�H&��P&$0�h&&��p&$@�x&���&���&���&H��&���&���&� ��&`��&x��&���&`��&���&� ��&x��&#H�&$@�&`�&��&Qh�(&&��0&��8&X�@&'��H&X�P&��X&��h&��p&R �x&���&Rp��&���&���&� ��&R���&���&���&R���&&���&#���&S��&���&���&SH�&&��&#��&��&�� &#H�(&S��0&B@�8&��@&R��P&&��X&#��`&S��h&B@�p&��x&T��&&��&T@��&&���&T���&���&���&Tp��&&���&D`��&D��&���&h�&&��&T��&&�� &T��(&��0&��8&T��H&&�X&LP�h&&��p&H�x&`��&`��&L���&���&`��&���&���&T���&&���&x��&��&��&U��&U�� &��(&U��0&D`�8&6��H&��P&U��`&&��h&� �p&U��x&D`��&'��&���&3x��&&���&� ��&'p��&:0��&'��&���&V��&&���& ��&18��&��&��&��&�� &0�0&&��8&:0�@&x�H&��P&5��`&&�p&Vh��&&'���&���&&���&���&���&���&P��&���&��&���&��&���&��&��&��&&� &&�8&&0�@&&(�H&V��`&&��h&V���&&���&V���&&&d��&V���&&���&���&���&>���& ��&)p��&���&`��&x�&��&��&�� &X�(&��0&9��H&&��P&H��X&9��`&`�h&��p&Wp��&&��&W���&&��&*p��&&���&9��&���&���&W���&&���&X�&�&X�&��&I�� &��(&XH�@&&��H&H�P&W��X&3@�`&��h&X��p&P��x&���&U���&&���&X���&���&Y ��&���&X��&���&YP��&&���&X���&O���&+���&��&Y��&&��&#�� &��(&��0&#H�8&(x�@&p�H&��P&Y��`&&��h&?��p&`�x&�€&9�&&�˜&W� &9�¨&`°&�¸&;���&&���&H��&`��&18��&��&`�&�� &`�0&��8&��@&Z�P&&��X&�`&��h&K��p&��x&Z�È&&�Ð&`à&è&+ð&Z�ø&��&���&���&���&[���&&���&@��&��&(�&&�� &��(&0�0&��8&[��H&&��P&H�X&`�h&`�x&L�Ā&�Đ&`Ġ&xĨ&�İ&M��&&���&1���&���&M��&���&;h�&&��&>��&H�&>�� &P��(&��8&�@&(�H&��P&18�X&��h&(�p&��x&�ŀ&�ň&\Ř&&�Š&Ũ&HŰ&�Ÿ&��&\@��&���&���&P��&N���&���&��&>��&&��&�� &�(&��0&��8&��@&��P&&��X&�`&0�h&��p&\�ƀ&&�ƈ&�Ɛ&Ƙ&HƠ&ƨ&�ư&HƸ&���&���&���&���&x��&���&\0��&&��&�&Ox�&P�&`�(&O��0&+��8&��@&Ox�H&��P&\��`&&��h&1��p&P��x&�ǀ&Dǐ&&�ǘ&OhǨ&&�ǰ&1�Ǹ&@���&���&]��&&���&]��&��&!���&H�&P�&'p�&x�&�� &H�(&Y �0&��@&8�H&��P&`�X&`�`&'p�h&�x&�Ȁ&�Ȉ&O�Ș&&�Ƞ&@�Ȱ&&�ȸ&)p��&`��&���&]���&&���&Qx��&$@��&��&��&��&#H�&� � &� �(&$@�0&`�8&�@&#H�H&��P&R`�`&&��h&X�p&��x&1�ɀ&XɈ&'�ɐ&�ɠ&�ɨ&� ɰ&Rpɸ&`��&R���&���&� ��&R ��&&���&���&^8�&&��&��&@� &H�(&��0&#H�8&�@&��H&R�X&&��h&^xʀ&&(ʈ&Cʘ&&�ʠ&#�ʨ&�ʰ&�ʸ&#H��&S���&B@��&���&^���&&���&Qx��&��&��&#H�&� �&� &#H�(&��0&Sx�@&&��H&Qx�P&� �X&��`&^��x&&�ˀ&� ˈ&@ː&x˘&#Hˠ&�˨&B0��&&���&� ��&`��&@��&x��&���&`��&��&_0�&&�(&4��8&&��@&_X�H&��P&��X&_H�h&&��p&T��x&D̀&�̈&*�̘&&�̠&_�̨&�̰&�̸&_x��&&��&_���&&���&x�&��&��&U�� &W��(&��0&U��8&D`�@&6��P&��X&`�h&&8�p&I�̀&&�͈&IX͐&�͘&I�͠&�ͨ&Up͸&&\��&`0��&&���&� ��&`(��&T���&'��&��&.��&&��& � &)p�(&��8&��@&��H&��P&`p�h&&',�p&`�Έ&&�ΐ&`�Ψ&&xΰ&`���&&(��&`���&&���&���&���&>���& �&)p�&��&`� &x�(&��0&��@&��H&X�P&��X&a�h&&�x&a8ϐ&&Ϡ&aXϰ&&�ϸ&a���&���&Y ��&���&ah��&���&a���&&��&b8�&�&b8�&�� &b�(&��0&b`�H&&��P&H�X&aH�`&3@�h&��p&H��x&P�Ѐ&�Ј&H�И&&Ш&I@��&&���&X`��&��&bx��&���&bx��&���&N�&&��&�&N(� &��(&N(�0&��8&b��H&&��P&X`�X&��`&b�h&��p&b�ш&&�ѐ&6(ј&� Ѡ&�Ѩ&&�Ѱ&#HѸ&4��&���&c@��&&���&��&P���&���&cp�&&��&H�&� & �(& �0&��8&�@&c��H&`�P&3X�X&��`&3@�h&��x&*�Ҁ&�҈&�Ґ&�Ҙ&�Ҡ&�Ҩ&�Ұ&�Ҹ&���&d0��&&���&��&H��&���&��&\@�&��&`�&P�&;x� &+��(&��8&�@&1��H&+��P&��X&P�`&x�h&��p&��x&d�ӈ&&�Ӑ&P�Ә&�Ӡ&Ӱ&&�Ӹ&H��&��&���&d���&���&���&? ��&&��&e�&?0�&��&L��(&&��0&\��8&`�@&��H&x�P&�X&\��`&��h&��p&d�Ԁ&&�Ԉ&HԐ&�Ԙ&�Ԩ&e԰&�Ը&e`��&&���&1���&O���&���&ex��&&��&e��&e��&��&`�(&D�0&��8&e��@&��H&1��P&��X&H�`&`�p&x�x&�Ո&�Ր&՘&e�ՠ&`ը&�հ&Ah��&&���&Qx��&$@��&���&� ��&���&+��&#H�&�&$@�&`�&�� &e��0&&��8&`�H&!��P&X�X&��`&fH�x&&ր&S�֐&&�֘&Qx֠&�֨&�ְ&#Hָ&� ��&��&#H��&���&f`��&&���&#���&�&g�&��&��&gX�(&&��0&7�@&&��H&_��P&D�X&��`&: �p&&׀&gpט&&�נ&xר&�׸&���&U���&:���&���&U���&D`��&6���&��&g��&&�&E��(&&��0&� �8&h�@&_��H&'�P&��X&h �h&&'h�p&U�؈&&�ؐ&R�ب&&Pذ&h`��&&(8��&h���&&���&���&X��&0��&��&) �&&� &h��0&&�@&I��P&&��X&b�`&�h&b�p&��x&I�ـ&�و&X�٠&&�٨&IXٰ&ٸ&X`��&���&X`��&���&b(��&&���&H���&O��&+��&��&h�� &&��(&W��0&O��8&+��@&��H&i�`&&��h&H�p&h��x&3@ڀ&�ڈ&W�ڐ&P�ژ&�ڠ&Xڰ&&�ڸ&bx��&���&b8��&���&#0��&&���& ��&8`�&��&&��&#H�&4� &��(&3H�8&&��@&�H&18�P&��X&K��h&&��p&`�x&ۀ&ۈ&\�ې&Pۘ&.�۠&K�ۨ&�۰&�۸&���&1��&���&���&���&1��&��&1�&��&��&>p�(&&��0& �8& �@&�H&�P&.��X&��`&.��h&>��p&��x&�܀&�ܐ&eܘ&�ܠ&O�ܰ&&�ܸ&O���&���&���&&���&iH��&&��&=H�&�&1�&H� &`�(&��0&��8&x�@&��H&ix�X&&��`&�x&&�݈&hݠ&&�ݨ&i�ݸ&&���&X��&���&���&j@��&���&X��&#H�&��&`�&!�� &X�(&��0&j��@&&��H&k�X&&��`&#��h&&��p&�x&�ހ&`ވ&#Hސ&�ޘ&xޠ&#Hި&Sް&�޸&���&#H��&���&���&CX��&&���&#���&��&��&#H�&� �&� &#H�(&��0&S��8&��@&d��P&&��X&k��p&&��x&x߀&�ߐ&�ߘ&hߠ&I�ߨ&�߰&`(߸&T���&6���&���&h��&&���&l �&&��&�`�(&&��0&���8&��@&��H&l8�`&&&�h& �x&&���&0��&���&X��&&�&a���&&���&IX��&��&X���&���&X���&��&lX�&&��&lh� &��(&��0&h�@&&��H&H�P&��X&��`&l��p&&��x&��&��&P�&`�&�&>��&�&��&���&j0��&&���&j@��& ��&���&��&��&'p�&��&��&:��(&&��0&X�8&��@&��P&:��X&��`&�h&#H�p&��x&`�&!��&H�&�&]�&H�&�&���&d���&���&���&���&e���&&���&l��&&��&#�� &��(&��0&#H�8&��@&��P&*��X&��`&Ch�h&��x&B@�&��&m�&&��&x�&���&���&h��&Y`��&���&`(��&T���&6��&��&'`�&&�� &m��8&&&<�@&m��P&&��X&�`&d@�h&��p&Z �x&��&m��&&��&��&��&��&>��&��&���&���&f���&&���&Qx��&��&��&n8�&&�� &x�(&��8&��@&l0�H&b��P&��X&h�`&_��h&6��x&��&n��&&%��&n��&&��&n���&���&���&o��&&���&���&>���&�&��&�&�&�� &o��0&&��8&H�@&�H&`�P&��X&@�`&`�h&��p&p0�&&%��&n��&&��&n��&��&���&KX��&&���&��&iX��&���&Z ��&��&pH�&&��&H� &��(&��8&�@&>��H&��P&��X&�`&1��h&x�p&��&��&��&��&��&1��&x�&���&���&q��&&���&H��&@��&��&��&��&��&qp�(&&%t�0&q��@&&��H&H�P&��X&��h&>��p&�x&1��&x�&��&��&��&��&N(��&1���&x��&���&���&q���&&��&l0�&H�&`� &P��(&��8&`�H&x�P&��X&r�h&&%��p&Y�&&��&�&�&Y �&��&��&Y �&���&0��&&���&���&���&`��&���&r(�&&%$�&r@� &&%L�(&rX�8&&$��@&rp�P&&$��X&r��h&&$��p&r��&&$��&r��&&$0�&r��&&$\�&r���&&#���&s��&&$��&s��&&#��&s0�&&#��&sH�(&&#d�0&s`�@&&#<�H&sx�X&&*��`&s��p&&#�x&s��&&*��&s��&&*��&s��&&*|��&s���&&*P��&t��&&*(��&t �&&)��&t8�&&)�� &tP�0&&)��8&th�H&&)p�P&t��`&&),�h&t��x&&)�&t��&&(��&t��&&(��&t���&&(���&t���&&(`��&u��&&+���&u(�&&+l�&u@� &&+H�(&u`�@&&+$�H&u��`&&+��h&u��&&+��&u���&&,��&u���&&"���&v��&&!���&v0�&& ��&vX�8&&��@&v��`&&��h&v��&&"��&v��&&!`�&w��&&���&w(�&&\�&wX�8&&��@&w��`&&4�h&w��&&��&w��&&��&w���&&8��&x��&&��&x(�&&<�&xH�(&&��0&xh�H&&�P&x��h&&��p&x���&&��&x��&&d�&x���&&���&y��&&l��&y0�&& �&yX�8&&��@&y��`&&�h&y��&&��&y��&&`�&y���&&(��&z��&&��&z8�&&�� &zX�8&&��@&zx�X&&P�`&z��x&&��&z��&&t�&z��&&H��&z���&&��&{`��&&���& �&9��&��&�&J�� &&x�(&��0&9��8&`�@&��H&{��X&&��`& �h&9��p&��x&�&9��&&x�&��&9��&`�&��&|0��&&���& ��&9���&���&��&H`��&&x��&��&9��&`�&��&|x�0&&��8&��@&��H&(H�P&#H�X&��`&|��x&&��&(x�&���&|���&&���&9��&4���&x��&���&}��&&���&9��&4���&���&��&}P�&&�� &@�(&��0&��8&}��H&&��P&�X&X�`&��h&��x&���&���&#H��&#H��&���&@��&`��&���&~p��&&���&H��&��&`��&���&>��&��&��&��&#� &��0&1�8&��@&(�H&��P&��X&~��h&&��p&�x&���&���&#H��&#H��&���&~���&&���&@x��&���&���&���&&���& ��&`�&`�&��&@�&�� &#�(&`�0&��@&��H&��P&#H�X&#H�`&��h&#H�p&#H�x&���&���&&���&���&`��&#H��&#H��&���&���&&���&��&#H��&��&���&&��& � &8`�(&��0&&X�8&#H�@&`�H&3��P&��X&(x�`&��h&����&&���&���&���&����&&���&��&���&�8��&&���& ��&8`��&���&&���&#H�&�&#H�&(x�&�� &���0&&��8& �@&8`�H&��P&&��X&#H�`&��h&%(�p&#H�x&(x��&���&���&&���& ��&8`��&���&&���&#H��&'��&(x��&���&�h�&&��& �&8`�&�� &&��(&#H�0&�8&#H�@&(x�H&��P&���`&&��h& �p&8`�x&���&&0��&#H��&#H��&(x��&���&� ��&&���& ��&8`��&���&&��&#H��&#H��&(x�&��&�X�&&�� &��(&�p�0&#H�8&��@&���X&&��`&��h&@�p&��x&���&(H��&@��&`��&���&����&&���& ��&���&���&�X��&&���&8`��&��&&��&#H�&��&
        !          5759: �� &@�(&#H�0&(x�8&��@&���X&&��`& �h&���p&��x&����&&���&����& ��&��&��&x��&���&���&P��&���&��&P��&x�&P�&��& �&� &1��(&��8&��@&H�H&�P&&x�X&��`&&��h&6��x&���&���&���&���&���&&���&`��&&���&���&&��>&�>&�� &
        !          5760: ��8&&��@&��H&��P&��X&�`&��h&(�p&��x&���&���&��&���&@��&`��C&��&`��K&��&`��&x��&���&&x��&���&
        !          5761: ���&���&$P�&&0�D&�&)��8&&�@)&�H&���h&&�pZ&�x&���&&��&&d8&��8dX&�Ԉ��������H0bootinfo&&��������H(snkELF&&�@&;@8&@

        !          5762: &�&&&:(2�&|�����8c��|�#x�&�!��|c"xc H�Q`8!�|�;���|�||c8�&����|�N� &�&`|�������8`�&�!����肀��P{� ��x��H�`9 �J;�U)0W�0��PW�����|Hl|�|O�|�L&,9)�B��HY`8!��&����|�N� &�&`|���������|~x|�#x�&�!��8 9`�A���a��|  ���������9@�!�A�"�```8&�i�I9)@|�B�쀢�$�€48�p;����b�(|�0Px� H5M`/�A�&�"�8�&p8�;@낀����"���P� {� #�x��x��H��`��x��x8`H��`I�xk�x}kJ9kU)0Uk0}iXPUk��}i�|Hl|�|O�|�L&,9)�B��H�`��x��xH        �`||xH�`$�x��x8`H�M`{�;{WZ0W{0z�PW{��i�|�l|�|׬|�L&,;Z�B��H =`8!���x�&�!���A���a��|���������������N� &�``|�xi �&�!��8      ��+�&@�(+�@�x8`��8!p�&|�N� ``/�@��8&9&p| �|�#x} Cx9@
�8�&� | P9)&�(���/
        !          5763: A�p@�B��`|�HP}Cx�"�@x`6d}i|  ./�A��xxc6d8})*/�A��d� �A(}c[x|     ��i�IN�!�A(K��D``�I9)&K���8�9&pK���&�```|����������&�!����&���&�|dx��&���&��&&��!&��A&�;�p8�&���xH�1`��x|~x8`&��xK���8!&���x�&��������|�N� &�```|��&�!��H�`8!p�&|�N� &�|���������8`|�#x�&�!��|�+xH
        !          5764: &`,#A�T�#@/�A�H�     �A(��x��x| ��i�IN�!�A(8!��&��������|�N� ``�b�HK���8`��K���&�`|�+�
��������|x�&�A���a�����������!�QA�d�"�PyJ�|     R�} J})�N� HH&&H&x8HHhxHHH�|�+�@�``8`��8!��&�A���a�����|������������N� `/�A�|A��/�&@���8`��pH�`��p|yA���?/�A�؀/�A��|�;x8�P8�H�-``8!�8`�&�A���a�����|������������N� `|�+�A��8�"�@{�6d|i�| �./�A�� �#/�@�&hK��```8!�|c��&�A���a�����|������������K���`�b�@8 |��;�}i[x|     �H`;�&9)@��B@&4�     /�@���{�6dK�뢀X;�HH� �A(C�x��xe�x|     ��i�IN�!�A(/�A��;�&;���/�
        !          5765: A��@�}/�A����+0/�A��؀/�@����+�  �A(| ��i�IN�!�A(�=�)0K��p```|�+�A����"�@{�6d|i|     ./�A����#|��/�A�&`�     �A(| ��i�IN�!�A(K���```��xK���``�b�`��xK��y8`��K��d```8!�|��|�+x|��|���&�A���a�����|������������K���``/�A���/�@��8`��x��pH�`�x��p,#A���#8/�A�t�     �A(|�+x|��| ��i�IN�!�A(K����"�@{�6d|i�|     �./�A����#0/�A���� �A(| ��i�IN�!�A(8`��K��h�b�xK��m8`��K��X8`��p��xH5`�p�x,#A���#H/�A�t�     �A(|�#x|�+x| ��i�IN�!�A(K��� �A(| ��i��p�IN�!�A(���p8`��/�A���K��<�b�pK���8`��K����b�hK���8`��K���&�`|��!���A��; ;@�a������|�+x�"��������|}x|~x�&�&�������!�Q�/� H���x/� ;�&A���@@����P��P{ �xH��`8�����xx� ��x�{H��`����?��`�&/� A���<�@@�;Z&;{Z�/
        !          5766: ��x@���8!�8z&|c��&�&���!���A��|��a����������������N� &�|�����|���&�!�1;�p��xK�����xH��`8!��&����|�N� &�&`|�����|���&�!�1;�p��xK��u��xH�M`8!��&����|�N� &�&`|mB�|B�|�B�| @���xc�|cxN� `}mB�|B�|�B�| @���yk�}kx}k}-B�|B�|�B�|       @���y)�})x�H@@�8�|     �`B@��B��K���N� `}-B�|B�|�B�|      @���y)�})x�b������k}cY�}kykt�}iZ``}-B�|B�|�B�|  @���y)�})x�H@@�8�|     �`B@��B��K���N� `}-B�|B�|�B�|      @���y)�})x�b������k}cY�yk��}kyk�}iZ`}-B�|B�|�B�|  @���y)�})x�H@@�8�|     �`B@��B��K���N� `|�8�Tc0T�0|� PT���|��|l|�|�|�L&,8c�B��N� ``��������|��‘����;��&�!�q;�PH``��;���A�L�?/�A���     /�A����) � �A(| ��i�IN�!�A(��;���@���8!��&�����������|�N� &�8
        !          5767: �"��|  �`�i9)/�A���A�B��9`}c[xN� ``��������|��‘����;������&|}x�!�q;�PH;���A�8�?/�A��� ��@����     /�@�4��;���@���8!��&����������|�����N� �) � �A(| ��i�IN�!�A(��K���&�```��������}�&�†����|}x|��&����!�a.#A�&;�H`�;�.#A����xH�m`/�@���A��8   �"��|   �```� 9)/�@�tB���€�9@
        !          5768: ;�}I���x``�  9&/�A��}�9)B��;���8!���x�&���������|�����}�� N� ``8!�;�����x�&���������|�����}�� N� `8!�;�����x�&���������|�����}�� N� `��x8�pH(       `/�@�X�‸�ap8�x8�肀�H��`/�A�<�"���b��;����)�       �A(| ��i�IN�!�A(K��;���K���!x�b��8�x�     �A(| ��i�IN�!�A({�$/�|~&*A� �/�@���8cPHU`K���;���K����`��������|~x�†|��&�!���/�A�4;�`���@�K���/�@�<�;�/�@���8!�8`�&��������|�N� ```8!��"��xc$�&����|i*����|�N� &�|������b���&�!���"���B���������`�KX9`   }i��   9)8�     9)B���†�/�A�;�K����;�/�@���8!��&����|�N� &�&`|�3x|�;x|&x|��B�`&�f4}��(|!B�A@��8�H|BB���€����B���*K��!�8|���A@�!N� |��&�!��|�3x|�;xK��u�!�&|�N� �"���!K����b���#��&0}���A@�aH�P�X��`��h�&p�!x�A������������&��!��A��a������������&��!��A&�a&�&�&��& ��&(8!&0�&H|��&P|��&8|��&0�a@8!XL$���`N� ``|����������&�����!�q���xH�`��/��A��肁08�8�H�`�/�@��x� 8�&K��`|}yA����xH`/�|dxA���b�P��H�`/��@����8`8!��&�����������|�N� ``�"� �b�(�)�     �A(| ��i�IN�!�A(8`��K����"� �b�8�)� �A(| ��i�IN�!�A(8`��K����"� �b�HK����"� �b�@K����"� �b�XK���&�|�������|dx�&�!�a�/�A�@8�p8�H�`8/���A��&r8!�|x�&����|�N� `���K��=���K���&�&|������&�!��K��/�@���b�`K��a��h��b�pK��Q��b�xK��E��b��K��9��b��K��-��b��K��!��b��K����b��K��   ��b��K���� �b��K���$�b��K���(�b��K��ِ,8!��&����|�N� &�&|���������x�d�&����/�|�3x�!�q���8}`Z�!��&�����A�������P9!�@�49D��|xyJH9J}IR`9)�P�   ���9k@���/�@��;����P8{� ;�&{�d9=��y)��9)&})�9 `|I.9)B���"���x��H$I`/�A�,�P9 ```|H.|I.9)��@����?P�i8!��&�����������|�N� �"���x��H#�`8`K���&�```�"�h|�8�8�&�&�!��8 8` � ,8�pK��i�b��K���`�ar8!��&|�N� &�``|���������|~x�&����8|�#x뢁h�!�a�}*/�A�$|�+x8�8�&8�p��x��K����*�r�b��|x��x��xK��)`�ar8!��&�����������|�N� &�`|��"�h|kx8`���&�!�a8���&���&/�A�D���|�3x8��+�K8�&8������k��p�ax�&�K��-�a�8!��&|�N� &�``|��"�h����|x8`���&�!�A8���&��     "/�A�D|x8&��&p8&�8��&x8�8&�8��8���&�9&�9!�9A�K����a��&���&���&���&���&���&���&�8!���&����|�N� &�&``|��"�h�&�!���i/�A�8�8�&8�pK��   �ar8!��&|�N� &�`|��b�h|ix�&�!�q|�#x�k/�A�(9`8�&�!��&�8�&8�p�ax8�xK����ar8!��&|�N� &�``|��"�h|gx�&�!���i/�A�8�&8�&8�pK��E�ar8!��&|�N� &�|��b�h|ix�&�!�q|�#x�k/�A�(9`8�&�!��&�8�&8�p�ax8�xK����ar8!��&|�N� &�``|��"�h}Cx�&�!�q|`x�i/�A�/�@�HT�@.�i
        !          5769: |�;xT��|�+x|�#x8��|��}i[x8�8�&K��Y�a�8!��&|�N� T�@.|�;xT��|�+xx   �ap|�#x8��|v|��8�8�&K���a�8!��&|�N� &�```|��"�h�&�!��|`x�i/�A�/�@�L�i/�A�,T�@.|�;xT��|�+x|�#x|��8�8�8�pK����av8!��&|�N� T�@.|�;xT��|�+xx  |�#x8�p|v|��8�8�K��E�av8!��&|�N� &��"��8&8`�     N� �"��88`� N� |�#xN� ```|�#xN� ```8`N� ```|���������|~x8��&�!�18�L;�p��xH�`�����x��|�&p8&�&tH1`8!��&��������|�N� &�```|���������|~x8��&�!�18�L;�p��xH��`�����x��|�&p8&�&tH�`8!��&��������|�N� &�```|�|iy8`���&�!��A�8� �)8�iK��Y8`8!p�&|�N� &�`|���������||x|�+x�&����8�L|�#x�����!�!8�;�p��xH��`�����x��|�&p���8�&t���H�`8!��&��������������|�N� &�```|���������||x|�+x�&����8�L|�#x�����!�!8�;�p��xH�`����x��|�&p���8�&t���H)`8!��&��������������|�N� &�```|���������|}x|�#x�&����8�8�L�!�!;�p��xH��`����x��|�&p���8�&tH�`8!��&�����������|�N� &�```|���������|}x|�#x�&����8�8�L�!�!;�p��xH��`����x��|�&p���8�&tH`8!��&�����������|�N� &�```�"�� /�M� ���iK��X``|���������|~x8��&�!�18�L;�p��xH�9`8&��x�"� ��|�&t�&x�!pHM`�a�8!��&��������|�N� &�`|���������|~x8��&�!�18�L;�p��xH��`8&��x�"�(��|�&t�&x�!pH�`�a�8!��&��������|�N� &�`|���������|x|�#x�&�!����K��a�"�|`x/�8`��{�d���A�<��B�@9)8`�b�0��8�_0��yd})B�?89 &�?8!��&��������|�N� &�|���������|~x8��&�!�18�L;�p��xH��`8&��x�"�H��|�&t�&x�!pH�`�a�8!��&��������|�N� &�`|���������|~x8��&�!�18�L;�p��xH�`8&��x�"�P��|�&t�&x�!pH-`�a�8!��&��������|�N� &�`|���������|~x8��&�!�18�L;�p��xH��`8&��x�"�X��|�&t�&x�!pH�`�a�8!��&��������|�N� &�`|���������|~x8��&�!�18�L;�p��xH�`8&��x�"�`��|�&t�&x�!pH-`�a�8!��&��������|�N� &�`|�����8�8�L�&�!�1;�p��xH��`��h��x�&p8&�&xH�`�a~8!��&����|�N� &�&``|��A���a��|zx|�#x�&����8�|�+x��������8�L;������!�;�&;�p��xH�   `��p��x��t�&p���8�&|H`��x8�8�LH��`��x��x��t�&p��x�A|�a����H�`�a�8!��&�A���a�����|������������N� &�``|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH�)`�����x��|�&p���8�&t���8&�&xH1`�a�8!��&����������|�����N� &�|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH��`�����x��|�&p���8�&t���8&�&xH�`�a�8!��&����������|�����N� &�|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH��`�����x��|�&p���8�&t���8&�&xH�`�a�8!��&����������|�����N� &�|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH�I`�����x��|�&p���8�&t���8&�&xHQ`�a�8!��&����������|�����N� &�|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH��`�����x��|�&p���8�&t���8&�&xH�`�a�8!��&����������|�����N� &�|�|iy8`���&�!��A��)8|���iK��=8!p�&|�N� &�```|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH��`�����x��|�&p���8�&t���8&�&xH�`�a�8!��&����������|�����N� &�|�|iy8`���&�!��A��)8|���iK��=8!p�&|�N� &�```|���������||x|�#x�&����8�|�+x�����!�!8�L;�p��xH��`�����x��|�&p���8�&t���8�&xH�`�&��a�8!�|4T�~x ������|���������|c8�&|�N� &�``|��a������||x|�3x�&����|�#x8���������|�+x8�L�!�;�p��xH�&`�����x��|�&p���8�&t���8&�&x�a�H`�a�8!��&�a��������|���������N� &�|������b���&�!��K���/���A�D;�p肂�8���xK��!��xK���|`x8!�|x�&����|�N� ``�b��K��m/���|`xA���;�p肂�8���xK���K���&�&``|���������|~x�&�!�qK��I/���A�4肂�;�p8���xK��}/�A�4��x��x8�H��`8!��&��������|�N� `��x8�r8�H��`8!��&��������|�N� &�``}�&|�.&����|�#x�&���!��A��肂�8�p8��K���/�@�x9!�H@```�   ��}c���@A��i��|x �@@�`/�9)@�49c��9I��@��Ȉ     ��}c�/�A���/�9)A���``8`��8!&`�&������|�}�� N� �jxcG�/�@���8!&`8`�&������|�}�� N� 肂�K��$�&```|��!���&��8�&��&������������|�#x��������|x��x�������������A���a���!�!�"��$�x;�|��xK������x8�K��u/���|~xA����x{� K��]:�t:�x;&p|}x��xK��E|{yA�``�B�~ųx8���xD�xK��肃8�~�x��xK��   D�x�x8�c�xK����&t�Ap��x��x肃8�&�Z�&xZK���{Z /�A�&�/�A�&X��t�!x{U(��x��p|uP~��9   ��{Zd|�"y�x�d|�*9z� xc }B,�/,$�Gy@G���A�A�d|�+x8A� `�i9)x��@|[x@���A�&HA�&x|�;x9 |��H�Ky)�}IKxB����|     �0@A�4|c�|��xc }�|�/�@�x|��K��l```�0@A���/�A��/�8A�<9L��x�dyJ }gZ9J&}I�```�Kx�9k|SxB��})0P|     ���x8�&�$�x��xK��Q}�xc�x$�x��x8�&�K��9��xK��1|{y@���8!��&����������|������&���!���A���a����������������N� `�'�gy)�})[xK���8&xd}G}g.�
        !          5770: yk�}`xK��D9 K������x8�&K���|~xK��,&�|�����|x�&�!��K��8!�|dx��x�&����|�K��p&�&|����������&����8�����!�a�&x�&pK��|~yA��낂���x;�xH ```K�����x|yA�d�&x��x��x8���x�&pK���/���xA���8ap��xK����ap8!��&����������|�����N� ``8!�8`�&����������|�����N� &�|���������|~x�&���������!��K���8��/���|xA�&@K��낃;�p8�@��x��xK��肃 ��xH��`/�A�&<肃(8��8���x;��K���肃08��8���xK���肃88��8���xK���肃@8��8���xK���肃H8��8���xK���肂���x��x8�&�K��q9^x8��/�@���&�x    �"x�"���>�``�8c��|c�T     >xG"9)��/�y)�y+&�y)d}iXP}jZ9+ � �� �;��     A�����xK���8�~x8!`|x�&����������|�����N� ```肂�8�x8���xK�����x��x8�|8�@K���8!`8|x�&����������|�����N� &�`|��A���a��|�3x|�+x�&������������|~x|�#x�b���������������&���!���!�AK����8��/���||x��_@�L8!�|x�&���������&��|��!���A���a����������������N� ```�b�P��08:�&��8�B�@; |x肃X8��8�[0���;���K��a8��@��H8��x�[p|x��x�P�;X肃`K��1�肃h8�&K��q8��/�A��,��xK���/���A�t�b�xK��}/���A� K��q/���A�肃���x8�K���K�ޅ`����B��8��"���b���p�>h�^(�~ ���K���8�K����>�b�p� �A(| ��i�IN�!�A(K��l&�
        !          5771: ```|���������|}x|�#x�&����8�L8��!�!;�p��xHa`�����x��|�&p8&�&t8�&xHq`�&���a�8!��&�����������|�N� &�```|���������||x�&����|�#x�����!�H|�`;�x8�8�L|}x��xH~�`�����x����&x���8�&|8�&�H�`�&��!��a�8!�x�|Kx��&������|���������N� &�``/�A�L/�A�4/�&8A�|xN� ```�|xN� `�|xN� `�|xN� ``/�|ixA�8/�A� /�&8`��L� ��8`N� `��8`N� `��8`N� ``|�|�;x�&�!��8T:|�+x|�|�#x8�K���`8!p�&|�N� &�`|�8�|�+x�&�!��T�:|�#x|��8�K��M`8!p�&|�N� &�``|��A���a���&����||x��������|�#x|�+x�����!�a;�W�:����x��x��x8�K���`9����x��x��x|zx8���xK���`��x��x��x��x8�K��`��x��x��xH�x|{x8���xW{:K���`8!�|{�|c��&�A���a�����|������������N� &�肃�|���!��|���&N�!�&|�8!N� |��N� `�"��9I�        /�A�0}`=J �P@8`��M� �i|xN� ```}@Sx�I=J }`8`���P@@���N� `8DN� ``8DN� ``8
DN� ``8D|c�N� `8D|c�N� `8D|c�N� `|�#x|�+x|�3x|dx|x}%Kx8       8`&D|c�N� ``|�#x|�+x|�3x|�;x}   Cx|dx|x}�cx}FSx}g[x8       8`D|c�N� ``|�#x|�+x|�3x|dx|x}%Kx8 8`D|c�N� ``|�#x|�+x|�3x|dx|x}%Kx8 8`D|c�N� ``�"������ixc��|cxc�|c�N� `�"���iN� ``|v�N� ```|v�|c�N� ``�b��N� ```��������|x|�3x|�8c�&�!����|�+x8�Hx�`��x��x8�Hx�`8!��&��������|�N� &�`|�|�#x8��&�!��|dx8`K��E`8!p�&|�N� &�|�|dy�&�!��A�0�b��8�Hx`8!p�&|�N� ```�b��8�8�Hw�`8!p�&|�N� &�|���������8�8���&�����!�a�ƒ�;���xHwU`8`��x8��8�K���`8,#@�,8!�|x�&�����������|�N� ``x} +�
A�8��K���```肃���x8�Hx`/�A�<肃���x8�Hw�`/�A� ��x��x8�Hw�`/�@�P�/�A�(/�@���8���8~|��H�`|`xK��88���8~|��H1`|`xK��|$x833��x8��pHwm`/�A���8��K���&�``�"���iN� ``�"���iN� ``�"���iN� ``�"���iN� ``89 ���� ���
        !          5772: ����8�&�#8E���N� ``�"���iN� ``�"��|���������;��&����8;������!�q��x�  �     ;�� ��{�>${�M�|`P8�|P;�&xcd||8�8c��Ht�`/�
        !          5773: ���;��@����"����8!��������      �&��������|�N� &��"��iK��8``�"��iK��``�"��iK���``|�=# �&�!��<�`���@A�T�"��b��x`�bTj�>8!p� �I8^�     �i8�     &�k8&�     �&|�N� ``�"���b�88��8��     Hsi`8!p�&|�N� &�`|���������}Cx|�;x�&����8|�3x�����!�q|x���8|�+x�88��8&�8cHs%`����x88�Hs
`8!����&����������|�����N� &�`|�+������a��||x�&�������������!�QA�88`��8!��&�a��������|���������N� ```�/�&@��Ġ/�@���뢃���=�@����#/�&A�4/�@���K��1`8�8�Hs!`/�A��8`K��l/�A����;�8�8�*�&p;�xM�x     >$})XP|HPxd�;�
        !          5774: ��xHq�`K���`8���x|ex��xK���`K���`���&p��x8�|ex8~K�����x8�*K��&`8`K��ā|/�A���<��́=����x`���y >$y%M�|(P�8@|      P9I&xd�A��|�?�XA�$|
        !          5775: 0T��T        8T<} J})PPy) K���;�肄8��;���xHq�`|{y@��(8���x8�Hp�`�/�@���;�
        !          5776: ��x8���xHp�`���xK��`�8`K���&�``}�&|���������|�#x�&����8|x+�������&��8`���!���A���a�������!�!A�&��/�A�(/�&A� �ƒ�9`
1.1       root     5777: 8}i��
                   5778: ��x��x;8``�i9)|ZB��x       x�| �?   x�|/�|��
                   5779: A�܂�z� /���A�&Ё>} H�~�8�A�&����A�\�|�x|H8,@�X�>�~�H@A��y*M�y >$|PP=��|      Pa��x
                   5780: d}^R�J��@�H�`�J��A��9)&|    @T��T
                   5781: 8T<|R} HPy) y*M�y >$|PP�H@|    Px
1.1.1.2 ! root     5782: d}^R@���;��b��"�.<y`>$yxM��P8��P8�*{d�;[;�
        !          5783: ��xHnI`K���`��~�x8�&G�x|ex8xK���K��]`8�F�x|ex��xK��e`��x8�*K���`A� 8`��8!��&�������&��|��!���A��}�� �a����������������N� ``�ƒ���K��܀|�x|H8,@��L��B�;�x  >$xM�})XP;Z|HPxd�K���`;�
        !          5784: F�x{� 8�|ex��xK���`��x��x8|;�Hm]`��x��K���`8!��&�������&��|��!���A��}�� �a����������������N� ``�>�~��H@A��,y*M�y >$|PP<���|  P`���x
1.1       root     5785: d}^R�J�@@� H````�J�@A�H9)&|    8T��T
                   5786: 8T<|R} HPy) y*M�y >$|PP�H@|    Px
1.1.1.2 ! root     5787: d}^R@���K���xd;>�.<A��b�;\8�C�xd�xHm9`/�@������~K��l```��B�;�x    >$xM�})XP|HPxd�K��X``�ƒ�����K���``8;Ap�C�x8�8�Hki`�;�       ����&y�a|/�8����!rA�,8   ��9T<}k8�<;��X|J@���9a�``�:;Z�X|J@���x  x�| x     �|     |��K��|�>�=@��aJ��8 &y&M�}`PUk��Ug8Uk<}k:y'>$|P|�0Px |     8Pxd�X�~�@�$9k&}+PU)��U*8U)<})R}iXP�~�?8�8�}9&.8|{� HjA`K��y`f�x8�|ex8|
        !          5788: K��`��x��x8|;�HjI`���8`K���b��~K��x�      ```�"��|�/����������&�!�|`x�i@�8!��&��������|�N� ;�p9@E�Ap9@;��9 9`�_&�9@p8�_�9@��8a��_�9@&8�*�_   �?
        !          5789: 8�T�?�&�8�v��>8&��~&Hi`��x9A�8`�i9)�P|Z@���x       x�| ��xx �|     8�p|��K���8!��&��������|�N� &�|���������|�#x�&�!���A���a�����������!�Q�|?x/�A�&�/�A��/�A�88`8?��&�!���A���a��|���������������N� `�DmK��/��vA�&�8?�8`���&�!���A���a��|���������������N� 82�!|:xx�9`E|�;`}!&j�9%;�x� %�x;�p;���x�>�~9 ���~�>9`9 &�~&�>       ����~��
        !          5790: Hg�`�~��9`.��x}i�8```�i9)|ZB��x   x�| 8�x �|     ��x|�|���K����&8`�A�x8?��&�!���A���a��|���������������N� ``�/�A�,/�@��\8�����&8ix� H
`8`K��@8�����&8ix� H=`8`K�� �$/�&@��T�"���c�I�X@��@/�A��8� 8`K���&�```|�+���������|x�&�!��@�@�ƒ��>/�A�T�_y@ �@A�t/���A�l�>/�A�`�H@A�X8`��8!��&��������|�N� ``�_=`��ak��y@ �X@@���= ��a)���H@A���K���`9`
1.1       root     5791: 8�
                   5792: }i��
1.1.1.2 ! root     5793: ��x8�8�i9)|ZB��x   x�| x     �|     |�T>�@@��\�x �@�4x ��A������x8~;�He=`8`K��0```;�;���~�A�8`K���~   �     �@���~��@��܀�P@��Р�y)$8i8���|~x� Hd�`�x��@����?T8��x��x|J��     /�A�X/�A�4/�&@��x8!���8�8����&����|������|�K��t��88���|��H�`K��8��88���|��H&�`K��&�```8�������N� ```|�+��&�!��@��/��A�8!p�&|�N� |�+xH&�`8!p�&|�N� &�``|�x� +��&�!��A�8`��8!p�&|�N� `�/��A�Hl
        !          5794: ��/��&A�L/�D@��̠/�C@���9)��8c}$�H�`K���```H-�`|ctK����/�5@���9)��8c}$�H&�`|ctK��h&�```8`��N� ```N� �"� �i8`N� `|��a������|{x;���������|�+x|�+x�����&|�#x�!�a```�?|�P��x��x})tU+28�&|J/��x� ,��/)A�\A�lA��Ha�`�?})t8        &��|�P��x��x�?})tU+28�&|J/��x� ,��/)@����;�x���K��d/��>A�p8!���x�&�a��������|���������N� ```肄(��xH^�`8!�8`�&�a��������|���������N� ;�&K���&�`|���������|x�&�&���!���A���a�����������!�Q�/�4A�88`8!��&�&���!���A��|��a����������������N� �T(mi��/��@���x !@�h�;�/�A�x낄0;�H``�;���@�T��x��x��x;�&K�����,#@���8`��K��\``�"� 8&8`� K��@```�/�A��$�b� ;�;;;�;[&8�xH ``;�&�����@�����x��x��xK��1|~yA��x�/�&@���D�x��xH\�`/�@�4�/�&/A�dA�@�>8     
        !          5795: �K���```��x�xH\9`/�@���K���`8�
1.1       root     5796: ��x%�xK���/�@���8`��K��D�
1.1.1.2 ! root     5797: 8`�K��4&�`|��!���A��;@&�&�a��|{x�����������������!�QH\q`뢄 8�;�;�{� ��x;�(;=8{� {� ��xH^`9=,84�,8&d�x#�x�      �IH[�`c�xH\   `8�8�x� `��&8c&8�5xc }9Y.8}$�IK���`��8�(��xx� 8�8�K��`��x��K��e`8!��&�!���A���a��|���������������N� &�`|��!���A��|�#x�&�a��8��������||x��������������&���!�A�B�(�b� ;�  D�x��x��xHZ�`肄8��xH[�`/�A�肄@��xH[�`;�뢄H��x��xH[�`/�A���x��xH[�`;�&뢄P��x��xH[�`/�A�&���x��xH[q`뢄X||P��xxx ��xH[U`/�A�&���x��xH[=`�P{� ��@@��x{�!A�+��@�T�b�`Hf]`8!�8`�&�����&���!��|��A���a����������������N� ```��x��x��x;&HZ`8D�x|��x�xHYe`��xHY�`+��A��;� &�xH8```HY�`���P}}�/�A����x;�&;�&�}>�P;�&|��Py) /�.x� ��x��x/ (�?A�@��ș+@���~�xD�xHX�`�b�hHe9`8!�8`�&�����&���!��|��A���a����������������N� ``��xHX�`뢄Xxx ��x��xHY�`/�@��4`��xHX}`x} K��4```��;/�A�&��;�D�x��x��x;�~�xHW�`��xHX%`/�A����xK��qK���`K���````K��Q`�/�@�@�
        !          5798: /�@��K���`/�A���;�&��/�@����b�x8�Hc�`8!�8`�&�����&���!��|��A���a����������������N� ``�xK���K��L`�b�pHc�`8!�8`�&�����&���!��|��A���a����������������N� ```8!��8`&�&�����&���!��|��A���a����������������N� &�  ``8��/�x @�T8���9#x� 88�&|��H`9)�c}#Kx|ZB��x  x�| x     �|     |�x |xN� ```|�|ix�b���&�!��������&��HbM`8!p�&|�N� &�``|���������|}x8��&����8�&V�!�q�&|?x�&��;�p��xHW�`����x;�8�&H8�8�K���`��x;�8�C8�D8�&4K��`8&9 肄��&�=8~��HU   `K��a`8�|dx8~8HWM`����xK���`8?�8`�&�����������|�N� &�``|������&��8�8���&�!��|yx;�A���a�������������������!�A�&|?x�&�!;�p��x;]"HVi`;�;}*K��9`:�F^�xK��I`8`��x8��8�K�ܡ`/�A�&�\
        !          5799: �
        !          5800: ��x8�i9)��|Z@���x   x�| x     �|     |�T>�P@�̈   /�@���/�D@���/�C@���/�@��K���`~�x8�HV�`/�@�|�"���i/�A�d�x8��HU�`��;8y8�l��9HS1`8?�8`�&�����&���!��|��A���a����������������N� K��1`/�A���8?�8`���&�����&���!��|��A���a����������������N� &�   ```|��a������;e&�&����8|}x�b������{~ �����|�#x�!�aH^�`�"��낄�������x��xH^�`/���xA�TK�����x;���K��u{� /�@����b��H^�`8!�8`�&�a��������|���������N� �b��{d H^I`8!�8`���&�a��������|���������N� &�```|��A���a���&����|�3x��������;�&|�#x�����!�a{� |x��|�;d��;Ape�P`�P{{ |� Pe�x|�"C�xHS}`��|&D�xe�x|c|{P|HSY`���&8�{P|�HS=`}?讈&|     |鮈&�>| �8!��&�A���a�����|������������N� &�|��!���A��|�3x�&�a��|�#x��������|�+x��������|x�&���!�A�/�;!pA�X�c9 /��@� H&�}ISx�H@@�8}H�/��A�&�9I&/�yJ 9)A���}P�})Zy) �H@A���;�;{� ��@@�(}]���/�@�`;�&��{� ��@A���8!�Cx|ct�&�&��xcт�!���A��|��a����������������N� ```/��A�̀��x�!A�t�9 �@A��/��@�4HX```}i[x�H@@�@|H��@/�A��A�,9i&/�yk 9)A���|X�})y) �H@A��Ȉ�&x� ��x|:8�HQ%`�{�<&8|J��&;����K���`8!�8`&�&�&���!���A��|��a����������������N� ```�;K��l``�9}%Kx��xd�x��xK���K���&�``|��a���A��|�#x8��&����|�+x8���������|~x��x�����&���!�������!�AHO�`肄���x8�HQ`/�@��:�;;�;�&; {� ��@@�X|��}>��&�|��/�4A��+�4A�x/�A�P+�A��/�@�&;�&��{� ��@A���``8!�cx|ct�&����xcт�&���!��|��A���a����������������N� /�BA�&�+�BA�d/�5A��/�6@�d�     ;���     &���K��(`/�A��/�2@�4�     ;���     &���K���`/�CA��/��A��     &;����K���```/�&@��ܘ&;�� �� &���K���``�i8��T>+�A�&@�};��     &���K��h`;_&8�|�"�x;�|�ЮHN9`}>Ю}=J�)|Ю���K��(`��;��     �� &���K��8!�8`&�&�����&���!��|��A���a����������������N� ``;_&8�|�"~�x;�|�ЮHM�`}>Ю}=J�)|Ю���K���`��;�� �� &���K��d� ;���     &���K��H`8!�8`�&�����&���!��|��A���a����������������N� &�     ```|���������|�#x8�肄��&|}x�����!�qHL�`�+�@�$8!�8`�&�����������|�N� |t9 &} 6p&�A���9}85�;��+&���/�A�84��?&��;�
        !          5801: �2/�A� 82�8�&��;��6/�@��9`&��x}i���x8``�i&9)&|Zx B��/�A�@9 7�&�?;�9 �j&8  &9J&/�A��?;�&x  /�&@��܈B/�@���C/�@�L8��8!��8`&�&�����������|�N� 86�8�&��;�K��08C;����xHH�`��x8�&8x� ��&HJ�`�?&8     �K��x8B;����xHH�`��x8�&8x� ��&HJ�`�?&8     ��C/�A��,K��p&�``|��a���A��|�#x8��&����|}x8����������!�������!�;�t��xHJ&`�/�A�@8`��8!��&�!���A���a��|���������������N� ```����/�A�/��A����x{e HI�`肄�;]�8�C�x;���HJ�`/�A���};},�=�c�x�?�HGe`/�A�(��/�@�d�x88�@HG�`��X;�l��xHG)`/�A� ��x8&8��HG]`8�&�88`�8!��&�!���A���a��|���������������N� `��x8��HH�`K��```{{ C�x8����xx� K��=/�A��x�&�/�@�\�&�/�@��=�;},�?�c�xHFQ`/�A���/�A��;�l��xHF-`/�@�`��8��K���`�&u/�A��&w/�@�T�&z/�@�8`K��Ѐa|K��`8`K�����x8&8��HF`8�&�K���d�x88�@HE�`��XK��T��/�&A�8/�@��h/�A�&�/�@���89 �?�8`�K��@/�@��d�;� 8���&t8�&H��x�;��HF�`9?<8��<� ��&K��`8�|dx8XHG   `8�8���xHF�`88���8�8a��&�HF�`8�8����8a�HF�`��x8(��ϛ�Λ�›��������K���8�&48�D8�C84K��`8�����xx� 8�&H8�8�K�Х`��x8�&HK���`88`�K��9;�;a�y) D�x8�c�x�!px� HF`�&�/�A�&/�A��/�&@���8a�8�p8�l8��K�� /�A�����pc�x��x8�x� K��Y/�@��,K����a�K��E`�a�K��`K����a���=�/��&t�?�A��88��HC`���/�A�t8&8��HB�`8�K��;!�;Ap#�xD�x8�l8��K��I/�A���#�xD�x8�,8�@K��-K��$8a�8�p8�,8�@K��K��肄�;�&��xHB�`�&�/�&A���/�A��|;�l��xHB�`/�A��d��x��x8��HB�`��&�K��H肄�;���xHB%`�&�0��T>+�&@����/�@�����x8�,8�@HB�`��XK���&�`|��a������8�&H8��&����;�&���������!�A���;� ;�<��xHC�`8��&��<8��肄�;apHAq`K���`8�|dx8XHC�`�8�8��c�xHCY`�9 d�x���8(�&p�!�K���848�&48�D8�CK��a`������x8�&H8�K�ͅ`��x8�&HK���`8!��&�a��������|���������N� &�```|���������8�8�&H�&����;�&�����!�Q�„�;� ��xHB}`9><8��<;�p�       ��&K�ɝ`8�|dx8~XHB�`8�8���xHB5`��x8~(��&���&������&q��&v��&sK��m8~48�&48�D8�CK��9`��8�����xx� 8�&H8�K��Y`��x8�&HK�ѩ`8!��&����������|�����N� &�`|��A���a��;@�&����8||x��������;������!�a����;ap|t/�|x/A�&,A��HC�`/���xA��뢄���xH@)`��x/���xA��H@`��x|P|}4{� c�xH?U`}!����Ip8�c�x8�
        !          5802: ;�&HE!`|c4T`>+��A�<��4T@.|`�|�|t/�.@��@�&|tK��4``8`8!&��&�A���a�����|������������N� `��xc�xH>`c�xH>M`�K��P```k�|c4Tc�~xc K���&�|����������&�&��8|�+x�!���A���a������|{x|�#x��������;�&�����������!�!����„�;?&;_��x#�x�&pW�x��xH=]`��xC�xH=M`��b��;`&HI�`�„�;�����x����xHI�`HKU`/�A��/�A�&�K��m�:�K���`K��        `K�ǁ`�/�/A��A���K��`/�A���:�&~��/�@���;�����x����xHI`HJ�`/�@��|```�b��HH�`8!�8`���&�����������|��&���!���A���a����������������N� `�b��HH�`�/�A���/�A���/�@��~�xH<%`/�A�&;�p��xK��]/�A���&p�?�8|$�x�<H;�`8`8!��&�����������|��&���!���A���a����������������N� #�x8�H;Y`K��h```C�x��xK��`/�@��l�8`��/�A����&pK��X�b���xHG�`8!�8`���&�����������|��&���!���A���a����������������N� �8`��/�A���&pK���&�```�"� c��8&�       �iN� ```|���������|�#x�&�a��뢅���������!���
        !          5803: }  P}+�q@�����?/�A�\낅�Vp��x|��HF�`8&��9 �8�8!&�?�&�a��������|���������N� 낅|Vp;ap|�c�x��xHEi`�&p/�A�(i�x9````�i�      &/�@���c�xHE�`K��P���?y+�A��09)&/�y) @�� K��X&�|���������|�#x|~x�&����8�8�&�a�������!�a;�p��xH;`�"�� /�A��;�8`;`��x8�8��K��)`8���"���x�d�x�)� �A(| ��i�IN�!�A(8!&��&�a��������|���������N� `�)��x8� 8�8�;��;` ��K���`8a�K��`&�`|��a���A��8�8�&�&���������������������&���!���������������!�!�"� �     �)�!p�&t;avc�xH9�`���/�A�&��…(;:�;@;�p;��;88cH7�`|tx��xH7�`|ux��xH7�`|vx��xH7�`|��8�E8�8��|��|�~�xx� K�Ս`8&��;�xH7Q`�x8�&#�xx� H9Y`�8cH7)`8&��xx 9H7`��x8�&#�xx� H9`��xH6�`8&��xx 9H6�`��x8�&#�xx� H8�`��xH6�`|x��xH6�`8&��xx 8�&|yx� H8�`�"�c�xD�x�)� �A(| ��i�IN�!�A(8!&��&����������|������&���!���A���a����������������N� ```�;�p;�:��8cH5�`|xx��xH5�`�…(|zx��xH5�`X�;&�;Z"|yx��xH5�`�?Z�8�8�Zc�xZ���{D K���`K���&�``��������|���9`/������&�!�q8|�#x��$�� 8��(�_���8��0��@�/��A�&`}%�肅08��xH@m`�b�8HA!`8�8`��K��1��@K���`K���`K��YH,K��`�?0� �i�@A���)�@A���/�@��K��}`/�A����=0�i+�@�@�B���/���A�0�Hx� +�&|x@�K����=0�i```9k&�iK���`K���`K��i`�?0� �i�@@��\8��8`�ؐH```8��8`�א8�@8!��&�����������|�N� 9 �K���``�}8�@/�@����N8`��K����b�@H?�`�R/�@�,�N8!��&�����������|�N� ``�b�HH?m`�NK���&�|����������&�A��|�#x������|}x�a�������!�a�@/�A���N8`;}K��)K���`K���`�낅��|�4/���A�&</�A�T >/�A�x/�A���?08`�i8&�     8!&��&�A���a�����|������������N� 8!&�8`�&�A���a�����|������������N� `�T >+�@�&�8��8`���`8&�8!&��&�A���a�����|������������N� �?H�{9I&yc }@��A��m*��/���A���@A�LA���?0Uk>8`�֐     �i8�֐K���```{[ }�;�
        !          5804: ��@@�&�…(HD`��x8�H0)`,#A��8c&8�H0`,#A��;�&��@@����xH1&`��x8�&��xx� H4        `/�@�����xH0�`8�8�
        !          5805: 8c&|}H5�`xc 8���8T>+��A����8`K��%8`K��$``�"�Px�|  �} J})�N� ���h&8&(���h&&���h�``��8�8;�p8���x8�&H2`�/�A�&�;�8`;`{� 8�
8��K��`8�"���x�8d�x�8��)� �A(| ��i�IN�!�A(8��8`���K���```88`�8K��8`K��``8��8`���K��t8��8`���K��d8��8`���K��T8��8`���K��D8��8`���K��4�_H�?N�0���$9I��}J*�8�@�88��8`���K���`�_(/�A��@+�&A��8�HK���`�@8���8�x� |cJH0�`�{��K��-�?L�8�9)��9k�| �L@���?Hm ��/���@��(�(/�@��8��8`���K��\K����?0�P8`8&�i�P8&� K����?��x8�!8�8�;��;`!��K��a`8a�K���8&8`�K��|��K���&�```}�&|���������|vx8��&�&���!���A���a������|�#x8���������������;��a�����������!���{H3�`8�8�;A�;�t|xx�{H3�`8�8�|yx�{H3i`88�8�
        !          5806: |wx�{ �&pH3I`8�8�
        !          5807: |}x�{(H31`|~x�b�XH9!`�b�`H9`8�8�&C�xH.�`8`8�8���xK��)`/���@�l``H:�`/�A� �;�&��/�XA� �K��1`K��I`K��a`/�A���8`8�8���xK���`/���A���/���A�
���t��u��v��w�&x�!y�b�pH8M`��xK���`/�@����0~óxHI`.#|ux@�L8�&&��b��;�&��/�A��@��8X�&&�8�&&̀&&�|P|�/�WA��8X�&&�C�x��x8�H-�`�/�A���&&�/�&A�/�A�&t;��/�A�(����b��x� x�Fxņ"x��"H7m`;�+�&@�
        !          5808: x�&&T;��/�@�����b����x�x� x��"x��"x�FH7)`�[��&���C�x$�x��x��8�|K��a`�&&�/�|~xA��/�A�D/���A��/���A��/���A�        D/���A��/���A�
1.1       root     5809: t/���A�
                   5810: �/���A�
1.1.1.2 ! root     5811: �/���A�@/���A��8+�@��/���A��/���A�    �/���A� @8!P��x�&���a�����|��������}�� �����&���!���A���a����������������N� �b��H6!`��&�~�xD�xK��`|x/�@��l/���A�Ȁ���b��x� x�Fxņ"x��"H5�`/���@��h���肅�;�&�;�����xx� x�Fx�"x��"H4�`8�&�8`0K���`��xH)I`8��|dx��xK���`K���``8�8�|8a&T;�&�H*�`�b��8C�x�&&�8X��x�&&�8�8�&&�H+&`�/�@��h;�p��x��x8�H+�`/�A��H:�&���x~óx8�H+�`/�A��(�&&T/�A��~ijx8a�8�H*�`8�&&�K���Vp�b����x|��H4�`K���b��;�&�H4}`��x8�p8�H+I`/�@�L8���&Ԁ�&�~�xD�xK��5`|xK��8��x8�&T8��H(9`8�&�K��А&&�K��HA��:��8�~��x8�d~óx;�&�H�`~��x��xH!`/�@�$�&�/�@� ��x8�8�H)Y`~óx8�&;���HE`{� /�|vx@�8�&&T;�&�8���x8�H)`8a&�8�8�H)&`A��d:��~óx8�~��x8�dHA`�&�/�@�&�8X�&&�~óx8�&H�`/�&|vxA�� 8�~��x8�dH�`�&�/�@�&`8�&&�~óx8�&Hy`K���;��8���x8�d~óxH�`肅���xH*        `/�@��~óx8�&8&�&&�:���H%`z� |vx.5K��dK��`K��|:�p��x~�x8�H)1`/�@�&h;�&�~�x��x8�H)`/�@�&�a�K���`K�����x8a�8�H'�`K���肅���xH)Q`/�A��肅���xH)9`/�@���8~óx8�&�&&�:���HU`�b��z� 8.5;�&�|vx�K���~��x8�8�
        !          5812: H+�`|c�/��a&�@���K���~óx8�&8K���8a&�8�8�H&�`K���~��x8�8�
        !          5813: H+1`|c�/��a&�@���K���:����x~�x8�H'�`/�A���~�x��x8�H&�`K�����xD�x8�H'�`/�A�����xC�x8�H&�`K��l��x8�8�~��xH&9`:a&T~óx8�~e�x8�dH}`�&&T/�A�(9 /H�&/�A�/�\@���3K���~óx8�&H�`;���{�!|vxA���8�~��x8�d;�&�H`~��x��xHE`/�@�$�&�/�@�&�8�8���xH%}`~óx8�&Hm`8��x /�|vxA��H8�~��x8�d~óx:a&�H�`~��x~d�xH�`/�@�<�&�/�A�~c�x8�8�H%`K��d~c�x8�8�H$�`~óx8�&H�`|vxK��8肅�;�&���xH"�`8�&�8`0&K��&`��x;���H"�`8��|dx��xK��=`K��p肅x;�&���xH"U`8�&�8`0K���肆(;�&�;���xH-�`+�@����xH"]`肆`|H-�`��x;���H"=`肆h|H-�`8�&�8`0K��M`��xH"`8��|dx��xK���`K�����x8�8�H#�`K��l肅�8`0;���K���`K���;�&�肅�;�����xH!q`8�&�8`0K���`��xH!�`8��|dx��xK��`K��D�"�0{��|  �} J})�N� �� @;�&�肅���x��xH,�`8�&�8`0       K��Y`��xH!`8��|dx��xK���`;���K��Ȁ�����;�&�;���肆���xH,a`8�&�8`0K��&`��xH �`8��|dx��xK��A`K��t;�&�肅�;�����xH U`8�&�8`0K���`��xH y`8��|dx��xK���`K��(���肆x;�&�;�����xH+�`8�&�8`0K��e`��xH )`8��|dx��xK���`K���;�&�肆;�����xH�`8�&�8`0K��`��xH�`8��|dx��xK��Y`K���;�&�肆;�����xHm`8�&�8`0K���`��xH�`8��|dx��xK��
`K��@;�&�肆;�����xH!`8�&�8`0K���`��xHE`8��|dx��xK���`K���;�&�肆;�����xH�`8�&�8`0K��5`��xH�`8��|dx��xK��u`K���;�&�肆 ;�����xH�`8�&�8`0K���`��xH�`8��|dx��xK��)`K��\��|肆p;�&�;�����xH)�`8�&�8`0K���`��xH]`8��|dx��xK���`K��;�&�肅h;�����xH�`8�&�8`0K��M`��xH`8��|dx��xK���`K���;�&�肅���x��x��xH)]`8�&�8`0K���`��xH�`8��|dx��xK��=`;���K��l��xH�`肆H|H)     `K��<��xHy`肆P|H(�`K����xHY`肆X|H(�`K�����xH9`肆@|H(�`K�����xH`肆8|H(�`K����
|���������|�#x�&����|x�b�������!�Q;�&�H)`8���x8�&H�`/�A�&�/�@�&��>�       /�-@�&�     &/�f@�&��     /�@�&��~8�8�H"�`/���|xA�X�b�x;�pH(�`8`8�8���xK���`/���A�/���A�Ȉ�p��q��r��s�&t�!u�b��H(=`��xK���`�b��H(%`8`��x8�K���`|c4/�A�&��a&�K���`��&��b��x�Fx� xņ"x��"H'�`��/�A�<9 /H``�&/�A�/�\@���$�&/�@�����b�H'�`�;�&���xH�`��x��x<��8�8�x99 9@K��`|}xK���`/�A�&@/���A��/���A��8+�@�&�/�A�x�b�p��x;�H&�`H`�>� /�-A���b��;���H&�`�b��H&�`�b��H&�`�b��H&�`�b��H&�`�b��H&�`8!���x�&����������|�����N� /���A�&</���@��t��&�肆�8a�;�&x� x�Fx�"x��"H%�`K���`�     &/�cA�&/�r@��@�     /�@��48`K�}`|}xK��l```�Vp�b���x|��H%�`�b�H%�`��x��xK�~�`8!�|}x�&�����x�������|�����N� �b��;���H%�`K����b�(;�H%y`+�@�p�b�`H%e````�b�h;�&H%I`K���```�b��;�&H%)`K���� /�@��48`&K�~}`|}xK��l�"�0{��| �} J})�N� 4$DT�b�HH$�`K��t�b�PH$�`K��d�b�XH$�`K��T�b�@H$�`K��D�b�8H$�`K��4�b���x;�&H$u`K����b� ��x;�&H$]`K����b��;���H$I`K����b��;���H$5`K���&�```|���������|�#x|~x�����&8�8������!�;�x��xH}`/�@������xH�`8
        !          5814: �&�||yA�p/�&A��;��8�@��x8���xH�`��x��xH�`/�A����x8�@8���xHa`��x��xH�`/�@���b��H#=`8`��8!&��&����������|�����N� ;��8�@��x8���xH�`��x��xH-`/�A���;��8�8�&��xHm`�b��;�pH"�`8`8�8���xK���`/���A��/���A����p��q��r��s�&t�!u�b��H"q`��xK��`�&|/�@�&4�b��H"M`��x8`8�K���`|c4/���A���a�K���`����b��x� x��"x�Fx��"H"&`��x8�8a�H�`����b��x� x�Fxņ"x��"H!�`�a�K���`K��9`<ff`fg|�|c�p|p|cP�&�|c&�|c�K��-``K��A`/�@��K���`K���`/�@����b��H!U`8!&�8`�&����������|�����N� ``��x8�|8�H�`�b��H!    `K���```�b��H �`8!&�8`���&����������|�����N� ��x8�&H&Y`;���{�!|~xA���8���x8�@H�`��x8�|H�`/�A��8��x8�&H&
`;���{�!|~xA��|8���x8�@HI`��x8��Hy`/�A�����x8�&H�`/�&|~xA��4��x8�8�@H&`��x8�8�
        !          5815: H�`�a�K��```��x8�&Hi`;���{� |~xK��D�b��H�`8`��K��p�b��H�`8`��K��\�b��H�`8`��K��H&�``,$M� 9 `�/�,A�,/�@�H<``A�0�&/�,/ @���9)&8c&y) �H@A���N� `8`N� ```|ix8`&``�  /�,A�,/�@�H@``A�0�     &/�,/ @���5)&A� 8c&xc K���``N� N� N� ``�|kx/�,A�8/�A�0|ix`9)&|HPx � /�,/ M� @���N� 8`N� ``|���������|�+x�&�!��|�#yA�\9````�#/�,A�,/�@�H�``A���#&/�,/)@���9k&8c&yk �X@A���/�A���/�,A��/�A��|ixH`A� 9)&�HP{� �     /�,/ @���|dx|�3x��xHE`/�A�(88!�|���x�&��������|�N� 8!�;���x�&��������|�N� ;�K���&�```|��A���a��;@��������|�#x;���������|x�&�!���!�A�c;ap/�A��/�A��H�`/�A���"����x$�xH`|~yA��$�x��xH�`�P�4{� +�       A�t��xc�x��x��H!`}!��Ipc�x8�8�
        !          5816: H�`|c�+��A�4�|�/�.A�T;�&/�{� ;�&@��H/�8`��A�8`8!��&�!���A���a��|���������������N� �&K���``��x8�    c�xHu`c�x��yH`�K��H&�``|���������|}x|�#x�b���&���������!�qH     `�b��H�`/�@�8낇�;�`���x;�&��x��H�`��;�A���8!�8`���&����������|�����N� &�``|���������|�#x�&����|x�b������!�qK�z�`肈�}H
I`/�@�/�A��肈�}H
)`/�A�L肈�}H
`/�@����x��xK���`8!��&����������|�����N� ��x��xK��`8!��&����������|�����N� ��x��xK�ߙ`8!��&����������|�����N� �b� Hm`/�@�8낇�;�`���x;�&��x��H=`��;�A���8`��K��4&�`|��&�!���cm`E/�LFA�8!p8`���&|�N� �/�@���c8��T>+�&A��Сc8��T>+�&A����/�&A�$/�@���HI`8!p�&|�N� H�`8!p�&|�N� &�```|�=`E��������|�#x�&�!��akLF;�����XA�$8!���x�&��������|�N� `�;���/�@��Ԡ;���0��T>+�&A����;���0��T>+�&A�����/�&A�8/�@���8�H�`8!��~��x�&��������|�N� 8�H]`8!��~��x�&��������|�N� &�``|�= E�A���a��|�3x�&����a)LF|�#x��������|�;x|�+x�����!�a|x;�����HA�48!���x�&�A���a�����|������������N� `�;���/�@��Ġ;���0��T>+�&A����;���0��T>+�&A�����/�&A�t/�@���H`E�xf�x��P��x��xH1`��x���x��Hi`8!���x�&�A���a�����|������������N� He`E�xf�x��P��x��xH�`8!�����x�&�A�����a��|���������������N� &����,}C|./�&A�L�*9`}*BH ``�   }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A����H,```�,;�&�����*A����/�&@���/�A�&�?9��A�0��A(#�x|     ����|�\N�!�A(/�@�����|��#�xH
        !          5817: i`��?8�|y|HPx H        �`��/�A��XA��T��A(#�x;�&��|      ��w�WN�!�A(�,���*@��4``8!��`��&��{c �����&��|��!���A��}�& �a�����}�� �����������N� `�?�{�P{�K���� � ��8}C|./�&A�L�69`}*BH ``�     }*Kx})B/�&A� 9k&}k��8@���8`N� `�jN� ```|��!���A���&�a��|�#x��������;���������|x�!�Q�#(#�>�xH(```;�&�<;�@����A��/�@����>,�^(y)6d}9J{Z6dY��     x     ��A���� /�A����_ ��8;��z��8|�2|�2|P.}_R/�&�A��``�69`}*BH� }*Kx})B/�&A��9k&}k��8@���|0*x�"y+.�y)$})XP�ex� |i+�@|�#}+J}`�})�@���b�8H}`� �8����`@��x@����_ ���z��8|�2|�2|P.}_R/�&�@��@```|0*�*�@@��\�b�(H
`� K���```�B�0x�d|
        !          5818: �}@R}I�N� ���X&���X���X&&d&P���X���X���X���h���h���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X���X&D&8���X&,���X���X���h���X���X���h���h���h���h&���X���X���X���X���X&���h���h���X���X���X���h���hU):�+K��\�+K��T�|��� K��@y)� �+K��4y)"�+K��(�+� K��y �y)��|        �K��y)��+K���``8!��&�!���A���a��|���������������N� &�``|�}�&�&����.%-������&��|�3x�A���a��|�#x;`��������|�+x|}x�����!��;����!�A�� ��H,```�8;�&�����6A����/�&@���/�A�&�?9��A�0��A(#�x|     ��(�|�\N�!�A(/�@�����$|��#�xHi`� �?(8�|y|HPx H�`�(/�A��XA��T��A(#�x;�&��| ��w�WN�!�A(�8���6@��4``8!��}|{�&�������&��|��!���A��}�& �a�����}�� �����������N� ``�?�{�PK����     `�/�A�,x� �@@�N� `M� �&/�@@���8`N� ``�c/�A�\�}i[x/�A�@�@A�$H4``�/� @A�@��#&8�&/�@����} HP}#�N� �9 K���`|ix```��     9)&�8�&/�@���N� `|ix9`8`� /�M� ``�     &9k&}k�/�@���yc N� ``�|ix/�A�4/�M� |��HB@p�     8���9)&x� �&/�@���/�M� 8���9i&x� 88�&|��H```9k&� }i[xB��N� ```N� |���������|y|�#x�&���������!�q@�,8!���x�&����������|�����N� `/�A�dK���`||x��xK���`/�|}x@���������@@�0`��x��x��xH�`/�A���;�&��@A���8!�;���x�&����������|�����N� &�`,%M� 8���x� x� |ix8�&|����9)&B��N� `,%M� 8���|ixx� 8�&|��`�8�&�     9)&B��N� ```�@@�\|*�@A�P/�M� 9%��8���y) |�*9)&|�*})�9 `|H�|I�9)��B��N� ```/�M� 8���|ixx� 8�&|��`�8�&� 9)&B��N� ```,%A�L�#�8���x� �@A�(H@```�#&�&ye �@@� /�9e��@���8`N� ``|`HPN� ```|���������|x|�#x�&�����!�q�c/�@�8HhH�`|}x�~H�`��@�D�&;�&/�A�8�/�@���8!�8|`P�&�����������|�N� �8!��|`P�&�����������|�N� &�```8��+�   8A�8c���"�@|c�xcd|       �|xN� ``8��+�M� 8c��|c�N� ```,$|ixA�&@+�$�$@�H&`9)&�$�i/� /       ,�
1.1       root     5819: A���/�
A���A���A���/�@��/�0A��8�
                   5820: /�A��8``8��9K��T>UJ>+�    +
                   5821: 9)&9K��|4@�$8��T>+�}@4@�M� 9k��}`4�(L� �$|c)҉i/�|`@���N� `/�@��|/�08�@��p�        &9I&/�x@��h9*&�$�j&K��P```8`N� �     &9I&/�x@��(9*&�$�j&K���8���K���`,$|ixA�&X+�$�$8`@�N� 9)&�$�i/� /       ,�
                   5822: A���/�
A���A���A���/�-8�A��/�@��/�08�
                   5823: A�&/�8`A�t8`H�$|c)҉i/�|`A�T8��9K��T>UJ>+�    +
1.1.1.2 ! root     5824: 9)&9K��|4@�$8��T>+�}@4@�A�9k��}`4�(A���/�M� |c�N� ``/�A�,�$�iK��\9)&/��$8�&�i@���K��4�$/�08�@��0�    &9i&/�x@�<9+&�$�k&K��8���+�$8`�$@���N� � &9i&/�xA�9`0K���9+&�$�k&K���`|��!���A���a��������������;������&{� |x�&���!�Q;]�ˆHWZ&��Y���x�```/�A���>|�8h�H@@�&��~}i[x```� )@@T
1.1       root     5825: 6x�(/�|�3x@�,�I&��yJ��}F3xx�E�I|�3x}F3x��@@�@@�D�        &�Ix��|;xyJE�     }G;x|;x8�}):K���```�@@A�&��@@@�& 8�9 H@`9 ��&�Kx�(��xƃ�|�xyJE�}Jx|�Sx8
                   5826: }k�X@@�Ј/)T
                   5827: 6x�(/�@���A����&�I�    &��� ��yC�(y���{�䈉}�;xxxE�x�E�|�;x|x|�3x|�x|�:UJ688�&xG"x�}J;xx��I��&���     ���&�K��x�(xƃ�|�xyJE�}Jx|�Sx8
1.1.1.2 ! root     5828: }k�X@A��8/�@��(c�xK�|!`��@�&|c��|K���}i[xK���{�G"{�a){�����H�h&�(�8!��&�&���!���A��|��a����������������N� �0@@�P8i|�0P��}c�{�G"`�{�{��x�G"x��x������&��}�����K�&K���T>8i`�        K��l#�xK�{9`/���|hx�~A�}#��|�<K�� 8`K��8&�```���T>���N� `|�/��&�!������������&��!��A�@�8!p8`���&|�N� /�A���8��H%`8!p�&|�N� &�|�|�+x�&�!��|�#x8���|xx�`H`8!p�&|�N� &�```|��&�!��|`x�b�P������|x�������&��!��A�8��H�`8!p�&|�N� &�`|�����|x�&�!�q�/�A�&�/�A���#
        !          5829: /�A�/�O@�d�8�PK�y�`8|c�/�A�x/�O@��8�9 &���?8!�|x�&����|�N� ``|H�9)&})�/�@����8�PK�y�`8|c�/�@����?9`}i&�8�9 &��K���``�?|`x9`}i&�K���```�8�p8�&K�y`8��/�&@��D�&pK��<&�&```�b�XK���```K���}�&|��a������|�+x;�&��������|}x�&�&���!���A���������!�Q�$&/�A�&�;@;�;�;!pH08      ��T>+�       A�;Z��}:J}:�`�<&/�A�&�8       ��T>+�)A����b�`x�|�}`Z}i�N� ���������������������������������&�����������������������������������������������������������������������������������������������������������&�`��xK��
x` /� A���/�       A���/�
1.1       root     5830: A���/�
A���/�A����;��x9i�{�)�      K���xc /� A���/�   A���/�
                   5831: A���/�
A���/�A����/�A����=
                   5832: /�@���9)���=�<&/�@���8!&�8`&�&���&���!��|��A���a��}�& ������}�� ��������N� ``��xK��/�xx A��. A� -�    A��/�
                   5833: A��/�
A��/�A�x��@�p```�xH
                   5834: `/�A��}!���x;�&��� pK���xx . A��-�   A�$/�
                   5835: A�/�
A�/�A���A���}!���pA�H/�
                   5836: A�@/�
A�8/�A�0�/�A�$�=
1.1.1.2 ! root     5837: /�@�9)���=```#�xK��}`/�A���;#�x8�8�8      �� K���`�xK�����xK���/�xi A��/� A�/�       A�/�
1.1       root     5838: A��/  
A��/)A�x�@�p```8     ��T>+A�T}a���x;�&���+pK��mxi /� A��/�   A��/�
                   5839: A� /  
A�/)A��A���`}a���pA�4/�
A�,/�A�$�/�A��=
1.1.1.2 ! root     5840: /�@�9)���=#�xK��Q`/�A�T�;#�x8�8�8  �� K��e`�xK���`��xK���/�x` A�P/� |xA�T/�       A�L/�
1.1       root     5841: A�t/�
A�l/�A�d��@�\``}!���x;�&���  pK��Mx` /� |xA�&�/�       A�&�/�
                   5842: A�/�
A�/�A���A���}!�/�
                   5843: ��pA�4/�
A�,/�A�$�/�A��=
1.1.1.2 ! root     5844: /�@�9)���=�;$�x8      ��iK���`K�����xK���/�xx A��. A�0-�   A��/�
1.1       root     5845: A��/�
A��/�A�x��@�p```�xK��-`/�A�h}!���x;�&���  pK��9xx . A��-�   A�$/�
                   5846: A�/�
A�/�A���A���}!���pA�H/�
                   5847: A�@/�
A�8/�A�0�/�A�$�=
1.1.1.2 ! root     5848: /�@�9)���=```#�xK��
`/�A�&�;#�x8�8�
        !          5849: 8      �� K��!`�xK���}!���x;�&���     pK��]x` /� @�```}!�$�x��p�;8 ��iK��E`K��,``/� A�```/�       A�P/�
        !          5850: A���/  
A���/)A���8 ��T>+A���}a���x;�&���+pK���xi /� @���}!�#�x��pK��&`/�@���8!&�8`�&���&���!��|��A���a��}�& ������}�� ��������N� . A�d``-�       A���/�
1.1       root     5851: A���/�
A���/�A����xHm`/�A�&}!���x;�&���      pK���xx . @���}!���pK���```. A�d``-�   A���/�
                   5852: A���/�
A���/�A����xK��m`/�A��}!���x;�&���      pK��yxx . @���}!���pK���```/� A��``/�   A���/�
                   5853: A�$/�
A�,/�@���9`K��``9`
                   5854: K���``9`
K���}!���pA���K���}!���pA��0K����```}�&|��a���A��|{x��������;��&�����������!�1��&�x!A�&`;�p;�;A&H ```�&8�&x!A�&4/�%|�#x@���x ��x�      ;�&9)&|�P|
1.1.1.2 ! root     5855: ��-s/�d}&U@-%/i,�x,X.p-�c�&�}&U@-O�&�}&U@-o�&�A��A�&A�&A�&A�&(A�&4�&�U >} U�>A�&0�&�U >} U�>A� �&�U >} U�>A�&@��H9`o9*&}AR})�}!J�jp��p�/�%A���c�x��xE�xK���/�@�$�&;�&8�&��x!@���``8!���x�&���A���a��|�������}�& ��������}�& }�� N� `9`dK��```9`iK��P``9`xK��@``9`XK��0``9`pK�� ``9`cK��``9`sK��``9`OK����```,%|ix8`M� �I/�A�p�}KSx/�A�T8���x�!A�H�@@�@|��H$``�/�@A� B@@��i&8�&/�@��܈}`XP}c�N� �9`K���xc 9#��8��(�+  8c��L�(BOY�B+�O��B} &U#?�U)��|&T��|cKx|cx|c�N� ``|���������|�+x|~x�&����|�#x8�&@�!�1;�p��xH�`��x|}x�~{� K�k)`8!&���x�&�����������|�N� &�`|��"�h����|�#x�&����8��|�+x��������T>|x�!�a+�
�I�)8�!p�AxA�X� @@�|�"�p�       /�A���c8-�8�c9k&�c� ��8&�=p�+�?9)&�?8!�|x�&����������|�����N� ``�+������x��PK��!���?8!�8&|x�}p�i�&�?������|�9)&�����?����N� ``�cK��T&�```|��a������}Cx|�;x�&����|�3x��������|~x|�+x�!�a|�#x8�
1.1       root     5856: 8�K��`/�9 8&|c�A� `��9)&/�})�@���y  |�|��@�@|P|�/�@�0x �>|  �```���>9)&�>B��8!�8`�&�a��������|���������N� &�``|����p���x9�x9�0�&�&��:&��������:� �����&��|�#x|xx�!���A��; �a�������!���A���a�������������������!��;a&P;Ap:���{1�%/�A�8|P��@�,/�%A���#8�&�a&�8c&�a&��%/�@���8��a&�8!&P|xP�&���p|c����x�&��|��!���A���a�����������������&���!���A���a����������������N� `K�x|�+x8%�;�&|�P|
1.1.1.2 ! root     5857: ��/�dA��/�iA��/�uA��/�xA��/�XA��/�pA��/�cA��/�sA��/�%A�/�OA��/�o9k&@���9 o9j&}AR}k�}aZ�*p�+p�/�%@� 9#&��!&�8�&�a&�K���`�&q��:&/�0A�/�.:` ;�qA��</�A�P|�:��&�;�8        ��T>+�)@�D8 ��T>+�       A�}z�;�&{� �+�<&/�@���~&�xK��p```�b�xx�|�}`Z}i�N� X������������������������������������������������������������������������&������������������������X��������X&h������������������������8�8�
        !          5858: ~��x�?K��m`x ��xK��}`�@@�D|c�Pxc!A�8/��!&�|i�A��A��```���!&�9)&�!&�B��;�H(`�!&�|��;�&{� �  �!&�8 &�&&���xK���`��@A���K��l``}:�~��x��x8�8� 9�)c�xK����!&�c�x��x8����!&�8     &�&&���&�!&�8 &�&&�K��]�<&K��}:�c�x~��x8�&8�
        !          5859: 8� �)9K����!&����a&��<&8c&�a&�K���}:��b�hz�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK��-c�x~D�x8�K��͍<&K��x}:��b�hz�$8�~g�x}k9�)~��xc�x�KҐ8~E�xK���c�x~D�x8�K��}�<&K��(�<&:�/�h@���<&:�&K��`V�88      ��}:�~6��x�)�9A�4�a&��"�hz�$})8-��I�!&��a�8 &}r�8�&&�~E�x8�
1.1       root     5860: ~g�x9~��xc�xK��9c�x~D�x8�
1.1.1.2 ! root     5861: K��ٍ<&K���```�<&:�/�l@��hK��````:`0;�rK���`9 dK���``9 iK��|``9 uK��l9 xK��d9 XK��\9 pK��T9 cK��L9 sK��D9 OK��<8&|  �K�� &��H�X�`No net_xmit function availableCan not open "%s" because file descriptor list is full
        !          5862: No net_ioctl function availableNo net_init function availableNo net_receive function availableELF loading failed!
        !          5863: net_e1000net_bcmnet_veth``/rtas
        !          5864: Could not open /rtas
        !          5865: rtas-size
        !          5866: Size of rtas (%x) too small to make sense
        !          5867: 
        !          5868: Failed to allocated memory for RTAS
        !          5869: Could not open /rtas
        !          5870: instantiate-rtasinstantiate-rtas failed
1.1       root     5871: read-pci-configibm,read-pci-configwrite-pci-configibm,write-pci-configibm,update-flash-64-and-rebootibm,update-flash-64ibm,manage-flash-imagesystem-rebootget-time-of-dayset-time-of-daystart-cpustop-selfTOK
                   5872: start-cpu called %d %x %x %x
                   5873: bootmsg-cpclosebootmsg-debugcpbootmsg-warningbootmsg-errorreleaseset-callbackopenfinddeviceparentchildpeeryieldset-ledwrite-mm-logrtas-write-vpdrtas-read-vpdclaimseekreadwritecall-methodgetprop/chosen/aliasesnetbootpathlocal-mac-addressregassigned-addressesname#address-cells#size-cellsrangescompatibleIBM,vdevicevendor-iddevice-idrevision-idclass-codeinterruptsstdinstdout  No net device found 
                   5874: /cpustimebase-frequencyinterpretibm,romfs-lookup``������������`:////@/:
                   5875: ERROR:                 Bad URL!
                   5876: 
                   5877: ERROR:                 Bad host name!
                   5878: 
                   5879: ERROR:                 Can't resolve domain name (DNS server is not presented)!
                   5880: 
                   5881: Giving up after %d DNS requests
                   5882: %d.%d.%d.%d
                   5883: bla   %02d
                   5884: Giving up after %d bootp requests
                   5885: .    %03d
                   5886: Aborted
                   5887: 
                   5888: Giving up after %d DHCP requests
                   5889: %d KBytesblksizeoctet%d  Receiving data:  Lost ACK packets: %d
                   5890:  Bootloader 1.6 
                   5891: E3000: (net) Could not read MAC address  Reading MAC address from device: %02x:%02x:%02x:%02x:%02x:%02x
                   5892: E3006: (net) Could not initialize network devicebootpdhcpipv6  Requesting IP address via BOOTP:   Requesting IP address via DHCP: E3001: (net) Could not get IP addressE3002: (net) ARP request to TFTP server (%d.%d.%d.%d) failedE3008: (net) Can't obtain TFTP server IP address  Requesting file "%s" via TFTP from %d.%d.%d.%d
                   5893:   TFTP: Received %s (%d KBytes)
                   5894: (net) unknown TFTP errorE3004: (net) TFTP buffer of %d bytes is too small for %sE3009: (net) file not found: %sE3010: (net) TFTP access violationE3011: (net) illegal TFTP operationE3012: (net) unknown TFTP transfer IDE3013: (net) no such TFTP userE3017: (net) TFTP blocksize negotiation failedE3018: (net) file exceeds maximum TFTP transfer sizeE3005: (net) ICMP ERROR "net unreachablehost unreachableprotocol unreachableport unreachablefragmentation needed and DF setsource route failedE3014: (net) TFTP error occurred after %d bad packets receivedE3015: (net) TFTP error occurred after missing %d responsesE3016: (net) TFTP error missing block %d, expected block was %d
                   5895:  Flasher 1.4 
                   5896:    Bad buffer address. Exiting...
                   5897:    Usage: netflash [options] [<filename>]
                   5898:    Options:
                   5899:             -f     <filename> flash temporary image
                   5900:             -c     commit temporary image
                   5901:             -r     reject temporary image
                   5902:    Bad arguments. Exiting...
                   5903: 
                   5904: 
                   5905: E3000: Could not read MAC address
                   5906: 
                   5907: E3006: Could not initialize network device
                   5908: %02x:%02x:%02x:%02x:%02x:%02x
                   5909: 
                   5910:   DHCP: Could not get ip address
                   5911: 
                   5912:   ARP request to TFTP server (%d.%d.%d.%d) failed  Requesting file "%s" via TFTP
                   5913:   Now flashing:
                   5914:   Tftp: Could not load file %s
                   5915:   Tftp: Buffer to small for %s
                   5916: 
                   5917:   ICMP ERROR: Destination unreachable:  UNKNOWN: rc = %d!  Reading MAC address from device: 
                   5918: ping device-path:[device-args,]server-ip,[client-ip],[gateway-ip][,timeout]
                   5919:   Own IP address:   Ping to %d.%d.%d.%d success
                   5920: failed
                   5921: 
                   5922:   Reading MAC address from device: No such callback function
                   5923: argv[%d] %s
                   5924: netbootnetflashpingUnknown client application called
1.1.1.2 ! root     5925: ``
        !          5926: ELF relocation out of bounds!
        !          5927: ERROR: Unhandled relocation (A) type %i
        !          5928: &&&&&&&&&&0123456789ABCDEF������������������������������������&&��&`&��&���&��&���&���&��`&��`&���&���&��
 &��
P&��
�&��P&���&��0&���&��0&��&��@&���&���&���&�� &��,&���&��P&���&���&��&��p&��&���&��p&���&��0&���&���&���&���&���&���&���&�� &��  &�� �&��! &��!p&��"&��"�&��#@&��#�&��$&��$�&��%&��%�&��& &��&�&��' &��'�&��(&��)&��)�&��*@&��*�&��+�&��, &��,p&��-&��-`&��. &��.�&��/p&��0 &��1@&��4�&��4�&��5�&��7�&��9�&��:p&��;0&��;�&��<&��<P&��<�&��=�&��=�&��=�&��>@&��>`&��>�&��>�&��>�&��>�&��?&��?@&��?�&��?�&��@&��@@&��@`&��@�&��@�&��@�&��A0&��Ap&��A�&��C`&��C�&��C�&��C�&��C�&��D0&��DP&��E&��E0&��EP&��Ep&��F &��F�&��I@&��O�&��P�&��S@&��U�&��U�&��V0&��W&��W &��W0&��WP&��X�&��Z�&��\ &��`�&��aP&��a�&��b�&��d�&��e�&��f�&��i0&��l�&��o &��up&��v�&��w�&��yp&��|�&��|�&��~&�� &��� &���p&����&����&����&���`&����&���`&����&���&����&���@&����&���p&����&��� &����&���p&����&����&���p&����&���@&����&����&���p&���`&����&����&����&��� &����&���0&���`&����&���p&����&���&���p&����&��� &��ŀ&��Š&��Ű&���`&����&���p&����&���P&��Ԡ&��ՠ&��````````````````````````````````````````````````````&�X�0�H�������`�p�������h�����&&&&���� ����&^������c�Sc&������`&2�`P&&2߰P�!���&0|��&8|��&H|��&P�a@8�``H-A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H,A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8��`�H+��&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H+A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8��`�H*��&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H*A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H)A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H(A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H'A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8 �`     `H&A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8
1.1       root     5929: �`
1.1.1.2 ! root     5930: `H%A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H$A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!��}h��a0}z��a@}{��aH�b��k}i�|
1.1       root     5931: xN�!�a0}h��a@}z��aH}{�8!PL$�!���&0|��&8|��&H|��&P�a@8
�`
`H"A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H!A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``H A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8�``HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8 �` `HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8!�`!`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8"�`"`H
A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8#�`#`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8$�`$`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8%�`%`H
1.1.1.2 ! root     5932: A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8&�`&`H        A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8'�`'`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8(�`(`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8)�`)`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8*�`*`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8+�`+`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8,�`,`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8-�`-`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8.�`.`H&A�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���&0|��&8|��&H|��&P�a@8/�`/`HA�&H|��&P|��&8|��&0�a@8!XL$``&`N� �!���A@�aH��P��X��`��h�&p�!x�A��a��������������&��!��A��a��������������&��!��A&�a&��&��&��& ��&(}����&0}i�<``cxc�dc`c��C�b��#}��N�!}����&0}���A@�aH�P�X��`��h�&p�!x�A������������&��!��A��a������������&��!��A&�a&�&�&��& ��&(8!&0N� &2�&&;@{P&&2�&��{P�p��Pܐ�������Cނ׶4� ě��S���P�0�X�&�`&�0����& ��&{@&{H����p�x&�xݐݠ������(�H���X�pވޠ��������� �0���@�H& �h�x߀ߐߠ߰��߸���@�p�`��������������(�8�@�H�P�X�h�p�x������������������(�8�H�X�h{P�x��������������&{H���� ě��S��1����&x1��2�@�h&���1�2���2������ �(�0�H�h�����2��������(&�2����0�8�@�H�X�2��&��2�@���������������� �h���&��������0�p�����(�h������ �P��$�������� ��8�x�����0�`�p�����(�P������������(�@�`����������� ��������(�P�����@���X�p���0������ ��������(���H�x2�H&�&��d��2��8GCC: (GNU) 4.4.5.symtab.strtab.shstrtab.rela.client.rela.lowmem.rela.got.comment.branch_lt.bss &&�&&Tx�p&-&&&�.�&(&���:&&2�&2(�5&��8?&0&;(&:�&&H&&;@&:�S&;@&:�1��&:�X&&&>X0
        !          5933:     &M��&&&&2�     &;@&&&� &&`&&;(&;@3&� I&�H�P&�x<W&��g&��m&�`�&&\�&��D�&,� &{H�&�@8�&�Ph�&��t�&���&�hD�&�p�&���&�`&��&���&
        !          5934: &&    {P&!& &(&���&3&��&A&�8|&O&��h&W&��D&^&���&c&�&t&��&�&���&�&��d&�&�&d&�&&&�&�&�p&�&���&�&��X&�&��|&�&��X&�&��&\&�&�p&��&��T$&��8+ �PP7&& XA&���L 2�&Y&��&�o ��w&���&2��&� �&�(8�&���&���&&�X�&&� �&���&��&��&����&��(�&��$
        !          5935: &���&���"&���*&�h0&�@B&�X�K&�$[&�XPq&�& z&�x��&�(��&�0��&���&���&��L�&��L�&����&���&����&&���&�Ht�&����&�0��&�8�        &�hP&��x     �x#&� t*&�h|3&�X�:&�A&�@&�I&&& ^&�|f&�Plk&��&�&�0&��&��D� 2�@�&��<�&�p&l�&&@�&����&��t�&��4� ���&�`|�&&&��p&�8#&�&)&��&4;&��@F&�(&4N&�(]&��\l&&� x&��&�P8�&=��&���&���&���&2��&�X��&�8�&��&0�&��&��H&�P|&��H&��&�@'&�h$/&�HB&�@h[&=�l&�HHs&�t�&��� ��X�&��l�&�P�&���&���&�&x�&&�|�&���&�._start_kernel.callback_entry.exception_forwardcall_client_interfacemdelaystrcpyset_ipv4_routerioctltranslate_address_devprintfvsprintf.undo_exception_prom_entryrecvhandle_arpget_arg_ptrset_timersend_ipv4get_sec_ticksmemmoveglue_inithandle_udp_lowmem_startfd_array._exitrtas_tokenrmmod_by_typeof_finddeviceread_iomemcpypingset_ipv4_addressrtas_pci_config_readromfs_lookupmallocrtas_callvsnprintfset_mac_addressof_getpropwrite_ioof_set_callbackhandle_udp_dunstrtoulhandle_dnsof_call_method_3handle_ipv4socketsnk_modulesof_moduleof_release__client_endelf_load_file_to_addrtb_freq_system_call_lowmem_end_callback_entrysendget_mac_addressget_timerisxdigitstdin_datapong_ipv4strtolmodules_initglue_releasefill_udphdrof_claiminsmod_by_typeget_macwritetranslate_addressof_writehandle_tftp_dunrtas_ibm_manage_flashgen_argvmodules_termof_readget_puidrtas_pci_config_writenetflashhandle_dhcp_startstrstrreadnetbootstrncmpof_closestrncpyudelaystrcasecmptftpget_args_count_rtasmemcmpof_childprintk_entrystrtoipsnk_kernel_interfaceof_opensbrkelf_load_segments32elf_load_segments64handle_tftpsend_ipmemsetmaingetchardns_get_ipelf_get_base_addr32dhcpexception_stack_framestrcmp__client_startsprintfrtas_call_entrybootpdhcp_send_releasesend_etherargncpyhandle_tcp_dunmalloc_alignedstdout_data._callback_entryisdigit.call_client_interfaceset_ipv4_netmaskbootmsg_errorwrite_mm_log_gotcallback_exitping_ipv4handle_tcpfill_iphdrof_parentstrlenopendns_inittoupperget_module_by_typertas_ibm_update_flash_64.rtas_call_entrystrchrelf_get_base_addr64elf_relocate64rtas_argsfill_ethhdrundo_exceptionrtas_initclosereceive_ethervfprintffree._entry& )
        !          5936: &j/&z/&~?&�$
        !          5937: &��
        !          5938: B?j/$n/4z?(�
        !          5939: �?8�?�/�?�$
        !          5940: �$
        !          5941: $F
        !          5942: 4X
        !          5943: @R
        !          5944: T$
        !          5945: �G
        !          5946: z?@@
        !          5947: X&
        !          5948: �@��
        !          5949: ��
        !          5950: B?HDf
        !          5951: �?P<�
        !          5952: t$
        !          5953: �?@&
        !          5954: �@"?@f?X ?@ �?` �f
        !          5955:  �&
        !          5956: � ��
        !          5957: 
        !          5958: J?@
        !          5959: �?x
        !          5960: �f
        !          5961: 
        !          5962: ��
        !          5963: 2?p4f
        !          5964: B?hDf
        !          5965: �)
        !          5966: �$
        !          5967: �Q
        !          5968: ��
        !          5969: �Q
        !          5970: �q
        !          5971: 
�?�
�?�n?�r?�>?��?�>?�?�Tw
        !          5972: n?��?�h(
        !          5973: z?��?��:
        !          5974: �?��?��?�K
        !          5975: N?�|&
        !          5976: ���?��?�?�
        !          5977: ?�?�?�>?�P&
        !          5978: ����,��,?��?��?��
        !          5979: 
        !          5980: "?�.?��0&&�H�@&&�X�P&&�`&f&&_&&&&0)&&8�&&@�&&Hw&&Pq&&��&&��&&�Z&&L&&&&!&&J&��&&�3�&&`�3�(&&&�03�@&&��H3�X&&�`3�p&&��x3�&&��3�&&`�3�&&
        !          5981: `��3��&&���3��&&���3�&& �3�&&P� 3�0&&��83�H&&
P�P3�`&&
��h3�x&&0�3�&&��3�&&0�3��&&��3��&&@��3��&&���3��&�3� �&�(3�8&�@3�P&�X3
        !          5982: ?&"
        !          5983: ?&*?&04-
        !          5984: P�
        !          5985: dj
        !          5986: z?&P�3
        !          5987: �?& �?&(�?& �?&8"?& &?&H.?& 2?&@:?& >?&XZ?&|-
        !          5988: �&
        !          5989: �h�&
        !          5990: �h�?&`� 
        !          5991: �?&h�?&p 
        !          5992: 
        !          5993: ?&x 
        !          5994: ?&� 
        !          5995: "?&�$ 
        !          5996: .?&�0 
        !          5997: :?&�< 
        !          5998: F?&�H 
        !          5999: R?&�T 
        !          6000: ^?&�` 
        !          6001: j?&�l 
        !          6002: v?&�x 
        !          6003: �?&�n?&|z
        !          6004: �?&�z
        !          6005: ?&h8*
        !          6006: >?&�@f
        !          6007: �?&h�*
        !          6008: �?&��f
        !          6009: ?&ht*
        !          6010: �?&h*
        !          6011: v?&h�*
        !          6012: �?&h*
        !          6013: 6?&h\*
        !          6014: �?&h�*
        !          6015: �?&hH*
        !          6016: �*
        !          6017: �?&h*
        !          6018: \*
        !          6019: �?&��?&� Hp
        !          6020:  R?&� h
        !          6021: 
        !          6022:  �p
        !          6023:  �?&� �
        !          6024: 
        !          6025: !H]
        !          6026: !�p
        !          6027: !�?&�!�
        !          6028: 
        !          6029: "Hp
        !          6030: "R?"p
        !          6031: 
        !          6032: "�p
        !          6033: "�?#
        !          6034: 
        !          6035: #pp
        !          6036: #z?#�
        !          6037: 
        !          6038: #�?#�8
        !          6039: $(p
        !          6040: $:? $L
        !          6041: 
        !          6042: $�p
        !          6043: $�?($�
        !          6044: 
        !          6045: % j
        !          6046: %&?%J?@%V?0%Z?8%�p
        !          6047: %�?H%�
        !          6048: 
        !          6049: &Hp
        !          6050: &Z?P&l
        !          6051: 
        !          6052: &�p
        !          6053: &�?X&�
        !          6054: 
        !          6055: 'Hp
        !          6056: 'Z?`'l
        !          6057: 
        !          6058: '�p
        !          6059: '�?h'�
        !          6060: 
        !          6061: (Xp
        !          6062: (b?p(|
        !          6063: 
        !          6064: (�p
        !          6065: (�?x(�
        !          6066: 
        !          6067: )8p
        !          6068: )B?�)h
        !          6069: 
        !          6070: )�p
        !          6071: )�?�*
        !          6072: 
        !          6073: *xp
        !          6074: *�?�*�
        !          6075: 
        !          6076: +p
        !          6077: +"?�+H
        !          6078: 
        !          6079: +�p
        !          6080: +�?�+�
        !          6081: 
        !          6082: ,DS
        !          6083: ,�p
        !          6084: ,�?�,�
        !          6085: 
        !          6086: -4N
        !          6087: -�p
        !          6088: -�?�-�
        !          6089: 
        !          6090: .`p
        !          6091: .j?�.�
        !          6092: 
        !          6093: .�?�.�"
        !          6094: .�?�/-
        !          6095: /"
        !          6096: /2?�/4"
        !          6097: /J?�/T-
        !          6098: /�&
        !          6099: �/�?�/�-
        !          6100: /�$
        !          6101: /�$
        !          6102: 0F?�0P-
        !          6103: 1"?�1�?�1�-
        !          6104: 1�&
        !          6105: ��1��
        !          6106: 1��
        !          6107: 1�?2-
        !          6108: 2
        !          6109: ?2-
        !          6110: 2,-
        !          6111: 2B?2T-
        !          6112: 3�-
        !          6113: 3�-
        !          6114: 3��
        !          6115: 4�&
        !          6116: ��4�&
        !          6117: �4�
        !          6118: 5�
        !          6119: 5?�50�
        !          6120: 5X-
        !          6121: 5p
        !          6122: 5�&
        !          6123: �6�
        !          6124: 6
        !          6125: ?6-
        !          6126: 6"? 6(w
        !          6127: 6:?(6L-
        !          6128: 6R?06`-
        !          6129: 6f?86t-
        !          6130: 6z?@6�-
        !          6131: 6�?H6�-
        !          6132: 6�?�6�-
        !          6133: 74T
        !          6134: 7r?�7�-
        !          6135: 7�-
        !          6136: 7�?�8"
        !          6137: 8?8�?P8�?08�?88�?@8�?X8�-
        !          6138: 8�?`8�-
        !          6139: 8�?h9N
        !          6140: 9&
        !          6141: �H9"?x9$"
        !          6142: 90e
        !          6143: 9>?�9H-
        !          6144: 9L�
        !          6145: 9V?�9Z?�9b?�9f?�9�I
        !          6146: 9�?p:p
        !          6147: :
        !          6148: ?�:(
        !          6149: 
        !          6150: :��
        !          6151: :�p
        !          6152: :�?�:�
        !          6153: 
        !          6154: <(U
        !          6155: <t'
        !          6156: <�'
        !          6157: =U
        !          6158: =,'
        !          6159: =TU
        !          6160: =�?�&8&&�&@&&��&P&&� &X&&��&`&&�&h&&��h&&��p3��&&P��3�&&��3�&&��3��&&��3��&&p��3��&&�3�&&��3�(&&p�03�@&&��H3�X&&0�`3�p&&��x3�&&��3�&&��3�&&���3��&&���3��&&���3�&&��3�&&� 3�0&& �83�H&&��P3�`&&  �h3�x&& p�3�&&!�3�&&!��3��&&"@��3��&&"���3��&&#��3�&&#��3� &&$�(3�8&&$��@3�P&&% �X3�h&&%��p3�&&& �3�&&&��3�&&'�3��&&(��3��&&(���3��&&)@�3�&&)��3�(&&*��03�@&&+ �H3�X&&+p�`3�p&&,�x3�&&,`��3��&&- ��3��&&-���3��&&.p��3��&&/ ��3�&&0@�3�&&3�� 3�0&&3��83�H&&4��P3�`&&6��h3�x&&8���3��&&9p��3��&&:0��3��&&:���3��&&;��3��&&;P��3�&&;��3� �&�(3�8�&�@3=�?�@?�@?�@B?��P&&<��X3�h&&=@�p3��&&=`��3��&&=���3��&&=���3��&&=���3��&&=���3��&&>�3�&&>@�3�(&&>��03�@&&>��H3�X&&?�`3�p&&?@�x3��&&?`��3��&&?���3@�?�@�$
        !          6161: A$
        !          6162: AL?
        !          6163: A�?�A�$
        !          6164: A�?�A�p
        !          6165: B?�Bp
        !          6166: B$
        !          6167: B�?�B�d
        !          6168: B�?�B�d
        !          6169: B�d
        !          6170: B�
        !          6171: C4
        !          6172: C4d
        !          6173: Cb?�C�?�C�?�C�?�D2?�DR?�D�p
        !          6174: D�?�D�?E?�E&
        !          6175: ��E2?�E8&
        !          6176: ��ER?�EX&
        !          6177: ��E�?E�?�E�?�E�?E�p
        !          6178: F|$
        !          6179: F�$
        !          6180: GJ?�Gp@
        !          6181: G�d
        !          6182: G�p
        !          6183: G�@
        !          6184: G��
        !          6185: H@
        !          6186: H$&
        !          6187: �8H0}
        !          6188: H�?H�d
        !          6189: H�$
        !          6190: I$
        !          6191: I}
        !          6192: I�?�J�?J�?Kp
        !          6193: K @
        !          6194: K@&
        !          6195: �8KD@
        !          6196: K\�
        !          6197: Kl}
        !          6198: K�?�K�?L@
        !          6199: L,�
        !          6200: LD$
        !          6201: LT}
        !          6202: MV?Mhd
        !          6203: M�?M�?�M�p
        !          6204: O p
        !          6205: O(@
        !          6206: O@�
        !          6207: OX$
        !          6208: On?O�?�PHp
        !          6209: P�
        !          6210: Q�$
        !          6211: RX
        !          6212: R�0
        !          6213: R�
        !          6214: S?�Sb?�Td$
        !          6215: T�$
        !          6216: UL&
        !          6217: ��U`
        !          6218: U|�
        !          6219: VO
        !          6220: V�W
        !          6221: V�n
        !          6222: V�2
        !          6223: W2? W�$
        !          6224: Xr?(Xx
        !          6225: Y^?0Y�&
        !          6226: �XY�? Y�? Z &
        !          6227: �XZ@w
        !          6228: Z�w
        !          6229: Z�&
        !          6230: �X[�
        !          6231: [? [Dp
        !          6232: [l
        !          6233: [x�
        !          6234: [�H
        !          6235: [��
        !          6236: [�
        !          6237: \b?(\f? \x
        !          6238: \�?8\�Y
        !          6239: \�?@\�Y
        !          6240: \�?H\�Y
        !          6241: \�Y
        !          6242: \�?P\�Y
        !          6243: ]Y
        !          6244: ]
        !          6245: ?X]Y
        !          6246: ]4Y
        !          6247: ]b?`]d
        !          6248: ]�^
        !          6249: ]�
        !          6250: ]��
        !          6251: ^^
        !          6252: ^|
        !          6253: ^�?h^�
        !          6254: ^��
        !          6255: ^�?X^�Y
        !          6256: _�
        !          6257: _P
        !          6258: _\�
        !          6259: _p&
        !          6260: ��_t
        !          6261: _|
        !          6262: _��
        !          6263: _�A
        !          6264: _�?x_�
        !          6265: `$&
        !          6266: ��`2?p`4
        !          6267: aZ?�at
        !          6268: a�p
        !          6269: a��
        !          6270: bH
        !          6271: b&?�b8
        !          6272: b@@
        !          6273: bT$
        !          6274: bd
        !          6275: b�p
        !          6276: c
        !          6277: c
        !          6278: c0
        !          6279: c�@
        !          6280: c�d
        !          6281: c�?�c�$
        !          6282: d
        !          6283: dPA
        !          6284: d�?�d�
        !          6285: d�?�d�?�e
        !          6286: e &
        !          6287: ��e,&
        !          6288: �e>?�e@
        !          6289: er?�ex
        !          6290: f$$
        !          6291: fH$
        !          6292: fd$
        !          6293: h|$
        !          6294: i&
        !          6295: �0ixp
        !          6296: i�?�i�d
        !          6297: kh$
        !          6298: l$
        !          6299: l�?�l�$
        !          6300: n��
        !          6301: n�$
        !          6302: n��
        !          6303: n�$
        !          6304: o`p
        !          6305: o�?�o�$
        !          6306: o�?�o�d
        !          6307: p�
        !          6308: pD^
        !          6309: pX�
        !          6310: pt^
        !          6311: p�$
        !          6312: p�&
        !          6313: �`q0�
        !          6314: qT�
        !          6315: qx&
        !          6316: q��
        !          6317: q�^
        !          6318: q�^
        !          6319: rhp
        !          6320: r�@
        !          6321: r�$
        !          6322: r�p
        !          6323: r�$
        !          6324: r�$
        !          6325: s&
        !          6326: �xsH
        !          6327: s<�
        !          6328: sL
        !          6329: s�$
        !          6330: s�&
        !          6331: �Hs�&
        !          6332: �`s�

        !          6333: s��
        !          6334: t0
        !          6335: tL
        !          6336: tx&
        !          6337: �Ht�&
        !          6338: �Ht�&
        !          6339: �Ht�?�t�
        !          6340: t��
        !          6341: u^
        !          6342: u?�u
        !          6343: uP^
        !          6344: u�?�u�p
        !          6345: u�?�u�
        !          6346: u�@
        !          6347: u�$
        !          6348: vp
        !          6349: v,&
        !          6350: �xv@H
        !          6351: v\�
        !          6352: vl
        !          6353: v�?�v�p
        !          6354: w@
        !          6355: w$
        !          6356: w,p
        !          6357: wT&
        !          6358: �xwhH
        !          6359: w��
        !          6360: w�
        !          6361: x
        !          6362: ?�x,�
        !          6363: xB?�xHY
        !          6364: x`Y
        !          6365: x|^
        !          6366: x�E
        !          6367: y(
        !          6368: y4�
        !          6369: y�?�y�?�y�
        !          6370: y�
        !          6371: z?�z
        !          6372: z?�z$
        !          6373: z,r
        !          6374: zD&
        !          6375: ��zP
        !          6376: zX
        !          6377: z`�
        !          6378: z|A
        !          6379: z�
        !          6380: z�r
        !          6381: z�?�z�
        !          6382: {"?�{$
        !          6383: {\�
        !          6384: {t&
        !          6385: ��{�
        !          6386: {�
        !          6387: |s
        !          6388: |2?�|8
        !          6389: |�?|�?}?}*?}8
        !          6390: }�?}�y
        !          6391: }�
        !          6392: }�?~Hp
        !          6393: ~R?~xH
        !          6394: ~�?�
        !          6395: f? �p
        !          6396: �?�?(��
        !          6397: ��
        !          6398: ��
        !          6399: ��
        !          6400: �H
        !          6401: �0�
        !          6402: �H$
        !          6403: �X�
        !          6404: �p�
        !          6405: ��$
        !          6406: ���
        !          6407: ���
        !          6408: ��$
        !          6409: ���
        !          6410: ���
        !          6411: �$
        !          6412: �
        !          6413: ?���
        !          6414: ���
        !          6415: ��?(���
        !          6416: ���
        !          6417: ��
        !          6418: �.?��?0��y
        !          6419: ��?8��
        !          6420: ��&
        !          6421: � ��
        !          6422: ��
        !          6423: ��&
        !          6424: �P���
        !          6425: �A
        !          6426: �&?�H&
        !          6427: �8�h
        !          6428: �p
        !          6429: �x�
        !          6430: �&
        !          6431: � �?@�
        !          6432: �R?H�T
        !          6433: ��?��&
        !          6434: � ��
        !          6435: ��
        !          6436: ��?�6?(�H�
        !          6437: �`�
        !          6438: ���
        !          6439: ��d
        !          6440: ���
        !          6441: ��1
        !          6442: ��&
        !          6443: �8�?P�\p
        !          6444: ��H
        !          6445: ��?��&
        !          6446: �8��$
        !          6447: ��&
        !          6448: �8�8&
        !          6449: �8���
        !          6450: � E
        !          6451: �@E
        !          6452: �XE
        !          6453: �xE
        !          6454: ��E
        !          6455: ��?X��
        !          6456: ��?`��
        !          6457: ��p
        !          6458: ��5
        !          6459: ��r
        !          6460: �
        !          6461: �
        !          6462: � A
        !          6463: �@5
        !          6464: �r?p�t
        !          6465: ��,
        !          6466: ��b
        !          6467: ��?��$
        !          6468: �B?��T
        !          6469: �~?���
        !          6470: ��a
        !          6471: ��?���
        !          6472: ��u
        !          6473: ��?���
        !          6474: ��?��y
        !          6475: �,�
        !          6476: �8�
        !          6477: �L�
        !          6478: �pp
        !          6479: �z?���$
        !          6480: ��d
        !          6481: ��d
        !          6482: �$
        !          6483: �&?��0
        !          6484: �>?��D
        !          6485: �Xd
        !          6486: �|{
        !          6487: ��^
        !          6488: ��~
        !          6489: ��h
        !          6490: �p
        !          6491: �
        !          6492: �Lp
        !          6493: �`p
        !          6494: ��~
        !          6495: ��
        !          6496: ��~
        !          6497: ��
        !          6498: �~
        !          6499: �?��`
        !          6500: �<
        !          6501: �T|
        !          6502: �pd
        !          6503: ��d
        !          6504: ��&
        !          6505: ��$
        !          6506: ��?���`
        !          6507: ��?���`
        !          6508: �
        !          6509: �?��@E
        !          6510: �xp
        !          6511: ��E
        !          6512: ��d
        !          6513: ��$
        !          6514: ��d
        !          6515: �$
        !          6516: �(p
        !          6517: �D~
        !          6518: ��
        !          6519: ��~
        !          6520: ��h
        !          6521: ��p
        !          6522: ��
        !          6523: �$~
        !          6524: �4h
        !          6525: �\p
        !          6526: �tp
        !          6527: ��
        !          6528: ��?���
        !          6529: ���
        !          6530: ���
        !          6531: ���
        !          6532: ��?x��
        !          6533: �?(�y
        !          6534: �$�
        !          6535: �.?`�4y
        !          6536: �D�
        !          6537: �N?h�Ty
        !          6538: �d�
        !          6539: �p�
        !          6540: ���
        !          6541: ��p
        !          6542: ��?����
        !          6543: ��?���
        !          6544: ���
        !          6545: ���
        !          6546: ��
        !          6547: �?0�>?��Hy
        !          6548: �X�
        !          6549: �d�
        !          6550: �x�
        !          6551: ��?���y
        !          6552: ���
        !          6553: ���
        !          6554: ���
        !          6555: ��?���
        !          6556: ���
        !          6557: ��
        !          6558: ��
        !          6559: �.?x�<y
        !          6560: �L�
        !          6561: �X�
        !          6562: �l�
        !          6563: �~?��
        !          6564: ���
        !          6565: ���
        !          6566: ���
        !          6567: ��?��
        !          6568: ���
        !          6569: ���
        !          6570: ��
        !          6571: �?� 
        !          6572: �0�
        !          6573: �<�
        !          6574: �P�
        !          6575: �b?�l
        !          6576: �|�
        !          6577: ���
        !          6578: ���
        !          6579: ��? ��
        !          6580: ���
        !          6581: ���
        !          6582: ���
        !          6583: ��?p�y
        !          6584: ��
        !          6585: �$�
        !          6586: �8�
        !          6587: �J?h�T
        !          6588: �d�
        !          6589: �p�
        !          6590: ���
        !          6591: ��?���y
        !          6592: ���
        !          6593: ���
        !          6594: ���
        !          6595: ���
        !          6596: ��?H��y
        !          6597: ��
        !          6598: �?P�y
        !          6599: �(�
        !          6600: �2?X�8y
        !          6601: �H�
        !          6602: �R?@�Xy
        !          6603: �h�
        !          6604: �r?8�xy
        !          6605: ��?���
        !          6606: ��p
        !          6607: �E
        !          6608: �2?x�8
        !          6609: �P5
        !          6610: ��?���
        !          6611: ��,
        !          6612: ��?���
        !          6613: ��u
        !          6614: ��&
        !          6615: ��?���
        !          6616: �:?�<
        !          6617: �P
        !          6618: �xa
        !          6619: ��|
        !          6620: ��?p��
        !          6621: ��?���
        !          6622: ��?���
        !          6623: ��?��
        !          6624: �
        !          6625: ?��
        !          6626: �?��
        !          6627: �"?��$
        !          6628: �f?���y
        !          6629: ��P
        !          6630: ��?��
        !          6631: ��?��
        !          6632: ���
        !          6633: �.?��4
        !          6634: �B?(�H
        !          6635: �Z?`�\
        !          6636: �r?h�x
        !          6637: ��?���
        !          6638: ��P
        !          6639: ��?0��?H��
        !          6640: �?P�
        !          6641: �?X�
        !          6642: �"?@�$
        !          6643: �2?8�4
        !          6644: �B?�L
        !          6645: �Z? �d
        !          6646: �r?��x
        !          6647: ��?���
        !          6648: ��p
        !          6649: ��b
        !          6650: �0~
        !          6651: �@h
        !          6652: �`~
        !          6653: �ph
        !          6654: ��?���
        !          6655: ��~
        !          6656: ��h
        !          6657: ��p
        !          6658: ��?��
        !          6659: �5
        !          6660: �N?��P
        !          6661: �\,
        !          6662: �r?��t
        !          6663: ��u
        !          6664: ��&
        !          6665: ��?���
        !          6666: ��$
        !          6667: ��?���
        !          6668: ��
        !          6669: �
        !          6670: �4
        !          6671: �@A
        !          6672: �P�
        !          6673: �XD
        !          6674: �j?��l
        !          6675: ��$
        !          6676: ��?���
        !          6677: ��?���
        !          6678: �
        !          6679: �,~
        !          6680: �<h
        !          6681: �T
        !          6682: �x~
        !          6683: ��h
        !          6684: ��
        !          6685: ��~
        !          6686: ��E
        !          6687: ��
        !          6688: �?��
        !          6689: �&?��(
        !          6690: �:?��<
        !          6691: ��^
        !          6692: �P�
        !          6693: �b?��lY
        !          6694: ��Y
        !          6695: ��^
        !          6696: ��E
        !          6697: �\^
        !          6698: �l�
        !          6699: ��?���
        !          6700: ��?���
        !          6701: ��?���
        !          6702: �^?�h/
        !          6703: �r?�xw
        !          6704: ��?��w
        !          6705: ��?��w
        !          6706: ��%
        !          6707: ��V
        !          6708: �([
        !          6709: �R? �T
        !          6710: �f?���
        !          6711: ��&&?���3��&&?���3��&&@0��3�&&@p�3�&&@�� 3�0&&B`�83�H&&B��P3�`&&B��h3�x&&B���3��&&B���3��&&C0��3��&&CP��3��&&D��3��&&D0��3�&&DP�3� &&Dp�(3�8&&E �@3�P&&E��X3�h&&H@�p3��&&N���3��&&O���3��&&R@��3��&&T���3��&&T���3��&&U0�3�&&V�3�(&&V �03�@&&V0�H3�X&&VP�`3�p&&W��x3��&&Y���3��&&[ ��3��&&_���3��&&`P��3��&&`���3�&&a��3�&&c�� 3�0&&d��83�H&&e��P3�`&&h0�h3�x&&k���3��&&n ��3��&&tp��3��&&u���3��&&v���3��&&xp��3�&&{��3� &&{��(3�8&&}�@3�P&&~ �X3�h&&� �p3��&&�p��3��&&����3��&&����3��&&����3��&&�`��3��&&���3�&&�`�3�(&&���03�@&&��H3�X&&���`3�p&&�@�x3�(�
        !          6712: �@t
        !          6713: �m
        !          6714: �Dl
        !          6715: �T�
        !          6716: �pm
        !          6717: ���
        !          6718: ��t
        !          6719: ��l
        !          6720: ��&&����3��&&�p��3��&&����3��
        !          6721: ��p
        !          6722: ��&&� ��3��&&����3�B?8�D
        !          6723: ��?(��
        !          6724: ��?0��
        !          6725: ��p
        !          6726: �&&�p�3�&&��� 3�0&&���83�H&&�p�P3�`&&���h3�x&&�@��3��&&����3��&&����3���
        !          6727: ���
        !          6728: �\
        !          6729: ��&&�p��3��&&�`��3��&&����3�&&���3� &&���(3�P�
        !          6730: �`�
        !          6731: �8&&� �@3�?@�P&&���X3�h&&�0�p3��&&�`��3��&&����3��?H��k
        !          6732: ˜k
        !          6733: ��&&�p��3��&&����3�L
        !          6734: ��&&���3Ð+
        !          6735: ��&&�p&3��?P���
        !          6736: &&&��&3&�&1� &�&1�p�hZ
        !          6737: ��Z
        !          6738: �LZ
        !          6739: ł?Xń&
        !          6740: �(Š&
        !          6741: �(�N?`�&
        !          6742: �(�\&
        !          6743: �(�&
        !          6744: �(�TB
        !          6745: �x&
        !          6746: �(��
        !          6747: �0E
        !          6748: �D&
        !          6749: �(ɴ&
        !          6750: �(�0�
        !          6751: �\E
        !          6752: �t&
        !          6753: �(��&
        !          6754: �(�d
        !          6755: �t&
        !          6756: �(���
        !          6757: ��&
        !          6758: �(�t�
        !          6759: ̠E
        !          6760: ��&
        !          6761: �(��
        !          6762: �d&
        !          6763: �(̀�
        !          6764: �B
        !          6765: �(&
        !          6766: �(΄�
        !          6767: Ψ&
        !          6768: �(��&
        !          6769: �p&(&&� &03&@&&Ā&H3&X&&Ġ&`3&p&&İ&x3&�&&�`&�3&�&&��&�3&�&&�p&�3�+
        !          6770: �L
        !          6771: &�&&��&�3�V?hӪ?p�0&
        !          6772: ����1
        !          6773: �"?x��1
        !          6774: ��
        !          6775: ل�
        !          6776: ��&
        !          6777: &��&
        !          6778: ��� &
        !          6779: &�F?h�t&
        !          6780: &ڄ&
        !          6781: ��ږ?h��&
        !          6782: &��&
        !          6783: ���&?h�h&
        !          6784: &�x&
        !          6785: ��&�&&�P&�3&&&&Ӡ&&3&&&&Ԡ&& 3&`&&`&&�&&`&&�&&`&&`&& `&&
        !          6786: `&&`&&`&&
`&&?&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&&`&& `&&!`&&"`&&#`&&$`&&%`&&&`&&'`&&(`&&)`&&*`&&+`&&,`&&-`&&.`&&/`&&0`&&1`&&1�g)&1�g'&2g&2g&2?&&2�=&&2�&&2�&&2�&&2�x&&2�&&&&&2�9&&2�;&&2�&&2�&&�p&2�&&�&36&&3&&ې&3&&��&3&&��&3 &&�&3(;&&3@6&&3H&&�0&3P6&&3Xx&�&3`&&�`&3hi&&3p&&�0&3x#&&3�.&&3�7&&3�v&&3�&@&3�&&3�v&&3�<&&3�&&�p&3�c&&3�i&&3�&&�x&3�&&ܐ&3�&&ܠ&3�&&��&3�&&��&3�&&�&4&&�(&4&&�H&4&Hp&4&&�X&4 &&�p&4(&&݈&40&&ݠ&48&&��&4@&&��&4H&&��&4P&&�&4X&&�&4`&&� &4h&&�0&4p�&&4x&&�@&4�&&�H&4�&&& &4�&&�h&4�&&�x&4�&&ހ&4�&&ސ&4�&&ޠ&4�&&ް&4�&H�&4�&&޸&4�&&��&4�&&�@&4�&&�p&4�&&�`&4�&&��&4�&&��&5&&��&5&&��&5&&��&5&&�&5 &&�&5(&&�&50&&�(&58&&�8&5@&&�@&5H&&�H&5P&&�P&5X&&�X&5`&&�h&5h&&�p&5p&&�x&5x&&߈&5�&&ߐ&5�&&ߠ&5�&&߸&5�&&��&5�&&��&5�&&��&5�&&��&5�&&�&5�&&�&5�&&�&5�&&�(&5�&&�8&5�&&�H&5�&&�X&5�&&�h&5�&&6&&�x&6&&��&6&&��&6&&��&6 &&�&6(&&�&60(&&68M&&6@'&&6HU&&6P&&��&6X&&��&6`&&6h&I�&6p;&&6�&0I�&6�&&��&6�&&&x&6�&0O�&6�o&&6�&&6�&&&�&6�&&��&6�&0O�&6�&1��&6�&&�&6�&1��&6�&&�&6�&&�&6�&&�&6�&&� &7&&�(&7&&�0&7&&�H&7&&�h&7 &&�&7(&&��&70&&��&78&1��&7@&&��&7H&&��&7P&&�&7X&&�(&7`&&&�&7h&1��&7p&&�&7x&&�0&7�&&�8&7�&&�@&7�&&�H&7�&&�X&7�&&�&7�&1��&7�&&&�&7�&&�&7�o&&7�&&�&7�&&�&7�&&�&7�&&�&7�&&��&7�&&��&7�&&�&8&&��&8&&��&8&&��&8&&� &8 &&�h&8(&&�&80&&�&88&&�&8@&&&�&8H&&�&8P&&��&8X&&�&8`&&��&8h&&�0&8p&&�p&8x&&�&8�&&��&8�&&�&8�&&�(&8�&&�h&8�&&�&8�&&�&8�&&��&8�&&�&8�&&� &8�&&�P&8�&&�&8�&&�$&8�&&�&8�&&�&8�&&��&8�&&��&9&&�&9&&� &9&&�&9&&�8&9 &&�x&9(&&�&90&&��&98&&�&9@&&�0&9H&&�`&9P&&�p&9X&&�&9`&&��&9h&&�&9p&&�(&9x&&�P&9�&&�&9�&&��&9�&&�&9�&&��&9�&&��&9�&&�&9�&&��&9�&&�(&9�&&�@&9�&&�`&9�&&�&9�&&��&9�&&�&9�&&�&9�&&��&9�&&��&:&&�&:&&� &:&&��&:&&�&: &&��&:(&&��&:0&&�(&:8&&�P&:@&&�&:H&&��&:P&&�&:X&&�@&:`&&��&:h&&�X&:p&&�p&:x&&�&:�&&�&:�&&�0&:�&&��&:�&&�&:�&&��&:�>&&:�&&��&:�&&��&:�&&��&:�&&�&:�&&�(&:�&&��&:�&&�H&:�&&�x&:�&1�&:��&&;C&&;&&�d&;&&�&;&1��&; &&�8����������0net_vethELF&&�@�@8&@&���p� ���|��"��b��&�!��8��}iXPx`�@�@�#�b�}d[x� �A(| ��i�IN�!�A(8`8!p�&|�N� �"���$| Px!A�,0��9i&x ||     P|     �8� 9)&B��HA`K���&�8`N� ```|��"�0����|kx�&����|�#x��(�!����?�C�     8`�A�$8!��&��������|�N� ``�+H肀88~�     �A(| ��i�IN�!�A(/�@���>��H�?�K����?�b�@�)� �A(| ��i�IN�!�A(8`K��l&�```|���������|�#x8��&�!��g���€(xd,x8�8�8�99 �~HQ`|dy@� 8!���x�&��������|�N� �>�b�P;����)�     �A(| ��i�IN�!�A(K���&�`|��A���a��|zx|�#x�&����?����������c������!���!�A��(��x�```�?� x&�}I}i.�*U`�@@�&y`�;�A�X����@A��/�|��A�@8���yk x� }yZ8�&I�x|��```�9k&� 9)&B��!t��p8`&���pHA`�?8     &x /��@��= =)��= /�A��88!���x�&�!���A���a��|���������������N� `�=�b�X�)� �A(| ��i�IN�!�A(K��\`8!�;���x�&�!���A���a��|���������������N� &�|�������(�&�!���?�     /�@� 8!�8`�&����|�N� `��8`&H!`�(/�A�(�?�)@�     �A(| ��i�IN�!�A(�0/�A�(�?�)@� �A(| ��i�IN�!�A(�/�A�(�?�)@� �A(| ��i�IN�!�A(�8/�A�(�?�)@� �A(| ��i�IN�!�A(�?8!�88`����� �&|�N� &�&|���������8`�&�a����(���������!�Q���/�A�,8!��&�a��������|���������N� `= ��8��? �?8` �)8� �A(| ��i�IN�!�A(�?8�8�08`&�(�)8� �A(| ��i�IN�!�A(�?�8``c��)0� �A(| ��i�IN�!�A(�0/��8A����(/�A���?/�A��/�A��8�<��P��y&,`&`cx8&y��@8`&;�H&�`|dy@�&�;�?��c�c����x``�?@��8`&| �|     �*�&t;���p�pH&u`��@����;8!�8&8`�a������     �&�������|�����N� �?�b�`�)� �A(| ��i�IN�!�A(�(/�A�(�?�)@� �A(| ��i�IN�!�A(�0/�A�(�?�)@� �A(| ��i�IN�!�A(�/�A�(�?�)@� �A(| ��i�IN�!�A(�88`��/�A��|�?|x�)@� �A(| ��i�IN�!�A(8`��K��L�?�b�h�)� �A(| ��i�IN�!�A(K��&�D"N� xf��8`X8�8�&D"N� }H�H-}H�,M� = �a)X��|dH�8�&��N� 8`��= �a)X����|0@L� 8`T8�D"= �a)X��8`�i(M� 8`������N� ���|dx8`&D"N� 9`}*Kx} Cx|�;x|�3x|�+x|�#x|dx8`& D"N� Module size (%llu bytes) is too big!
        !          6787: IBM,l-lanveth: netdevice not supported
1.1       root     6788: veth: Error %ld sending packet !
                   6789: veth: Dropping too big packet [%d bytes]
                   6790: veth: Failed to allocate memory !
                   6791: veth: Error %ld registering interface !
1.1.1.2 ! root     6792: &���p�X�@�������&����&����������`����������p�� ��p��
        !          6793: ��        �� ���
        !          6794: �
        !          6795: 0�
        !          6796: `�
        !          6797: �GCC: (GNU) 4.4.5.symtab.strtab.shstrtab.rela.code.branch_lt.rela.got.bss.comment &�����   &&&���6&�� p1H&P ;��`@&0�&&�I&&�&h
        !          6798:         {&&������&�p&�      &�(�(�4���pA&�P&��\&� �p&��__bss_end.hv_hascharveth_module_init__bss_start__module_end__module_startmodule_inithv_send_logical_lanhv_generic�&?�*?�N?��?��/$��
        !          6799: �&& �3�&?0�&?(�&f?8�&�?H�&�?@�?(�4

        !          6800: �f?P��?(��
        !          6801: ��?X�j?(��
        !          6802: ��?(�
        !          6803: �T
        !          6804: ��?`��?h�
        !          6805: �&&��
        !          6806: �&&p�
        !          6807: �&&X�
        !          6808: �&&@�&&�&&��3�(&&&�03�@&&&��H3�X&&��`3�p&&`�x3��&&���3��
        !          6809: ��H� H� H� "H� BH� FH��    &��
        !          6810: &��&��&&     ���&��&��&&
        !          6811: ���&&        ���&& ���&��&&
        !          6812: ��&&
        !          6813: 0�&&
        !          6814: `�&&
        !          6815: ���������<�<](ide.fs1 encode-int s" #address-cells" property
1.1       root     6816: 0 encode-int s" #size-cells" property
                   6817: : decode-unit  1 hex-decode-unit ;
                   6818: : encode-unit  1 hex-encode-unit ;
                   6819: 0 VALUE >ata                                 \ base address for command-block
                   6820: 0 VALUE >ata1                                \ base address for control block
                   6821: true VALUE no-timeout                        \ flag that no timeout occured
                   6822: 0c  CONSTANT #cdb-bytes                      \ command descriptor block (12 bytes)
                   6823: 800 CONSTANT atapi-size
                   6824: 200 CONSTANT ata-size
                   6825: : ata-ctrl! 2 >ata1 + io-c! ;                      \ device control reg
                   6826: : ata-astat@ 2 >ata1 + io-c@ ;                     \ read alternate status
                   6827: : ata-data@ 0 >ata + io-w@ ;                       \ data reg
                   6828: : ata-data! 0 >ata + io-w! ;                       \ data reg
                   6829: : ata-err@  1 >ata + io-c@ ;                       \ error reg
                   6830: : ata-feat! 1 >ata + io-c! ;                       \ feature reg
                   6831: : ata-cnt@  2 >ata + io-c@ ;                       \ sector count reg
                   6832: : ata-cnt!  2 >ata + io-c! ;                       \ sector count reg
                   6833: : ata-lbal! 3 >ata + io-c! ;                       \ lba low reg
                   6834: : ata-lbal@ 3 >ata + io-c@ ;                       \ lba low reg
                   6835: : ata-lbam! 4 >ata + io-c! ;                       \ lba mid reg
                   6836: : ata-lbam@ 4 >ata + io-c@ ;                       \ lba mid reg
                   6837: : ata-lbah! 5 >ata + io-c! ;                       \ lba high reg
                   6838: : ata-lbah@ 5 >ata + io-c@ ;                       \ lba high reg
                   6839: : ata-dev!  6 >ata + io-c! ;                       \ device reg
                   6840: : ata-dev@  6 >ata + io-c@ ;                       \ device reg
                   6841: : ata-cmd!  7 >ata + io-c! ;                       \ command reg
                   6842: : ata-stat@ 7 >ata + io-c@ ;                       \ status reg
                   6843: 00 CONSTANT cmd#nop                                \ ATA and ATAPI
                   6844: 08 CONSTANT cmd#device-reset                       \ ATAPI only (mandatory)
                   6845: 20 CONSTANT cmd#read-sector                        \ ATA and ATAPI
                   6846: 90 CONSTANT cmd#execute-device-diagnostic          \ ATA and ATAPI
                   6847: a0 CONSTANT cmd#packet                             \ ATAPI only (mandatory)
                   6848: a1 CONSTANT cmd#identify-packet-device             \ ATAPI only (mandatory)
                   6849: ec CONSTANT cmd#identify-device                    \ ATA and ATAPI
                   6850: : set-regs ( n -- )
                   6851: dup
                   6852: 01 and                                    \ only Chan 0 or Chan 1 allowed
                   6853: 3 lshift dup 10 + config-l@ -4 and to >ata
                   6854: 14 + config-l@ -4 and to >ata1
                   6855: 02 ata-ctrl!                              \ disable interrupts
                   6856: 02 and
                   6857: IF
                   6858: 10
                   6859: ELSE
                   6860: 00
                   6861: THEN
                   6862: ata-dev!
                   6863: ;
                   6864: ata-size VALUE block-size
                   6865: 80000    VALUE max-transfer            \ Arbitrary, really
                   6866: CREATE sector d# 512 allot
                   6867: CREATE packet-cdb #cdb-bytes allot
                   6868: CREATE return-buffer atapi-size allot
                   6869: scsi-open                             \ add scsi functions
                   6870: : show-regs
                   6871: cr
                   6872: cr ." alt. Status: " ata-astat@ .
                   6873: cr ." Status     : " ata-stat@ .
                   6874: cr ." Device     : " ata-dev@ .
                   6875: cr ." Error-Reg  : " ata-err@ .
                   6876: cr ." Sect-Count : " ata-cnt@ .
                   6877: cr ." LBA-Low    : " ata-lbal@ .
                   6878: cr ." LBA-Med    : " ata-lbam@ .
                   6879: cr ." LBA-High   : " ata-lbah@ .
                   6880: ;
                   6881: : status-check               ( -- )
                   6882: ata-stat@
                   6883: dup   
                   6884: 01 and                                    \ is 'check' flag set ?
                   6885: IF
                   6886: cr
                   6887: ."    - ATAPI-Status: " .
                   6888: ata-err@                               \ retrieve sense code
                   6889: dup
                   6890: 60 =                                   \ sense code = 6 ?
                   6891: IF
                   6892: ." ( media changed or reset )"      \ 'unit attention'
                   6893: drop                                \ drop err-reg content
                   6894: ELSE
                   6895: dup
                   6896: ." (Err : " .                       \ show err-reg content
                   6897: space
                   6898: rshift 4 .sense-text                \ show text string
                   6899: 29 emit
                   6900: THEN
                   6901: cr
                   6902: ELSE
                   6903: drop                                   \ remove unused status      
                   6904: THEN      
                   6905: ;
                   6906: : wait-for-ready
                   6907: get-msecs                                 \ start timer
                   6908: BEGIN
                   6909: ata-stat@ 80 and 0<>                   \ busy flag still set ?
                   6910: no-timeout and
                   6911: WHILE                                  \ yes
                   6912: dup get-msecs swap
                   6913: -                                   \ calculate timer difference
                   6914: FFFF AND                            \ reduce to 65.5 seconds
                   6915: d# 5000 >                           \ difference > 5 seconds ?
                   6916: IF
                   6917: false to no-timeout
                   6918: THEN
                   6919: REPEAT
                   6920: drop
                   6921: ;
                   6922: : wait-for-status          ( val mask -- )
                   6923: get-msecs                                 \ initial timer value (start)
                   6924: >r
                   6925: BEGIN
                   6926: 2dup                                   \ val mask
                   6927: ata-stat@ and <>                       \ expected status ?
                   6928: no-timeout and                         \ and no timeout ?
                   6929: WHILE      
                   6930: get-msecs r@ -                         \ calculate timer difference
                   6931: FFFF AND                               \ mask-off overflow bits
                   6932: d# 5000 >                              \ 5 seconds exceeded ?
                   6933: IF
                   6934: false to no-timeout                 \ set global flag
                   6935: THEN      
                   6936: REPEAT                  
                   6937: r>                                        \ clean return stack
                   6938: 3drop
                   6939: ;
                   6940: : cut-string      ( saddr nul -- )
                   6941: swap
                   6942: over +
                   6943: swap   
                   6944: 1 rshift                                  \ bytecount -> wordcount
                   6945: 0 do
                   6946: /w -
                   6947: dup               ( addr -- addr addr )
                   6948: w@                ( addr addr -- addr nuw )
                   6949: dup               ( addr nuw -- addr nuw nuw )
                   6950: 2020 =
                   6951: IF
                   6952: drop
                   6953: 0 
                   6954: ELSE
                   6955: LEAVE         
                   6956: THEN
                   6957: over         
                   6958: w!
                   6959: LOOP
                   6960: drop
                   6961: drop
                   6962: ; 
                   6963: : show-model          ( dev# chan# -- )
                   6964: 2dup
                   6965: ."    CH " .                  \ channel 0 / 1
                   6966: 0= IF ." / MA"                \ Master / Slave
                   6967: ELSE  ." / SL"
                   6968: THEN
                   6969: swap
                   6970: 2 * + ."  (@" . ." ) : "      \ device number
                   6971: sector 1 +
                   6972: c@
                   6973: 80 AND 0=
                   6974: IF
                   6975: ." ATA-Drive    "
                   6976: ELSE
                   6977: ." ATAPI-Drive  "
                   6978: THEN
                   6979: 22 emit                       \ start string display with "
                   6980: sector d# 54 +                \ string starts 54 bytes from buffer start
                   6981: dup
                   6982: d# 40                         \ and is 40 chars long
                   6983: cut-string                    \ remove all trailing spaces
                   6984: BEGIN
                   6985: dup
                   6986: w@
                   6987: wbflip
                   6988: wbsplit
                   6989: dup 0<>                    \ first char
                   6990: IF                   
                   6991: emit
                   6992: dup 0<>                 \ second char
                   6993: IF
                   6994: emit
                   6995: wa1+                 \ increment address for next
                   6996: false
                   6997: ELSE                    \ second char = EndOfString
                   6998: drop
                   6999: true
                   7000: THEN   
                   7001: ELSE                       \ first char = EndOfString
                   7002: drop
                   7003: drop
                   7004: true
                   7005: THEN
                   7006: UNTIL                         \ end of string detected
                   7007: drop
                   7008: 22 emit                       \ end string display
                   7009: sector c@                     \ get lower byte of first doublet
                   7010: 80 AND                        \ check bit 7
                   7011: IF
                   7012: ."  (removable media)"
                   7013: THEN
                   7014: sector 1 +
                   7015: c@
                   7016: 80 AND 0= IF                  \ is this an ATA drive ?
                   7017: sector d# 120 +            \ get word 60 + 61
                   7018: rl@-le                     \ read 32-bit as little endian value
                   7019: d# 512                     \ standard ATA block-size
                   7020: swap
                   7021: .capacity-text ( block-size #blocks -- )
                   7022: THEN
                   7023: sector d# 98 +               \ goto word 49
                   7024: w@
                   7025: wbflip
                   7026: 200 and 0= IF cr ."    ** LBA is not supported " THEN   
                   7027: sector c@                     \ get lower byte of first doublet
                   7028: 03 AND 01 =                   \ we use 12-byte packet commands (=00b)
                   7029: IF
                   7030: cr ."    packet size = 16 ** not supported ! **"
                   7031: THEN
                   7032: no-timeout not                \ any timeout occured so far ?
                   7033: IF
                   7034: cr   ."    ** timeout **"
                   7035: THEN
                   7036: ;
                   7037: : pio-sector ( addr -- )  100 0 DO ata-data@
                   7038: over w! wa1+ LOOP drop ;
                   7039: : pio-sector ( addr -- ) 
                   7040: wait-for-ready pio-sector ;
                   7041: : pio-sectors ( n addr -- )  swap 0 ?DO dup pio-sector 200 + LOOP drop ;
                   7042: : lba!  lbsplit   
                   7043: 0f and 40 or                  \ always set LBA-mode + LBA (27..24)
                   7044: ata-dev@ 10 and or            \ add current device-bit (DEV)
                   7045: ata-dev!                      \ set LBA (27..24)
                   7046: ata-lbah!                     \ set LBA (23..16)
                   7047: ata-lbam!                     \ set LBA (15..8)
                   7048: ata-lbal!                     \ set LBA (7..0)
                   7049: ;
                   7050: : read-sectors ( lba count addr -- ) 
                   7051: >r dup >r ata-cnt! lba! 20 ata-cmd! r> r> pio-sectors ;
                   7052: : read-sectors ( lba count addr dev-nr -- )
                   7053: set-regs             ( lba count addr ) \ Set ata regs 
                   7054: BEGIN >r dup 100 > WHILE
                   7055: over 100 r@ read-sectors
                   7056: >r 100 + r> 100 - r> 20000 + REPEAT
                   7057: r> read-sectors
                   7058: ;
                   7059: : ata-read-blocks                ( addr block# #blocks dev# -- #read )
                   7060: swap dup >r swap >r rot r>    ( addr block# #blocks dev # R: #blocks )
                   7061: read-sectors r>               ( R: #read )
                   7062: ;    
                   7063: : set-lba                              ( block-length -- )
                   7064: lbsplit                             ( quad -- b1.lo b2 b3 b4.hi )
                   7065: drop                                \ skip upper two bytes
                   7066: drop
                   7067: ata-lbah!
                   7068: ata-lbam!
                   7069: ;
                   7070: : read-pio-block                        ( buff-addr -- buff-addr-new )
                   7071: ata-lbah@ 8 lshift                  \ get block length High
                   7072: ata-lbam@ or                        \ get block length Low
                   7073: 1 rshift                            \ bcount -> wcount
                   7074: dup
                   7075: 0> IF                               \ any data to transfer?
                   7076: 0 DO                             \ words to read
                   7077: dup                           \ buffer-address
                   7078: ata-data@ swap w!             \ write 16-bits
                   7079: wa1+                          \ address of next entry
                   7080: LOOP
                   7081: ELSE
                   7082: drop                          ( buff-addr wcount -- buff-addr )
                   7083: THEN
                   7084: wait-for-ready
                   7085: ;
                   7086: : send-atapi-packet                    ( req-buffer -- )
                   7087: >r                                  (   R: req-buffer )
                   7088: atapi-size set-lba                  \ set regs to length limit
                   7089: 00 ata-feat!
                   7090: cmd#packet ata-cmd!                 \ A0 = ATAPI packet command
                   7091: 48 C8  wait-for-status     ( val mask -- )  \ BSY:0 DRDY:1 DRQ:1
                   7092: 6 0  do
                   7093: packet-cdb i 2 * +                \ transfer command block (12 bytes)
                   7094: w@
                   7095: ata-data!                        \ 6 doublets PIO transfer to device
                   7096: loop                             \ copy packet to data-reg
                   7097: status-check                        ( -- ) \ status err bit set ? -> display
                   7098: wait-for-ready                      ( -- ) \ busy released ?
                   7099: BEGIN
                   7100: ata-stat@ 08 and 08 = WHILE         \ Data-Request-Bit set ?
                   7101: r>                               \ get last target buffer address
                   7102: read-pio-block                   \ only if from device requested
                   7103: >r                               \ start of next block
                   7104: REPEAT
                   7105: r>                                  \ original value
                   7106: drop                                \ return clean
                   7107: ;   
                   7108: : atapi-packet-io                      ( -- )
                   7109: return-buffer atapi-size erase      \ clear return buffer
                   7110: return-buffer send-atapi-packet     \ send 'packet-cdb' , get 'return-buffer'
                   7111: ;
                   7112: : atapi-test ( -- true|false )
                   7113: packet-cdb scsi-build-test-unit-ready     \ command-code: 00
                   7114: atapi-packet-io                           ( )  \ send CDB, get return-buffer
                   7115: ata-stat@ 1 and IF false ELSE true THEN
                   7116: ;
                   7117: : atapi-sense ( -- ascq asc sense-key )
                   7118: d# 252 packet-cdb scsi-build-request-sense ( alloc-len cdb -- )
                   7119: atapi-packet-io                           ( )  \ send CDB, get return-buffer
                   7120: return-buffer scsi-get-sense-data         ( cdb-addr -- ascq asc sense-key )
                   7121: ;
                   7122: : atapi-read-blocks                    ( address block# #blocks dev# -- #read-blocks )
                   7123: set-regs                            ( address block# #blocks )
                   7124: dup >r                              ( address block# #blocks )
                   7125: packet-cdb scsi-build-read-10       ( address block# #blocks cdb -- )
                   7126: send-atapi-packet                   ( address -- )
                   7127: r>                                  \ return requested number of blocks
                   7128: ;
                   7129: : atapi-read-capacity                        ( -- )
                   7130: packet-cdb scsi-build-read-cap-10         \ fill block with command
                   7131: atapi-packet-io                           ( )  \ send CDB, get return-buffer
                   7132: return-buffer scsi-get-capacity-10        ( cdb -- block-size #blocks )
                   7133: .capacity-text                            ( block-size #blocks -- )
                   7134: status-check                              ( -- )
                   7135: ;
                   7136: : atapi-read-capacity-ext                    ( -- )
                   7137: packet-cdb scsi-build-read-cap-16         \ fill block with command
                   7138: atapi-packet-io                           ( )  \ send CDB, get return-buffer
                   7139: return-buffer scsi-get-capacity-16        ( cdb -- block-size #blocks )
                   7140: .capacity-text                            ( block-size #blocks -- )
                   7141: status-check                              ( -- )
                   7142: ;
                   7143: : wait-for-media-ready                 ( -- true|false )
                   7144: get-msecs                                 \ initial timer value (start)
                   7145: >r
                   7146: BEGIN
                   7147: atapi-test                             \ unit ready? false if not      
                   7148: not
                   7149: no-timeout and
                   7150: WHILE
                   7151: atapi-sense  ( -- ascq asc sense-key )
                   7152: 02 =                                \ sense key 2 = media error
                   7153: IF                                  \ check add. sense code
                   7154: 3A =                             \ asc: device not ready ?
                   7155: IF
                   7156: false to no-timeout
                   7157: ."  empty (" . 29 emit        \ show asc qualifier
                   7158: ELSE
                   7159: drop                          \ discard asc qualifier
                   7160: THEN                             \ medium not present, abort waiting
                   7161: ELSE
                   7162: drop                             \ discard asc
                   7163: drop                             \ discard ascq
                   7164: THEN
                   7165: get-msecs r@ -                      \ calculate timer difference
                   7166: FFFF AND                            \ mask-off overflow bits
                   7167: d# 5000 >                           \ 5 seconds exceeded ?
                   7168: IF
                   7169: false to no-timeout              \ set global flag
                   7170: THEN      
                   7171: REPEAT
                   7172: r>
                   7173: drop
                   7174: no-timeout
                   7175: ;
                   7176: 2 CONSTANT #chan 
                   7177: 2 CONSTANT #dev
                   7178: : #totaldev #dev #chan * ;
                   7179: CREATE read-blocks-xt #totaldev cells allot read-blocks-xt #totaldev cells erase
                   7180: : dev-read-blocks  ( address block# #blocks dev# -- #read-blocks )
                   7181: dup cells read-blocks-xt + @ execute
                   7182: ;
                   7183: : read-ident  ( -- true|false )
                   7184: false
                   7185: 00 ata-lbal!                              \ clear previous signature
                   7186: 00 ata-lbam!
                   7187: 00 ata-lbah!
                   7188: cmd#identify-device ata-cmd! wait-for-ready \ first try ATA, ATAPI aborts command
                   7189: ata-stat@ CF and 48 =
                   7190: IF
                   7191: drop true                                          \ cmd accepted, this is a ATA
                   7192: d# 512 set-lba                                     \ set LBA to sector-length
                   7193: ELSE                                                  \ ATAPI sends signature instead
                   7194: ata-lbam@ 14 = IF                                  \ cylinder low  = 14 ?
                   7195: ata-lbah@ EB = IF                               \ cylinder high = EB ?
                   7196: cmd#device-reset ata-cmd! wait-for-ready     \ only supported by ATAPI
                   7197: cmd#identify-packet-device ata-cmd! wait-for-ready                     \ first try ata
                   7198: ata-stat@ CF and 48 = IF               
                   7199: drop true                                 \ replace flag
                   7200: THEN
                   7201: THEN
                   7202: THEN
                   7203: THEN
                   7204: dup IF
                   7205: ata-stat@ 8 AND IF                        \ data requested (as expected) ?      
                   7206: sector read-pio-block 
                   7207: drop                                   \ discard address end 
                   7208: ELSE
                   7209: drop false
                   7210: THEN
                   7211: THEN
                   7212: no-timeout not IF                            \ check without any timeout ?
                   7213: drop
                   7214: false                                     \ no, detection discarded
                   7215: THEN
                   7216: ;
                   7217: scsi-close                             \ remove scsi commands from word list
                   7218: : find-disks      ( -- )   
                   7219: #chan 0 DO                                      \ check 2 channels (primary & secondary)
                   7220: #dev 0 DO                                    \ check 2 devices per channel (master / slave)
                   7221: i 2 * j +
                   7222: set-regs                                  \ set base address and dev-register for register access
                   7223: ata-stat@ 7f and 7f <>                    \ Check, if device is connected
                   7224: IF
                   7225: true to no-timeout                     \ preset timeout-flag
                   7226: read-ident        ( -- true|false )
                   7227: IF
                   7228: i j show-model                      \ print manufacturer + device string
                   7229: sector 1+ c@ C0 and 80 =            \ Check for ata or atapi
                   7230: IF
                   7231: wait-for-media-ready             \ wait up to 5 sec if not ready
                   7232: no-timeout and
                   7233: IF
                   7234: atapi-read-capacity
                   7235: atapi-size to block-size      \ ATAPI: 2048 bytes
                   7236: 80000 to max-transfer
                   7237: ['] atapi-read-blocks i 2 * j + cells read-blocks-xt + !
                   7238: s" cdrom" strdup i 2 * j + s" generic-disk.fs" included
                   7239: ELSE
                   7240: ."  -"                        \ show hint for not registered
                   7241: THEN    
                   7242: ELSE
                   7243: ata-size to block-size           \ ATA: 512 bytes
                   7244: 80000 to max-transfer
                   7245: ['] ata-read-blocks i 2 * j + cells read-blocks-xt + !
                   7246: s" disk" strdup i 2 * j + s" generic-disk.fs" included
                   7247: THEN
                   7248: cr
                   7249: THEN    
                   7250: THEN
                   7251: i 2 * j + 200 + cp
                   7252: LOOP
                   7253: LOOP
                   7254: ;
                   7255: find-disks
                   7256: ��������)`)%0fbuffer.fs0 VALUE line#
                   7257: 0 VALUE column#
                   7258: false VALUE inverse?
                   7259: false VALUE inverse-screen?
                   7260: 18 VALUE #lines
                   7261: 50 VALUE #columns
                   7262: false VALUE cursor
                   7263: false VALUE saved-cursor
                   7264: defer draw-character   \ 2B inited by display driver
                   7265: defer reset-screen     \ 2B inited by display driver
                   7266: defer toggle-cursor    \ 2B inited by display driver
                   7267: defer erase-screen     \ 2B inited by display driver
                   7268: defer blink-screen     \ 2B inited by display driver
                   7269: defer invert-screen    \ 2B inited by display driver
                   7270: defer insert-characters        \ 2B inited by display driver
                   7271: defer delete-characters        \ 2B inited by display driver
                   7272: defer insert-lines     \ 2B inited by display driver
                   7273: defer delete-lines     \ 2B inited by display driver
                   7274: defer draw-logo                \ 2B inited by display driver
                   7275: : nop-toggle-cursor ( nop ) ;
                   7276: ' nop-toggle-cursor to toggle-cursor
                   7277: : (cursor-off) ( -- ) cursor dup to saved-cursor
                   7278: IF toggle-cursor false to cursor THEN ;
                   7279: : (cursor-on) ( -- ) cursor dup to saved-cursor
                   7280: 0= IF toggle-cursor true to cursor THEN ;
                   7281: : restore-cursor ( -- ) saved-cursor dup cursor
                   7282: <> IF toggle-cursor to cursor ELSE drop THEN ;
                   7283: ' (cursor-off) to cursor-off
                   7284: ' (cursor-on) to cursor-on
                   7285: false VALUE esc-on
                   7286: false VALUE csi-on
                   7287: defer esc-process
                   7288: 0 VALUE esc-num-parm
                   7289: 0 VALUE esc-num-parm2
                   7290: 0 VALUE saved-line#
                   7291: 0 VALUE saved-column#
                   7292: : get-esc-parm ( default -- value )
                   7293: esc-num-parm dup 0> IF nip ELSE drop THEN 0 to esc-num-parm ;
                   7294: : get-esc-parm2 ( default -- value )
                   7295: esc-num-parm2 dup 0> IF nip ELSE drop THEN 0 to esc-num-parm2 ;
                   7296: : set-esc-parm ( newdigit -- ) [char] 0 - esc-num-parm a * + to esc-num-parm ;
                   7297: : reverse-cursor ( oldpos -- newpos) dup IF 1 get-esc-parm - THEN ;
                   7298: : advance-cursor ( bound oldpos -- newpos) tuck > IF 1 get-esc-parm + THEN ;
                   7299: : erase-in-line #columns column# - dup 0> IF delete-characters ELSE drop THEN ;
                   7300: : terminal-line++ ( -- )
                   7301: line# 1+ dup #lines = IF 1- 0 to line# 1 delete-lines THEN
                   7302: to line#
                   7303: ;
                   7304: 0 VALUE dang
                   7305: 0 VALUE blipp
                   7306: : ansi-esc ( char -- )
                   7307: csi-on IF
                   7308: dup [char] 0 [char] 9 between IF set-esc-parm
                   7309: ELSE CASE
                   7310: [char] A OF line# reverse-cursor to line# ENDOF
                   7311: [char] B OF #lines line# advance-cursor to line# ENDOF
                   7312: [char] C OF #columns column# advance-cursor to column# ENDOF
                   7313: [char] D OF column# reverse-cursor to column# ENDOF
                   7314: [char] E OF ( FIXME: Cursor Next Line - No idea what does it mean )
                   7315: #lines line# advance-cursor to line#
                   7316: ENDOF
                   7317: [char] f OF
                   7318: 1 get-esc-parm2 to line# column# get-esc-parm to column#
                   7319: ENDOF
                   7320: [char] H OF
                   7321: 1 get-esc-parm2 to line# column# get-esc-parm to column#
                   7322: ENDOF
                   7323: [char] ; OF 0 get-esc-parm to esc-num-parm2 ENDOF
                   7324: [char] J OF
                   7325: #lines line# - dup 0> IF
                   7326: line# 1+ to line# delete-lines line# 1- to line#
                   7327: ELSE drop THEN
                   7328: erase-in-line
                   7329: ENDOF
                   7330: [char] K OF erase-in-line ENDOF
                   7331: [char] L OF 1 get-esc-parm insert-lines ENDOF
                   7332: [char] M OF 1 get-esc-parm delete-lines ENDOF
                   7333: [char] @ OF 1 get-esc-parm insert-characters ENDOF
                   7334: [char] P OF 1 get-esc-parm delete-characters ENDOF
                   7335: [char] m OF 0 get-esc-parm 0<> to inverse? ENDOF
                   7336: [char] p OF inverse-screen? IF false to inverse-screen?
                   7337: inverse? 0= to inverse? invert-screen
                   7338: THEN
                   7339: ENDOF
                   7340: [char] q OF inverse-screen? 0= IF true to inverse-screen?
                   7341: inverse? 0= to inverse? invert-screen
                   7342: THEN
                   7343: ENDOF
                   7344: [char] u OF saved-line# to line# saved-column# to column# ENDOF
                   7345: dup dup to dang OF blink-screen ENDOF
                   7346: ENDCASE false to csi-on
                   7347: false to esc-on 0 to esc-num-parm 0 to esc-num-parm2
                   7348: THEN
                   7349: ELSE CASE
                   7350: [char] 7 OF line# to saved-line# column# to saved-column# ENDOF
                   7351: [char] 8 OF saved-line# to line# saved-column# to column# ENDOF
                   7352: [char] [ OF true to csi-on ENDOF
                   7353: dup dup OF false to esc-on to blipp ENDOF
                   7354: ENDCASE
                   7355: csi-on 0= IF false to esc-on THEN 0 to esc-num-parm 0 to esc-num-parm2
                   7356: THEN
                   7357: ;
                   7358: ' ansi-esc to esc-process
                   7359: CREATE twtracebuf 4000 allot twtracebuf 4000 erase
                   7360: twtracebuf VALUE twbp
                   7361: 0 VALUE twbc
                   7362: : twtrace
                   7363: twbc 4000 = IF 0 to twbc twtracebuf to twbp THEN
                   7364: dup twbp c! twbp 1+ to twbp twbc 1+ to twbc
                   7365: ;
                   7366: : terminal-write ( addr len -- actual-len )
                   7367: cursor-off
                   7368: tuck bounds ?DO i c@
                   7369: twtrace
                   7370: esc-on IF esc-process
                   7371: ELSE CASE
                   7372: 1B OF true to esc-on ENDOF
                   7373: carret OF 0 to column# ENDOF
                   7374: linefeed OF terminal-line++ ENDOF
                   7375: bell OF blink-screen ENDOF
                   7376: 9 ( TAB ) OF column# 7 + -8 and dup #columns < IF
                   7377: to column#
                   7378: ELSE drop THEN
                   7379: ENDOF
                   7380: B ( VT ) OF line# ?dup IF 1- to line# THEN ENDOF
                   7381: C ( FF ) OF 0 to line# 0 to column# erase-screen ENDOF
                   7382: bs OF  column# 1- dup 0< IF
                   7383: line# IF
                   7384: line# 1- to line#
                   7385: drop #columns 1-
                   7386: ELSE drop column#
                   7387: THEN
                   7388: THEN
                   7389: to column# ( bl draw-character )
                   7390: ENDOF
                   7391: dup OF
                   7392: i c@ draw-character
                   7393: column# 1+ dup #columns >= IF
                   7394: drop 0 terminal-line++
                   7395: THEN
                   7396: to column#
                   7397: ENDOF
                   7398: ENDCASE
                   7399: THEN
                   7400: LOOP
                   7401: restore-cursor
                   7402: ;
                   7403: 0 VALUE char-height
                   7404: 0 VALUE char-width
                   7405: 0 VALUE fontbytes
                   7406: CREATE display-emit-buffer 20 allot
                   7407: defer dis-old-emit
                   7408: ' emit behavior to dis-old-emit
                   7409: : display-write terminal-write ;
                   7410: : display-emit dup dis-old-emit display-emit-buffer tuck c! 1 terminal-write drop ;
                   7411: : is-install ( 'open -- )
                   7412: s" defer vendor-open to vendor-open" eval
                   7413: s" : open deadbeef vendor-open dup deadbeef = IF drop true ELSE nip THEN ;" eval
                   7414: s" defer write ' display-write to write" eval
                   7415: s" : draw-logo ['] draw-logo CATCH IF 2drop 2drop THEN ;" eval
                   7416: s" : reset-screen ['] reset-screen CATCH drop ;" eval
                   7417: ;
                   7418: : is-remove ( 'close -- )
                   7419: s" defer close to close" eval
                   7420: ;
                   7421: : is-selftest ( 'selftest -- )
                   7422: s" defer selftest to selftest" eval
                   7423: ;
                   7424: STRUCT
                   7425: cell FIELD font>addr
                   7426: cell FIELD font>width
                   7427: cell FIELD font>height
                   7428: cell FIELD font>advance
                   7429: cell FIELD font>min-char
                   7430: cell FIELD font>#glyphs
                   7431: CONSTANT /font
                   7432: CREATE default-font-ctrblk /font allot default-font-ctrblk
                   7433: dup font>addr 0 swap !
                   7434: dup font>width 8 swap !
                   7435: dup font>height -10 swap !
                   7436: dup font>advance 1 swap !
                   7437: dup font>min-char 20 swap !
                   7438: font>#glyphs 7f swap !
                   7439: : display-default-font ( str len -- )
                   7440: romfs-lookup dup 0= IF drop EXIT THEN
                   7441: 600 <> IF ." Only support 60x8x16 fonts ! " drop EXIT THEN
                   7442: default-font-ctrblk font>addr !
                   7443: ;
                   7444: s" default-font.bin" display-default-font
                   7445: : .scan-lines ( height -- scanlines ) dup 0>= IF 1- ELSE negate THEN ;
                   7446: : set-font ( addr width height advance min-char #glyphs -- )
                   7447: default-font-ctrblk /font + /font 0
                   7448: DO
                   7449: 1 cells - dup >r ! r> 1 cells
                   7450: +LOOP drop
                   7451: default-font-ctrblk dup font>height @ abs to char-height
                   7452: dup font>width @ to char-width font>advance @ to fontbytes
                   7453: ;
                   7454: : >font ( char -- addr )
                   7455: dup default-font-ctrblk dup >r font>min-char @ dup r@ font>#glyphs + within
                   7456: IF
                   7457: r@ font>min-char @ -
                   7458: r@ font>advance @ * r@ font>height @ .scan-lines *
                   7459: r> font>addr @ +
                   7460: ELSE
                   7461: drop r> font>addr @
                   7462: THEN
                   7463: ;
                   7464: : default-font ( -- addr width height advance min-char #glyphs )
                   7465: default-font-ctrblk /font 0 DO dup cell+ >r @ r> 1 cells +LOOP drop
                   7466: ;
                   7467: 0 VALUE frame-buffer-adr
                   7468: 0 VALUE screen-height
                   7469: 0 VALUE screen-width
                   7470: 0 VALUE window-top
                   7471: 0 VALUE window-left
                   7472: 0 VALUE .sc
                   7473: : screen-#rows .sc IF 18 ELSE true to .sc s" screen-#rows" eval false to .sc THEN ;
                   7474: : screen-#columns .sc IF 50 ELSE true to .sc s" screen-#columns" eval false to .sc THEN ;
                   7475: : fb8-background inverse-screen? ;
                   7476: : fb8-foreground inverse? invert ;
                   7477: : fb8-lines2bytes ( #lines -- #bytes ) char-height * screen-width * ;
                   7478: : fb8-columns2bytes ( #columns -- #bytes ) char-width * ;
                   7479: : fb8-line2addr ( line# -- addr )
                   7480: char-height * window-top + screen-width *
                   7481: frame-buffer-adr + window-left +
                   7482: ;
                   7483: : fb8-erase-block ( addr len ) fb8-background rfill ;
                   7484: 0 VALUE .ab
                   7485: CREATE bitmap-buffer 400 allot
                   7486: : active-bits ( -- new ) .ab dup 8 > IF 8 - to .ab 8 ELSE
                   7487: char-width to .ab ?dup 0= IF recurse THEN
                   7488: THEN ;
                   7489: : fb8-char2bitmap ( font-height font-addr -- bitmap-buffer )
                   7490: bitmap-buffer >r
                   7491: char-height rot 0> IF r> char-width 2dup fb8-erase-block + >r 1- THEN
                   7492: r> -rot char-width to .ab
                   7493: fontbytes * bounds ?DO
                   7494: i c@ active-bits 0 ?DO
                   7495: dup 80 and IF fb8-foreground ELSE fb8-background THEN
                   7496: ( fb-addr fbyte colr ) 2 pick ! 1 lshift swap 1+ swap
                   7497: LOOP drop
                   7498: LOOP drop
                   7499: bitmap-buffer
                   7500: ;
                   7501: : fb8-draw-logo ( line# addr width height -- ) ." fb8-draw-logo ( " .s ."  )" cr
                   7502: 2drop 2drop
                   7503: ;
                   7504: : fb8-toggle-cursor ( -- )
                   7505: line# fb8-line2addr column# fb8-columns2bytes +
                   7506: char-height 0 ?DO
                   7507: char-width 0 ?DO dup dup rb@ -1 xor swap rb! 1+ LOOP
                   7508: screen-width + char-width -
                   7509: LOOP drop
                   7510: ;
                   7511: : fb8-draw-character ( char -- )
                   7512: >r default-font over + r@ -rot between IF
                   7513: 2swap 3drop r> >font fb8-char2bitmap ( bitmap-buf )
                   7514: line# fb8-line2addr column# fb8-columns2bytes + ( bitmap-buf fb-addr )
                   7515: char-height 0 ?DO
                   7516: 2dup char-width mrmove
                   7517: screen-width + >r char-width + r>
                   7518: LOOP 2drop
                   7519: ELSE 2drop r> 3drop THEN
                   7520: ;
                   7521: : fb8-insert-lines ( n -- )
                   7522: fb8-lines2bytes >r line# fb8-line2addr dup dup r@ +
                   7523: #lines line# - fb8-lines2bytes r@ - rmove
                   7524: r> fb8-erase-block
                   7525: ;
                   7526: : fb8-delete-lines ( n -- )
                   7527: fb8-lines2bytes >r line# fb8-line2addr dup dup r@ + swap
                   7528: #lines fb8-lines2bytes r@ - dup >r rmove
                   7529: r> + r> fb8-erase-block
                   7530: ;
                   7531: : fb8-insert-characters ( n -- )
                   7532: line# fb8-line2addr column# fb8-columns2bytes + >r
                   7533: #columns column# - 2dup >= IF
                   7534: nip dup 0> IF fb8-columns2bytes r> ELSE r> 2drop EXIT THEN
                   7535: ELSE
                   7536: fb8-columns2bytes swap fb8-columns2bytes tuck -
                   7537: over r@ tuck + rot char-height 0 ?DO
                   7538: 3dup rmove
                   7539: -rot screen-width tuck + -rot + swap rot
                   7540: LOOP
                   7541: 3drop r>
                   7542: THEN
                   7543: char-height 0 ?DO dup 2 pick fb8-erase-block screen-width + LOOP 2drop
                   7544: ;
                   7545: : fb8-delete-characters ( n -- )
                   7546: line# fb8-line2addr column# fb8-columns2bytes + >r
                   7547: #columns column# - 2dup >= IF
                   7548: nip dup 0> IF fb8-columns2bytes r> ELSE r> 2drop EXIT THEN
                   7549: ELSE
                   7550: fb8-columns2bytes swap fb8-columns2bytes tuck -
                   7551: over r@ + 2dup + r> swap >r rot char-height 0 ?DO
                   7552: 3dup rmove
                   7553: -rot screen-width tuck + -rot + swap rot
                   7554: LOOP
                   7555: 3drop r> over -
                   7556: THEN
                   7557: char-height 0 ?DO dup 2 pick fb8-erase-block screen-width + LOOP 2drop
                   7558: ;
                   7559: : fb8-reset-screen ( -- ) ( Left as no-op by design ) ;
                   7560: : fb8-erase-screen ( -- )
                   7561: frame-buffer-adr screen-height screen-width * fb8-erase-block
                   7562: ;
                   7563: : fb8-invert-screen ( -- )
                   7564: frame-buffer-adr screen-height screen-width * 2dup /x / 0 ?DO
                   7565: dup rx@ -1 xor over rx! xa1+
                   7566: LOOP 3drop
                   7567: ;
                   7568: : fb8-blink-screen ( -- ) fb8-invert-screen fb8-invert-screen ;
                   7569: : fb8-install ( width height #columns #lines -- )
                   7570: screen-#rows min to #lines
                   7571: screen-#columns min to #columns
                   7572: dup to screen-height char-height #lines * - 2/ to window-top
                   7573: dup to screen-width char-width #columns * - 2/ to window-left
                   7574: ['] fb8-toggle-cursor to toggle-cursor
                   7575: ['] fb8-draw-character to draw-character
                   7576: ['] fb8-insert-lines to insert-lines
                   7577: ['] fb8-delete-lines to delete-lines
                   7578: ['] fb8-insert-characters to insert-characters
                   7579: ['] fb8-delete-characters to delete-characters
                   7580: ['] fb8-erase-screen to erase-screen
                   7581: ['] fb8-blink-screen to blink-screen
                   7582: ['] fb8-invert-screen to invert-screen
                   7583: ['] fb8-reset-screen to reset-screen
                   7584: ['] fb8-draw-logo to draw-logo
                   7585: ;
                   7586: : fb8-dump-bitmap cr char-height 0 ?do char-width 0 ?do dup c@ if ." @" else ." ." then 1+ loop cr loop drop ;
                   7587: : fb8-dump-char >font -b swap fb8-char2bitmap fb8-dump-bitmap ;
                   7588: ���������0generic-disk.fsnew-device set-unit                                          ( str len )
                   7589: 2dup device-name 
                   7590: s" 0 pci-alias-" 2swap $cat evaluate
                   7591: s" block" device-type      
                   7592: s" block-size" $call-parent   CONSTANT block-size
                   7593: s" max-transfer" $call-parent CONSTANT max-transfer 
                   7594: : read-blocks ( addr block# #blocks -- #read )
                   7595: my-unit s" dev-read-blocks" $call-parent
                   7596: ;    
                   7597: INSTANCE VARIABLE deblocker
                   7598: : open ( -- okay? )
                   7599: 0 0 s" deblocker" $open-package dup deblocker ! dup IF 
                   7600: s" disk-label" find-package IF
                   7601: my-args rot interpose
                   7602: THEN
                   7603: THEN 0<> ;
                   7604: : close ( -- )
                   7605: deblocker @ close-package ;
                   7606: : seek ( pos.lo pos.hi -- status )
                   7607: s" seek" deblocker @ $call-method ;
                   7608: : read ( addr len -- actual )
                   7609: s" read" deblocker @ $call-method ;
                   7610: finish-device
                   7611: ��������X0pci-device.fss" my-puid" $call-parent CONSTANT my-puid
                   7612: : config-b@  puid >r my-puid TO puid my-space + rtas-config-b@ r> TO puid ;
                   7613: : config-w@  puid >r my-puid TO puid my-space + rtas-config-w@ r> TO puid ;
                   7614: : config-l@  puid >r my-puid TO puid my-space + rtas-config-l@ r> TO puid ;
                   7615: : config-b!  puid >r my-puid TO puid my-space + rtas-config-b! r> TO puid ;
                   7616: : config-w!  puid >r my-puid TO puid my-space + rtas-config-w! r> TO puid ;
                   7617: : config-l!  puid >r my-puid TO puid my-space + rtas-config-l! r> TO puid ;
                   7618: : config-dump puid >r my-puid TO puid my-space pci-dump r> TO puid ;
                   7619: : open
                   7620: puid >r             \ save the old puid
                   7621: my-puid TO puid     \ set up the puid to the devices Hostbridge
                   7622: pci-master-enable   \ And enable Bus Master, IO and MEM access again.
                   7623: pci-mem-enable      \ enable mem access
                   7624: pci-io-enable       \ enable io access
                   7625: r> TO puid          \ restore puid
                   7626: true
                   7627: ;
                   7628: : close 
                   7629: puid >r             \ save the old puid
                   7630: my-puid TO puid     \ set up the puid
                   7631: pci-device-disable  \ and disable the device
                   7632: r> TO puid          \ restore puid
                   7633: ;
                   7634: : devicefile ( -- str len )
                   7635: s" pci-device_"
                   7636: my-space pci-vendor@ 4 int2str $cat
                   7637: s" _" $cat
                   7638: my-space pci-device@ 4 int2str $cat
                   7639: s" .fs" $cat
                   7640: ;
                   7641: : classfile ( -- str len )
                   7642: s" pci-class_"
                   7643: my-space pci-class@ 10 rshift 2 int2str $cat
                   7644: s" .fs" $cat
                   7645: ;
                   7646: : setup ( -- )
                   7647: devicefile romfs-lookup ?dup
                   7648: IF
                   7649: evaluate
                   7650: ELSE
                   7651: classfile romfs-lookup ?dup
                   7652: IF
                   7653: evaluate
                   7654: ELSE
                   7655: my-space pci-class-name type 2a emit cr
                   7656: my-space pci-device-generic-setup
                   7657: THEN
                   7658: THEN
                   7659: ;
                   7660: pci-device-disable
                   7661: pci-error-enable
                   7662: my-space 44 pci-out     \ config-addr ascii('D')
                   7663: setup
                   7664: ��������`'0pci-bridge.fss" my-puid" $call-parent CONSTANT my-puid
                   7665: pci-bus-number 1+ CONSTANT my-bus
                   7666: s" pci-config-bridge.fs" included
                   7667: : filename ( -- str len )
                   7668: s" pci-bridge_"
                   7669: my-space pci-vendor@ 4 int2str $cat
                   7670: s" _" $cat
                   7671: my-space pci-device@ 4 int2str $cat
                   7672: s" .fs" $cat
                   7673: ;
                   7674: : setup ( -- )
                   7675: filename romfs-lookup ?dup
                   7676: IF
                   7677: evaluate
                   7678: ELSE
                   7679: my-space pci-class-name type 2a emit cr
                   7680: my-space pci-bridge-generic-setup
                   7681: my-space pci-reset-2nd
                   7682: THEN
                   7683: ;
                   7684: pci-device-disable
                   7685: pci-error-enable
                   7686: my-space 42 pci-out     \ config-addr ascii('B')
                   7687: setup
                   7688: pci-master-enable
                   7689: pci-mem-enable
                   7690: pci-io-enable
                   7691: ���������X�8pci-properties.fs: pci-class-name-00 ( addr -- str len )
                   7692: pci-class@ 8 rshift FF and CASE
                   7693: 01  OF s" display"               ENDOF
                   7694: dup OF s" unknown-legacy-device" ENDOF
                   7695: ENDCASE
                   7696: ;
                   7697: : pci-class-name-01 ( addr -- str len )
                   7698: pci-class@ 8 rshift FF and CASE
                   7699: 00  OF s" scsi"         ENDOF
                   7700: 01  OF s" ide"          ENDOF
                   7701: 02  OF s" fdc"          ENDOF
                   7702: 03  OF s" ipi"          ENDOF
                   7703: 04  OF s" raid"         ENDOF
                   7704: 05  OF s" ata"          ENDOF
                   7705: 06  OF s" sata"         ENDOF
                   7706: 07  OF s" sas"          ENDOF
                   7707: dup OF s" mass-storage" ENDOF
                   7708: ENDCASE
                   7709: ;
                   7710: : pci-class-name-02 ( addr -- str len )
                   7711: pci-class@ 8 rshift FF and CASE
                   7712: 00  OF s" ethernet"   ENDOF
                   7713: 01  OF s" token-ring" ENDOF
                   7714: 02  OF s" fddi"       ENDOF
                   7715: 03  OF s" atm"        ENDOF
                   7716: 04  OF s" isdn"       ENDOF
                   7717: 05  OF s" worldfip"   ENDOF
                   7718: 05  OF s" picmg"      ENDOF
                   7719: dup OF s" network"    ENDOF
                   7720: ENDCASE
                   7721: ;
                   7722: : pci-class-name-03 ( addr -- str len )
                   7723: pci-class@ FFFF and CASE
                   7724: 0000  OF s" vga"             ENDOF
                   7725: 0001  OF s" 8514-compatible" ENDOF
                   7726: 0100  OF s" xga"             ENDOF
                   7727: 0200  OF s" 3d-controller"   ENDOF
                   7728: dup OF s" display"           ENDOF
                   7729: ENDCASE
                   7730: ;
                   7731: : pci-class-name-04 ( addr -- str len )
                   7732: pci-class@ 8 rshift FF and CASE
                   7733: 00  OF s" video"             ENDOF
                   7734: 01  OF s" sound"             ENDOF
                   7735: 02  OF s" telephony"         ENDOF
                   7736: dup OF s" multimedia-device" ENDOF
                   7737: ENDCASE
                   7738: ;
                   7739: : pci-class-name-05 ( addr -- str len )
                   7740: pci-class@ 8 rshift FF and CASE
                   7741: 00  OF s" memory"            ENDOF
                   7742: 01  OF s" flash"             ENDOF
                   7743: dup OF s" memory-controller" ENDOF
                   7744: ENDCASE
                   7745: ;
                   7746: : pci-class-name-06 ( addr -- str len )
                   7747: pci-class@ 8 rshift FF and CASE
                   7748: 00  OF s" host"                 ENDOF
                   7749: 01  OF s" isa"                  ENDOF
                   7750: 02  OF s" eisa"                 ENDOF
                   7751: 03  OF s" mca"                  ENDOF
                   7752: 04  OF s" pci"                  ENDOF
                   7753: 05  OF s" pcmcia"               ENDOF
                   7754: 06  OF s" nubus"                ENDOF
                   7755: 07  OF s" cardbus"              ENDOF
                   7756: 08  OF s" raceway"              ENDOF
                   7757: 09  OF s" semi-transparent-pci" ENDOF
                   7758: 0A  OF s" infiniband"           ENDOF
                   7759: dup OF s" unkown-bridge"        ENDOF
                   7760: ENDCASE
                   7761: ;
                   7762: : pci-class-name-07 ( addr -- str len )
                   7763: pci-class@ FFFF and CASE
                   7764: 0000  OF s" serial"                   ENDOF
                   7765: 0001  OF s" 16450-serial"             ENDOF
                   7766: 0002  OF s" 16550-serial"             ENDOF
                   7767: 0003  OF s" 16650-serial"             ENDOF
                   7768: 0004  OF s" 16750-serial"             ENDOF
                   7769: 0005  OF s" 16850-serial"             ENDOF
                   7770: 0006  OF s" 16950-serial"             ENDOF
                   7771: 0100  OF s" parallel"                 ENDOF
                   7772: 0101  OF s" bi-directional-parallel"  ENDOF
                   7773: 0102  OF s" ecp-1.x-parallel"         ENDOF
                   7774: 0103  OF s" ieee1284-controller"      ENDOF
                   7775: 01FE  OF s" ieee1284-device"          ENDOF
                   7776: 0200  OF s" multiport-serial"         ENDOF
                   7777: 0300  OF s" modem"                    ENDOF
                   7778: 0301  OF s" 16450-modem"              ENDOF
                   7779: 0302  OF s" 16550-modem"              ENDOF
                   7780: 0303  OF s" 16650-modem"              ENDOF
                   7781: 0304  OF s" 16750-modem"              ENDOF
                   7782: 0400  OF s" gpib"                     ENDOF
                   7783: 0500  OF s" smart-card"               ENDOF
                   7784: dup   OF s" communication-controller" ENDOF
                   7785: ENDCASE
                   7786: ;
                   7787: : pci-class-name-08 ( addr -- str len )
                   7788: pci-class@ FFFF and CASE
                   7789: 0000  OF s" interrupt-controller" ENDOF
                   7790: 0001  OF s" isa-pic"              ENDOF
                   7791: 0002  OF s" eisa-pic"             ENDOF
                   7792: 0010  OF s" io-apic"              ENDOF
                   7793: 0020  OF s" iox-apic"             ENDOF
                   7794: 0100  OF s" dma-controller"       ENDOF
                   7795: 0101  OF s" isa-dma"              ENDOF
                   7796: 0102  OF s" eisa-dma"             ENDOF
                   7797: 0200  OF s" timer"                ENDOF
                   7798: 0201  OF s" isa-system-timer"     ENDOF
                   7799: 0202  OF s" eisa-system-timer"    ENDOF
                   7800: 0300  OF s" rtc"                  ENDOF
                   7801: 0301  OF s" isa-rtc"              ENDOF
                   7802: 0400  OF s" hot-plug-controller"  ENDOF
                   7803: 0500  OF s" sd-host-conrtoller"   ENDOF
                   7804: dup   OF s" system-periphal"      ENDOF
                   7805: ENDCASE
                   7806: ;
                   7807: : pci-class-name-09 ( addr -- str len )
                   7808: pci-class@ 8 rshift FF and CASE
                   7809: 00  OF s" keyboard"         ENDOF
                   7810: 01  OF s" pen"              ENDOF
                   7811: 02  OF s" mouse"            ENDOF
                   7812: 03  OF s" scanner"          ENDOF
                   7813: 04  OF s" gameport"         ENDOF
                   7814: dup OF s" input-controller" ENDOF
                   7815: ENDCASE
                   7816: ;
                   7817: : pci-class-name-0A ( addr -- str len )
                   7818: pci-class@ 8 rshift FF and CASE
                   7819: 00  OF s" dock"            ENDOF
                   7820: dup OF s" docking-station" ENDOF
                   7821: ENDCASE
                   7822: ;
                   7823: : pci-class-name-0B ( addr -- str len )
                   7824: pci-class@ 8 rshift FF and CASE
                   7825: 00  OF s" 386"           ENDOF
                   7826: 01  OF s" 486"           ENDOF
                   7827: 02  OF s" pentium"       ENDOF
                   7828: 10  OF s" alpha"         ENDOF
                   7829: 20  OF s" powerpc"       ENDOF
                   7830: 30  OF s" mips"          ENDOF
                   7831: 40  OF s" co-processor"  ENDOF
                   7832: dup OF s" cpu"           ENDOF
                   7833: ENDCASE
                   7834: ;
                   7835: : pci-class-name-0C ( addr -- str len )
                   7836: pci-class@ FFFF and CASE
                   7837: 0000  OF s" firewire"      ENDOF
                   7838: 0100  OF s" access-bus"    ENDOF
                   7839: 0200  OF s" ssa"           ENDOF
                   7840: 0300  OF s" usb-uhci"      ENDOF
                   7841: 0310  OF s" usb-ohci"      ENDOF
                   7842: 0320  OF s" usb-ehci"      ENDOF
                   7843: 0380  OF s" usb"           ENDOF
                   7844: 03FE  OF s" usb-device"    ENDOF
                   7845: 0400  OF s" fibre-channel" ENDOF
                   7846: 0500  OF s" smb"           ENDOF
                   7847: 0600  OF s" infiniband"    ENDOF
                   7848: 0700  OF s" ipmi-smic"     ENDOF
                   7849: 0701  OF s" ipmi-kbrd"     ENDOF
                   7850: 0702  OF s" ipmi-bltr"     ENDOF
                   7851: 0800  OF s" sercos"        ENDOF
                   7852: 0900  OF s" canbus"        ENDOF
                   7853: dup OF s" serial-bus"      ENDOF
                   7854: ENDCASE
                   7855: ;
                   7856: : pci-class-name-0D ( addr -- str len )
                   7857: pci-class@ 8 rshift FF and CASE
                   7858: 00  OF s" irda"                ENDOF
                   7859: 01  OF s" consumer-ir"         ENDOF
                   7860: 10  OF s" rf-controller"       ENDOF
                   7861: 11  OF s" bluetooth"           ENDOF
                   7862: 12  OF s" broadband"           ENDOF
                   7863: 20  OF s" enet-802.11a"        ENDOF
                   7864: 21  OF s" enet-802.11b"        ENDOF
                   7865: dup OF s" wireless-controller" ENDOF
                   7866: ENDCASE
                   7867: ;
                   7868: : pci-class-name-0E ( addr -- str len )
                   7869: pci-class@ 8 rshift FF and CASE
                   7870: dup OF s" intelligent-io" ENDOF
                   7871: ENDCASE
                   7872: ;
                   7873: : pci-class-name-0F ( addr -- str len )
                   7874: pci-class@ 8 rshift FF and CASE
                   7875: 01  OF s" satelite-tv"     ENDOF
                   7876: 02  OF s" satelite-audio"  ENDOF
                   7877: 03  OF s" satelite-voice"  ENDOF
                   7878: 04  OF s" satelite-data"   ENDOF
                   7879: dup OF s" satelite-devoce" ENDOF
                   7880: ENDCASE
                   7881: ;
                   7882: : pci-class-name-10 ( addr -- str len )
                   7883: pci-class@ 8 rshift FF and CASE
                   7884: 00  OF s" network-encryption"       ENDOF
                   7885: 01  OF s" entertainment-encryption" ENDOF
                   7886: dup OF s" encryption"               ENDOF
                   7887: ENDCASE
                   7888: ;
                   7889: : pci-class-name-11 ( addr -- str len )
                   7890: pci-class@ 8 rshift FF and CASE
                   7891: 00  OF s" dpio"                       ENDOF
                   7892: 01  OF s" counter"                    ENDOF
                   7893: 10  OF s" measurement"                ENDOF
                   7894: 20  OF s" managment-card"             ENDOF
                   7895: dup OF s" data-processing-controller" ENDOF
                   7896: ENDCASE
                   7897: ;
                   7898: : pci-class-name ( addr -- str len )
                   7899: dup pci-class@ 10 rshift CASE
                   7900: 00  OF pci-class-name-00 ENDOF
                   7901: 01  OF pci-class-name-01 ENDOF
                   7902: 02  OF pci-class-name-02 ENDOF
                   7903: 03  OF pci-class-name-03 ENDOF
                   7904: 04  OF pci-class-name-04 ENDOF
                   7905: 05  OF pci-class-name-05 ENDOF
                   7906: 06  OF pci-class-name-06 ENDOF
                   7907: 07  OF pci-class-name-07 ENDOF
                   7908: 08  OF pci-class-name-08 ENDOF
                   7909: 09  OF pci-class-name-09 ENDOF
                   7910: 0A  OF pci-class-name-0A ENDOF
                   7911: 0B  OF pci-class-name-0B ENDOF
                   7912: 0C  OF pci-class-name-0C ENDOF
                   7913: 0C  OF pci-class-name-0D ENDOF
                   7914: 0C  OF pci-class-name-0E ENDOF
                   7915: 0C  OF pci-class-name-0F ENDOF
                   7916: 0C  OF pci-class-name-10 ENDOF
                   7917: 0C  OF pci-class-name-11 ENDOF
                   7918: dup OF drop s" unknown"  ENDOF
                   7919: ENDCASE
                   7920: ;
                   7921: : pci-bar-size@     ( bar-addr -- bar-size ) -1 over rtas-config-l! rtas-config-l@ ;
                   7922: : pci-bar-size-mem@ ( bar-addr -- mem-size ) pci-bar-size@ -10 and invert 1+ FFFFFFFF and ;
                   7923: : pci-bar-size-io@  ( bar-addr -- io-size  ) pci-bar-size@ -4 and invert 1+ FFFFFFFF and ;
                   7924: : pci-bar-size ( bar-addr -- bar-size-raw )
                   7925: dup rtas-config-l@ swap \ fetch original Value  ( bval baddr )
                   7926: -1 over rtas-config-l!  \ make BAR show size    ( bval baddr )
                   7927: dup rtas-config-l@      \ and fetch the size    ( bval baddr bsize )
                   7928: -rot rtas-config-l!     \ restore Value
                   7929: ;
                   7930: : pci-bar-size-mem32 ( bar-addr -- bar-size )
                   7931: pci-bar-size            \ fetch raw size
                   7932: -10 and invert 1+       \ calc size
                   7933: FFFFFFFF and            \ keep lower 32 bits
                   7934: ;
                   7935: : pci-bar-size-rom ( bar-addr -- bar-size )
                   7936: pci-bar-size            \ fetch raw size
                   7937: FFFFF800 and invert 1+  \ calc size
                   7938: FFFFFFFF and            \ keep lower 32 bits
                   7939: ;
                   7940: : pci-bar-size-mem64 ( bar-addr -- bar-size )
                   7941: dup pci-bar-size        \ fetch raw size lower 32 bits
                   7942: swap 4 + pci-bar-size   \ fetch raw size upper 32 bits
                   7943: 20 lshift +             \ and put them together
                   7944: -10 and invert 1+       \ calc size
                   7945: ;
                   7946: : pci-bar-size-io ( bar-addr -- bar-size )
                   7947: pci-bar-size            \ fetch raw size
                   7948: -4 and invert 1+        \ calc size
                   7949: FFFFFFFF and            \ keep lower 32 bits
                   7950: ;
                   7951: : pci-bar-code@ ( bar-addr -- 0|1..4|5 )
                   7952: rtas-config-l@ dup                \ fetch the BaseAddressRegister
                   7953: 1 and IF                          \ IO BAR ?
                   7954: 2 and IF 0 ELSE 1 THEN    \ only '01' is valid
                   7955: ELSE                              \ Memory BAR ?
                   7956: F and CASE
                   7957: 0   OF 2 ENDOF    \ Memory 32 Bit Non-Prefetchable
                   7958: 8   OF 3 ENDOF    \ Memory 32 Bit Prefetchable
                   7959: 4   OF 4 ENDOF    \ Memory 64 Bit Non-Prefetchable
                   7960: C   OF 5 ENDOF    \ Memory 64 Bit Prefechtable
                   7961: dup OF 0 ENDOF    \ Not a valid BarType
                   7962: ENDCASE
                   7963: THEN
                   7964: ;
                   7965: : assign-var ( size var -- al-mem )
                   7966: 2dup @                          \ ( size var size cur-mem ) read current free mem
                   7967: swap #aligned                   \ ( size var al-mem )       align the mem to the size
                   7968: dup 2swap -rot +                \ ( al-mem var new-mem )    add size to aligned mem
                   7969: swap !                          \ ( al-mem )                set variable to new mem
                   7970: ;
                   7971: : assign-bar-value32 ( bar size var -- 4 )
                   7972: over IF                         \ IF size > 0
                   7973: assign-var              \ | ( bar al-mem ) set variable to next mem
                   7974: swap rtas-config-l!     \ | ( -- )         set the bar to al-mem
                   7975: ELSE                            \ ELSE
                   7976: 2drop drop              \ | clear stack
                   7977: THEN                            \ FI
                   7978: 4                               \ size of the base-address-register
                   7979: ;
                   7980: : assign-bar-value64 ( bar size var -- 8 )
                   7981: over IF                         \ IF size > 0
                   7982: assign-var              \ | ( bar al-mem ) set variable to next mem
                   7983: swap                    \ | ( al-mem addr ) calc config-addr of this bar
                   7984: 2dup rtas-config-l!     \ | ( al-mem addr ) set the Lower part of the bar to al-mem
                   7985: 4 + swap 20 rshift      \ | ( al-mem>>32 addr ) prepare the upper part of the al-mem
                   7986: swap rtas-config-l!     \ | ( -- ) and set the upper part of the bar
                   7987: ELSE                            \ ELSE
                   7988: 2drop drop              \ | clear stack
                   7989: THEN                            \ FI
                   7990: 8                               \ size of the base-address-register
                   7991: ;
                   7992: : assign-mem64-bar ( bar-addr -- 8 )
                   7993: dup pci-bar-size-mem64         \ fetch size
                   7994: pci-next-mem                    \ var to change
                   7995: assign-bar-value64              \ and set it all
                   7996: ;
                   7997: : assign-mem32-bar ( bar-addr -- 4 )
                   7998: dup pci-bar-size-mem32          \ fetch size
                   7999: pci-next-mem                    \ var to change
                   8000: assign-bar-value32              \ and set it all
                   8001: ;
                   8002: : assign-mmio64-bar ( bar-addr -- 8 )
                   8003: dup pci-bar-size-mem64          \ fetch size
                   8004: pci-next-mmio                   \ var to change
                   8005: assign-bar-value64              \ and set it all
                   8006: ;
                   8007: : assign-mmio32-bar ( bar-addr -- 4 )
                   8008: dup pci-bar-size-mem32          \ fetch size
                   8009: pci-next-mmio                   \ var to change
                   8010: assign-bar-value32              \ and set it all
                   8011: ;
                   8012: : assign-io-bar ( bar-addr -- 4 )
                   8013: dup pci-bar-size-io             \ fetch size
                   8014: pci-next-io                     \ var to change
                   8015: assign-bar-value32              \ and set it all
                   8016: ;
                   8017: : assign-rom-bar ( bar-addr -- )
                   8018: dup pci-bar-size-rom            \ fetch size
                   8019: dup IF                          \ IF size > 0
                   8020: over >r                 \ | save bar addr for enable
                   8021: pci-next-mmio           \ | var to change
                   8022: assign-bar-value32      \ | and set it
                   8023: drop                    \ | forget the BAR length
                   8024: r@ rtas-config-l@       \ | fetch BAR
                   8025: 1 or r> rtas-config-l!  \ | and enable the ROM
                   8026: ELSE                            \ ELSE
                   8027: 2drop                   \ | clear stack
                   8028: THEN
                   8029: ;
                   8030: : assign-bar ( bar-addr -- reg-size )
                   8031: dup pci-bar-code@                       \ calc BAR type
                   8032: dup IF                                  \ IF >0
                   8033: CASE                            \ | CASE Setup the right type
                   8034: 1 OF assign-io-bar     ENDOF    \ | - set up an IO-Bar
                   8035: 2 OF assign-mmio32-bar ENDOF    \ | - set up an 32bit MMIO-Bar
                   8036: 3 OF assign-mem32-bar  ENDOF    \ | - set up an 32bit MEM-Bar (prefetchable)
                   8037: 4 OF assign-mmio64-bar ENDOF    \ | - set up an 64bit MMIO-Bar
                   8038: 5 OF assign-mem64-bar  ENDOF    \ | - set up an 64bit MEM-Bar (prefetchable)
                   8039: ENDCASE                         \ | ESAC
                   8040: ELSE                                    \ ELSE
                   8041: ABORT                           \ | Throw an exception
                   8042: THEN                                    \ FI
                   8043: ;
                   8044: : assign-all-device-bars ( configaddr -- )
                   8045: 28 10 DO                        \ BARs start at 10 and end at 27
                   8046: dup i +                 \ calc config-addr of the BAR
                   8047: assign-bar              \ and set it up
                   8048: +LOOP                           \ add 4 or 8 to the index and loop
                   8049: 30 + assign-rom-bar             \ set up the ROM if available
                   8050: ;
                   8051: : assign-all-bridge-bars ( configaddr -- )
                   8052: 18 10 DO                        \ BARs start at 10 and end at 17
                   8053: dup i +                 \ calc config-addr of the BAR
                   8054: assign-bar              \ and set it up
                   8055: +LOOP                           \ add 4 or 8 to the index and loop
                   8056: 38 + assign-rom-bar             \ set up the ROM if available
                   8057: ;
                   8058: : gen-mem64-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len 8 )
                   8059: dup pci-bar-size-mem64                  \ fetch BAR Size        ( paddr plen baddr bsize )
                   8060: dup IF                                  \ IF Size > 0
                   8061: >r dup rtas-config-l@           \ | save size and fetch lower 32 bits ( paddr plen baddr val.lo R: size)
                   8062: over 4 + rtas-config-l@         \ | fetch upper 32 bits               ( paddr plen baddr val.lo val.hi R: size)
                   8063: 20 lshift + -10 and >r          \ | calc 64 bit value and save it     ( paddr plen baddr R: size val )
                   8064: 83000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8065: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8066: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8067: ELSE                                    \ ELSE
                   8068: 2drop                           \ | don't do anything
                   8069: THEN                                    \ FI
                   8070: 8                                       \ sizeof(BAR) = 8 Bytes
                   8071: ;
                   8072: : gen-pmem64-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len 8 )
                   8073: dup pci-bar-size-mem64                  \ fetch BAR Size        ( paddr plen baddr bsize )
                   8074: dup IF                                  \ IF Size > 0
                   8075: >r dup rtas-config-l@           \ | save size and fetch lower 32 bits ( paddr plen baddr val.lo R: size)
                   8076: over 4 + rtas-config-l@         \ | fetch upper 32 bits               ( paddr plen baddr val.lo val.hi R: size)
                   8077: 20 lshift + -10 and >r          \ | calc 64 bit value and save it     ( paddr plen baddr R: size val )
                   8078: C3000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8079: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8080: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8081: ELSE                                    \ ELSE
                   8082: 2drop                           \ | don't do anything
                   8083: THEN                                    \ FI
                   8084: 8                                       \ sizeof(BAR) = 8 Bytes
                   8085: ;
                   8086: : gen-mem32-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len 4 )
                   8087: dup pci-bar-size-mem32                  \ fetch BAR Size        ( paddr plen baddr bsize )
                   8088: dup IF                                  \ IF Size > 0
                   8089: >r dup rtas-config-l@           \ | save size and fetch value         ( paddr plen baddr val R: size)
                   8090: -10 and >r                      \ | calc 32 bit value and save it     ( paddr plen baddr R: size val )
                   8091: 82000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8092: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8093: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8094: ELSE                                    \ ELSE
                   8095: 2drop                           \ | don't do anything
                   8096: THEN                                    \ FI
                   8097: 4                                       \ sizeof(BAR) = 4 Bytes
                   8098: ;
                   8099: : gen-pmem32-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len 4 )
                   8100: dup pci-bar-size-mem32                  \ fetch BAR Size        ( paddr plen baddr bsize )
                   8101: dup IF                                  \ IF Size > 0
                   8102: >r dup rtas-config-l@           \ | save size and fetch value         ( paddr plen baddr val R: size)
                   8103: -10 and >r                      \ | calc 32 bit value and save it     ( paddr plen baddr R: size val )
                   8104: C2000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8105: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8106: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8107: ELSE                                    \ ELSE
                   8108: 2drop                           \ | don't do anything
                   8109: THEN                                    \ FI
                   8110: 4                                       \ sizeof(BAR) = 4 Bytes
                   8111: ;
                   8112: : gen-io-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len 4 )
                   8113: dup pci-bar-size-io                     \ fetch BAR Size                      ( paddr plen baddr bsize )
                   8114: dup IF                                  \ IF Size > 0
                   8115: >r dup rtas-config-l@           \ | save size and fetch value         ( paddr plen baddr val R: size)
                   8116: -4 and >r                       \ | calc 32 bit value and save it     ( paddr plen baddr R: size val )
                   8117: 81000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8118: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8119: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8120: ELSE                                    \ ELSE
                   8121: 2drop                           \ | don't do anything
                   8122: THEN                                    \ FI
                   8123: 4                                       \ sizeof(BAR) = 4 Bytes
                   8124: ;
                   8125: : gen-rom-bar-prop ( prop-addr prop-len bar-addr -- prop-addr prop-len )
                   8126: dup pci-bar-size-rom                    \ fetch BAR Size                      ( paddr plen baddr bsize )
                   8127: dup IF                                  \ IF Size > 0
                   8128: >r dup rtas-config-l@           \ | save size and fetch value         ( paddr plen baddr val R: size)
                   8129: FFFFF800 and >r                 \ | calc 32 bit value and save it     ( paddr plen baddr R: size val )
                   8130: 82000000 or encode-int+         \ | Encode config addr                ( paddr plen R: size val )
                   8131: r> encode-64+                   \ | Encode assigned addr              ( paddr plen R: size )
                   8132: r> encode-64+                   \ | Encode size                       ( paddr plen )
                   8133: ELSE                                    \ ELSE
                   8134: 2drop                           \ | don't do anything
                   8135: THEN                                    \ FI
                   8136: ;
                   8137: : pci-add-assigned-address ( prop-addr prop-len bar-addr -- prop-addr prop-len bsize )
                   8138: dup pci-bar-code@                               \ calc BAR type                         ( paddr plen baddr btype)
                   8139: CASE                                            \ CASE for the BAR types                ( paddr plen baddr )
                   8140: 0 OF drop 4              ENDOF          \ - not a valid type so do nothing
                   8141: 1 OF gen-io-bar-prop     ENDOF          \ - IO-BAR
                   8142: 2 OF gen-mem32-bar-prop  ENDOF          \ - MEM32
                   8143: 3 OF gen-pmem32-bar-prop ENDOF          \ - MEM32 prefetchable
                   8144: 4 OF gen-mem64-bar-prop  ENDOF          \ - MEM64
                   8145: 5 OF gen-pmem64-bar-prop ENDOF          \ - MEM64 prefetchable
                   8146: ENDCASE                                         \ ESAC ( paddr plen bsize )
                   8147: ;
                   8148: : pci-device-assigned-addresses-prop ( addr -- )
                   8149: encode-start                                    \ provide mem for property              ( addr paddr plen )
                   8150: 2 pick 30 + gen-rom-bar-prop                    \ assign the rom bar
                   8151: 28 10 DO                                        \ we have 6 possible BARs
                   8152: 2 pick i +                              \ calc BAR address                      ( addr paddr plen bar-addr )      
                   8153: pci-add-assigned-address                \ and generate the props for the BAR
                   8154: +LOOP                                           \ increase Index by returned len
                   8155: s" assigned-addresses" property drop            \ and write it into the device tree
                   8156: ;
                   8157: : pci-bridge-assigned-addresses-prop ( addr -- )
                   8158: encode-start                                    \ provide mem for property
                   8159: 2 pick 38 + gen-rom-bar-prop                    \ assign the rom bar
                   8160: 18 10 DO                                        \ we have 2 possible BARs
                   8161: 2 pick i +                              \ ( addr paddr plen current-addr )
                   8162: pci-add-assigned-address                \ and generate the props for the BAR
                   8163: +LOOP                                           \ increase Index by returned len
                   8164: s" assigned-addresses" property drop            \ and write it into the device tree
                   8165: ;
                   8166: : pci-bridge-gen-range ( paddr plen base limit type -- paddr plen )
                   8167: >r over -                       \ calc size             ( paddr plen base size R:type )
                   8168: dup 0< IF                       \ IF Size < 0           ( paddr plen base size R:type )
                   8169: 2drop r> drop           \ | forget values       ( paddr plen )
                   8170: ELSE                            \ ELSE
                   8171: 1+ swap 2swap           \ | adjust stack        ( size base paddr plen R:type )
                   8172: r@ encode-int+          \ | Child type          ( size base paddr plen R:type )
                   8173: 2 pick encode-64+       \ | Child address       ( size base paddr plen R:type )
                   8174: r> encode-int+          \ | Parent type         ( size base paddr plen )
                   8175: rot encode-64+          \ | Parent address      ( size paddr plen )
                   8176: rot encode-64+          \ | Encode size         ( paddr plen )
                   8177: THEN                            \ FI
                   8178: ;
                   8179: : pci-bridge-gen-mmio-range ( addr prop-addr prop-len -- addr prop-addr prop-len )
                   8180: 2 pick 20 + rtas-config-l@      \ fetch Value           ( addr paddr plen val )
                   8181: dup 0000FFF0 and 10 lshift      \ calc base-address     ( addr paddr plen val base )
                   8182: swap 000FFFFF or                \ calc limit-address    ( addr paddr plen base limit )
                   8183: 02000000 pci-bridge-gen-range   \ and generate it       ( addr paddr plen )
                   8184: ;
                   8185: : pci-bridge-gen-mem-range ( addr prop-addr prop-len -- addr prop-addr prop-len )
                   8186: 2 pick 24 + rtas-config-l@      \ fetch Value           ( addr paddr plen val )
                   8187: dup 000FFFFF or                 \ calc limit Bits 31:0  ( addr paddr plen val limit.31:0 )
                   8188: swap 0000FFF0 and 10 lshift     \ calc base Bits 31:0   ( addr paddr plen limit.31:0 base.31:0 )
                   8189: 4 pick 28 + rtas-config-l@      \ fetch upper Basebits  ( addr paddr plen limit.31:0 base.31:0 base.63:32 )
                   8190: 20 lshift or swap               \ and calc Base         ( addr paddr plen base.63:0 limit.31:0 )
                   8191: 4 pick 2C + rtas-config-l@      \ fetch upper Limitbits ( addr paddr plen base.63:0 limit.31:0 limit.63:32 )
                   8192: 20 lshift or                    \ and calc Limit        ( addr paddr plen base.63:0 limit.63:0 )
                   8193: 42000000 pci-bridge-gen-range   \ and generate it       ( addr paddr plen )
                   8194: ;
                   8195: : pci-bridge-gen-io-range ( addr prop-addr prop-len -- addr prop-addr prop-len )
                   8196: 2 pick 1C + rtas-config-l@      \ fetch Value           ( addr paddr plen val )
                   8197: dup 0000F000 and 00000FFF or    \ calc Limit Bits 15:0  ( addr paddr plen val limit.15:0 )
                   8198: swap 000000F0 and 8 lshift      \ calc Base Bits 15:0   ( addr paddr plen limit.15:0 base.15:0 )
                   8199: 4 pick 30 + rtas-config-l@      \ fetch upper Bits      ( addr paddr plen limit.15:0 base.15:0 val )
                   8200: dup FFFF and 10 lshift rot or   \ calc Base             ( addr paddr plen limit.15:0 val base.31:0 )
                   8201: -rot FFFF0000 and or            \ calc Limit            ( addr paddr plen base.31:0 limit.31:0 )
                   8202: 01000000 pci-bridge-gen-range   \ and generate it       ( addr paddr plen )
                   8203: ;
                   8204: : pci-bridge-range-props ( addr -- )
                   8205: encode-start                    \ provide mem for property
                   8206: pci-bridge-gen-mmio-range       \ generate the non prefetchable Memory Entry
                   8207: pci-bridge-gen-mem-range        \ generate the prefetchable Memory Entry
                   8208: pci-bridge-gen-io-range         \ generate the IO Entry
                   8209: dup IF                          \ IF any space present (propsize>0)
                   8210: s" ranges" property     \ | write it into the device tree
                   8211: ELSE                            \ ELSE
                   8212: 2drop                   \ | forget the properties
                   8213: THEN                            \ FI
                   8214: drop                            \ forget the address
                   8215: ;
                   8216: : pci-bridge-interrupt-map ( -- )
                   8217: encode-start                                    \ create the property                           ( paddr plen )
                   8218: get-node child                                  \ find the first child                          ( paddr plen handle )
                   8219: BEGIN dup WHILE                                 \ Loop as long as the handle is non-zero        ( paddr plen handle )
                   8220: dup >r >space                           \ Get the my-space                              ( paddr plen addr R: handle )
                   8221: pci-gen-irq-entry                       \ and Encode the interrupt settings             ( paddr plen R: handle)
                   8222: r> peer                                 \ Get neighbour                                 ( paddr plen handle )
                   8223: REPEAT                                          \ process next childe node                      ( paddr plen handle )
                   8224: drop                                            \ forget the null                               ( paddr plen )
                   8225: s" interrupt-map" property                      \ and set it                                    ( -- )
                   8226: 1 encode-int s" #interrupt-cells" property      \ encode the cell#
                   8227: f800 encode-int 0 encode-int+ 0 encode-int+     \ encode the bit mask for config addr (Dev only)
                   8228: 7 encode-int+ s" interrupt-map-mask" property   \ encode IRQ#=7 and generate property
                   8229: ;
                   8230: : encode-mem32-bar ( prop-addr prop-len BAR-addr -- prop-addr prop-len 4 )
                   8231: dup pci-bar-size-mem32                  \ calc BAR-size ( not changing the BAR )
                   8232: dup IF                                  \ IF BAR-size > 0       ( paddr plen baddr bsize )
                   8233: >r 02000000 or encode-int+      \ | save size and encode BAR addr
                   8234: 0 encode-64+                    \ | make mid and lo zero
                   8235: r> encode-64+                   \ | encode size
                   8236: ELSE                                    \ ELSE
                   8237: 2drop                           \ | don't do anything
                   8238: THEN                                    \ FI
                   8239: 4                                       \ BAR-Len = 4 (32Bit)
                   8240: ;
                   8241: : encode-pmem32-bar ( prop-addr prop-len BAR-addr -- prop-addr prop-len 4 )
                   8242: dup pci-bar-size-mem32                  \ calc BAR-size ( not changing the BAR )
                   8243: dup IF                                  \ IF BAR-size > 0       ( paddr plen baddr bsize )
                   8244: >r 42000000 or encode-int+      \ | save size and encode BAR addr
                   8245: 0 encode-64+                    \ | make mid and lo zero
                   8246: r> encode-64+                   \ | encode size
                   8247: ELSE                                    \ ELSE
                   8248: 2drop                           \ | don't do anything
                   8249: THEN                                    \ FI
                   8250: 4                                       \ BAR-Len = 4 (32Bit)
                   8251: ;
                   8252: : encode-mem64-bar ( prop-addr prop-len BAR-addr -- prop-addr prop-len 8 )
                   8253: dup pci-bar-size-mem64                  \ calc BAR-size ( not changing the BAR )
                   8254: dup IF                                  \ IF BAR-size > 0       ( paddr plen baddr bsize )
                   8255: >r 03000000 or encode-int+      \ | save size and encode BAR addr
                   8256: 0 encode-64+                    \ | make mid and lo zero
                   8257: r> encode-64+                   \ | encode size
                   8258: ELSE                                    \ ELSE
                   8259: 2drop                           \ | don't do anything
                   8260: THEN                                    \ FI
                   8261: 8                                       \ BAR-Len = 8 (64Bit)
                   8262: ;
                   8263: : encode-pmem64-bar ( prop-addr prop-len BAR-addr -- prop-addr prop-len 8 )
                   8264: dup pci-bar-size-mem64                  \ calc BAR-size ( not changing the BAR )
                   8265: dup IF                                  \ IF BAR-size > 0       ( paddr plen baddr bsize )
                   8266: >r 43000000 or encode-int+      \ | save size and encode BAR addr
                   8267: 0 encode-64+                    \ | make mid and lo zero
                   8268: r> encode-64+                   \ | encode size
                   8269: ELSE                                    \ ELSE
                   8270: 2drop                           \ | don't do anything
                   8271: THEN                                    \ FI
                   8272: 8                                       \ BAR-Len = 8 (64Bit)
                   8273: ;
                   8274: : encode-rom-bar ( prop-addr prop-len configaddr -- prop-addr prop-len )
                   8275: dup pci-bar-size-rom                            \ fetch raw BAR-size
                   8276: dup IF                                          \ IF BAR is used
                   8277: >r 02000000 or encode-int+              \ | save size and encode BAR addr
                   8278: 0 encode-64+                            \ | make mid and lo zero
                   8279: r> encode-64+                           \ | calc and encode the size
                   8280: ELSE                                            \ ELSE
                   8281: 2drop                                   \ | don't do anything
                   8282: THEN                                            \ FI
                   8283: ;
                   8284: : encode-io-bar ( prop-addr prop-len BAR-addr BAR-value -- prop-addr prop-len 4 )
                   8285: dup pci-bar-size-io                     \ calc BAR-size ( not changing the BAR )
                   8286: dup IF                                  \ IF BAR-size > 0       ( paddr plen baddr bsize )
                   8287: >r 01000000 or encode-int+      \ | save size and encode BAR addr
                   8288: 0 encode-64+                    \ | make mid and lo zero
                   8289: r> encode-64+                   \ | encode size
                   8290: ELSE                                    \ ELSE
                   8291: 2drop                           \ | don't do anything
                   8292: THEN                                    \ FI
                   8293: 4                                       \ BAR-Len = 4 (32Bit)
                   8294: ;
                   8295: : encode-bar ( prop-addr prop-len bar-addr -- prop-addr prop-len bar-len )
                   8296: dup pci-bar-code@                               \ calc BAR type
                   8297: CASE                                            \ CASE for the BAR types ( paddr plen baddr val )
                   8298: 0 OF drop 4             ENDOF           \ - not a valid type so do nothing
                   8299: 1 OF encode-io-bar      ENDOF           \ - IO-BAR
                   8300: 2 OF encode-mem32-bar   ENDOF           \ - MEM32
                   8301: 3 OF encode-pmem32-bar  ENDOF           \ - MEM32 prefetchable
                   8302: 4 OF encode-mem64-bar   ENDOF           \ - MEM64
                   8303: 5 OF encode-pmem64-bar  ENDOF           \ - MEM64 prefetchable
                   8304: ENDCASE                                         \ ESAC ( paddr plen blen )
                   8305: ;
                   8306: : pci-reg-props ( configaddr -- )
                   8307: dup encode-int                  \ configuration space           ( caddr paddr plen )
                   8308: 0 encode-64+                    \ make the rest 0
                   8309: 0 encode-64+                    \ encode the size as 0
                   8310: 2 pick pci-htype@               \ fetch Header Type             ( caddr paddr plen type )
                   8311: 1 and IF                        \ IF Bridge                     ( caddr paddr plen )
                   8312: 18 10 DO                \ | loop over all BARs
                   8313: 2 pick i +      \ | calc bar-addr               ( caddr paddr plen baddr )
                   8314: encode-bar      \ | encode this BAR             ( caddr paddr plen blen )
                   8315: +LOOP              \ | increase LoopIndex by the BARlen
                   8316: 2 pick 38 +             \ | calc ROM-BAR for a bridge   ( caddr paddr plen baddr )
                   8317: encode-rom-bar          \ | encode the ROM-BAR          ( caddr paddr plen )
                   8318: ELSE                            \ ELSE ordinary device          ( caddr paddr plen )
                   8319: 28 10 DO                 \ | loop over all BARs
                   8320: 2 pick i +      \ | calc bar-addr               ( caddr paddr plen baddr )
                   8321: encode-bar      \ | encode this BAR             ( caddr paddr plen blen )
                   8322: +LOOP              \ | increase LoopIndex by the BARlen
                   8323: 2 pick 30 +             \ | calc ROM-BAR for a device   ( caddr paddr plen baddr )
                   8324: encode-rom-bar          \ | encode the ROM-BAR          ( caddr paddr plen )
                   8325: THEN                            \ FI                            ( caddr paddr plen )
                   8326: s" reg" property                \ and store it into the property
                   8327: drop
                   8328: ;
                   8329: : pci-common-props ( addr -- )
                   8330: dup pci-class-name 2dup device-name device-type
                   8331: dup pci-vendor@    encode-int s" vendor-id"      property
                   8332: dup pci-device@    encode-int s" device-id"      property
                   8333: dup pci-revision@  encode-int s" revision-id"    property
                   8334: dup pci-class@     encode-int s" class-code"     property
                   8335: 3 encode-int s" #address-cells" property
                   8336: 2 encode-int s" #size-cells"    property
                   8337: dup pci-config-ext? IF 1 encode-int s" ibm,pci-config-space-type" property THEN
                   8338: dup pci-status@
                   8339: dup 9 rshift 3 and encode-int s" devsel-speed" property
                   8340: dup 7 rshift 1 and IF 0 0 s" fast-back-to-back" property THEN
                   8341: dup 6 rshift 1 and IF 0 0 s" 66mhz-capable" property THEN
                   8342: 5 rshift 1 and IF 0 0 s" udf-supported" property THEN
                   8343: dup pci-cache@     ?dup IF encode-int s" cache-line-size" property THEN
                   8344: pci-interrupt@ ?dup IF encode-int s" interrupts"      property THEN
                   8345: ;
                   8346: : pci-device-props ( addr -- )
                   8347: dup pci-common-props
                   8348: dup pci-min-grant@ encode-int s" min-grant"   property
                   8349: dup pci-max-lat@   encode-int s" max-latency" property
                   8350: dup pci-sub-device@ ?dup IF encode-int s" subsystem-id" property THEN
                   8351: dup pci-sub-vendor@ ?dup IF encode-int s" subsystem-vendor-id" property THEN
                   8352: dup pci-device-assigned-addresses-prop
                   8353: pci-reg-props
                   8354: ;
                   8355: : pci-bridge-props ( addr -- )
                   8356: dup pci-bus@
                   8357: encode-int s" primary-bus" property
                   8358: encode-int s" secondary-bus" property
                   8359: encode-int s" subordinate-bus" property
                   8360: dup pci-bus@ drop encode-int rot encode-int+ s" bus-range" property
                   8361: pci-device-slots encode-int s" slot-names" property
                   8362: dup pci-bridge-range-props
                   8363: dup pci-bridge-assigned-addresses-prop
                   8364: pci-bridge-interrupt-map
                   8365: pci-reg-props
                   8366: ;
                   8367: : assign-bar-mapping ( bar-offset size var -- )
                   8368: rot my-unit-64 + -rot
                   8369: assign-bar-value32 drop
                   8370: ;
                   8371: : assigned-addresses-property (  -- )
                   8372: my-unit-64
                   8373: dup pci-common-props
                   8374: pci-device-assigned-addresses-prop
                   8375: ;
                   8376: : pci-bridge-generic-setup ( addr -- )
                   8377: pci-device-slots >r             \ save the slot array on return stack
                   8378: dup pci-common-props            \ set the common properties before scanning the bus
                   8379: s" pci" device-type             \ the type is allways "pci"
                   8380: dup pci-bridge-probe            \ find all device connected to it
                   8381: dup assign-all-bridge-bars      \ set up all memory access BARs
                   8382: dup pci-set-irq-line            \ set the interrupt pin
                   8383: dup pci-set-capabilities        \ set up the capabilities
                   8384: pci-bridge-props            \ and generate all properties
                   8385: r> TO pci-device-slots          \ and reset the slot array
                   8386: ;
                   8387: : pci-device-generic-setup ( config-addr -- )
                   8388: dup assign-all-device-bars      \ calc all BARs
                   8389: dup pci-set-irq-line            \ set the interrupt pin
                   8390: dup pci-set-capabilities        \ set up the capabilities
                   8391: dup pci-device-props            \ and generate all properties
                   8392: drop                            \ forget the config-addr
                   8393: ;
                   8394: ���������8pci-config-bridge.fs: config-b@  puid >r my-puid TO puid my-space + rtas-config-b@ r> TO puid ;
                   8395: : config-w@  puid >r my-puid TO puid my-space + rtas-config-w@ r> TO puid ;
                   8396: : config-l@  puid >r my-puid TO puid my-space + rtas-config-l@ r> TO puid ;
                   8397: : config-b!  puid >r my-puid TO puid my-space + rtas-config-b! r> TO puid ;
                   8398: : config-w!  puid >r my-puid TO puid my-space + rtas-config-w! r> TO puid ;
                   8399: : config-l!  puid >r my-puid TO puid my-space + rtas-config-l! r> TO puid ;
                   8400: : config-dump puid >r my-puid TO puid my-space pci-dump r> TO puid ;
                   8401: : decode-unit ( addr len -- phys.lo ... phys.hi )
                   8402: 2 hex-decode-unit       \ decode string
                   8403: B lshift swap           \ shift the devicenumber to the right spot
                   8404: 8 lshift or             \ add the functionnumber
                   8405: my-bus 10 lshift or     \ add the busnumber
                   8406: 0 0 rot                 \ make phys.lo = 0 = phys.mid
                   8407: ;
                   8408: : encode-unit ( phys.lo ... phys.hi -- unit-str unit-len )
                   8409: nip nip                         \ forget the both zeros
                   8410: dup 8 rshift 7 and swap         \ calc Functionnumber
                   8411: B rshift 1F and                 \ calc Devicenumber
                   8412: over IF                         \ IF Function!=0
                   8413: 2 hex-encode-unit       \ | create string with DevNum,FnNum
                   8414: ELSE                            \ ELSE
                   8415: nip 1 hex-encode-unit   \ | create string with only DevNum
                   8416: THEN                            \ FI
                   8417: ;
                   8418: : map-in ( phys.lo ... phys.hi size -- virt )
                   8419: 2drop drop
                   8420: ;
                   8421: : map-out ( virt size -- )
                   8422: 2drop 
                   8423: ;
                   8424: : dma-alloc ( ... size -- virt )
                   8425: alloc-mem
                   8426: ;
                   8427: : dma-free ( virt size -- )
                   8428: free-mem
                   8429: ;
                   8430: : dma-map-in ( ... virt size cacheable? -- devaddr )
                   8431: 2drop
                   8432: ;
                   8433: : dma-map-out ( virt devaddr size -- )
                   8434: 2drop drop
                   8435: ;
                   8436: : dma-sync ( virt devaddr size -- )
                   8437: 2drop drop
                   8438: ;
                   8439: : open true ;
                   8440: : close ;
                   8441: ����������0update_flash.fsfalse value flash-new
                   8442: : update-flash-help ( -- )
                   8443: cr ." update-flash tool to flash host FW " cr
                   8444: ."              -f <filename>      : Flash from file (e.g. net:\boot_rom.bin)" cr
                   8445: ."              -l                 : Flash from load-base" cr
                   8446: ."              -d                 : Flash from old load base (used by drone)" cr
                   8447: ."              -c                 : Flash from temp to perm" cr
                   8448: ."              -r                 : Flash from perm to temp" cr
                   8449: ;
                   8450: : flash-read-temp ( -- success? )
                   8451: get-flashside 1 = IF flash-addr load-base over flash-image-size rmove true
                   8452: ELSE
                   8453: false
                   8454: THEN
                   8455: ;
                   8456: : flash-read-perm ( -- success? )
                   8457: get-flashside 0= IF
                   8458: flash-addr load-base over flash-image-size rmove true
                   8459: ELSE
                   8460: false
                   8461: THEN
                   8462: ;
                   8463: : flash-switch-side ( side -- success? )
                   8464: set-flashside 0<> IF
                   8465: s" Cannot change flashside" type cr false
                   8466: ELSE
                   8467: true
                   8468: THEN
                   8469: ;
                   8470: : flash-ensure-temp ( -- success? )
                   8471: get-flashside 0= IF
                   8472: cr ." Cannot flash perm! Switching to temp side!"
                   8473: 1 flash-switch-side
                   8474: ELSE
                   8475: true
                   8476: THEN
                   8477: ;
                   8478: : update-flash ( "text" )
                   8479: get-flashside >r                              \ Save old flashside
                   8480: parse-word                      ( str len )   \ Parse first string
                   8481: drop dup c@                     ( str first-char )
                   8482: [char] - <> IF
                   8483: update-flash-help r> 2drop EXIT
                   8484: THEN
                   8485: 1+ c@                           ( second-char )
                   8486: CASE
                   8487: [char] f OF
                   8488: parse-word cr s" do-load" evaluate
                   8489: flash-ensure-temp TO flash-new
                   8490: ENDOF
                   8491: [char] l OF
                   8492: flash-ensure-temp
                   8493: ENDOF
                   8494: [char] d OF
                   8495: flash-load-base load-base 200000 move
                   8496: flash-ensure-temp
                   8497: ENDOF
                   8498: [char] c OF
                   8499: flash-read-temp 0= flash-new or IF
                   8500: ." Cannot commit temp, need to boot on temp first " cr false
                   8501: ELSE
                   8502: 0 flash-switch-side
                   8503: THEN
                   8504: ENDOF
                   8505: [char] r OF
                   8506: flash-read-perm 0= IF
                   8507: ." Cannot commit perm, need to boot on perm first " cr false
                   8508: ELSE
                   8509: 1 flash-switch-side
                   8510: THEN
                   8511: ENDOF
                   8512: dup      OF
                   8513: false
                   8514: ENDOF
                   8515: ENDCASE
                   8516: 0= IF
                   8517: update-flash-help r> drop EXIT
                   8518: THEN
                   8519: load-base flash-write 0= IF ." Flash write failed !! " cr THEN
                   8520: r> set-flashside drop                           \ Restore old flashside
                   8521: ;
                   8522: ��������0�0xmodem.fs01 CONSTANT XM-SOH   \ Start of header
                   8523: 04 CONSTANT XM-EOT   \ End-of-transmission
                   8524: 06 CONSTANT XM-ACK   \ Acknowledge
                   8525: 15 CONSTANT XM-NAK   \ Neg. acknowledge
                   8526: 0 VALUE xm-retries   \ Retry count
                   8527: 0 VALUE xm-block#
                   8528: : xmodem-get-byte  ( timeout -- byte|-1 )
                   8529: d# 1000 *
                   8530: 0 DO
                   8531: key? IF key UNLOOP EXIT THEN
                   8532: 1 ms
                   8533: LOOP
                   8534: -1
                   8535: ;
                   8536: : xmodem-rx-packet  ( address -- success? )
                   8537: 1 xmodem-get-byte    \ Get block number
                   8538: dup 0 < IF
                   8539: 2drop false EXIT  \ Timeout
                   8540: THEN
                   8541: 1 xmodem-get-byte    \ Get neg. block number
                   8542: dup 0 < IF
                   8543: 3drop false EXIT  \ Timeout
                   8544: THEN
                   8545: rot 0                ( blk# ~blk# address chksum )
                   8546: 80 0 DO
                   8547: 1 xmodem-get-byte dup 0 < IF     ( blk# ~blk# address chksum byte )
                   8548: 3drop 2drop UNLOOP FALSE EXIT
                   8549: THEN
                   8550: dup 3 pick c!            ( blk# ~blk# address chksum byte )
                   8551: + swap 1+ swap           ( blk# ~blk# address+1 chksum' )
                   8552: LOOP
                   8553: 0ff and
                   8554: 1 xmodem-get-byte <> IF
                   8555: 3drop FALSE EXIT
                   8556: THEN
                   8557: drop                        ( blk# ~blk# )
                   8558: over xm-block# <> IF
                   8559: 2drop FALSE EXIT
                   8560: THEN                        ( blk# ~blk# )
                   8561: ff xor =
                   8562: ;
                   8563: : (xmodem-load)  ( address -- bytes )
                   8564: 1 to xm-block#
                   8565: 0 to xm-retries
                   8566: dup
                   8567: BEGIN
                   8568: d# 10 xmodem-get-byte dup >r
                   8569: CASE
                   8570: XM-SOH OF
                   8571: dup xmodem-rx-packet IF
                   8572: XM-ACK emit
                   8573: 80 +                     ( start-addr next-addr  R: rx-byte )
                   8574: 0 to xm-retries                    \ Reset retry count
                   8575: xm-block# 1+ ff and to xm-block#   \ Increase current block#
                   8576: ELSE
                   8577: XM-NAK emit
                   8578: xm-retries 1+ to xm-retries  \ Increase retry count
                   8579: THEN
                   8580: ENDOF
                   8581: XM-EOT OF
                   8582: XM-ACK emit
                   8583: ENDOF
                   8584: dup OF
                   8585: XM-NAK emit
                   8586: xm-retries 1+ to xm-retries  \ Increase retry count
                   8587: ENDOF
                   8588: ENDCASE
                   8589: r> XM-EOT =
                   8590: xm-retries d# 10 >= OR
                   8591: UNTIL                         ( start-address end-address )
                   8592: swap -                        ( bytes received )
                   8593: ;
                   8594: : xmodem-load  ( -- bytes )
                   8595: cr ." Waiting for start of XMODEM upload..." cr
                   8596: load-base (xmodem-load)
                   8597: ;
                   8598: ��������@8default-font.bin(($$~$$~$$*((
                   8599: 
                   8600: *0H00@8DD@"THT"    |(||00  @8DDDDDDDD88DD @x8DD8@@@HH~~@@@xx @@@xDDD8~B   8DDD8DDDD88DDD<D800000000 @ @@ ~~  "$BNRN@@$$$$~BBBB|BBB||BBB|<"`@@@@`"<xDBBBBBBDx~@@@~~@@@~~@@@~~@@@@<B@@@@NBB<BBBB~~BBBB<<$BDHP``PHDB@@@@@@@@@~Bf~ZBBBBBBBbbRRJJFFB$BBBBBB$pHDDHp@@@@$BBBBBJ$pHDDHpPHDB @@ ~~BBBBBBBBB<BBBBB$$$$BBBBBBBZfBBB$$$$BBBB$$~B  B~0        0@  <fB~ 8D<D:@@@@XdDDdX8D@@D8<LDDL<8Dx@D884LDL4D8@@@XdDDDDDH0@@@DHPpHDB08T****jX$$$$v""""XdDdX@@@4LDL4xD@@@@$$8$$$$$DDD((*****DD((D"" < <  $THDDD((��������h3(core.fs: ?offset16 ( -- true|false )
                   8601: fcode-offset 16 =
                   8602: ;
                   8603: : ?arch64 ( -- true|false )
                   8604: cell 8 =
                   8605: ;
                   8606: : ?bigendian ( -- true|false )
                   8607: deadbeef fcode-num !
                   8608: fcode-num ?arch64 IF 4 + THEN 
                   8609: c@ de =
                   8610: ;
                   8611: : reset-fcode-end ( -- )
                   8612: false fcode-end !
                   8613: ;
                   8614: : get-ip ( -- n )
                   8615: ip @
                   8616: ;
                   8617: : set-ip ( n -- )
                   8618: ip !
                   8619: ;
                   8620: : next-ip ( -- )
                   8621: get-ip 1+ set-ip
                   8622: ;
                   8623: : jump-n-ip ( n -- )
                   8624: get-ip + set-ip
                   8625: ;
                   8626: : read-byte ( -- n )
                   8627: get-ip fcode-rb@
                   8628: ;
                   8629: : ?compile-mode ( -- on|off )
                   8630: state @
                   8631: ;
                   8632: : save-evaluator-state
                   8633: get-ip               eva-debug? IF ." saved ip "           dup . cr THEN
                   8634: fcode-end @          eva-debug? IF ." saved fcode-end "    dup . cr THEN
                   8635: fcode-offset         eva-debug? IF ." saved fcode-offset " dup . cr THEN
                   8636: fcode-spread         eva-debug? IF ." saved fcode-spread " dup . cr THEN  
                   8637: ['] fcode@ behavior  eva-debug? IF ." saved fcode@ "       dup . cr THEN
                   8638: ;
                   8639: : restore-evaluator-state
                   8640: eva-debug? IF ." restored fcode@ "       dup . cr THEN  to fcode@            
                   8641: eva-debug? IF ." restored fcode-spread " dup . cr THEN  to fcode-spread
                   8642: eva-debug? IF ." restored fcode-offset " dup . cr THEN  to fcode-offset
                   8643: eva-debug? IF ." restored fcode-end "    dup . cr THEN  fcode-end !
                   8644: eva-debug? IF ." restored ip "           dup . cr THEN  set-ip
                   8645: ;
                   8646: : token-table-index ( fcode# -- addr )
                   8647: cells token-table +
                   8648: ;
                   8649: : join-immediate ( xt immediate? addr -- xt+immediate? addr )
                   8650: -rot + swap
                   8651: ;
                   8652: : split-immediate ( xt+immediate? -- xt immediate? )
                   8653: dup 1 and 2dup - rot drop swap
                   8654: ;
                   8655: : literal, ( n -- )
                   8656: postpone literal
                   8657: ;
                   8658: : fc-string,
                   8659: postpone sliteral
                   8660: dup c, bounds ?do i c@ c, loop
                   8661: ;
                   8662: : set-token ( xt immediate? fcode# -- )
                   8663: token-table-index join-immediate !
                   8664: ;
                   8665: : get-token ( fcode# -- xt immediate? )
                   8666: token-table-index @ split-immediate
                   8667: ;
                   8668: -1 VALUE break-fcode-addr 
                   8669: : exec ( FCode# -- )
                   8670: eva-debug? IF
                   8671: dup
                   8672: get-ip 8 u.r ." : "
                   8673: ." [" 3 u.r ." ] "
                   8674: THEN
                   8675: get-ip break-fcode-addr = IF
                   8676: TRUE fcode-end ! drop EXIT
                   8677: THEN
                   8678: get-token 0= IF  \ imm == 0 == false
                   8679: ?compile-mode IF
                   8680: compile,
                   8681: ELSE
                   8682: eva-debug? IF dup xt>name type space THEN        
                   8683: execute
                   8684: THEN
                   8685: ELSE \ immediate
                   8686: eva-debug? IF dup xt>name type space THEN
                   8687: execute
                   8688: THEN
                   8689: eva-debug? IF .s cr THEN
                   8690: ;
                   8691: 0 ?bigendian INCLUDE? big.fs
                   8692: 0 ?bigendian NOT INCLUDE? little.fs
                   8693: : read-fcode# ( -- FCode# )
                   8694: read-byte
                   8695: dup 01 0F between IF drop read-fcode-num16 THEN
                   8696: ;
                   8697: : read-header ( adr -- )
                   8698: next-ip read-byte        drop
                   8699: next-ip read-fcode-num16 drop 
                   8700: next-ip read-fcode-num32 drop 
                   8701: ;
                   8702: : read-fcode-string ( -- str len )
                   8703: read-byte            \ get string length ( -- len )
                   8704: next-ip get-ip       \ get string addr   ( -- len str )
                   8705: swap                 \ type needs the parameters swapped ( -- str len )
                   8706: dup 1- jump-n-ip     \ jump to the end of the string in FCode
                   8707: ;
                   8708: : evaluate-fcode ( -- )
                   8709: fcode@ exec              \ read start code
                   8710: BEGIN
                   8711: next-ip fcode@ exec
                   8712: fcode-end @
                   8713: UNTIL
                   8714: ;
                   8715: : step-fcode ( -- )
                   8716: break-fcode-addr >r -1 to break-fcode-addr      
                   8717: fcode@ exec next-ip
                   8718: r> to break-fcode-addr   
                   8719: ;    
                   8720: ���������0evaluator.fshex
                   8721: -1 constant true
                   8722: 0 constant false
                   8723: variable ip
                   8724: variable fcode-end 
                   8725: variable fcode-num
                   8726: 1 value fcode-spread
                   8727: 16 value fcode-offset
                   8728: false value eva-debug?
                   8729: false value fcode-debug?
                   8730: defer fcode-rb@
                   8731: defer fcode@
                   8732: ' c@ to fcode-rb@
                   8733: create token-table 2000 cells allot    \ 1000h = 4096d
                   8734: include core.fs
                   8735: include 1275.fs
                   8736: include tokens.fs
                   8737: 0 value buff
                   8738: 0 value buff-size
                   8739: ' read-fcode# to fcode@
                   8740: : step next-ip fcode@ exec ; immediate
                   8741: : rom-code-ignored ( image# name len -- )
                   8742: diagnostic-mode? IF type ."  code found in image " .  ." , ignoring ..." cr
                   8743: ELSE 3drop THEN
                   8744: ;
                   8745: : pci-find-rom ( baseaddr -- addr )
                   8746: -8 and dup IF
                   8747: dup rw@ 55aa = IF
                   8748: diagnostic-mode? IF ." Device ROM found at " dup . cr THEN
                   8749: ELSE drop 0 THEN
                   8750: THEN
                   8751: ;
                   8752: : pci-find-fcode ( baseaddr -- addr len | false )
                   8753: pci-find-rom ?dup IF
                   8754: dup 18 + rw@ wbflip +
                   8755: 0 swap BEGIN
                   8756: dup rl@ 50434952 ( 'PCIR') <> IF
                   8757: diagnostic-mode? IF
                   8758: ." Invalid PCI Data structure, ignoring ROM contents" cr
                   8759: THEN
                   8760: 2drop false EXIT
                   8761: THEN
                   8762: dup 14 + rb@ CASE
                   8763: 0 OF over . s" Intel x86 BIOS" rom-code-ignored ENDOF
                   8764: 1 OF swap diagnostic-mode? IF
                   8765: ." Open Firmware FCode found at image " . cr
                   8766: ELSE drop THEN
                   8767: dup a + rw@ wbflip over + \ This code start
                   8768: swap 10 + rw@ wbflip 200 * \ This code length
                   8769: EXIT
                   8770: ENDOF
                   8771: 2 OF over . s" HP PA RISC" rom-code-ignored ENDOF
                   8772: 3 OF over . s" EFI" rom-code-ignored ENDOF
                   8773: dup OF over . s" Unknown type" rom-code-ignored ENDOF
                   8774: ENDCASE
                   8775: dup 15 + rb@ 80 and IF 2drop EXIT THEN \ End of last image
                   8776: dup 10 + rw@ wbflip 200 * + \ Next image start
                   8777: swap 1+ swap \ Next image #
                   8778: 0 UNTIL
                   8779: THEN false
                   8780: ;
                   8781: : execute-rom-fcode ( addr len | false -- )
                   8782: ?dup IF
                   8783: diagnostic-mode? IF ." , executing ..." cr THEN
                   8784: dup >r r@ alloc-mem dup >r swap rmove
                   8785: r@ set-ip evaluate-fcode
                   8786: diagnostic-mode? IF ." Done." cr THEN
                   8787: r> r> free-mem
                   8788: THEN
                   8789: ;
                   8790: ��������P(big.fs: read-fcode-num16 ( -- n )
                   8791: 0 fcode-num !
                   8792: ?arch64 IF
                   8793: read-byte fcode-num 6 + C!
                   8794: next-ip read-byte fcode-num 7 + C!
                   8795: ELSE
                   8796: read-byte fcode-num 2 + C!
                   8797: next-ip read-byte fcode-num 3 + C!
                   8798: THEN
                   8799: fcode-num @
                   8800: ;
                   8801: : read-fcode-num32 ( -- n )
                   8802: 0 fcode-num !
                   8803: ?arch64 IF
                   8804: read-byte fcode-num 4 + C!
                   8805: next-ip read-byte fcode-num 5 + C!
                   8806: next-ip read-byte fcode-num 6 + C!
                   8807: next-ip read-byte fcode-num 7 + C!
                   8808: ELSE
                   8809: read-byte fcode-num 0 + C!
                   8810: next-ip read-byte fcode-num 1 + C!
                   8811: next-ip read-byte fcode-num 2 + C!
                   8812: next-ip read-byte fcode-num 3 + C!
                   8813: THEN
                   8814: fcode-num @
                   8815: ;
                   8816: ��������+`+!0tokens.fs: fc-abort ." FCode called abort: IP " get-ip . ( ." STACK: " .s ) depth dup 0< IF abort THEN . rdepth . cr  abort ;
                   8817: : fc-0 ." 0(lit): STACK ( S: " depth . ." R: " rdepth . ." ): " depth 0> IF .s THEN 0 ;
                   8818: : fc-1 ." 1(lit): STACK ( S: " depth . ." R: " rdepth . ." ): " depth 0> IF .s THEN 1 ;
                   8819: : parse-1hex 1 hex-decode-unit ;
                   8820: : reset-token-table
                   8821: FFF 0 DO ['] ferror 0 i set-token LOOP
                   8822: ;
                   8823: reset-token-table
                   8824: ' end0 0        00 set-token
                   8825: ' b(lit)      1 10 set-token
                   8826: ' b(')        1 11 set-token
                   8827: ' b(")        1 12 set-token
                   8828: ' bbranch     1 13 set-token
                   8829: ' b?branch    1 14 set-token
                   8830: ' b(loop)     1 15 set-token
                   8831: ' b(+loop)    1 16 set-token
                   8832: ' b(do)       1 17 set-token
                   8833: ' b(?do)      1 18 set-token
                   8834: ' i           0 19 set-token
                   8835: ' j           0 1A set-token
                   8836: ' b(leave)    1 1B set-token
                   8837: ' b(of)       1 1C set-token
                   8838: ' execute     0 1D set-token
                   8839: ' +           0 1E set-token
                   8840: ' -           0 1F set-token
                   8841: ' *           0 20 set-token
                   8842: ' /           0 21 set-token
                   8843: ' mod         0 22 set-token 
                   8844: ' and         0 23 set-token 
                   8845: ' or          0 24 set-token 
                   8846: ' xor         0 25 set-token 
                   8847: ' invert      0 26 set-token 
                   8848: ' lshift      0 27 set-token 
                   8849: ' rshift      0 28 set-token 
                   8850: ' >>a         0 29 set-token 
                   8851: ' /mod        0 2A set-token 
                   8852: ' u/mod       0 2B set-token
                   8853: ' negate      0 2C set-token 
                   8854: ' abs         0 2D set-token 
                   8855: ' min         0 2E set-token 
                   8856: ' max         0 2F set-token 
                   8857: ' >r          0 30 set-token 
                   8858: ' r>          0 31 set-token 
                   8859: ' r@          0 32 set-token 
                   8860: ' exit        0 33 set-token 
                   8861: ' 0=          0 34 set-token 
                   8862: ' 0<>         0 35 set-token 
                   8863: ' 0<          0 36 set-token 
                   8864: ' 0<=         0 37 set-token 
                   8865: ' 0>          0 38 set-token 
                   8866: ' 0>=         0 39 set-token 
                   8867: ' <           0 3A set-token
                   8868: ' >           0 3B set-token
                   8869: ' =           0 3C set-token
                   8870: ' <>          0 3D set-token
                   8871: ' u>          0 3E set-token
                   8872: ' u<=         0 3F set-token 
                   8873: ' u<          0 40 set-token 
                   8874: ' u>=         0 41 set-token 
                   8875: ' >=          0 42 set-token 
                   8876: ' <=          0 43 set-token 
                   8877: ' between     0 44 set-token 
                   8878: ' within      0 45 set-token 
                   8879: ' DROP        0 46 set-token
                   8880: ' DUP         0 47 set-token
                   8881: ' OVER        0 48 set-token
                   8882: ' SWAP        0 49 set-token
                   8883: ' ROT         0 4A set-token
                   8884: ' -ROT        0 4B set-token
                   8885: ' TUCK        0 4C set-token
                   8886: ' nip         0 4D set-token 
                   8887: ' pick        0 4E set-token 
                   8888: ' roll        0 4F set-token 
                   8889: ' ?dup        0 50 set-token 
                   8890: ' depth       0 51 set-token 
                   8891: ' 2drop       0 52 set-token 
                   8892: ' 2dup        0 53 set-token 
                   8893: ' 2over       0 54 set-token 
                   8894: ' 2swap       0 55 set-token 
                   8895: ' 2rot        0 56 set-token 
                   8896: ' 2/          0 57 set-token 
                   8897: ' u2/         0 58 set-token 
                   8898: ' 2*          0 59 set-token 
                   8899: ' /c          0 5A set-token
                   8900: ' /w          0 5B set-token 
                   8901: ' /l          0 5C set-token 
                   8902: ' /n          0 5D set-token 
                   8903: ' ca+         0 5E set-token 
                   8904: ' wa+         0 5F set-token 
                   8905: ' la+         0 60 set-token 
                   8906: ' na+         0 61 set-token 
                   8907: ' char+       0 62 set-token 
                   8908: ' wa1+        0 63 set-token 
                   8909: ' la1+        0 64 set-token 
                   8910: ' cell+       0 65 set-token 
                   8911: ' chars       0 66 set-token 
                   8912: ' /w*         0 67 set-token 
                   8913: ' /l*         0 68 set-token 
                   8914: ' cells       0 69 set-token 
                   8915: ' on          0 6A set-token 
                   8916: ' off         0 6B set-token 
                   8917: ' +!          0 6C set-token 
                   8918: ' @           0 6D set-token 
                   8919: ' l@          0 6E set-token 
                   8920: ' w@          0 6F set-token 
                   8921: ' <w@         0 70 set-token 
                   8922: ' c@          0 71 set-token 
                   8923: ' !           0 72 set-token 
                   8924: ' l!          0 73 set-token 
                   8925: ' w!          0 74 set-token 
                   8926: ' c!          0 75 set-token 
                   8927: ' 2@          0 76 set-token 
                   8928: ' 2!          0 77 set-token 
                   8929: ' move        0 78 set-token 
                   8930: ' fill        0 79 set-token 
                   8931: ' comp        0 7A set-token 
                   8932: ' noop        0 7B set-token
                   8933: ' lwsplit     0 7C set-token 
                   8934: ' wljoin      0 7D set-token 
                   8935: ' lbsplit     0 7E set-token 
                   8936: ' bljoin      0 7F set-token 
                   8937: ' wbflip      0 80 set-token 
                   8938: ' upc         0 81 set-token 
                   8939: ' lcc         0 82 set-token 
                   8940: ' pack      0 83 set-token 
                   8941: ' count       0 84 set-token 
                   8942: ' body>       0 85 set-token 
                   8943: ' >body       0 86 set-token 
                   8944: ' fcode-revision 0 87 set-token 
                   8945: ' span        0 88 set-token 
                   8946: ' unloop      0 89 set-token 
                   8947: ' expect      0 8A set-token 
                   8948: ' alloc-mem   0 8B set-token \ alloc-mem  
                   8949: ' free-mem    0 8C set-token \ free-mem 
                   8950: ' key?        0 8D set-token 
                   8951: ' key         0 8E set-token 
                   8952: ' emit        0 8F set-token 
                   8953: ' type        0 90 set-token 
                   8954: ' cr          0 91 set-token \ should be (cr but terminal support is not
                   8955: ' cr          0 92 set-token 
                   8956: ' hold        0 95 set-token 
                   8957: ' <#          0 96 set-token 
                   8958: ' u#>         0 97 set-token 
                   8959: ' sign        0 98 set-token 
                   8960: ' u#          0 99 set-token 
                   8961: ' u#s         0 9A set-token 
                   8962: ' u.          0 9B set-token 
                   8963: ' u.r         0 9C set-token 
                   8964: ' .           0 9D set-token 
                   8965: ' .r          0 9E set-token 
                   8966: ' .s          0 9F set-token 
                   8967: ' base        0 A0 set-token 
                   8968: ' $number     0 A2 set-token 
                   8969: ' digit       0 A3 set-token 
                   8970: ' -1          0 A4 set-token
                   8971: '  0          0 A5 set-token
                   8972: '  1          0 A6 set-token
                   8973: '  2          0 A7 set-token
                   8974: '  3          0 A8 set-token
                   8975: ' bl          0 A9 set-token
                   8976: ' bs          0 AA set-token 
                   8977: ' bell        0 AB set-token 
                   8978: ' bounds      0 AC set-token 
                   8979: ' here        0 AD set-token 
                   8980: ' aligned     0 AE set-token 
                   8981: ' wbsplit     0 AF set-token 
                   8982: ' bwjoin      0 B0 set-token 
                   8983: ' b(<mark)    1 B1 set-token
                   8984: ' b(>resolve) 1 B2 set-token
                   8985: ' new-token   0 B5 set-token 
                   8986: ' named-token 0 B6 set-token
                   8987: ' b(:)        1 B7 set-token
                   8988: ' b(value)    1 B8 set-token 
                   8989: ' b(variable) 1 B9 set-token 
                   8990: ' b(constant) 1 BA set-token 
                   8991: ' b(create)   1 BB set-token 
                   8992: ' b(defer)    1 BC set-token 
                   8993: ' b(buffer:)  1 BD set-token 
                   8994: ' b(field)    1 BE set-token 
                   8995: ' INSTANCE     0 C0 set-token 
                   8996: ' b(;)        1 C2 set-token
                   8997: ' b(to)       1 C3 set-token 
                   8998: ' b(case)     1 C4 set-token
                   8999: ' b(endcase)  1 C5 set-token
                   9000: ' b(endof)    1 C6 set-token
                   9001: ' #           0 C7 set-token
                   9002: ' #s          0 C8 set-token
                   9003: ' #>          0 C9 set-token
                   9004: ' external-token 0 CA set-token 
                   9005: ' $find       0 CB set-token
                   9006: ' offset16    0 CC set-token 
                   9007: ' evaluate    0 CD set-token
                   9008: ' c,          0  D0 set-token
                   9009: ' w,          0  D1 set-token
                   9010: ' l,          0  D2 set-token
                   9011: ' ,           0  D3 set-token
                   9012: ' um*         0  D4 set-token
                   9013: ' um/mod      0  D5 set-token
                   9014: ' d+          0  D8 set-token
                   9015: ' d-          0  D9 set-token
                   9016: ' get-token   0  DA set-token 
                   9017: ' set-token   0  DB set-token 
                   9018: ' state       0  DC set-token  \ possibly broken
                   9019: ' compile,    0  DD set-token
                   9020: ' behavior    0  DE set-token 
                   9021: ' start0             0  F0 set-token
                   9022: ' start1             0  F1 set-token
                   9023: ' start2             0  F2 set-token
                   9024: ' start4             0  F3 set-token
                   9025: ' ferror             0  FC set-token
                   9026: ' version1           0  FD set-token
                   9027: ' end1               0  FF set-token
                   9028: ' my-address        0 102 set-token 
                   9029: ' my-space          0 103 set-token
                   9030: ' property          0 110 set-token
                   9031: ' encode-int        0 111 set-token
                   9032: ' encode+           0 112 set-token
                   9033: ' encode-phys       0 113 set-token
                   9034: ' encode-string     0 114 set-token
                   9035: ' encode-bytes      0 115 set-token
                   9036: ' reg               0 116 set-token
                   9037: ' model             0 119 set-token    
                   9038: ' device-type       0 11A set-token
                   9039: ' parse-2int        0 11B set-token
                   9040: ' is-install        0 11C set-token
                   9041: ' is-remove         0 11D set-token
                   9042: ' is-selftest       0 11E set-token
                   9043: ' new-device        0 11F set-token
                   9044: ' diagnostic-mode?  0 120 set-token
                   9045: ' memory-test-suite 0 122 set-token
                   9046: ' mask              0 124 set-token
                   9047: ' get-msecs         0 125 set-token
                   9048: ' ms                0 126 set-token
                   9049: ' finish-device     0 127 set-token
                   9050: ' decode-phys       0 128 set-token
                   9051: ' #lines            0 150 set-token
                   9052: ' #columns          0 151 set-token
                   9053: ' line#             0 152 set-token
                   9054: ' column#           0 153 set-token
                   9055: ' inverse?          0 154 set-token
                   9056: ' inverse-screen?   0 155 set-token
                   9057: ' draw-character    0 157 set-token
                   9058: ' reset-screen      0 158 set-token
                   9059: ' toggle-cursor     0 159 set-token
                   9060: ' erase-screen      0 15A set-token
                   9061: ' blink-screen      0 15B set-token
                   9062: ' invert-screen     0 15C set-token
                   9063: ' insert-characters 0 15D set-token
                   9064: ' delete-characters 0 15E set-token
                   9065: ' insert-lines      0 15F set-token
                   9066: ' delete-lines      0 160 set-token
                   9067: ' draw-logo         0 161 set-token
                   9068: ' frame-buffer-adr  0 162 set-token
                   9069: ' screen-height     0 163 set-token
                   9070: ' screen-width      0 164 set-token
                   9071: ' window-top        0 165 set-token
                   9072: ' window-left       0 166 set-token
                   9073: ' default-font      0 16A set-token
                   9074: ' set-font          0 16B set-token
                   9075: ' char-height       0 16C set-token
                   9076: ' char-width        0 16D set-token
                   9077: ' >font             0 16E set-token
                   9078: ' fontbytes         0 16F set-token
                   9079: ' fb8-install       0 18B set-token
                   9080: ' device-name       0 201 set-token
                   9081: ' my-args           0 202 set-token
                   9082: ' my-self           0 203 set-token
                   9083: ' find-package      0 204 set-token
                   9084: ' open-package      0 205 set-token
                   9085: ' close-package     0 206 set-token
                   9086: ' find-method       0 207 set-token
                   9087: ' call-package      0 208 set-token
                   9088: ' $call-parent      0 209 set-token
                   9089: ' my-parent         0 20A set-token
                   9090: ' ihandle>phandle   0 20B set-token
                   9091: ' my-unit           0 20D set-token
                   9092: ' $call-method      0 20E set-token
                   9093: ' $open-package     0 20F set-token
                   9094: ' (is-user-word)    0 214 set-token
                   9095: ' suspend-fcode     0 215 set-token
                   9096: ' fc-abort             0 216 set-token
                   9097: ' catch             0 217 set-token
                   9098: ' throw             0 218 set-token
                   9099: ' get-my-property   0 21A set-token
                   9100: ' decode-int        0 21B set-token
                   9101: ' decode-string     0 21C set-token
                   9102: ' get-inherited-property 0 21D set-token  
                   9103: ' delete-property   0 21E set-token  
                   9104: ' get-package-property 0 21F set-token
                   9105: ' cpeek             0 220 set-token 
                   9106: ' wpeek             0 221 set-token 
                   9107: ' lpeek             0 222 set-token 
                   9108: ' cpoke             0 223 set-token 
                   9109: ' wpoke             0 224 set-token 
                   9110: ' lpoke             0 225 set-token 
                   9111: ' lwflip            0 226 set-token 
                   9112: ' lbflip            0 227 set-token 
                   9113: ' lbflips           0 228 set-token
                   9114: ' rx@               0 22E set-token
                   9115: ' rx!               0 22F set-token
                   9116: ' rb@               0 230 set-token
                   9117: ' rb!               0 231 set-token
                   9118: ' rw@               0 232 set-token 
                   9119: ' rw!               0 233 set-token 
                   9120: ' rl@               0 234 set-token 
                   9121: ' rl!               0 235 set-token 
                   9122: ' wbflips           0 236 set-token 
                   9123: ' lwflips           0 237 set-token 
                   9124: ' child             0 23B set-token
                   9125: ' peer              0 23C set-token
                   9126: ' next-property     0 23D set-token
                   9127: ' byte-load         0 23E set-token
                   9128: ' set-args          0 23F set-token
                   9129: ' left-parse-string 0 240 set-token
                   9130: ' bxjoin            0 241 set-token
                   9131: ' <l@               0 242 set-token
                   9132: ' lxjoin            0 243 set-token
                   9133: ' wxjoin            0 244 set-token
                   9134: ' x,                0 245 set-token
                   9135: ' x@                0 246 set-token
                   9136: ' x!                0 247 set-token
                   9137: ' /x                0 248 set-token
                   9138: ' /x*               0 249 set-token
                   9139: ' xa+               0 24A set-token
                   9140: ' xa1+              0 24B set-token
                   9141: ' xbflip            0 24C set-token
                   9142: ' xbflips           0 24D set-token
                   9143: ' xbsplit           0 24E set-token
                   9144: ' xlflip            0 24F set-token
                   9145: ' xlflips           0 250 set-token
                   9146: ' xlsplit           0 251 set-token
                   9147: ' xwflip            0 252 set-token
                   9148: ' xwflips           0 253 set-token
                   9149: ' xwsplit           0 254 set-token
                   9150: ����������(1275.fs0 value function-type    ' function-type @ constant <value>
                   9151: variable function-type ' function-type @ constant <variable>
                   9152: 0 constant function-type ' function-type @ constant <constant>
                   9153: : function-type ;        ' function-type @ constant <colon>
                   9154: create function-type     ' function-type @ constant <create>
                   9155: defer function-type      ' function-type @ constant <defer>
                   9156: : fcode-revision ( -- n )
                   9157: 00030000 \ major * 65536 + minor
                   9158: ;
                   9159: : b(lit) ( -- n )
                   9160: next-ip read-fcode-num32
                   9161: ?compile-mode IF literal, THEN
                   9162: ;
                   9163: : b(")
                   9164: next-ip read-fcode-string
                   9165: ?compile-mode IF fc-string, align postpone count THEN
                   9166: ;
                   9167: : b(')
                   9168: next-ip read-fcode# get-token drop ?compile-mode IF literal, THEN
                   9169: ;
                   9170: : ?jump-direction ( n -- )
                   9171: dup 8000 >= IF FFFF swap - negate 2- THEN
                   9172: ;
                   9173: : ?negative
                   9174: 8000 and
                   9175: ;
                   9176: : dest-on-top
                   9177: 0 >r BEGIN dup @ 0= WHILE >r REPEAT
                   9178: BEGIN r> dup WHILE swap REPEAT 
                   9179: drop
                   9180: ;
                   9181: : ?branch
                   9182: true =
                   9183: ;
                   9184: : read-fcode-offset \ ELSE needs to be fixed!
                   9185: ?offset16 IF next-ip read-fcode-num16 ELSE THEN
                   9186: ;
                   9187: : b?branch ( flag -- )
                   9188: ?compile-mode IF  
                   9189: read-fcode-offset ?negative IF   dest-on-top postpone until
                   9190: ELSE postpone if
                   9191: THEN
                   9192: ELSE
                   9193: ?branch IF   2 jump-n-ip
                   9194: ELSE read-fcode-offset
                   9195: ?jump-direction 2- jump-n-ip
                   9196: THEN
                   9197: THEN
                   9198: ; immediate
                   9199: : bbranch ( -- )
                   9200: ?compile-mode IF 
                   9201: read-fcode-offset
                   9202: ?negative IF   dest-on-top postpone again
                   9203: ELSE postpone else
                   9204: get-ip next-ip fcode@ B2 = IF drop ELSE set-ip THEN
                   9205: THEN
                   9206: ELSE  
                   9207: read-fcode-offset ?jump-direction 2- jump-n-ip
                   9208: THEN
                   9209: ; immediate
                   9210: : b(<mark) ( -- )
                   9211: ?compile-mode IF postpone begin THEN
                   9212: ; immediate
                   9213: : b(>resolve) ( -- )
                   9214: ?compile-mode IF postpone then THEN
                   9215: ; immediate
                   9216: : ffwto; ( -- )
                   9217: BEGIN fcode@ dup c2 <> WHILE
                   9218: ." ffwto: skipping " dup . ." @ " get-ip . cr
                   9219: CASE   10 OF ( lit ) read-fcode-num32 drop ENDOF
                   9220: 11 OF ( ' ) read-fcode# drop ENDOF
                   9221: 12 OF ( " ) read-fcode-string 2drop ENDOF
                   9222: 13 OF ( bbranch ) read-fcode-offset drop ENDOF
                   9223: 14 OF ( b?branch ) read-fcode-offset drop ENDOF
                   9224: 15 OF ( loop ) read-fcode-offset drop ENDOF
                   9225: 16 OF ( +loop ) read-fcode-offset drop ENDOF
                   9226: 17 OF ( do ) read-fcode-offset drop ENDOF
                   9227: 18 OF ( ?do ) read-fcode-offset drop ENDOF
                   9228: 1C OF ( of ) read-fcode-offset drop ENDOF
                   9229: C6 OF ( endof ) read-fcode-offset drop ENDOF
                   9230: C3 OF ( to ) read-fcode# drop ENDOF
                   9231: dup OF next-ip ENDOF
                   9232: ENDCASE
                   9233: REPEAT next-ip
                   9234: ;
                   9235: : rpush ( rparm -- ) \ push the rparm to be on top of return stack after exit
                   9236: r> swap >r >r
                   9237: ;
                   9238: : rpop ( -- rparm ) \ pop the rparm that was on top of return stack before this
                   9239: r> r> swap >r
                   9240: ;
                   9241: : b1(;) ( -- )
                   9242: ." b1(;)" cr
                   9243: rpop set-ip 
                   9244: ;
                   9245: : b(;) ( -- )
                   9246: postpone exit reveal postpone [ 
                   9247: ; immediate
                   9248: : b(:) ( -- )
                   9249: <colon> compile, ]
                   9250: ; immediate
                   9251: : b(case) ( sel -- sel )
                   9252: postpone case
                   9253: ; immediate
                   9254: : b(endcase)
                   9255: postpone endcase
                   9256: ; immediate
                   9257: : b(of)
                   9258: postpone of
                   9259: read-fcode-offset drop   \ read and discard offset
                   9260: ; immediate
                   9261: : b(endof)
                   9262: postpone endof
                   9263: read-fcode-offset drop   
                   9264: ; immediate
                   9265: : b(do)
                   9266: postpone do
                   9267: read-fcode-offset drop   
                   9268: ; immediate
                   9269: : b(?do)
                   9270: postpone ?do
                   9271: read-fcode-offset drop   
                   9272: ; immediate
                   9273: : b(loop)
                   9274: postpone loop
                   9275: read-fcode-offset drop   
                   9276: ; immediate
                   9277: : b(+loop)
                   9278: postpone +loop
                   9279: read-fcode-offset drop   
                   9280: ; immediate
                   9281: : b(leave)
                   9282: postpone leave
                   9283: ; immediate
                   9284: : new-token  \ unnamed local fcode function
                   9285: align here next-ip read-fcode# 0 swap set-token
                   9286: ;
                   9287: : external-token ( -- )  \ named local fcode function 
                   9288: next-ip read-fcode-string
                   9289: header         ( str len -- )  \ create a header in the current dictionary entry
                   9290: new-token
                   9291: ;
                   9292: : new-token
                   9293: eva-debug? IF
                   9294: s" x" get-ip >r next-ip read-fcode# r> set-ip (u.) $cat strdup
                   9295: header
                   9296: THEN new-token
                   9297: ;
                   9298: : named-token  \ decide wether or not to give a new token an own name in the dictionary
                   9299: fcode-debug? IF new-token ELSE external-token THEN
                   9300: ;
                   9301: : b(to) ( x -- )
                   9302: next-ip read-fcode#
                   9303: get-token drop
                   9304: >body cell -
                   9305: ?compile-mode IF literal, postpone !  ELSE !  THEN
                   9306: ; immediate
                   9307: : b(value)
                   9308: <value> , , reveal
                   9309: ;
                   9310: : b(variable)
                   9311: <variable> , 0 , reveal
                   9312: ;
                   9313: : b(constant)
                   9314: <constant> , , reveal
                   9315: ;
                   9316: : undefined-defer
                   9317: cr cr ." Unititialized defer word has been executed!" cr cr 
                   9318: true fcode-end !
                   9319: ;
                   9320: : b(defer)
                   9321: <defer> , reveal
                   9322: postpone undefined-defer
                   9323: ;
                   9324: : b(create)
                   9325: <variable> , 
                   9326: postpone noop reveal
                   9327: ;
                   9328: : b(field) ( E: addr -- addr+offset ) ( F: offset size -- offset+size )
                   9329: <colon> , over literal,
                   9330: postpone + postpone exit
                   9331: +
                   9332: ;
                   9333: : b(buffer:) ( E: -- a-addr) ( F: size -- )
                   9334: <variable> , allot
                   9335: ;
                   9336: : suspend-fcode ( -- )
                   9337: noop        \ has to be implemented more efficiently ;-)
                   9338: ;
                   9339: : offset16 ( -- )
                   9340: 16 to fcode-offset
                   9341: ;
                   9342: : version1 ( -- )
                   9343: 1 to fcode-spread
                   9344: 8 to fcode-offset
                   9345: read-header
                   9346: ;
                   9347: : start0 ( -- )
                   9348: 0 to fcode-spread
                   9349: offset16
                   9350: read-header
                   9351: ;
                   9352: : start1 ( -- )
                   9353: 1 to fcode-spread
                   9354: offset16
                   9355: read-header
                   9356: ;
                   9357: : start2 ( -- )
                   9358: 2 to fcode-spread
                   9359: offset16
                   9360: read-header
                   9361: ;
                   9362: : start4 ( -- )
                   9363: 4 to fcode-spread
                   9364: offset16
                   9365: read-header
                   9366: ;
                   9367: : end0 ( -- ) 
                   9368: true fcode-end ! 
                   9369: ;
                   9370: : end1 ( -- ) 
                   9371: end0 
                   9372: ;
                   9373: : ferror ( -- )
                   9374: clear end0
                   9375: cr ." FCode# " fcode-num @ . ." not assigned!"
                   9376: cr ." FCode evaluation aborted." cr
                   9377: ." ( -- S:" depth . ." R:" rdepth . ." ) " .s cr
                   9378: abort
                   9379: ;
                   9380: : reset-local-fcodes
                   9381: FFF 800 DO ['] ferror 0 i set-token LOOP
                   9382: ;
                   9383: : byte-load ( addr xt -- )
                   9384: >r >r 
                   9385: save-evaluator-state
                   9386: r> r>
                   9387: reset-fcode-end
                   9388: 1 to fcode-spread
                   9389: dup 1 = IF drop ['] rb@ THEN to fcode-rb@
                   9390: set-ip
                   9391: reset-local-fcodes
                   9392: depth >r
                   9393: evaluate-fcode
                   9394: r> depth 1- <> IF   clear end0 
                   9395: cr ." Ambiguous stack depth after byte-load!"
                   9396: cr ." FCode evaluation aborted." cr cr
                   9397: ELSE restore-evaluator-state 
                   9398: THEN
                   9399: ['] c@ to fcode-rb@                
                   9400: ;
                   9401: create byte-load-test-fcode
                   9402: f1 c, 08 c, 18 c, 69 c, 00 c, 00 c, 00 c, 68 c,
                   9403: 12 c, 16 c, 62 c, 79 c, 74 c, 65 c, 2d c, 6c c, 
                   9404: 6f c, 61 c, 64 c, 2d c, 74 c, 65 c, 73 c, 74 c, 
                   9405: 2d c, 66 c, 63 c, 6f c, 64 c, 65 c, 21 c, 21 c, 
                   9406: 90 c, 92 c, ( a6 c, a7 c, 2e c, ) 00 c,
                   9407: : byte-load-test
                   9408: byte-load-test-fcode ['] w@
                   9409: ; immediate
                   9410: : fcode-ms
                   9411: s" ms" $find IF 0= IF compile, ELSE execute THEN THEN ; immediate
                   9412: : fcode-$find
                   9413: $find
                   9414: IF
                   9415: drop true
                   9416: ELSE
                   9417: false
                   9418: THEN    
                   9419: ;
                   9420: ���������P0pci-class_0c.fss" serial bus [ " type my-space pci-class-name type s"  ]" type cr
                   9421: my-space pci-device-generic-setup
                   9422: : handle-usb-ohci-class  ( -- )
                   9423: 4 config-w@ 110 or 4 config-w!
                   9424: pci-master-enable               \ set PCI Bus master bit and
                   9425: pci-mem-enable                  \ memory space enable for USB scan
                   9426: 10 config-l@                    \ get base address on stack for usb-ohci.fs
                   9427: s" usb-ohci.fs" included
                   9428: ;
                   9429: : handle-sbc-subclass  ( -- )
                   9430: my-space pci-class@ ffff and CASE         \ get PCI sub-class and interface
                   9431: 0310 OF handle-usb-ohci-class ENDOF    \ USB OHCI controller
                   9432: ENDCASE
                   9433: ;
                   9434: handle-sbc-subclass
                   9435: ��������P(O�0usb-ohci.fsCONSTANT baseaddrs
                   9436: s" OHCI base address = " baseaddrs usb-debug-print-val
                   9437: s" usb" 2dup device-name device-type
                   9438: 1 encode-int s" #address-cells" property
                   9439: 0 encode-int s" #size-cells" property
                   9440: : encode-unit ( port -- unit-str unit-len ) 1 hex-encode-unit ;
                   9441: : decode-unit ( addr len -- port ) 1 hex-decode-unit ;
                   9442: STRUCT
                   9443: /l field td>tattr
                   9444: /l field td>cbptr
                   9445: /l field td>ntd
                   9446: /l field td>bfrend
                   9447: CONSTANT /tdlen
                   9448: STRUCT
                   9449: /l field ed>eattr
                   9450: /l field ed>tdqtp
                   9451: /l field ed>tdqhp
                   9452: /l field ed>ned
                   9453: CONSTANT /edlen
                   9454: STRUCT
                   9455: /l field hc>hcattr
                   9456: /l field hc>hcdone
                   9457: CONSTANT /hclen
                   9458: baseaddrs      CONSTANT HcRevision
                   9459: baseaddrs 4  + CONSTANT hccontrol
                   9460: baseaddrs 8  + CONSTANT hccomstat
                   9461: baseaddrs 0c + CONSTANT hcintstat
                   9462: baseaddrs 14 + CONSTANT hcintdsbl
                   9463: baseaddrs 18 + CONSTANT hchccareg
                   9464: baseaddrs 20 + CONSTANT hcctrhead
                   9465: baseaddrs 24 + CONSTANT hccurcont
                   9466: baseaddrs 28 + CONSTANT hcbulkhead
                   9467: baseaddrs 2c + CONSTANT hccurbulk
                   9468: baseaddrs 30 + CONSTANT hcdnehead
                   9469: baseaddrs 34 + CONSTANT hcintrval
                   9470: baseaddrs 40 + CONSTANT HcPeriodicStart
                   9471: baseaddrs 48 + CONSTANT hcrhdescA
                   9472: baseaddrs 4c + CONSTANT hcrhdescB
                   9473: baseaddrs 50 + CONSTANT HcRhStatus
                   9474: baseaddrs 54 + CONSTANT hcrhpstat
                   9475: baseaddrs 58 + CONSTANT hcrhpstat2
                   9476: baseaddrs 5c + CONSTANT hcrhpstat3
                   9477: usb-debug-flag IF
                   9478: 0 config-l@ ."    - VENDOR: " 8 .r cr
                   9479: 40 config-l@ ."    - PMC   : " 8 .r
                   9480: 44 config-l@ ."      PMCSR : " 8 .r cr
                   9481: E0 config-l@ ."    - EXT1  : " 8 .r
                   9482: E4 config-l@ ."      EXT2  : " 8 .r cr
                   9483: THEN
                   9484: 2 CONSTANT WDH
                   9485: 1      CONSTANT RHP-CCS    \ Current Connect Status
                   9486: 2      CONSTANT RHP-PES    \ Port Enable Status
                   9487: 10     CONSTANT RHP-PRS    \ Port Reset Status
                   9488: 100    CONSTANT RHP-PPS    \ Port Power Status
                   9489: 10000  CONSTANT RHP-CSC    \ Connect Status Changed
                   9490: 100000 CONSTANT RHP-PRSC   \ Port Reset Status Changed
                   9491: 0 CONSTANT OHCI-DP-SETUP
                   9492: 1 CONSTANT OHCI-DP-OUT
                   9493: 2 CONSTANT OHCI-DP-IN
                   9494: 3 CONSTANT OHCI-DP-INVALID
                   9495: 8006000100001200 CONSTANT get-ddescp
                   9496: 8006000200000900 CONSTANT get-cdescp
                   9497: 8006000400000900 CONSTANT get-idescp
                   9498: 8006000500000700 CONSTANT get-edescp
                   9499: A006000000001000 CONSTANT get-hdescp
                   9500: 0009010000000000 CONSTANT set-cdescp
                   9501: 2303010004000000 CONSTANT hpenable-set
                   9502: 2303040001000000 CONSTANT hp1rst-set
                   9503: 2303040002000000 CONSTANT hp2rst-set
                   9504: 2303040003000000 CONSTANT hp3rst-set
                   9505: 2303040004000000 CONSTANT hp4rst-set
                   9506: 2303080001000000 CONSTANT hp1pwr-set
                   9507: 2303080002000000 CONSTANT hp2pwr-set
                   9508: 2303080003000000 CONSTANT hp3pwr-set
                   9509: 2303080004000000 CONSTANT hp4pwr-set
                   9510: A003000000000400 CONSTANT hstatus-get
                   9511: A300000001000400 CONSTANT hp1sta-get
                   9512: A300000002000400 CONSTANT hp2sta-get
                   9513: A300000003000400 CONSTANT hp3sta-get
                   9514: A300000004000400 CONSTANT hp4sta-get
                   9515: 8008000000000100 CONSTANT get-config
                   9516: A1FE000000000100 CONSTANT GET-MAX-LUN
                   9517: 2    18 lshift CONSTANT DATA0-TOGGLE
                   9518: 3    18 lshift CONSTANT DATA1-TOGGLE
                   9519: 0f   1c lshift CONSTANT CC-FRESH-TD
                   9520: 8 CONSTANT STD-REQUEST-SETUP-SIZE
                   9521: 0    13 lshift CONSTANT TD-DP-SETUP
                   9522: 1    13 lshift CONSTANT TD-DP-OUT
                   9523: 2    13 lshift CONSTANT TD-DP-IN
                   9524: 400001    CONSTANT ed-cntatr
                   9525: 400002    CONSTANT ed-cntatr1
                   9526: 80081     CONSTANT ed-hubatr
                   9527: 80000     CONSTANT ed-defatr
                   9528: 0f0e40000 CONSTANT td-attr
                   9529: 00 VALUE ptr
                   9530: 200 CONSTANT MAX-TDS
                   9531: 0 VALUE td-freelist-head
                   9532: 0 VALUE td-freelist-tail
                   9533: 0 VALUE num-free-tds
                   9534: 0 VALUE max-rh-ports
                   9535: 0 VALUE current-stat
                   9536: INSTANCE VARIABLE td-list-region
                   9537: 14 CONSTANT MAX-EDS
                   9538: 0 VALUE ed-freelist-head
                   9539: 0 VALUE num-free-eds
                   9540: INSTANCE VARIABLE ed-list-region
                   9541: 0 VALUE usb-address
                   9542: 0 VALUE initial-hub-address
                   9543: 0 VALUE new-device-address
                   9544: 0 VALUE mps
                   9545: 0 VALUE DEBUG-TDS
                   9546: 0 VALUE case-failed  \ available for general use to see IF a CASE statement
                   9547: 0 VALUE WHILE-failed \ available for general use to see IF a WHILE LOOP
                   9548: 8 CONSTANT DEFAULT-CONTROL-MPS
                   9549: 12 CONSTANT DEVICE-DESCRIPTOR-LEN
                   9550: 1 CONSTANT DEVICE-DESCRIPTOR-TYPE
                   9551: 1 CONSTANT DEVICE-DESCRIPTOR-TYPE-OFFSET
                   9552: 4 CONSTANT DEVICE-DESCRIPTOR-DEVCLASS-OFFSET
                   9553: 7 CONSTANT DEVICE-DESCRIPTOR-MPS-OFFSET
                   9554: 20 CONSTANT BULK-CONFIG-DESCRIPTOR-LEN
                   9555: 9 CONSTANT HUB-DEVICE-CLASS
                   9556: 0 CONSTANT NO-CLASS
                   9557: VARIABLE  setup-packet     \ 8 bytes for setup packet
                   9558: VARIABLE  ch-buffer        \ 1 byte character buffer
                   9559: INSTANCE VARIABLE dd-buffer
                   9560: INSTANCE VARIABLE cd-buffer
                   9561: 0 VALUE temp1
                   9562: 0 VALUE temp2
                   9563: 0 VALUE temp3
                   9564: 0 VALUE extra-bytes
                   9565: 0 VALUE num-td
                   9566: 0 VALUE current
                   9567: 0 VALUE device-speed
                   9568: : Show-OHCI-Register
                   9569: ." -> OHCI-Register: " cr
                   9570: ." - HcControl : " hccontrol       rl@-le 8 .r
                   9571: ."   CmdStat   : " hccomstat       rl@-le 8 .r
                   9572: ."   HcInterr. : " hcintstat       rl@-le 8 .r cr
                   9573: ." - HcFmIntval: " hcintrval       rl@-le 8 .r
                   9574: ."   Per. Start: " HcPeriodicStart rl@-le 8 .r cr
                   9575: ." - PortStat-1: " hcrhpstat       rl@-le 8 .r
                   9576: ."   PortStat-2: " hcrhpstat2      rl@-le 8 .r
                   9577: ."   PortStat-3: " hcrhpstat3      rl@-le 8 .r cr
                   9578: ."   Descr-A   : " hcrhdescA       rl@-le 8 .r
                   9579: ."   Descr-B   : " hcrhdescB       rl@-le 8 .r
                   9580: ."   HcRhStat  : " HcRhStatus      rl@-le 8 .r cr
                   9581: ;
                   9582: : display-ed ( ED-ADDRESS -- )
                   9583: TO temp1
                   9584: usb-debug-flag IF
                   9585: s" Dump OF ED " type temp1 u. cr
                   9586: s" eattr    : " type temp1 ed>eattr l@-le u. cr
                   9587: s" tdqhp    : " type temp1 ed>tdqhp l@-le u. cr
                   9588: s" tdqtp    : " type temp1 ed>tdqtp l@-le u. cr
                   9589: s" ned      : " type temp1 ed>ned   l@-le u. cr
                   9590: THEN
                   9591: ;
                   9592: : display-td ( TD-ADDRESS -- )
                   9593: TO temp1
                   9594: usb-debug-flag IF
                   9595: s" TD " type temp1 u. s" dump: " type cr
                   9596: s" td>tattr  : " type temp1 td>tattr l@-le u. cr
                   9597: s" td>cbptr  : " type temp1 td>cbptr l@-le u. cr
                   9598: s" td>ntd    : " type temp1 td>ntd l@-le u. cr
                   9599: s" td>bfrend : " type temp1 td>bfrend l@-le u. cr
                   9600: THEN
                   9601: ;
                   9602: : display-descriptors ( ED-ADDRESS -- )
                   9603: 10  1- not and             ( ED-ADDRESS~ )
                   9604: dup display-ed ed>tdqhp l@-le  BEGIN ( ED-ADDRESS~ )
                   9605: 10  1- not and         ( ED-ADDRESS~ )
                   9606: dup 0<>                ( ED-ADDRESS~ TRUE | FALSE )
                   9607: WHILE
                   9608: dup  display-td td>ntd l@-le ( ED-ADDRESS~ )
                   9609: REPEAT
                   9610: drop
                   9611: ;
                   9612: : zero-out-a-td-except-link ( td -- )
                   9613: dup 0 swap td>tattr  l!-le             ( td )
                   9614: dup 0 swap td>cbptr  l!-le             ( td )
                   9615: dup 0 swap td>bfrend l!-le             ( td )
                   9616: drop
                   9617: ;
                   9618: : initialize-td-free-list ( -- )
                   9619: MAX-TDS 0= IF EXIT THEN
                   9620: td-list-region @ 0= IF EXIT THEN
                   9621: td-list-region @ TO temp1
                   9622: 0 TO temp2  BEGIN
                   9623: temp1 zero-out-a-td-except-link
                   9624: temp1 /tdlen + dup   temp1 td>ntd   l!-le TO temp1
                   9625: temp2 1+ TO temp2
                   9626: temp2 MAX-TDS =                ( TRUE | FALSE )
                   9627: UNTIL
                   9628: temp1 /tdlen - dup 0 swap td>ntd l!-le TO td-freelist-tail
                   9629: td-list-region @ TO td-freelist-head
                   9630: MAX-TDS TO num-free-tds
                   9631: ;
                   9632: : allocate-td-list ( n -- head tail )
                   9633: dup 0= IF drop 0 0 EXIT THEN           ( 0 0 )
                   9634: dup num-free-tds > IF drop 0 0 EXIT THEN     ( 0 0 )
                   9635: dup num-free-tds = IF                  ( n )
                   9636: drop td-freelist-head td-freelist-tail ( td-freelist-head td-freelist-tail )
                   9637: 0 TO td-freelist-head                  ( td-freelist-head td-freelist-tail )
                   9638: 0 TO td-freelist-tail                  ( td-freelist-head td-freelist-tail )
                   9639: 0 TO num-free-tds                              ( td-freelist-head td-freelist-tail )
                   9640: EXIT
                   9641: THEN
                   9642: dup num-free-tds swap - TO num-free-tds        ( n )
                   9643: td-freelist-head                               ( n td-list-head )
                   9644: dup TO temp1                                   ( n td-list-head )
                   9645: swap                                   ( td-list-head n )
                   9646: 0 DO                                           ( td-list-head   )
                   9647: temp1 TO temp2                         ( td-list-head   )
                   9648: temp1 td>ntd l@-le   TO   temp1                ( td-list-head   )
                   9649: LOOP                                           ( td-list-head   )
                   9650: temp2                                  ( td-list-head td-list-tail )
                   9651: dup td>ntd 0 swap l!-le                        ( td-list-head td-list-tail )
                   9652: temp1 TO td-freelist-head                      ( td-list-head td-list-tail )
                   9653: ;
                   9654: : find-td-list-tail-and-size  ( head -- tail n )
                   9655: TO temp1
                   9656: 0 TO temp2
                   9657: 0 TO temp3
                   9658: DEBUG-TDS  IF
                   9659: s" BEGIN find-td-list-tail-and-size: "   usb-debug-print
                   9660: THEN
                   9661: BEGIN
                   9662: temp1 0<>                                      ( TRUE|FALSE )
                   9663: WHILE
                   9664: DEBUG-TDS  IF
                   9665: temp1 u. cr
                   9666: THEN
                   9667: temp1 TO temp3
                   9668: temp1 td>ntd l@-le TO temp1
                   9669: temp2 1+ TO temp2
                   9670: REPEAT
                   9671: temp3 temp2                                    ( tail n )
                   9672: DEBUG-TDS  IF
                   9673: s" END find-td-list-tail-and-size"   usb-debug-print
                   9674: THEN
                   9675: ;
                   9676: : (free-td-list) ( head  -- )
                   9677: dup find-td-list-tail-and-size num-free-tds + TO num-free-tds ( head tail )
                   9678: td-freelist-tail 0=  IF                                         ( head tail )
                   9679: dup TO td-freelist-tail                                         ( head tail )
                   9680: THEN                                                            ( head tail )
                   9681: td>ntd td-freelist-head swap l!-le                              ( head )
                   9682: TO td-freelist-head
                   9683: ;
                   9684: : zero-out-an-ed-except-link ( ed -- )
                   9685: dup 0 swap ed>eattr  l!-le             ( ed )
                   9686: dup 0 swap ed>tdqtp  l!-le             ( ed )
                   9687: dup 0 swap ed>tdqhp  l!-le             ( ed )
                   9688: drop
                   9689: ;
                   9690: : initialize-ed-free-list ( -- )
                   9691: MAX-EDS 0= IF EXIT THEN
                   9692: ed-list-region @ 0= IF
                   9693: s" init-ed-list: ed-list-region is not allocated!"   usb-debug-print
                   9694: EXIT
                   9695: THEN
                   9696: ed-list-region @ TO temp1
                   9697: 0 TO temp2   BEGIN
                   9698: temp1 zero-out-an-ed-except-link
                   9699: temp1 /edlen + dup   temp1 ed>ned   l!-le TO temp1
                   9700: temp2 1+ TO temp2
                   9701: temp2 MAX-EDS =
                   9702: UNTIL
                   9703: temp1 /edlen - ed>ned 0 swap l!-le
                   9704: ed-list-region @ TO ed-freelist-head
                   9705: MAX-EDS TO num-free-eds
                   9706: ;
                   9707: : allocate-ed  ( -- ed-ptr )
                   9708: num-free-eds 0= IF 0 EXIT THEN
                   9709: ed-freelist-head                                       ( ed-freelist-head )
                   9710: ed-freelist-head ed>ned l@-le TO ed-freelist-head      ( ed-freelist-head )
                   9711: num-free-eds 1- TO num-free-eds                        ( ed-freelist-head )
                   9712: dup ed>ned 0 swap l!-le \ Terminate the Link.  ( ed-freelist-head )
                   9713: ;
                   9714: : free-ed ( ed-ptr  -- )
                   9715: dup zero-out-an-ed-except-link                 ( ed-ptr )
                   9716: dup ed>ned ed-freelist-head swap l!-le                 ( ed-ptr )
                   9717: TO ed-freelist-head
                   9718: num-free-eds 1+ TO num-free-eds
                   9719: ;
                   9720: 100 alloc-mem VALUE hchcca
                   9721: hchcca ff and IF
                   9722: s" Warning: hchcca not aligned!" usb-debug-print
                   9723: THEN
                   9724: 84 hchcca + CONSTANT hchccadneq
                   9725: : (allocate-mem)  ( -- )
                   9726: /tdlen MAX-TDS * 10 + alloc-mem dup td-list-region !  ( td-list-region-ptr )
                   9727: f and IF
                   9728: s" Warning: td-list-region not aligned!" usb-debug-print
                   9729: THEN
                   9730: initialize-td-free-list
                   9731: /edlen MAX-EDS * 10 + alloc-mem dup ed-list-region !  ( ed-list-region-ptr )
                   9732: f and IF
                   9733: s" Warning: ed-list-region not aligned!" usb-debug-print
                   9734: THEN
                   9735: initialize-ed-free-list
                   9736: DEVICE-DESCRIPTOR-LEN chars alloc-mem dd-buffer !
                   9737: BULK-CONFIG-DESCRIPTOR-LEN chars alloc-mem cd-buffer !
                   9738: ;
                   9739: : (de-allocate-mem)  ( -- )
                   9740: td-list-region @ ?dup IF
                   9741: /tdlen MAX-TDS * 10 + free-mem
                   9742: 0 td-list-region !
                   9743: THEN
                   9744: ed-list-region @ ?dup IF
                   9745: /edlen MAX-EDS * 10 + free-mem
                   9746: 0 ed-list-region !
                   9747: THEN
                   9748: dd-buffer @ ?dup IF
                   9749: DEVICE-DESCRIPTOR-LEN free-mem
                   9750: 0 dd-buffer !
                   9751: THEN
                   9752: cd-buffer @ ?dup IF
                   9753: BULK-CONFIG-DESCRIPTOR-LEN free-mem
                   9754: 0 cd-buffer !
                   9755: THEN
                   9756: ;
                   9757: : hc-suspend  ( -- )
                   9758: 00C3 hccontrol rl!-le             \ Suspend USB host controller
                   9759: ;
                   9760: : open  ( -- TRUE|FALSE )
                   9761: (allocate-mem)
                   9762: TRUE
                   9763: ;
                   9764: : close  ( -- )
                   9765: (de-allocate-mem)
                   9766: ;
                   9767: : HC-enable-control-list-processing ( -- )
                   9768: hccomstat dup rl@-le 02 or swap rl!-le
                   9769: hccontrol dup rl@-le 10 or swap rl!-le
                   9770: ;
                   9771: : HC-enable-bulk-list-processing ( -- )
                   9772: hccomstat dup rl@-le 04 or swap rl!-le
                   9773: hccontrol dup rl@-le 20 or swap rl!-le
                   9774: ;
                   9775: : HC-enable-interrupt-list-processing ( -- )
                   9776: hccontrol dup rl@-le 04 or swap rl!-le
                   9777: ;
                   9778: : (HC-ACK-WDH) ( -- )   WDH hcintstat rl!-le ;
                   9779: : (HC-CHECK-WDH) ( -- ) hcintstat rl@-le WDH and 0<> ;
                   9780: : disable-control-list-processing ( -- )
                   9781: hccontrol dup rl@-le ffffffef and swap rl!-le
                   9782: hccomstat dup rl@-le fffffffd and swap rl!-le
                   9783: ;
                   9784: : disable-bulk-list-processing ( -- )
                   9785: hccontrol dup rl@-le ffffffdf and swap rl!-le
                   9786: hccomstat dup rl@-le fffffffb and swap rl!-le
                   9787: ;
                   9788: : disable-interrupt-list-processing ( -- )
                   9789: hccontrol dup rl@-le fffffffb and swap rl!-le
                   9790: ;
                   9791: 0 VALUE current-toggle
                   9792: : fill-TD-list ( start-toggle addr dlen dp MPS TD-List-Head -- )
                   9793: TO temp1                               ( start-toggle addr dlen dp MPS )
                   9794: TO temp2                               ( start-toggle addr dlen dp )
                   9795: CASE                                   ( start-toggle addr dlen )
                   9796: OHCI-DP-SETUP  OF  TD-DP-SETUP TO temp3 ENDOF ( start-toggle addr dlen )
                   9797: OHCI-DP-IN     OF  TD-DP-IN    TO temp3 ENDOF ( start-toggle addr dlen )
                   9798: OHCI-DP-OUT    OF  TD-DP-OUT   TO temp3 ENDOF ( start-toggle addr dlen )
                   9799: dup            OF  -1          TO temp3       ( start-toggle addr dlen )
                   9800: s" fill-TD-list: Invalid DP specified"   usb-debug-print
                   9801: ENDOF
                   9802: ENDCASE
                   9803: temp3 -1 = IF EXIT THEN                          ( start-toggle addr dlen )
                   9804: rot                                              ( addr dlen start-toggle )
                   9805: TO current-toggle swap                             ( dlen addr )
                   9806: BEGIN
                   9807: over temp2 >=                              ( dlen addr TRUE|FALSE )
                   9808: WHILE                                      ( dlen addr )
                   9809: dup temp1 td>cbptr l!-le                           ( dlen addr )
                   9810: current-toggle 18 lshift                      ( dlen addr current-toggle~ )
                   9811: DATA0-TOGGLE                        ( dlen  addr current-toggle~ toggle )
                   9812: CC-FRESH-TD temp3 or or or          ( dlen  addr or-result )
                   9813: temp1 td>tattr l!-le                ( dlen addr~  )
                   9814: dup temp2 1- + temp1 td>bfrend l!-le ( dlen addr~  )
                   9815: temp2 +                             ( dlen next-addr )
                   9816: swap temp2 - swap
                   9817: temp1 td>ntd l@-le TO temp1         ( dlen next-addr )
                   9818: current-toggle                      ( dlen next-addr current-toggle )
                   9819: CASE
                   9820: 0 OF 1 TO current-toggle ENDOF
                   9821: 1 OF 0 TO current-toggle ENDOF
                   9822: ENDCASE
                   9823: REPEAT                                   ( dlen addr )
                   9824: over 0<>  IF
                   9825: dup temp1 td>cbptr l!-le              ( dlen addr )
                   9826: current-toggle 18 lshift              ( dlen addr curent-toggle~ )
                   9827: DATA0-TOGGLE                          ( dlen addr curent-toggle~ toggle )
                   9828: CC-FRESH-TD temp3 or or or            ( dlen addr or-result )
                   9829: temp1 td>tattr l!-le                  ( dlen addr )
                   9830: + 1- temp1 td>bfrend l!-le
                   9831: ELSE
                   9832: 2drop
                   9833: THEN
                   9834: ;
                   9835: : (td-list-status) ( PointerToTDlist -- failingTD CCode TRUE | 0 )
                   9836: BEGIN   ( PointerToTDlist )
                   9837: dup 0<>         ( PointerToTDlist TRUE|FALSE )
                   9838: IF              ( PointerToTDlist )
                   9839: dup td>tattr l@-le f0000000 and 1c rshift dup 0= TRUE swap
                   9840: ELSE
                   9841: drop FALSE dup ( FALSE )
                   9842: THEN
                   9843: WHILE
                   9844: drop drop td>ntd l@-le
                   9845: REPEAT
                   9846: ;
                   9847: : (wait-for-done-q)           ( timeout -- TD-list TRUE | FALSE )
                   9848: BEGIN                      ( timeout )
                   9849: dup 0<>                 ( timeout TRUE|FALSE )
                   9850: (HC-CHECK-WDH) NOT      ( timeout TRUE|FALSE TRUE|FALSE )
                   9851: AND                     \ not timed out AND WDH-bit not set
                   9852: WHILE
                   9853: 1 ms                    \ wait
                   9854: 1-                      ( timeout )
                   9855: dup ff and 0= IF show-proceed THEN
                   9856: REPEAT                   ( timeout )
                   9857: drop
                   9858: hchccadneq  l@-le          \ read last HcDoneHead (RAM)
                   9859: (HC-CHECK-WDH)             \ HcDoneHead was updated ?
                   9860: IF
                   9861: (HC-ACK-WDH)            \ clear register bit: WDH
                   9862: TRUE                    ( td-list TRUE )
                   9863: ELSE
                   9864: FALSE
                   9865: THEN
                   9866: ;
                   9867: : debug-td ( -- )
                   9868: s" Num Free TDs = " num-free-tds usb-debug-print-val
                   9869: ;
                   9870: : HC-reset ( -- )
                   9871: hccomstat dup rl@-le 01 or swap rl!-le    \ issue HC reset
                   9872: BEGIN
                   9873: hccomstat rl@-le 01 and 0<>            \ wait for reset end
                   9874: WHILE
                   9875: REPEAT
                   9876: 23f02edf hcintrval rl!-le                 \ frame-interval register
                   9877: hchcca   hchccareg rl!-le                 \ HC communication area
                   9878: 0000     hcctrhead rl!-le                 \ control transfer head
                   9879: 0000     hcbulkhead rl!-le                \ bulk transfer head
                   9880: 0ffff    hcintdsbl rl!-le                 \ interrupt disable reg.
                   9881: 83       hccontrol rl!-le                 \ set USBOPERATIONAL
                   9882: 23f02edf hcintrval rl!-le                 \ frame-interval register
                   9883: hchcca   hchccareg rl!-le                 \ HC communication area
                   9884: d# 50 ms
                   9885: hcrhdescA rl@-le ff and     ( total-rh-ports )
                   9886: to max-rh-ports
                   9887: hcrhpstat TO current-stat              \ start with first port status reg
                   9888: 0                                      \ port status default
                   9889: max-rh-ports 0                         \ checking all ports
                   9890: DO
                   9891: current-stat rl@-le or              \ OR-ing all stats
                   9892: 200 current-stat rl!-le             \ Clear Port Power (CPP)
                   9893: current-stat 4 + TO current-stat    \ check next RH-Port
                   9894: LOOP
                   9895: 100 and 0<>                            \ any of the ports had power ?
                   9896: IF
                   9897: d# 750 wait-proceed                 \ wait for power discharge
                   9898: THEN
                   9899: hcrhpstat TO current-stat              \ start with first port status reg
                   9900: max-rh-ports 0
                   9901: DO
                   9902: 102 current-stat rl!-le             \ power on and enable
                   9903: hcrhdescA 3 + rb@ 2 * ms            \ startup delay 30 ms (2 * POTPGT)
                   9904: current-stat 4 + TO current-stat    \ check next RH-Port
                   9905: LOOP
                   9906: d# 500 wait-proceed                    \ STEC device needs 300 ms
                   9907: ;
                   9908: : error-recovery ( -- )
                   9909: initialize-td-free-list
                   9910: initialize-ed-free-list
                   9911: HC-reset
                   9912: ;
                   9913: : store-initial-usb-hub-address ( -- )
                   9914: usb-address TO initial-hub-address
                   9915: ;
                   9916: : reset-to-initial-usb-hub-address ( -- )
                   9917: initial-hub-address TO usb-address
                   9918: ;
                   9919: : allocate-usb-address ( -- usb-address )
                   9920: usb-address    7f <>           ( TRUE|FALSE )
                   9921: IF
                   9922: usb-address 1+ TO usb-address \ RISK: Check to see IF it overflows 127
                   9923: usb-address            ( usb-address )
                   9924: THEN                           ( usb-address )
                   9925: ;
                   9926: s" usb-support.fs" INCLUDED
                   9927: : control-std-set-address        ( speedbit -- usb-address TRUE | FALSE )
                   9928: >r                                                 ( R: speedbit )
                   9929: 0005000000000000 setup-packet !
                   9930: allocate-usb-address dup setup-packet 2 + c!       ( usb-addr  R: speedbit )
                   9931: s" USB set-address: " 2 pick usb-debug-print-val   ( usb-addr  R: speedbit )
                   9932: 0 0 0 setup-packet 8 r> controlxfer                ( usb-addr TRUE | FALSE )
                   9933: IF                                                   ( TRUE | FALSE )
                   9934: TRUE                                         ( TRUE )
                   9935: ELSE
                   9936: drop FALSE \ PENDING: Return the allocated address back. ( FALSE )
                   9937: THEN                                                 ( TRUE | FALSE )
                   9938: ;
                   9939: : control-std-get-device-descriptor
                   9940: 8006000100000000 setup-packet !
                   9941: 2 pick setup-packet 6 + w!-le
                   9942: setup-packet -rot ( data-buffer data-len setup-packet MPS fa )
                   9943: >r >r >r >r >r 0 r> r> r> r> r>
                   9944: controlxfer         ( TRUE | FALSE )
                   9945: ;
                   9946: : control-std-get-configuration-descriptor
                   9947: TO temp1 ( data-buffer data-len MPS )
                   9948: TO temp2 ( data-buffer data-len )
                   9949: TO temp3 ( data-buffer )
                   9950: 8006000200000000 setup-packet !
                   9951: temp3 setup-packet 6 + w!-le
                   9952: 0 swap temp3 setup-packet temp2 temp1 controlxfer
                   9953: ;
                   9954: : control-std-get-maxlun ( MPS fun-addr dir data-buff data-len -- TRUE | FALSE )
                   9955: GET-MAX-LUN setup-packet !  ( MPS fun-addr dir data-buff data-len )
                   9956: setup-packet 5 pick 5 pick
                   9957: controlxfer ( MPS fun-addr  TRUE | FALSE )
                   9958: nip nip    ( TRUE | FALSE )
                   9959: ;
                   9960: : control-bulk-reset ( MPS fun-addr dir data-buff data-len -- TRUE | FALSE )
                   9961: 21FF000000000000 setup-packet !  ( MPS fun-addr dir data-buff data-len )
                   9962: setup-packet 5 pick 5 pick
                   9963: controlxfer ( MPS fun-addr  TRUE | FALSE )
                   9964: nip nip    ( TRUE | FALSE )
                   9965: ;
                   9966: : control-std-get-string-descriptor
                   9967: TO temp1  ( StringIndex data-buffer data-len MPS )
                   9968: TO temp2  ( StringIndex data-buffer data-len )
                   9969: TO temp3  ( StringIndex )
                   9970: 8006000300000000 setup-packet !
                   9971: temp3 setup-packet 6 + w!-le
                   9972: 409 setup-packet 4 + w!-le \ US English Language code.
                   9973: swap      ( data buffer StringIndex )
                   9974: setup-packet 2 + c! ( data-buffer )
                   9975: 0 swap temp3 setup-packet temp2 temp1 controlxfer ( TRUE | FALSE )
                   9976: ;
                   9977: : control-std-set-configuration ( configvalue FuncAddr -- TRUE|FALSE )
                   9978: TO temp1                     ( configvalue )
                   9979: TO temp2
                   9980: 0009000000000000 setup-packet ! \ RISK: Endian and 64-bit assumptions
                   9981: temp2 setup-packet 2 + w!-le
                   9982: 0 0 0 setup-packet DEFAULT-CONTROL-MPS temp1 controlxfer
                   9983: ;
                   9984: 0 VALUE port-number
                   9985: s" usb-enumerate.fs" INCLUDED
                   9986: : rhport-enumerate ( port-num -- )
                   9987: TO port-number
                   9988: device-speed control-std-set-address        ( usb-addr TRUE | FALSE )
                   9989: IF
                   9990: device-speed or                          ( usb-addr+speedbit )
                   9991: TO new-device-address
                   9992: dd-buffer @ 8 erase
                   9993: dd-buffer @ DEFAULT-CONTROL-MPS DEFAULT-CONTROL-MPS      ( buffer mps mps )
                   9994: new-device-address control-std-get-device-descriptor   ( TRUE | FALSE )
                   9995: IF
                   9996: ELSE
                   9997: s" USB: Read Dev Descriptor failed"   usb-debug-print EXIT
                   9998: THEN
                   9999: dd-buffer @ DEVICE-DESCRIPTOR-TYPE-OFFSET + c@  ( Descriptor-type )
                   10000: DEVICE-DESCRIPTOR-TYPE <> IF
                   10001: s" USB: Error Reading Device Descriptor"   usb-debug-print
                   10002: s" Read descriptor is not OF the right type"  usb-debug-print
                   10003: s" Aborting enumeration"  usb-debug-print
                   10004: EXIT
                   10005: THEN
                   10006: dd-buffer @ DEVICE-DESCRIPTOR-MPS-OFFSET + c@ TO mps
                   10007: create-usb-device-tree
                   10008: ELSE
                   10009: s" Set address failed on port " port-number usb-debug-print-val
                   10010: s" Aborting Enumeration."   usb-debug-print
                   10011: EXIT
                   10012: THEN
                   10013: ;
                   10014: : rhport-initialize ( -- )
                   10015: hcrhpstat TO current-stat              \ start with first port status reg
                   10016: max-rh-ports 1+ 1
                   10017: DO
                   10018: current-stat rl@-le RHP-CCS and 0<>    ( TRUE|FALSE )
                   10019: IF
                   10020: current-stat hcrhpstat3 =        \ third port of NEC ?
                   10021: IF
                   10022: 81 to uDOC-present            \ uDOC is present and now processed
                   10023: THEN
                   10024: s" Device connected to this port!" usb-debug-print
                   10025: RHP-PRS current-stat rl!-le      \ issue a port reset
                   10026: BEGIN
                   10027: current-stat rl@-le RHP-PRS AND    \ wait for reset end
                   10028: WHILE
                   10029: REPEAT
                   10030: hcrhdescA 3 + rb@ 2 * ms         \ startup delay 30 ms (POTPGT)
                   10031: d# 100 ms
                   10032: current-stat rl@-le 200 and 4 lshift
                   10033: to device-speed                  \ store speed bit
                   10034: RHP-CSC RHP-PRSC or current-stat rl!-le
                   10035: I ['] rhport-enumerate CATCH IF  \ Scan port
                   10036: s" USB scan failed on root hub port: " rot usb-debug-print-val
                   10037: reset-to-initial-usb-hub-address
                   10038: THEN
                   10039: ELSE
                   10040: s" No device detected at this port." usb-debug-print
                   10041: current-stat hcrhpstat3 =        \ third port of NEC ? (=ModFD)
                   10042: IF                               \ here a ModFD should be on ELBA
                   10043: current-stat rl@-le 80000 and 0<>      \ is over-current detected ?
                   10044: IF
                   10045: uDOC-present 08 or to uDOC-present  \ set flag for uDOC-check
                   10046: THEN
                   10047: THEN
                   10048: THEN
                   10049: current-stat 4 + TO current-stat    \ check next RH-Port
                   10050: uDOC-present 0f and to uDOC-present \ remove processing flag
                   10051: LOOP
                   10052: ;
                   10053: : enumerate ( -- )
                   10054: HC-reset
                   10055: ['] hc-suspend add-quiesce-xt     \ Assert that HC will be supsended
                   10056: store-initial-usb-hub-address
                   10057: rhport-initialize                 \ Probe all available RH ports
                   10058: reset-to-initial-usb-hub-address
                   10059: ;
                   10060: set-ohci-alias
                   10061: ��������;�;�0usb-support.fs0 value NEXT-TD
                   10062: 0 VALUE num-tds
                   10063: 0 VALUE td-retire-count
                   10064: 0 VALUE saved-tail
                   10065: 0 VALUE poll-timer
                   10066: VARIABLE controlxfer-cmd
                   10067: : (ed-prepare) ( dir addr dlen setup-packet MPS ep-fun --
                   10068: FALSE | dir addr dlen ed-ptr setup-ptr )
                   10069: allocate-ed dup 0=  IF ( dir addr dlen setup-packet MPS ep-fun ed-ptr )
                   10070: drop 3drop 2drop FALSE EXIT  ( FALSE )
                   10071: THEN
                   10072: TO temp1               ( dir addr dlen setup-packet MPS ep-fun )
                   10073: temp1 zero-out-an-ed-except-link ( dir addr dlen setup-packet MPS ep-fun )
                   10074: temp1 ed>eattr l@-le or temp1 ed>eattr l!-le ( dir addr dlen setup-ptr MPS )
                   10075: dup TO temp2 10 lshift temp1 ed>eattr l@-le or temp1 ed>eattr l!-le
                   10076: temp1 swap TRUE            ( dir addr dlen ed-ptr setup-ptr TRUE )
                   10077: ;
                   10078: : (td-prepare) ( dir addr dlen ed-ptr setup-ptr --
                   10079: dir FALSE | dir addr dlen ed-ptr setup-ptr td-head td-tail )
                   10080: 2 pick         ( dir addr dlen ed-ptr setup-ptr dlen )
                   10081: temp2          ( dir addr dlen ed-ptr setup-ptr dlen MPS )
                   10082: /mod           ( dir addr dlen ed-ptr setup-ptr rem quo )
                   10083: swap 0<>   IF  ( dir addr dlen ed-ptr setup-ptr quo )
                   10084: 1+
                   10085: THEN
                   10086: 2+
                   10087: dup TO num-tds                ( dir addr dlen ed-ptr setup-ptr quo+2 )
                   10088: allocate-td-list dup 0=  IF   ( dir addr dlen ed-ptr setup-ptr quo+2 )
                   10089: 2drop                      ( dir addr dlen ed-ptr setup-ptr )
                   10090: drop                       ( dir addr dlen ed-ptr )
                   10091: free-ed                    ( dir addr dlen )
                   10092: 2drop                      ( dir )
                   10093: FALSE                      ( dir FALSE )
                   10094: EXIT
                   10095: THEN TRUE
                   10096: ;
                   10097: : (td-ready)  ( dir addr dlen ed-ptr setup-ptr td-head td-tail -- )
                   10098: 3 pick     ( dir addr dlen ed-ptr setup-ptr td-head td-tail ed-ptr )
                   10099: tuck       ( dir addr dlen ed-ptr setup-ptr td-head ed-ptr td-tail ed-ptr )
                   10100: ed>tdqtp l!-le            ( dir addr dlen ed-ptr setup-ptr td-head ed-ptr )
                   10101: ed>tdqhp l!-le            ( dir addr dlen ed-ptr setup-ptr )
                   10102: over ed>ned 0 swap l!-le  ( dir addr dlen ed-ptr setup-ptr )
                   10103: ;
                   10104: : (td-setup-status) ( dir addr dlen ed-ptr setup-ptr -- dir addr dlen ed-ptr )
                   10105: over ed>tdqhp l@-le             ( dir addr dlen ed-ptr setup-ptr td-head )
                   10106: dup zero-out-a-td-except-link   ( dir addr dlen ed-ptr setup-ptr td-head )
                   10107: dup td>tattr DATA0-TOGGLE CC-FRESH-TD or swap l!-le
                   10108: 2dup td>cbptr l!-le             ( dir addr dlen ed-ptr setup-ptr td-head )
                   10109: 2dup td>bfrend swap STD-REQUEST-SETUP-SIZE 1- + swap l!-le
                   10110: 2drop                           ( dir addr dlen ed-ptr )
                   10111: ;
                   10112: : (td-tailpointer) ( dir addr dlen ed-ptr -- dir addr dlen ed-ptr )
                   10113: dup ed>tdqtp l@-le              ( dir addr dlen ed-ptr td-tail )
                   10114: dup zero-out-a-td-except-link   ( dir addr dlen ed-ptr td-tail )
                   10115: dup td>tattr dup l@-le DATA1-TOGGLE CC-FRESH-TD or or swap l!-le
                   10116: 4 pick 0=                       ( dir addr dlen ed-ptr td-tail flag )
                   10117: 3 pick 0<>                      ( dir addr dlen ed-ptr td-tail flag flag )
                   10118: and   IF                        ( dir addr dlen ed-ptr td-tail )
                   10119: dup td>tattr dup l@-le TD-DP-OUT or swap l!-le
                   10120: ELSE
                   10121: dup td>tattr dup l@-le TD-DP-IN or swap l!-le
                   10122: THEN
                   10123: drop                           ( dir addr dlen ed-ptr )
                   10124: ;
                   10125: : (td-data) ( dir addr dlen ed-ptr --  ed-ptr )
                   10126: -rot             ( dir ed-ptr addr dlen )
                   10127: dup 0<>  IF      ( dir ed-ptr addr dlen )
                   10128: >r >r >r TO temp1 r> r> r> temp1 ( ed-ptr addr dlen dir )
                   10129: 3 pick                             ( ed-ptr addr dlen dir ed-ptr )
                   10130: ed>tdqhp l@-le td>ntd l@-le   ( ed-ptr addr dlen dir td-datahead )
                   10131: 4 pick                            ( ed-ptr addr dlen dir td-datahead ed-ptr )
                   10132: td>tattr l@-le 10 rshift ( ed-ptr addr dlen dir td-head-data MPS )
                   10133: swap                       ( ed-ptr addr dlen dir MPS td-head-data )
                   10134: >r >r >r >r >r 1 r> r> r> r> r>
                   10135: >r >r 0=  IF                 ( ed-ptr 1 addr dlen dir )
                   10136: OHCI-DP-IN                ( ed-ptr 1 addr dlen dir  OHCI-DP-IN )
                   10137: ELSE
                   10138: OHCI-DP-OUT               ( ed-ptr 1 addr dlen dir  OHCI-DP-OUT )
                   10139: THEN
                   10140: r> r>               ( ed-ptr 1 addr dlen dir  OHCI-DP- MPS td-head-data )
                   10141: fill-TD-list
                   10142: ELSE
                   10143: 2drop nip           ( ed-ptr )
                   10144: THEN
                   10145: ;
                   10146: 10 CONSTANT max-retire-td
                   10147: : (transfer-wait-for-doneq)  ( ed-ptr -- TRUE | FALSE )
                   10148: dup                               ( ed-ptr ed-ptr )
                   10149: hcctrhead rl!-le                  ( ed-ptr )
                   10150: HC-enable-control-list-processing ( ed-ptr )
                   10151: 0 TO td-retire-count              ( ed-ptr )
                   10152: 0 TO poll-timer                   ( ed-ptr )
                   10153: BEGIN
                   10154: td-retire-count num-tds <>     ( ed-ptr TRUE | FALSE )
                   10155: poll-timer max-retire-td < and       ( ed-ptr TRUE | FALSE )
                   10156: WHILE
                   10157: (HC-CHECK-WDH)                                      ( ed-ptr )
                   10158: IF
                   10159: hchccadneq l@-le find-td-list-tail-and-size nip ( ed-ptr n )
                   10160: td-retire-count + TO td-retire-count             ( ed-ptr )
                   10161: hchccadneq l@-le dup              ( ed-ptr done-td done-td )
                   10162: (td-list-status)                  ( ed-ptr done-td failed-td CCcode )
                   10163: IF
                   10164: dup >r
                   10165: s" (transfer-wait-for-doneq: USB device communication error."
                   10166: usb-debug-print                 ( ed-ptr done-td failed-td CCcode R: CCcode )
                   10167: dup 4 = swap dup 5 = rot or     ( ed-ptr done-td failed-td CCcode R: CCcode )
                   10168: IF
                   10169: max-retire-td TO poll-timer ( ed-ptr done-td failed-td CCcode R: CCcode )
                   10170: THEN
                   10171: usb-debug-flag
                   10172: IF
                   10173: s" CC code ->" type . cr
                   10174: s" Failing TD contents:" type cr display-td
                   10175: ELSE
                   10176: 2drop
                   10177: THEN                           ( ed-ptr done-td R: CCcode )
                   10178: controlxfer-cmd @ GET-MAX-LUN = r> 4 = and
                   10179: IF
                   10180: s" (transfer-wait-for-doneq): GET-MAX-LUN ControlXfer STALLed"
                   10181: usb-debug-print
                   10182: ELSE
                   10183: drop
                   10184: 5030 error" (USB) Device communication error."
                   10185: ABORT
                   10186: THEN
                   10187: THEN                              ( ed-ptr done-td )
                   10188: (free-td-list)                    ( ed-ptr )
                   10189: 0 hchccadneq l!-le                ( ed-ptr )
                   10190: (HC-ACK-WDH) \ TDs were written to DOne queue. ACK the HC.
                   10191: THEN
                   10192: poll-timer 1+ TO poll-timer
                   10193: 4 ms              \ longer  1 ms
                   10194: REPEAT                                  ( ed-ptr )
                   10195: disable-control-list-processing         ( ed-ptr )
                   10196: td-retire-count num-tds <>              ( ed-ptr )
                   10197: IF
                   10198: dup display-descriptors              ( ed-ptr )
                   10199: s" maximum of retire " usb-debug-print                                              
                   10200: THEN
                   10201: free-ed
                   10202: td-retire-count num-tds <>
                   10203: IF
                   10204: FALSE                                ( FALSE )
                   10205: ELSE
                   10206: TRUE                                 ( TRUE )
                   10207: THEN
                   10208: ;
                   10209: : controlxfer ( dir addr dlen setup-packet MPS ep-fun -- TRUE | FALSE )
                   10210: 2 pick @ controlxfer-cmd !
                   10211: (ed-prepare)       ( FALSE | dir addr dlen ed-ptr setup-ptr  )
                   10212: invert IF FALSE EXIT THEN
                   10213: (td-prepare)       ( pt ed-type toggle buffer length mps head )
                   10214: invert IF FALSE EXIT THEN
                   10215: (td-ready)         ( dir addr dlen ed-ptr setup-ptr )
                   10216: (td-setup-status)  ( dir addr dlen ed-ptr )
                   10217: (td-tailpointer)   ( dir addr dlen ed-ptr )
                   10218: (td-data)          ( ed-ptr )
                   10219: dup ed>tdqtp l@-le TO saved-tail    ( ed-ptr )
                   10220: dup ed>tdqtp 0 swap l!-le           ( ed-ptr )
                   10221: (transfer-wait-for-doneq)           ( TRUE | FALSE )
                   10222: ;
                   10223: 0201000000000000 CONSTANT CLEARHALTFEATURE
                   10224: 0 VALUE endpt-num
                   10225: 0 VALUE usb-addr-contr-req
                   10226: : control-std-clear-feature ( endpoint-nr usb-addr -- TRUE|FALSE )
                   10227: TO usb-addr-contr-req                        \ usb address
                   10228: TO endpt-num                                 \ endpoint number
                   10229: CLEARHALTFEATURE setup-packet !
                   10230: endpt-num setup-packet 4 + c!                \ endpoint number
                   10231: 0 0 0 setup-packet DEFAULT-CONTROL-MPS usb-addr-contr-req controlxfer
                   10232: ;  
                   10233: 21FF000000000000 CONSTANT BULK-RESET
                   10234: : control-std-bulk-reset ( usb-addr -- TRUE|FALSE )
                   10235: TO usb-addr-contr-req
                   10236: BULK-RESET setup-packet !
                   10237: 0 0 0 setup-packet DEFAULT-CONTROL-MPS usb-addr-contr-req controlxfer
                   10238: ;
                   10239: : bulk-reset-recovery-procedure ( bulk-out-endp bulk-in-endp usb-addr -- )
                   10240: >r                                          ( bulk-out-endp bulk-in-endp R: usb-addr )
                   10241: r@ control-std-bulk-reset
                   10242: IF s" bulk reset OK" 
                   10243: ELSE s" bulk reset failed" 
                   10244: THEN usb-debug-print
                   10245: 80 or r@ control-std-clear-feature
                   10246: IF s" control-std-clear IN endpoint OK" 
                   10247: ELSE s" control-std-clear-IN endpoint failed" 
                   10248: THEN usb-debug-print
                   10249: r@ control-std-clear-feature
                   10250: IF s" control-std-clear OUT endpoint OK" 
                   10251: ELSE s" control-std-clear-OUT endpoint failed" 
                   10252: THEN usb-debug-print
                   10253: r> drop
                   10254: ;
                   10255: 0 VALUE saved-rw-ed
                   10256: 0 VALUE num-rw-tds
                   10257: 0 VALUE num-rw-retired-tds
                   10258: 0 VALUE saved-rw-start-toggle
                   10259: 0 VALUE saved-list-type
                   10260: : (ed-prepare-rw)
                   10261: ( pt ed-type toggle buffer length mps address ed-ptr --
                   10262: FALSE | pt ed-type toggle buffer length mps )
                   10263: allocate-ed dup 0=  IF
                   10264: drop 2drop 2drop 2drop drop
                   10265: saved-rw-start-toggle FALSE EXIT  ( toggle FALSE )
                   10266: THEN
                   10267: TO saved-rw-ed             ( pt ed-type toggle buffer length mps address )
                   10268: saved-rw-ed zero-out-an-ed-except-link
                   10269: saved-rw-ed ed>eattr l!-le   ( pt ed-type toggle buffer length mps )
                   10270: dup 10 lshift saved-rw-ed ed>eattr l@-le or
                   10271: saved-rw-ed ed>eattr l!-le TRUE  ( pt ed-type toggle buffer length mps TRUE )
                   10272: ;
                   10273: : (td-prepare-rw)
                   10274: ( pt ed-type toggle buffer length mps --
                   10275: FALSE | pt ed-type toggle buffer length mps head )
                   10276: 2dup              ( pt ed-type toggle buffer length mps  length mps )
                   10277: /mod              ( pt ed-type toggle buffer length mps num-tds rem )
                   10278: swap 0<> IF       ( pt ed-type toggle buffer length mps num-tds )
                   10279: 1+             ( pt ed-type toggle buffer length mps num-tds+1 )
                   10280: THEN
                   10281: dup TO num-rw-tds ( pt ed-type toggle buffer length mps num-tds )
                   10282: allocate-td-list  ( pt ed-type toggle buffer length mps head tail )
                   10283: dup 0=  IF
                   10284: 2drop 2drop 2drop 2drop
                   10285: saved-rw-ed free-ed
                   10286: ." rw-endpoint: TD list allocation failed" cr
                   10287: saved-rw-start-toggle FALSE   ( FALSE )
                   10288: EXIT
                   10289: THEN
                   10290: drop  TRUE         ( pt ed-type toggle buffer length mps head TRUE )
                   10291: ;
                   10292: : (td-data-rw)
                   10293: 6 pick                    ( pt ed-type toggle buffer length mps head  pt )
                   10294: FALSE TO case-failed  CASE
                   10295: 0   OF OHCI-DP-IN    ENDOF
                   10296: 1   OF OHCI-DP-OUT   ENDOF
                   10297: 2   OF OHCI-DP-SETUP ENDOF
                   10298: dup OF TRUE TO case-failed
                   10299: ." rw-endpoint: Invalid Packet Type!" cr
                   10300: ENDOF
                   10301: ENDCASE                   ( pt ed-type toggle buffer length mps head dp )
                   10302: case-failed  IF
                   10303: saved-rw-ed free-ed    ( pt ed-type toggle buffer length mps head dp )
                   10304: drop (free-td-list)         ( pt ed-type toggle buffer length mps head )
                   10305: 2drop 2drop 2drop
                   10306: saved-rw-start-toggle FALSE ( FALSE )
                   10307: EXIT                        ( FALSE )
                   10308: THEN
                   10309: -rot                      ( pt ed-type toggle buffer length dp mps head )
                   10310: dup >r                      ( pt ed-type toggle buffer length dp mps head )
                   10311: fill-TD-list r>  TRUE      ( pt et head TRUE )
                   10312: ;
                   10313: : (ed-ready-rw)  ( pt et  -- - | toggle FALSE )
                   10314: nip           ( et )
                   10315: FALSE TO case-failed  CASE
                   10316: 0   OF \ Control List. Queue the ED to control list
                   10317: 0 TO saved-list-type
                   10318: saved-rw-ed hcctrhead rl!-le
                   10319: HC-enable-control-list-processing
                   10320: ENDOF
                   10321: 1   OF \ Bulk List. Queue the ED to bulk list
                   10322: 1 TO saved-list-type
                   10323: saved-rw-ed hcbulkhead rl!-le
                   10324: HC-enable-bulk-list-processing
                   10325: ENDOF
                   10326: 2   OF \ Interrupt List.
                   10327: 2 TO saved-list-type
                   10328: saved-rw-ed hchccareg rl@-le rl!-le
                   10329: HC-enable-interrupt-list-processing
                   10330: ENDOF
                   10331: dup OF
                   10332: saved-rw-ed ed>tdqhp l@-le (free-td-list)
                   10333: saved-rw-ed free-ed
                   10334: TRUE TO case-failed
                   10335: ENDOF
                   10336: ENDCASE
                   10337: case-failed  IF
                   10338: saved-rw-start-toggle FALSE ( toggle FALSE )
                   10339: EXIT
                   10340: THEN
                   10341: TRUE                           ( TRUE )
                   10342: ;
                   10343: : (wait-td-retire) ( -- )
                   10344: 0 TO num-rw-retired-tds
                   10345: FALSE TO while-failed
                   10346: BEGIN
                   10347: num-rw-retired-tds num-rw-tds <           ( TRUE | FALSE )
                   10348: while-failed FALSE =  and                 ( TRUE | FALSE )
                   10349: WHILE
                   10350: d# 5000 (wait-for-done-q)                  ( TD-list TRUE|FALSE )
                   10351: IF
                   10352: dup find-td-list-tail-and-size nip         ( td-list size )
                   10353: num-rw-retired-tds + TO num-rw-retired-tds ( td-list )
                   10354: dup (td-list-status)                   ( td-list failed-TD CC )
                   10355: IF
                   10356: dup 4 =
                   10357: IF
                   10358: saved-list-type
                   10359: CASE
                   10360: 0 OF
                   10361: 0 0 control-std-clear-feature
                   10362: s" clear feature " usb-debug-print
                   10363: ENDOF
                   10364: 1 OF                             \ clean bulk stalled
                   10365: s" clear bulk when stalled " usb-debug-print
                   10366: disable-bulk-list-processing   \ disable procesing
                   10367: saved-rw-ed ed>eattr l@-le dup \ extract
                   10368: 780 and 7 rshift 80 or         \ endpoint and
                   10369: swap 7f and                    \ usb addr
                   10370: control-std-clear-feature
                   10371: ENDOF
                   10372: 2 OF
                   10373: 0 saved-rw-ed ed>eattr l@-le
                   10374: control-std-clear-feature
                   10375: ENDOF
                   10376: dup OF
                   10377: s" unknown status " usb-debug-print
                   10378: ENDOF
                   10379: ENDCASE
                   10380: ELSE                             ( td-list failed-TD CC )
                   10381: ."  TD failed  " 5b emit .s 5d emit cr
                   10382: 5040 error" (USB) device transaction error (wait-td-retire)."
                   10383: ABORT
                   10384: THEN
                   10385: 2drop drop
                   10386: TRUE TO while-failed                \ transaction failed
                   10387: NEXT-TD 0<>                         \ clean the TD if we
                   10388: IF
                   10389: NEXT-TD (free-td-list)           \ had a stalled
                   10390: THEN
                   10391: THEN
                   10392: (free-td-list)
                   10393: ELSE
                   10394: drop                                   \ drop td-list pointer
                   10395: scan-time? IF 2e emit THEN             \ show proceeding dots
                   10396: TRUE TO while-failed
                   10397: s" time out wait for done" usb-debug-print
                   10398: 20 ms     \ wait for bad device
                   10399: THEN
                   10400: REPEAT
                   10401: ;
                   10402: : (process-retired-td)   ( -- TRUE | FALSE )
                   10403: saved-list-type  CASE
                   10404: 0 OF disable-control-list-processing ENDOF
                   10405: 1 OF disable-bulk-list-processing ENDOF
                   10406: 2 OF disable-interrupt-list-processing ENDOF
                   10407: ENDCASE
                   10408: saved-rw-ed ed>tdqhp l@-le 2 and 0<> IF 
                   10409: 1 
                   10410: s" retired 1" usb-debug-print
                   10411: ELSE
                   10412: 0 
                   10413: s" retired 0" usb-debug-print
                   10414: THEN
                   10415: WHILE-failed   IF
                   10416: FALSE           ( FALSE )
                   10417: ELSE
                   10418: TRUE            ( TRUE )
                   10419: THEN
                   10420: saved-rw-ed free-ed
                   10421: ;
                   10422: : (do-rw-endpoint)
                   10423: 4 pick              ( pt ed-type toggle buffer length mps address toggle )
                   10424: TO saved-rw-start-toggle ( pt ed-type toggle buffer length mps address )
                   10425: (ed-prepare-rw)     ( FALSE | pt ed-type toggle buffer length mps )
                   10426: invert IF FALSE EXIT THEN
                   10427: (td-prepare-rw)     ( FALSE | pt ed-type toggle buffer length mps head )
                   10428: invert IF FALSE EXIT THEN
                   10429: (td-data-rw)        ( FALSE | pt et head )
                   10430: invert IF FALSE EXIT THEN
                   10431: saved-rw-ed ed>tdqhp l!-le ( pt et )
                   10432: saved-rw-ed ed>tdqhp l@-le td>ntd l@-le TO NEXT-TD \ save for a stalled
                   10433: (ed-ready-rw)
                   10434: invert IF FALSE EXIT THEN
                   10435: (wait-td-retire)
                   10436: (process-retired-td)         ( TRUE | FALSE )
                   10437: ;
                   10438: 0 VALUE transfer-len
                   10439: 0 VALUE mps-current
                   10440: 0 VALUE addr-current
                   10441: 0 VALUE usb-addr
                   10442: 0 VALUE toggle-current
                   10443: 0 VALUE type-current
                   10444: 0 VALUE pt-current
                   10445: 0 VALUE read-status
                   10446: 0 VALUE counter
                   10447: 0 VALUE residue
                   10448: : rw-endpoint
                   10449: 2 pick TO transfer-len  ( pt ed-type toggle buffer length mps address )
                   10450: 1 pick TO mps-current   ( pt ed-type toggle buffer length mps address )
                   10451: TRUE TO read-status     ( pt ed-type toggle buffer length mps address )
                   10452: transfer-len mps-current num-free-tds * <=  IF
                   10453: (do-rw-endpoint)     ( toggle TRUE | toggle FALSE )
                   10454: TO read-status       ( toggle )
                   10455: TO toggle-current
                   10456: ELSE
                   10457: TO usb-addr          ( pt ed-type toggle buffer length mps )
                   10458: 2drop                ( pt ed-type toggle buffer )
                   10459: TO addr-current      ( pt ed-type toggle )
                   10460: TO toggle-current    ( pt ed-type )
                   10461: TO type-current      ( pt )
                   10462: TO pt-current
                   10463: transfer-len mps-current num-free-tds * /mod  ( residue count )
                   10464: TO counter           ( residue )
                   10465: TO residue
                   10466: mps-current num-free-tds * TO transfer-len   BEGIN
                   10467: counter 0 >       ( TRUE | FALSE )
                   10468: read-status TRUE = and   ( TRUE | FALSE )
                   10469: WHILE
                   10470: pt-current type-current toggle-current ( pt ed-type toggle )
                   10471: addr-current transfer-len  ( pt ed-type toggle buffer length )
                   10472: mps-current                ( pt ed-type toggle buffer length mps )
                   10473: usb-addr (do-rw-endpoint)  ( toggle TRUE | toggle FALSE )
                   10474: TO read-status             ( toggle )
                   10475: TO toggle-current
                   10476: addr-current transfer-len + TO addr-current
                   10477: counter 1- TO counter
                   10478: REPEAT
                   10479: residue 0<>                    ( TRUE |FALSE )
                   10480: read-status TRUE = and IF
                   10481: residue TO transfer-len
                   10482: pt-current type-current toggle-current ( pt ed-type toggle )
                   10483: addr-current transfer-len   ( pt ed-type toggle buffer length )
                   10484: mps-current                 ( pt ed-type toggle buffer length mps )
                   10485: usb-addr (do-rw-endpoint)   ( toggle TRUE | toggle FALSE )
                   10486: TO read-status
                   10487: TO toggle-current
                   10488: THEN
                   10489: THEN
                   10490: read-status invert  IF
                   10491: THEN
                   10492: toggle-current                    ( toggle )
                   10493: read-status                       ( TRUE | FALSE )
                   10494: ;
                   10495: ����������0usb-hub.fss" hub" device-name
                   10496: s" usb" device-type
                   10497: 1 encode-int s" #address-cells" property
                   10498: 0 encode-int s" #size-cells" property
                   10499: : encode-unit ( port-addr -- unit-str unit-len )  1 hex-encode-unit ;
                   10500: : decode-unit ( addr len -- port-addr ) 1 hex-decode-unit ;
                   10501: 0 VALUE new-device-address
                   10502: 0 VALUE port-number
                   10503: 0 VALUE MPS-DCP
                   10504: 0 VALUE mps
                   10505: 0 VALUE my-usb-address
                   10506: 00 value device-speed
                   10507: : mps-property-set ( -- )
                   10508: s"  HUB Compiling mps-property-set " usb-debug-print
                   10509: s" USB-ADDRESS" get-my-property ( TRUE | prop-addr prop-len FALSE )
                   10510: IF
                   10511: s" notpossible" usb-debug-print
                   10512: ELSE
                   10513: decode-int nip nip to my-usb-address
                   10514: THEN  
                   10515: s" MPS-DCP" get-my-property ( TRUE | prop-addr prop-len FALSE )
                   10516: IF 
                   10517: s" MPS-DCP property not found Assuming 8 as MAX PACKET SIZE" ( str len )  
                   10518: usb-debug-print
                   10519: s" for the default control pipe"  usb-debug-print
                   10520: 8 to MPS-DCP
                   10521: ELSE
                   10522: s" MPS-DCP property found!!" usb-debug-print ( prop-addr prop-len FALSE )
                   10523: decode-int nip nip to MPS-DCP
                   10524: THEN
                   10525: ;
                   10526: 2303080000000000 CONSTANT hppwr-set
                   10527: 2301080000000000 CONSTANT hppwr-clear
                   10528: 2303040000000000 CONSTANT hprst-set
                   10529: A300000000000400 CONSTANT hpsta-get
                   10530: 2303010000000000 CONSTANT hpena-set
                   10531: A006002900000000 CONSTANT hubds-get
                   10532: 8  CONSTANT DEFAULT-CONTROL-MPS
                   10533: 12 CONSTANT DEVICE-DESCRIPTOR-LEN
                   10534: 9  CONSTANT CONFIG-DESCRIPTOR-LEN
                   10535: 20 CONSTANT BULK-CONFIG-DESCRIPTOR-LEN
                   10536: 1 CONSTANT DEVICE-DESCRIPTOR-TYPE
                   10537: 1 CONSTANT DEVICE-DESCRIPTOR-TYPE-OFFSET
                   10538: 4 CONSTANT DEVICE-DESCRIPTOR-DEVCLASS-OFFSET
                   10539: 7 CONSTANT DEVICE-DESCRIPTOR-MPS-OFFSET
                   10540: 9 CONSTANT HUB-DEVICE-CLASS
                   10541: 0 CONSTANT NO-CLASS
                   10542: 00 VALUE temp1
                   10543: 00 VALUE temp2
                   10544: 00 VALUE temp3
                   10545: 00 VALUE po2pg            \ Power On to Power Good
                   10546: VARIABLE setup-packet     \ 8 bytes for setup packet
                   10547: VARIABLE ch-buffer        \ 1 byte character buffer
                   10548: INSTANCE VARIABLE dd-buffer
                   10549: INSTANCE VARIABLE cd-buffer
                   10550: 8 chars alloc-mem VALUE status-buffer
                   10551: 9 chars alloc-mem VALUE hd-buffer
                   10552: : (allocate-mem)  ( -- )
                   10553: DEVICE-DESCRIPTOR-LEN chars alloc-mem dd-buffer !
                   10554: BULK-CONFIG-DESCRIPTOR-LEN chars alloc-mem cd-buffer !
                   10555: ;
                   10556: : (de-allocate-mem)  ( -- )
                   10557: dd-buffer @ ?dup IF
                   10558: DEVICE-DESCRIPTOR-LEN free-mem
                   10559: 0 dd-buffer !
                   10560: THEN
                   10561: cd-buffer @ ?dup IF
                   10562: BULK-CONFIG-DESCRIPTOR-LEN free-mem
                   10563: 0 cd-buffer !
                   10564: THEN
                   10565: ;
                   10566: : open ( -- TRUE )
                   10567: (allocate-mem)
                   10568: TRUE
                   10569: ;
                   10570: : close ( -- )
                   10571: (de-allocate-mem)
                   10572: ;
                   10573: : controlxfer ( dir addr dlen setup-packet MPS ep-fun -- TRUE|FALSE )
                   10574: s" controlxfer" $call-parent 
                   10575: ;
                   10576: : control-std-set-address ( speedbit -- usb-address TRUE|FALSE )
                   10577: s" control-std-set-address" $call-parent 
                   10578: ; 
                   10579: : control-std-get-device-descriptor 
                   10580: s" control-std-get-device-descriptor" $call-parent 
                   10581: ;
                   10582: : control-std-get-configuration-descriptor 
                   10583: s" control-std-get-configuration-descriptor" $call-parent 
                   10584: ;
                   10585: : control-std-get-maxlun
                   10586: s" control-std-get-maxlun" $call-parent 
                   10587: ;
                   10588: : control-std-set-configuration 
                   10589: s" control-std-set-configuration" $call-parent 
                   10590: ;
                   10591: : control-std-get-string-descriptor
                   10592: s" control-std-get-string-descriptor" $call-parent 
                   10593: ;
                   10594: : rw-endpoint 
                   10595: s" rw-endpoint" $call-parent 
                   10596: ;
                   10597: : debug-td ( -- )
                   10598: s" debug-td" $call-parent
                   10599: ;
                   10600: : control-bulk-reset ( MPS fun-addr dir data-buff data-len -- TRUE | FALSE )
                   10601: s" control-bulk-reset" $call-parent
                   10602: ;
                   10603: : control-hub-port-power-set  ( port# -- TRUE|FALSE )
                   10604: hppwr-set setup-packet !       ( port#)
                   10605: setup-packet 4 + c!
                   10606: 0 0 0 setup-packet MPS-DCP my-usb-address controlxfer ( TRUE | FALSE )
                   10607: ;
                   10608: : control-hub-port-power-clear ( port#-- TRUE|FALSE )
                   10609: hppwr-clear setup-packet !     ( port#)
                   10610: setup-packet 4 + c!
                   10611: 0 0 0 setup-packet MPS-DCP my-usb-address controlxfer ( TRUE|FALSE )
                   10612: ;
                   10613: : control-hub-port-reset-set ( port# -- TRUE|FALSE )
                   10614: hprst-set setup-packet !       ( port# )
                   10615: setup-packet 4 + c!
                   10616: 0 0 0 setup-packet MPS-DCP my-usb-address controlxfer ( TRUE|FALSE )
                   10617: ;
                   10618: : control-hub-port-enable ( port# -- TRUE|FALSE )
                   10619: hpena-set setup-packet !       ( port# )
                   10620: setup-packet 4 +  c!
                   10621: 0 0 0 setup-packet MPS-DCP my-usb-address controlxfer ( TRUE|FALSE )
                   10622: ;
                   10623: : control-hub-port-status-get ( buffer port# -- TRUE|FALSE )
                   10624: hpsta-get setup-packet !       ( buffer port# )
                   10625: setup-packet 4 + c!            ( buffer )
                   10626: 0 swap 4 setup-packet MPS-DCP my-usb-address controlxfer ( TRUE|FALSE )
                   10627: ;
                   10628: : control-get-hub-descriptor ( buffer buffer-length -- TRUE|FALSE )
                   10629: hubds-get setup-packet ! 
                   10630: dup setup-packet 6 + w!-le ( buffer buffer-length )
                   10631: 0 -rot setup-packet MPS-DCP my-usb-address controlxfer ( TRUE|FALSE )
                   10632: ;
                   10633: s" usb-enumerate.fs" INCLUDED
                   10634: : hub-configure-port ( port# -- )
                   10635: BEGIN                          ( port# )
                   10636: status-buffer 4 erase             ( port# )
                   10637: status-buffer over control-hub-port-status-get drop ( port# ) 
                   10638: status-buffer w@-le 102 and 0=         ( port# TRUE|FALSE )
                   10639: WHILE                          ( port# )
                   10640: REPEAT                 ( port# )
                   10641: po2pg 3 * ms    \ wait for bPwrOn2PwrGood*3 ms
                   10642: dup control-hub-port-reset-set drop    ( port# )
                   10643: BEGIN                          ( port# )
                   10644: status-buffer 4 erase             ( port# )
                   10645: status-buffer over control-hub-port-status-get drop ( port# ) 
                   10646: status-buffer w@-le 10 and     ( port# TRUE|FALSE )
                   10647: WHILE                          ( port# )
                   10648: REPEAT                         ( port# )
                   10649: status-buffer 4 erase                ( port# )
                   10650: status-buffer over control-hub-port-status-get drop ( port# ) 
                   10651: status-buffer w@-le    103 and    103 <>              ( port# TRUE|FALSE )
                   10652: s" Port status bits: " status-buffer w@-le usb-debug-print-val
                   10653: IF                                     ( port# ) 
                   10654: drop                   
                   10655: s" Connect status: No device connected "  usb-debug-print
                   10656: EXIT 
                   10657: THEN 
                   10658: status-buffer w@-le 200 and 4 lshift \ get speed bit
                   10659: dup to device-speed                  \ store speed bit
                   10660: control-std-set-address        ( port# usb-addr TRUE|FALSE )
                   10661: 50 ms                  ( port# usb-addr TRUE|FALSE )
                   10662: debug-td                       ( port# usb-addr TRUE|FALSE )
                   10663: IF                             ( port# usb-addr )
                   10664: device-speed or           ( port# usb-addr+speedbit )
                   10665: to new-device-address     ( port# )
                   10666: to port-number
                   10667: dd-buffer @ DEVICE-DESCRIPTOR-LEN erase
                   10668: dd-buffer @ DEFAULT-CONTROL-MPS DEFAULT-CONTROL-MPS new-device-address
                   10669: control-std-get-device-descriptor     ( TRUE|FALSE )
                   10670: IF
                   10671: dd-buffer @ DEVICE-DESCRIPTOR-TYPE-OFFSET + c@ ( descriptor-type )
                   10672: DEVICE-DESCRIPTOR-TYPE <>          ( TRUE|FALSE )
                   10673: IF 
                   10674: s" HUB: ERROR!! Invalid Device Descriptor for the new device"
                   10675: usb-debug-print
                   10676: ELSE
                   10677: dd-buffer @ DEVICE-DESCRIPTOR-MPS-OFFSET + c@ to mps
                   10678: dd-buffer @ DEVICE-DESCRIPTOR-LEN erase
                   10679: dd-buffer @ DEVICE-DESCRIPTOR-LEN mps new-device-address
                   10680: control-std-get-device-descriptor invert
                   10681: IF
                   10682: s" ** reading dev-descriptor failed ** " usb-debug-print
                   10683: THEN
                   10684: create-usb-device-tree
                   10685: THEN
                   10686: ELSE
                   10687: s" ERROR!! Failed to get device descriptor" usb-debug-print 
                   10688: THEN
                   10689: ELSE                                               ( port# )
                   10690: s" USB Set Adddress failed!!" usb-debug-print ( port# )
                   10691: s" Clearing Port Power..."  usb-debug-print   ( port# )
                   10692: control-hub-port-power-clear               ( TRUE|FALSE )
                   10693: IF 
                   10694: s" Port power down " usb-debug-print
                   10695: ELSE
                   10696: s" Unable to clear port power!!!" usb-debug-print
                   10697: THEN
                   10698: THEN
                   10699: ;
                   10700: : hub-enumerate ( -- )
                   10701: cd-buffer @ CONFIG-DESCRIPTOR-LEN erase
                   10702: cd-buffer @ CONFIG-DESCRIPTOR-LEN MPS-DCP my-usb-address 
                   10703: control-std-get-configuration-descriptor drop 
                   10704: cd-buffer @ 1+ c@ 2 <>  IF
                   10705: s" Unable to read configuration descriptor" usb-debug-print
                   10706: EXIT 
                   10707: THEN 
                   10708: cd-buffer @ 4 + c@ 1 <> IF
                   10709: s" Not a valid HUB config descriptor" usb-debug-print 
                   10710: EXIT 
                   10711: THEN 
                   10712: cd-buffer @ 5 + c@ to temp1 \ Store the configuration in temp1
                   10713: temp1 my-usb-address control-std-set-configuration drop
                   10714: my-usb-address to temp1
                   10715: hd-buffer 9 erase
                   10716: hd-buffer 9 control-get-hub-descriptor drop
                   10717: hd-buffer 2 + c@ to temp2     \ number of downstream ports
                   10718: s" HUB: Found " usb-debug-print
                   10719: s" number of downstream hub ports! : " temp2 usb-debug-print-val
                   10720: hd-buffer 5 + c@ to po2pg     \ get bPwrOn2PwrGood
                   10721: temp2 1+ 1 DO
                   10722: i control-hub-port-power-set drop
                   10723: d# 20 ms
                   10724: LOOP
                   10725: d# 200 ms      \ some devices need a long time (10s)
                   10726: temp2 1+ 1 DO
                   10727: s" hub-configure-port: " i usb-debug-print-val
                   10728: i hub-configure-port
                   10729: LOOP
                   10730: ; 
                   10731: (allocate-mem)
                   10732: mps-property-set
                   10733: hub-enumerate
                   10734: (de-allocate-mem)
                   10735: ��������X8usb-enumerate.fs: (hub-create) ( -- )
                   10736: mps port-number new-device-address port-number 
                   10737: new-device set-space                ( mps port-number usb-address )
                   10738: encode-int s" USB-ADDRESS" property ( mps port-number )
                   10739: s" Address Set"  usb-debug-print
                   10740: encode-int s" reg" property         ( mps )
                   10741: s" Port Number Set"   usb-debug-print 
                   10742: encode-int s" MPS-DCP" property
                   10743: s" MPS Set"   usb-debug-print
                   10744: s" usb-hub.fs" INCLUDED
                   10745: s" Driver Included"   usb-debug-print
                   10746: finish-device
                   10747: ;
                   10748: : (atapi-scsi-property-set) ( -- )
                   10749: dd-buffer @ e + c@     ( Manuf )
                   10750: dd-buffer @ f + c@     ( Manuf Prod )
                   10751: dd-buffer @ 10 + c@    ( Manuf Prod Serial-Num )
                   10752: cd-buffer @ 16 + w@-le ( Manuf Prod Serial-Num ep-mps )
                   10753: cd-buffer @ 14 + c@    ( Manuf Prod Serial-Num ep-mps ep-addr )
                   10754: cd-buffer @ 1d + w@-le ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps )
                   10755: cd-buffer @ 1b + c@    ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps ep-addr )
                   10756: mps port-number new-device-address port-number
                   10757: ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps ep-addr 
                   10758: mps port-num usb-addr port-num )
                   10759: new-device set-space
                   10760: ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps ep-addr
                   10761: mps port-num usb-addr )
                   10762: encode-int s" USB-ADDRESS" property
                   10763: ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps ep-addr
                   10764: mps port-num )
                   10765: encode-int s" reg" property
                   10766: ( Manuf Prod Serial-Num ep-mps ep-addr ep-mps ep-addr 
                   10767: mps )
                   10768: encode-int s" MPS-DCP" property
                   10769: 2 0  DO
                   10770: dup 80 and IF
                   10771: 7f and encode-int
                   10772: s" BULK-IN-EP-ADDR" property
                   10773: encode-int s" MPS-BULKIN" property
                   10774: ELSE
                   10775: encode-int s" BULK-OUT-EP-ADDR" property
                   10776: encode-int s" MPS-BULKOUT" property
                   10777: THEN
                   10778: LOOP                                  ( Manuf Prod Serial-Num )
                   10779: encode-int s" iSerialNumber" property ( Manuf Prod )
                   10780: encode-int s" iProduct" property      ( Manuf )
                   10781: encode-int s" iManufacturer" property
                   10782: ;
                   10783: : (device-classify) 
                   10784: cd-buffer @ BULK-CONFIG-DESCRIPTOR-LEN erase
                   10785: cd-buffer @ BULK-CONFIG-DESCRIPTOR-LEN mps new-device-address 
                   10786: control-std-get-configuration-descriptor
                   10787: IF
                   10788: cd-buffer @ 1+ c@           ( Descriptor-type )
                   10789: 2 =   IF
                   10790: cd-buffer @ 10 + c@      ( protocol )
                   10791: cd-buffer @ f + c@       ( protocol subclass )
                   10792: cd-buffer @ e + c@       ( protocol subclass class )
                   10793: TRUE
                   10794: ELSE
                   10795: s" Not a valid configuration descriptor!!" usb-debug-print
                   10796: FALSE
                   10797: THEN
                   10798: ELSE
                   10799: s" Unable to read configuration descriptor!!" usb-debug-print
                   10800: FALSE
                   10801: THEN
                   10802: ;
                   10803: : (atapi-8020-create) ( -- )
                   10804: (atapi-scsi-property-set)
                   10805: s" usb-storage.fs" INCLUDED
                   10806: finish-device
                   10807: ;
                   10808: : (atapi-8070-create) ( -- )
                   10809: (atapi-scsi-property-set)
                   10810: s" usb-storage.fs" INCLUDED
                   10811: finish-device
                   10812: ;
                   10813: : (scsi-create) ( -- )
                   10814: s" SCSI-CREATE " usb-debug-print
                   10815: dd-buffer @ 8 + w@-le 4b4 =         \ VendorID = CYPRESS ?
                   10816: IF
                   10817: dd-buffer @ a + w@-le 6830 =     \ Device = CY7C68300 ?
                   10818: IF
                   10819: d# 20 ms
                   10820: mps new-device-address 0 0 0   ( MPS fun-addr dir data-buff data-len )
                   10821: control-bulk-reset             ( TRUE|FALSE )
                   10822: d# 100 ms
                   10823: mps new-device-address 0 0 0   ( TRUE|FALSE MPS fun-addr dir data-buff data-len )
                   10824: control-bulk-reset             ( TRUE|FALSE TRUE|FALSE )
                   10825: and invert
                   10826: IF
                   10827: ."   ** BULK-RESET failed **" cr
                   10828: THEN
                   10829: d# 20 ms
                   10830: THEN
                   10831: THEN
                   10832: 0 ch-buffer !                 \ preset a clean response
                   10833: mps new-device-address 0 ch-buffer 1 control-std-get-maxlun ( TRUE|FALSE )
                   10834: IF
                   10835: ELSE
                   10836: s" ERROR in GET-MAX-LUN " usb-debug-print
                   10837: 0 ch-buffer !              \ clear invalid numbers
                   10838: cd-buffer @ 5 + c@ to temp1
                   10839: temp1 new-device-address control-std-set-configuration drop
                   10840: THEN
                   10841: 0                       ( counter )
                   10842: begin
                   10843: dup 8 <              ( counter flag )           \ max 8 * 500 ms
                   10844: ch-buffer c@ f >     ( counter flag flag )      \ is MuxLUN above limit ?
                   10845: AND                  ( counter flag )
                   10846: while
                   10847: d# 500 ms                     \ this device is not yet ready
                   10848: 0 ch-buffer !                 \ preset a clean response
                   10849: mps new-device-address 0 ch-buffer 1 control-std-get-maxlun ( TRUE|FALSE )
                   10850: not
                   10851: IF
                   10852: s"  ** ERROR in GET-MAX-LUN ** " usb-debug-print
                   10853: drop 10                    \ replace counter to force loop end
                   10854: THEN
                   10855: 1+                ( counter+1 )
                   10856: repeat
                   10857: drop
                   10858: ch-buffer c@ dup 0= swap f > or IF   
                   10859: s" + LUN: " ch-buffer c@  usb-debug-print-val
                   10860: (atapi-scsi-property-set)
                   10861: s" usb-storage.fs" INCLUDED
                   10862: finish-device
                   10863: ELSE
                   10864: s" - LUN: " ch-buffer c@ usb-debug-print-val
                   10865: (atapi-scsi-property-set)
                   10866: s" usb-storage-wrapper.fs" INCLUDED
                   10867: finish-device
                   10868: THEN
                   10869: ;
                   10870: : (classify-storage)  ( interface-protocol interface-subclass -- )
                   10871: s" USB: Mass Storage Device Found!" usb-debug-print
                   10872: swap 50 <> IF
                   10873: s" USB storage: Protocol is not 50." usb-debug-print
                   10874: drop EXIT
                   10875: THEN
                   10876: CASE
                   10877: 02 OF  (atapi-8020-create) s" ATAPI Interface " usb-debug-print ENDOF
                   10878: 05 OF  (atapi-8070-create) s" ATAPI Interface " usb-debug-print ENDOF
                   10879: 06 OF  (scsi-create) s" SCSI Interface " usb-debug-print ENDOF
                   10880: dup OF  s" USB storage: Unsupported sub-class code." usb-debug-print ENDOF
                   10881: ENDCASE
                   10882: ;
                   10883: : (keyboard-create) ( -- )
                   10884: cd-buffer @ 1f + c@                 ( ep-mps )
                   10885: cd-buffer @ 1d + c@                 ( ep-mps ep-addr )  
                   10886: mps port-number new-device-address port-number
                   10887: new-device set-space                 ( ep-mps ep-addr mps port-num usb-addr )
                   10888: encode-int s" USB-ADDRESS" property  ( ep-mps ep-addr mps port-num )
                   10889: encode-int s" reg" property          ( ep-mps ep-addr mps )
                   10890: encode-int s" MPS-DCP" property      ( ep-mps ep-addr )
                   10891: 7f and encode-int s" INT-IN-EP-ADDR" property
                   10892: encode-int s" MPS-INTIN" property
                   10893: new-device-address   \ device-speed
                   10894: s" usb-keyboard.fs" INCLUDED
                   10895: finish-device
                   10896: ;
                   10897: : (mouse-create) ( -- )
                   10898: mps port-number new-device-address port-number
                   10899: new-device set-space                 ( mps port-num usb-addr )
                   10900: encode-int s" USB-ADDRESS" property  ( mps port-num )
                   10901: encode-int s" reg" property          ( mps )
                   10902: encode-int s" MPS-DCP" property
                   10903: s" usb-mouse.fs" INCLUDED
                   10904: finish-device
                   10905: ;
                   10906: : (classify-by-interface) ( -- )
                   10907: (device-classify)  IF
                   10908: CASE
                   10909: 08 OF
                   10910: (classify-storage)
                   10911: ENDOF
                   10912: 03 OF
                   10913: s" USB: HID Found!" usb-debug-print
                   10914: 01 =
                   10915: IF
                   10916: case
                   10917: 01 of
                   10918: s" USB keyboard!" usb-debug-print
                   10919: (keyboard-create)
                   10920: endof
                   10921: 02 of
                   10922: s" USB mouse!" usb-debug-print
                   10923: (mouse-create)
                   10924: endof
                   10925: dup of
                   10926: s" USB: unsupported HID!" usb-debug-print
                   10927: endof
                   10928: endcase
                   10929: ELSE
                   10930: s" USB: unsupported HID!" usb-debug-print
                   10931: THEN
                   10932: ENDOF
                   10933: dup OF
                   10934: s" USB: unsupported interface type." usb-debug-print
                   10935: 2drop
                   10936: ENDOF
                   10937: ENDCASE
                   10938: THEN
                   10939: ;
                   10940: : create-usb-device-tree ( -- )
                   10941: dd-buffer @ DEVICE-DESCRIPTOR-DEVCLASS-OFFSET + c@    ( Device-class )
                   10942: CASE
                   10943: HUB-DEVICE-CLASS OF s" USB: HUB found"   usb-debug-print
                   10944: (hub-create)
                   10945: ENDOF
                   10946: NO-CLASS  OF
                   10947: (classify-by-interface)
                   10948: ENDOF
                   10949: DUP OF
                   10950: s" USB: Unknown device found." usb-debug-print
                   10951: ENDOF
                   10952: ENDCASE
                   10953: uDOC-present 0f and to uDOC-present \ remove uDOC processing flag
                   10954: ;
                   10955: ��������.�.M0usb-storage.fss" storage" device-name
                   10956: s" block" device-type
                   10957: 2 encode-int s" #address-cells" property
                   10958: 0 encode-int s" #size-cells" property
                   10959: 8 VALUE mps-bulk-out
                   10960: 8 VALUE mps-bulk-in
                   10961: 8 VALUE mps-dcp
                   10962: 0 VALUE bulk-in-ep
                   10963: 0 VALUE bulk-out-ep
                   10964: 0 VALUE bulk-in-toggle
                   10965: 0 VALUE bulk-out-toggle
                   10966: 0 VALUE lun
                   10967: 0 VALUE my-usb-address
                   10968: 0  VALUE csw-buffer
                   10969: 0e VALUE cfg-buffer
                   10970: 0  VALUE response-buffer
                   10971: 0  VALUE command-buffer
                   10972: 0  VALUE resp-size
                   10973: 0  VALUE resp-buffer
                   10974: INSTANCE VARIABLE ihandle-bulk
                   10975: INSTANCE VARIABLE ihandle-deblocker
                   10976: INSTANCE VARIABLE flag
                   10977: INSTANCE VARIABLE count
                   10978: 0     VALUE max-transfer
                   10979: 200   VALUE block-size           \ default (512 Bytes)
                   10980: -1    VALUE max-block-num        \ highest reported block-number
                   10981: 0f CONSTANT SCSI-COMMAND-OFFSET
                   10982: s" usb-storage-support.fs" INCLUDED
                   10983: 0 VALUE bulk-cnt
                   10984: 0 VALUE bulk-cmd-len
                   10985: 0 VALUE itest
                   10986: : do-bulk-command ( resp-buffer resp-size -- TRUE | FALSE )
                   10987: TO resp-size
                   10988: TO resp-buffer
                   10989: usb-debug-flag
                   10990: IF
                   10991: command-buffer 0E + c@ TO bulk-cmd-len 
                   10992: s" cmd-length: " bulk-cmd-len usb-debug-print-val
                   10993: command-buffer bulk-cmd-len 0E + dump cr
                   10994: THEN
                   10995: 6 TO bulk-cnt \ 2 old value
                   10996: FALSE dup
                   10997: BEGIN
                   10998: 0=
                   10999: WHILE
                   11000: drop
                   11001: 1 1 bulk-out-toggle command-buffer 1f mps-bulk-out
                   11002: my-usb-address bulk-out-ep 7 lshift or
                   11003: rw-endpoint swap                            ( TRUE toggle | FALSE toggle )
                   11004: to bulk-out-toggle                ( TRUE | FALSE )
                   11005: IF
                   11006: s" resp-size : " resp-size usb-debug-print-val
                   11007: resp-size 0<>
                   11008: IF       \ do we need a response ?!
                   11009: 0 1 bulk-in-toggle resp-buffer resp-size mps-bulk-in
                   11010: my-usb-address bulk-in-ep 7 lshift or
                   11011: rw-endpoint swap                       ( TRUE toggle | FALSE toggle )
                   11012: to bulk-in-toggle                      ( TRUE | FALSE )
                   11013: ELSE
                   11014: TRUE
                   11015: THEN
                   11016: IF               \ read the bulk CSW
                   11017: 0 1 bulk-in-toggle csw-buffer D mps-bulk-in
                   11018: my-usb-address bulk-in-ep 7 lshift or
                   11019: rw-endpoint swap                    ( TRUE toggle | FALSE toggle )
                   11020: to bulk-in-toggle                   ( TRUE | FALSE )
                   11021: IF
                   11022: s" Command successful." usb-debug-print
                   11023: TRUE dup
                   11024: ELSE
                   11025: s" Command failed in CSW stage" usb-debug-print
                   11026: FALSE dup
                   11027: THEN
                   11028: ELSE
                   11029: s" Command failed while receiving DATA... read CSW..." usb-debug-print
                   11030: 0 1 bulk-in-toggle csw-buffer D mps-bulk-in
                   11031: my-usb-address bulk-in-ep 7 lshift or
                   11032: rw-endpoint swap                    ( TRUE toggle | FALSE toggle )
                   11033: to bulk-in-toggle                   ( TRUE | FALSE )
                   11034: IF
                   11035: s" OK evaluate the CSW ..." usb-debug-print
                   11036: csw-buffer c + c@ dup TO itest
                   11037: s" CSW Status: " itest usb-debug-print-val
                   11038: dup
                   11039: 2 =
                   11040: IF \ Phase Error
                   11041: s" Phase error do a bulk reset-recovery ..." usb-debug-print
                   11042: bulk-out-ep bulk-in-ep my-usb-address
                   11043: bulk-reset-recovery-procedure
                   11044: THEN
                   11045: 1 =
                   11046: IF \ Command failed
                   11047: s" Command Failed do a bulk-reset-recovery" usb-debug-print
                   11048: bulk-out-ep bulk-in-ep my-usb-address
                   11049: bulk-reset-recovery-procedure
                   11050: THEN
                   11051: THEN
                   11052: FALSE dup
                   11053: THEN
                   11054: ELSE
                   11055: s" Command failed while Sending CBW ..." usb-debug-print
                   11056: FALSE dup
                   11057: THEN
                   11058: bulk-cnt 1 - TO bulk-cnt
                   11059: bulk-cnt 0=
                   11060: IF
                   11061: 2drop FALSE dup
                   11062: THEN
                   11063: REPEAT
                   11064: ;
                   11065: scsi-open
                   11066: usb-debug-flag to scsi-param-debug  \ copy debug flag
                   11067: 24 CONSTANT inquiry-length    \ was 20
                   11068: : inquiry ( -- )
                   11069: s" usb-storage: inquiry" usb-debug-print
                   11070: command-buffer 1 inquiry-length 80 lun scsi-length-inquiry
                   11071: build-cbw
                   11072: inquiry-length command-buffer SCSI-COMMAND-OFFSET +   ( alloc-len address  )
                   11073: scsi-build-inquiry
                   11074: response-buffer inquiry-length erase      \ provide clean buffer
                   11075: response-buffer inquiry-length do-bulk-command
                   11076: IF
                   11077: s" Successfully read INQUIRY data" usb-debug-print
                   11078: 0d emit space space
                   11079: response-buffer c@  \ get 'Peripheral Device Type' (PDT)
                   11080: CASE
                   11081: 0   OF ." BLOCK-DEV: " ENDOF  \ SCSI Block Device
                   11082: 5   OF ." CD-ROM   : " ENDOF
                   11083: 7   OF ." OPTICAL  : " ENDOF
                   11084: e   OF ." RED-BLOCK: " ENDOF  \ SCSI Reduced Block Device
                   11085: dup dup OF ." ? (" . 8 emit 29 emit 2 spaces ENDOF
                   11086: ENDCASE
                   11087: space
                   11088: response-buffer 8 + 16 encode-string s" ident-str" property
                   11089: response-buffer .inquiry-text
                   11090: ELSE
                   11091: 5040 error" (USB) Device transaction error. (inquiry)"
                   11092: ABORT
                   11093: THEN
                   11094: ;
                   11095: : read-capacity ( -- )
                   11096: s" usb-storage: read-capacity" usb-debug-print
                   11097: command-buffer 1 8  80 lun  scsi-length-read-cap-10
                   11098: build-cbw 
                   11099: command-buffer SCSI-COMMAND-OFFSET +      ( address )   
                   11100: scsi-build-read-cap-10
                   11101: lun 5 lshift
                   11102: command-buffer SCSI-COMMAND-OFFSET +      ( address )
                   11103: read-cap-10>reserved1 c!
                   11104: response-buffer 8 erase          \ provide clean buffer
                   11105: response-buffer 8 do-bulk-command
                   11106: IF
                   11107: s" Successfully read READ CAPACITY data" usb-debug-print
                   11108: ELSE
                   11109: 5040 error" (USB) Device transaction error. (capacity)"
                   11110: ABORT
                   11111: THEN
                   11112: ;
                   11113: : test-unit-ready ( -- TRUE | FALSE )
                   11114: command-buffer 1 0 80 lun scsi-length-test-unit-ready    \ was: 0c
                   11115: build-cbw
                   11116: command-buffer SCSI-COMMAND-OFFSET +      ( address )
                   11117: scsi-build-test-unit-ready                ( cdb -- )
                   11118: response-buffer 0 do-bulk-command
                   11119: IF
                   11120: s" Successfully read test unit ready data" usb-debug-print
                   11121: s" Test Unit STATUS availabe in csw-buffer" usb-debug-print
                   11122: csw-buffer 0c + c@ 0=  IF
                   11123: s" Test Unit Command Successfully Executed" usb-debug-print
                   11124: TRUE                             ( TRUE )
                   11125: ELSE
                   11126: s" Test Unit Command Failed to execute" usb-debug-print
                   11127: FALSE                            ( FALSE )
                   11128: THEN
                   11129: ELSE
                   11130: 5040 error" (USB) Device transaction error. (test-unit-ready)"
                   11131: ABORT
                   11132: THEN
                   11133: ;
                   11134: : wait-for-unit-ready            ( -- TRUE|FALSE )
                   11135: s" --> WAIT: test-unit-ready ... " usb-debug-print
                   11136: d# 100                        ( count )   \ up to 10 seconds
                   11137: BEGIN                         ( count )
                   11138: dup 0>                     ( count flag )
                   11139: test-unit-ready      \ dup IF 2b ELSE 2d THEN emit
                   11140: not and    ( count flag )
                   11141: WHILE
                   11142: 1-                         ( count )
                   11143: d# 100 wait-proceed        \ wait 100 ms
                   11144: REPEAT                        ( count )
                   11145: 0=
                   11146: IF
                   11147: s" **  Device not ready **  " usb-debug-print
                   11148: FALSE
                   11149: ELSE
                   11150: TRUE
                   11151: THEN
                   11152: ;
                   11153: : request-sense ( -- )
                   11154: s" request-sense: Command ready." usb-debug-print
                   11155: command-buffer 1 12 80 lun scsi-length-request-sense
                   11156: build-cbw
                   11157: 12 command-buffer SCSI-COMMAND-OFFSET +   ( alloc-len cdb )
                   11158: scsi-build-request-sense                  ( alloc-len cdb -- )
                   11159: response-buffer 12 do-bulk-command
                   11160: IF
                   11161: s" Read Sense data successfully" usb-debug-print
                   11162: ELSE
                   11163: 5040 error" (USB) Device transaction error. (request-sense)"
                   11164: ABORT
                   11165: THEN
                   11166: ;
                   11167: : start ( -- )
                   11168: command-buffer 1 0 80 lun scsi-length-start-stop-unit
                   11169: build-cbw
                   11170: command-buffer SCSI-COMMAND-OFFSET +            ( cdb )
                   11171: scsi-const-start scsi-build-start-stop-unit     ( state# cdb -- )
                   11172: response-buffer 0 do-bulk-command
                   11173: IF
                   11174: s" Start successfully" usb-debug-print
                   11175: ELSE
                   11176: 5040 error" (USB) Device transaction error. (start)"
                   11177: ABORT
                   11178: THEN
                   11179: ;
                   11180: : stop ( -- )
                   11181: command-buffer 1 0 80 lun scsi-length-start-stop-unit
                   11182: build-cbw
                   11183: command-buffer SCSI-COMMAND-OFFSET +         ( cdb )
                   11184: scsi-const-stop scsi-build-start-stop-unit   ( state# cdb -- )
                   11185: response-buffer 0 do-bulk-command
                   11186: IF
                   11187: s" Stop successfully" usb-debug-print
                   11188: ELSE
                   11189: 5040 error" (USB) Device transaction error. (stop)"
                   11190: ABORT
                   11191: THEN
                   11192: ;
                   11193: 0 VALUE temp1
                   11194: 0 VALUE temp2
                   11195: 0 VALUE temp3
                   11196: : seek ( pos-lo pos-hi -- status )
                   11197: 2dup lxjoin max-block-num block-size * >
                   11198: IF
                   11199: ." ** Seek Error: pos too large ("
                   11200: dup . over . ." -> " max-block-num block-size * .
                   11201: ." ) ** " cr
                   11202: -1                   \ see spec-1275 page 183
                   11203: ELSE
                   11204: s" seek" ihandle-deblocker @ $call-method
                   11205: THEN
                   11206: ;
                   11207: : read ( address length -- actual )
                   11208: s" read" ihandle-deblocker @  $call-method
                   11209: ;
                   11210: : read-blocks ( address block# #blocks -- #read-blocks )
                   11211: 2dup + max-block-num >
                   11212: IF
                   11213: ." ** Requested block too large "
                   11214: 2dup + ." (" .d ." -> " max-block-num .d
                   11215: bs emit ." ) ... read aborted **" cr
                   11216: nip nip                       \ leave #blocks on stack
                   11217: ELSE
                   11218: block-size * command-buffer  ( address block# transfer-len command-buffer )
                   11219: 1 2 pick 80 lun 0c build-cbw ( address block# transfer-len )
                   11220: dup to temp1                 ( address block# transfer-len )
                   11221: block-size /                 ( address block# #blocks )
                   11222: command-buffer               ( address block# #blocks command-addr )
                   11223: SCSI-COMMAND-OFFSET +        ( address block# #blocks cdb )
                   11224: scsi-build-read?                     ( block# #blocks cdb -- length )
                   11225: command-buffer 0e + c!       \ update bCBWCBLength-field with resulting CDB length
                   11226: temp1                        ( address length )
                   11227: do-bulk-command
                   11228: IF
                   11229: s" Read  data successfully" usb-debug-print
                   11230: ELSE
                   11231: 5040 error" (USB) Device transaction error. (read-blocks)"
                   11232: ABORT
                   11233: THEN
                   11234: temp1 block-size /  ( #read-blocks )
                   11235: THEN
                   11236: ;
                   11237: d# 800 CONSTANT media-ready-retry
                   11238: : make-media-ready ( -- )
                   11239: s" usb-storage: make-media-ready" usb-debug-print
                   11240: 0  flag !
                   11241: 0  count !
                   11242: BEGIN
                   11243: flag @  0=
                   11244: WHILE
                   11245: test-unit-ready IF
                   11246: s" Media ready for access." usb-debug-print
                   11247: 1  flag !
                   11248: ELSE
                   11249: count @  1 +  count !
                   11250: count @ media-ready-retry = IF
                   11251: 1 flag !
                   11252: 5000 error" (USB) Media or drive not ready for this blade."
                   11253: ABORT
                   11254: THEN
                   11255: request-sense
                   11256: response-buffer scsi-get-sense-ID? ( addr -- false | sense-ID true )
                   11257: IF
                   11258: ffff00 AND     \ remaining: sense-key ASC
                   11259: CASE
                   11260: 023a00 OF   \ MEDIUM NOT PRESENT (02 3a 00)
                   11261: 5010 error" (USB) No Media found! Check for the drawer/inserted media."
                   11262: ABORT
                   11263: ENDOF
                   11264: 020400 OF   \ LOGICAL DRIVE NOT READY - INITIALIZATION REQUIRED
                   11265: 5010 error" (USB) No Media found! Check for the drawer/inserted media."
                   11266: ABORT
                   11267: ENDOF
                   11268: 033000 OF   \ CANNOT READ MEDIUM - UNKNOWN FORMAT
                   11269: 5020 error" (USB) Unknown media format."
                   11270: ABORT
                   11271: ENDOF
                   11272: ENDCASE
                   11273: THEN
                   11274: THEN
                   11275: d# 10 ms             \ wait maximum 10ms * 800 (=8s)
                   11276: REPEAT
                   11277: usb-debug-flag IF
                   11278: ." make-media-ready finished after "
                   11279: count @ decimal . hex ." tries." cr
                   11280: THEN
                   11281: ;
                   11282: : .showcap
                   11283: space
                   11284: test-unit-ready drop             \ initial command
                   11285: request-sense
                   11286: response-buffer scsi-get-sense-ID? ( addr -- false | sense-ID true )
                   11287: IF
                   11288: dup FFFF00 and 023a00 =       ( sense-id flag )
                   11289: IF
                   11290: uDOC-failure?
                   11291: 023a02 =                   \ see sense-codes SPC-3 clause 4.5.6
                   11292: IF
                   11293: ."  Tray Open!"
                   11294: ELSE
                   11295: ."    No Media"
                   11296: THEN
                   11297: ELSE                          ( sense-id )
                   11298: drop
                   11299: wait-for-unit-ready
                   11300: IF
                   11301: read-capacity
                   11302: response-buffer scsi-get-capacity-10 space .capacity-text
                   11303: ELSE
                   11304: request-sense
                   11305: response-buffer scsi-get-sense-ID? ( addr -- false | sense-ID true )
                   11306: IF
                   11307: dup ff0000 and 040000 =       \ sense-code = 4 ?
                   11308: IF
                   11309: ." *HW-ERROR*"
                   11310: uDOC-failure?
                   11311: ELSE
                   11312: dup FFFF00 and 023a00 = IF uDOC-failure? THEN
                   11313: CASE              ( sense-ID )
                   11314: 023a00 OF ."   No Media " ENDOF
                   11315: 023a02 OF ." Tray Open! " ENDOF
                   11316: dup    OF ."          ? " ENDOF
                   11317: ENDCASE
                   11318: THEN
                   11319: THEN
                   11320: THEN
                   11321: THEN
                   11322: ELSE
                   11323: ."       ??   "
                   11324: THEN
                   11325: ;
                   11326: : init-dev-ready
                   11327: test-unit-ready drop
                   11328: 4 >r                \ loop-counter
                   11329: 0 0
                   11330: BEGIN
                   11331: 2drop
                   11332: request-sense
                   11333: response-buffer scsi-get-sense-data ( ascq asc sense-key )
                   11334: 0<>  r> 1- dup >r 0<> AND          \ loop-counter or sense-key
                   11335: WHILE
                   11336: REPEAT
                   11337: 2drop
                   11338: r> drop
                   11339: ;
                   11340: scsi-close        \ no further scsi words required
                   11341: : (init-block-size)
                   11342: read-capacity
                   11343: response-buffer l@ dup 0<>
                   11344: IF
                   11345: to max-block-num        \ highest block-number
                   11346: ELSE
                   11347: -1 to max-block-num     \ indeterminate
                   11348: THEN
                   11349: response-buffer 4 + 
                   11350: l@ to block-size
                   11351: s" usb-storage: block-size=" block-size usb-debug-print-val
                   11352: ;
                   11353: : open ( -- TRUE )
                   11354: s" usb-storage: open" usb-debug-print
                   11355: ihandle-bulk s" bulk" (open-package)
                   11356: make-media-ready
                   11357: (init-block-size)           \ Init block-size before opening the deblocker
                   11358: ihandle-deblocker s" deblocker" (open-package)
                   11359: s" disk-label" find-package IF  ( phandle )
                   11360: usb-debug-flag IF ." my-args for disk-label = " my-args swap . . cr THEN
                   11361: my-args rot interpose
                   11362: THEN
                   11363: TRUE                        ( TRUE )
                   11364: ;
                   11365: : close  ( -- )
                   11366: ihandle-deblocker (close-package)
                   11367: ihandle-bulk (close-package)
                   11368: ;
                   11369: : (init-device-name)  ( -- )
                   11370: init-dev-ready
                   11371: inquiry
                   11372: response-buffer c@
                   11373: CASE
                   11374: 1  OF .showcap s" tape"    device-name ENDOF
                   11375: 5  OF .showcap s" cdrom"   device-name s" CDROM found" usb-debug-print ENDOF
                   11376: 0  OF .showcap s" sbc-dev" device-name s" SBC Direct access device" usb-debug-print ENDOF
                   11377: 7  OF .showcap s" optical" device-name s" Optical memory found" usb-debug-print ENDOF
                   11378: 0E OF .showcap s" rbc-dev" device-name s" RBC direct acces device found" usb-debug-print ENDOF
                   11379: ENDCASE
                   11380: ;
                   11381: : (initial-setup)
                   11382: ihandle-bulk s" bulk" (open-package)
                   11383: device-init
                   11384: (init-device-name)
                   11385: set-drive-alias
                   11386: 200 to block-size       \ Default block-size, will be overwritten in "open"
                   11387: 10000 to max-transfer
                   11388: ihandle-bulk (close-package)
                   11389: ;
                   11390: (initial-setup)
                   11391: ��������8
                   11392: �8usb-storage-support.fs: rw-endpoint
                   11393: s" rw-endpoint" $call-parent
                   11394: ;
                   11395: : controlxfer ( dir addr dlen setup-packet MPS ep-fun --- TRUE|FALSE )
                   11396: s" controlxfer" $call-parent
                   11397: ;
                   11398: : control-std-get-configuration-descriptor
                   11399: s" control-std-get-configuration-descriptor" $call-parent
                   11400: ;
                   11401: : control-std-set-configuration ( configvalue FuncAddr -- TRUE | FALSE )
                   11402: s" control-std-set-configuration" $call-parent   ( TRUE | FALSE )
                   11403: ;
                   11404: : bulk-reset-recovery-procedure ( bulk-out-endp bulk-in-endp usb-addr -- )
                   11405: s" bulk-reset-recovery-procedure" $call-parent
                   11406: ;
                   11407: : build-cbw ( address tag transfer-len direction lun command-len -- )
                   11408: s" build-cbw" ihandle-bulk @ $call-method
                   11409: ;
                   11410: : analyze-csw ( address -- residue tag TRUE | reason FALSE )
                   11411: s" analyze-csw" ihandle-bulk @ $call-method
                   11412: ;
                   11413: : device-init ( -- )
                   11414: s" Starting to initialize usb-storage device" usb-debug-print
                   11415: s" USB-ADDRESS" get-my-property         ( TRUE | propaddr proplen FALSE )
                   11416: IF
                   11417: s" not possible" usb-debug-print
                   11418: ELSE
                   11419: decode-int nip nip to my-usb-address
                   11420: THEN
                   11421: s" MPS-BULKOUT" get-my-property         ( TRUE | propaddr proplen FALSE )
                   11422: IF
                   11423: s" not possible"   usb-debug-print
                   11424: ELSE
                   11425: decode-int nip nip to mps-bulk-out
                   11426: THEN
                   11427: s" MPS-BULKIN" get-my-property          ( TRUE | propaddr proplen FALSE )
                   11428: IF
                   11429: s" not possible" usb-debug-print
                   11430: ELSE
                   11431: decode-int nip nip to mps-bulk-in
                   11432: THEN
                   11433: s" BULK-IN-EP-ADDR" get-my-property     ( TRUE | propaddr proplen FALSE )
                   11434: IF
                   11435: s" not possible" usb-debug-print
                   11436: ELSE
                   11437: decode-int nip nip to bulk-in-ep
                   11438: THEN
                   11439: s" BULK-OUT-EP-ADDR" get-my-property    ( TRUE | propaddr proplen FALSE )
                   11440: IF
                   11441: s" not possible"  usb-debug-print
                   11442: ELSE
                   11443: decode-int nip nip to bulk-out-ep
                   11444: THEN
                   11445: s" MPS-DCP" get-my-property             ( TRUE | propaddr proplen FALSE )
                   11446: IF
                   11447: s" Not possible" usb-debug-print
                   11448: ELSE
                   11449: decode-int nip nip to mps-dcp
                   11450: THEN
                   11451: s" LUN" get-my-property                 ( TRUE | propaddr proplen FALSE )
                   11452: IF
                   11453: s" NOT Possible to extract LUN" usb-debug-print
                   11454: ELSE
                   11455: decode-int nip nip to lun
                   11456: THEN
                   11457: s" Extracted properties inherited from parent."  usb-debug-print
                   11458: 40 alloc-mem to command-buffer
                   11459: 80 alloc-mem to response-buffer
                   11460: 10 alloc-mem to csw-buffer
                   11461: 8 alloc-mem to cfg-buffer
                   11462: s" Allocated buffers." usb-debug-print
                   11463: cfg-buffer 8 mps-dcp my-usb-address      ( buffer len mps fun-addr )
                   11464: control-std-get-configuration-descriptor ( TRUE | FALSE )
                   11465: drop
                   11466: s" Configuration descriptor extracted." usb-debug-print
                   11467: cfg-buffer 5 + c@ my-usb-address         ( configvalue fun-addr )
                   11468: control-std-set-configuration            ( TRUE | FALSE )
                   11469: s" usb-storage: Set config returned: " rot usb-debug-print-val
                   11470: ;
                   11471: : (open-package)  ( ihandle-var name-str name-len -- )
                   11472: find-package IF                 ( ihandle-var phandle )
                   11473: 0 0 rot open-package         ( ihandle-var ihandle )
                   11474: swap !
                   11475: ELSE
                   11476: s" Support package not found"  usb-debug-print
                   11477: THEN
                   11478: ;
                   11479: : (close-package)  ( ihandle-var -- )
                   11480: dup @ close-package
                   11481: 0 swap !
                   11482: ;
                   11483: ��������x38usb-storage-wrapper.fss" scsi" device-name
                   11484: s" block-type" device-type
                   11485: 1 encode-int s" #address-cells" property
                   11486: 0 encode-int s" #size-cells" property
                   11487: : encode-unit   1 hex-encode-unit ;
                   11488: : decode-unit   1 hex-decode-unit ;
                   11489: 1 chars alloc-mem VALUE ch-buffer
                   11490: 8 VALUE mps-dcp
                   11491: 0 VALUE port-number
                   11492: 0 VALUE my-usb-address
                   11493: : control-std-get-maxlun
                   11494: s" control-std-get-maxlun" $call-parent
                   11495: ;
                   11496: : control-std-get-configuration-descriptor
                   11497: s" control-std-get-configuration-descriptor" $call-parent
                   11498: ;
                   11499: : rw-endpoint
                   11500: s" rw-endpoint" $call-parent
                   11501: ;
                   11502: : controlxfer ( dir addr dlen setup-packet MPS ep-fun -- TRUE|FALSE )
                   11503: s" controlxfer" $call-parent
                   11504: ;
                   11505: : control-std-set-configuration
                   11506: s" control-std-set-configuration" $call-parent
                   11507: ;
                   11508: : extract-properties ( -- )
                   11509: s" USB-ADDRESS" get-inherited-property ( prop-addr prop-len FALSE | TRUE )
                   11510: IF
                   11511: s" notpossible" usb-debug-print
                   11512: ELSE
                   11513: decode-int nip nip to my-usb-address
                   11514: THEN
                   11515: s" MPS-DCP" get-inherited-property  ( prop-addr prop-len FALSE | TRUE )
                   11516: IF
                   11517: s" MPS-DCP property not found.Assume 8 as MAX PACKET SIZE" usb-debug-print
                   11518: s" for the default control pipe"  usb-debug-print
                   11519: 8 to mps-dcp
                   11520: ELSE
                   11521: s" MPS-DCP property found!!"  usb-debug-print
                   11522: decode-int nip nip to mps-dcp
                   11523: THEN
                   11524: s" reg" get-inherited-property   ( prop-addr prop-len FLASE | TRUE )
                   11525: IF
                   11526: s" notpossible" usb-debug-print
                   11527: ELSE
                   11528: decode-int nip nip to port-number
                   11529: THEN
                   11530: ;
                   11531: : create-tree ( -- )
                   11532: mps-dcp my-usb-address 0 ch-buffer 1 ( MPS fun-addr dir data-buff data-len )
                   11533: control-std-get-maxlun     ( TRUE | FALSE )
                   11534: IF
                   11535: s" GET-MAX-LUN IS WORKING :" usb-debug-print
                   11536: ELSE
                   11537: s" ERROR in GET-MAX-LUN " usb-debug-print
                   11538: THEN
                   11539: ch-buffer c@ 1 +  0                              ( max-lun+1 0 )
                   11540: DO
                   11541: s" iManufacturer" get-inherited-property drop ( prop-addr prop-len TRUE )
                   11542: decode-int nip nip                  ( iManu )
                   11543: s" iProduct" get-inherited-property drop
                   11544: decode-int nip nip                  ( iManu iProd )
                   11545: s" iSerialNumber" get-inherited-property drop
                   11546: decode-int nip nip                  ( iManu iProd iSerNum )
                   11547: s" MPS-BULKOUT" get-inherited-property drop
                   11548: decode-int nip nip                  ( iManu iProd iSerNum MPS-BULKOUT )
                   11549: s" BULK-OUT-EP-ADDR" get-inherited-property drop
                   11550: decode-int nip nip ( iManu iProd iSerNum MPS-BULKOUT BULK-OUT-EP-ADDR )
                   11551: s" MPS-BULKIN" get-inherited-property drop
                   11552: ( iManu iProd iSerNum MPS-BULKOUT BULK-OUT-EP-ADDR prop-addr prop-len
                   11553: TRUE | FALSE )
                   11554: decode-int nip nip
                   11555: s" BULK-IN-EP-ADDR" get-inherited-property drop
                   11556: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN prop-addr
                   11557: prop-len TRUE | FALSE )
                   11558: decode-int nip nip
                   11559: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11560: BULKIN-EP-ADDR )
                   11561: mps-dcp  port-number  my-usb-address I
                   11562: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11563: BULKIN-EP-ADDR mps-dcp port-address my-usb-address lun-number )
                   11564: new-device
                   11565: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11566: BULKIN-EP-ADDR mps-dcp port-address my-usb-address lun-number )
                   11567: set-space
                   11568: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11569: BULKIN-EP-ADDR mps-dcp port-number my-usb-address )
                   11570: encode-int s" USB-ADDRESS" property
                   11571: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11572: BULKIN-EP-ADDR mps-dcp port-number )
                   11573: encode-int s" reg" property
                   11574: encode-int s" MPS-DCP" property
                   11575: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11576: BULKIN-EP-ADDR )
                   11577: I encode-int s" LUN" property
                   11578: ( iManu iProd iSernum MPS-BULKOUT BULK-OUT-EP-ADDR MPS-BULKIN
                   11579: BULKIN-EP-ADDR )
                   11580: encode-int s" BULK-IN-EP-ADDR" property
                   11581: encode-int s" MPS-BULKIN" property
                   11582: encode-int s" BULK-OUT-EP-ADDR" property
                   11583: encode-int s" MPS-BULKOUT" property ( iManu iProd iSerNum )
                   11584: encode-int s" iSerialNumber" property ( iManu iProd )
                   11585: encode-int s" iProduct" property  ( iManu )
                   11586: encode-int s" iManufacturer" property ( -- )
                   11587: s" usb-storage.fs" INCLUDED
                   11588: finish-device
                   11589: LOOP
                   11590: ;
                   11591: extract-properties  \ Extract the properties from parent
                   11592: create-tree       \ this method creates the node for every lun with properties
                   11593: ��������*�*0usb-keyboard.fss" keyboard" device-name
                   11594: s" keyboard" device-type
                   11595: ."   USB Keyboard" cr
                   11596: 3 encode-int s" assigned-addresses" property
                   11597: 1 encode-int s" reg" property
                   11598: 1 encode-int s" configuration#" property
                   11599: s" EN" encode-string s" language" property
                   11600: 1 constant NumLk
                   11601: 2 constant CapsLk
                   11602: 4 constant ScrLk
                   11603: 00 value kbd-addr
                   11604: to kbd-addr                                \ save speed bit
                   11605: 8 value mps-dcp
                   11606: 8 constant DEFAULT-CONTROL-MPS
                   11607: 8 chars alloc-mem value setup-packet
                   11608: 8 chars alloc-mem value kbd-report
                   11609: 4 chars alloc-mem value multi-key
                   11610: 0 value cfg-buffer
                   11611: 0 value led-state
                   11612: 0 value temp1
                   11613: 0 value temp2
                   11614: 0 value temp3
                   11615: 0 value ret
                   11616: 0 value scancode
                   11617: 0 value kbd-shift
                   11618: 0 value kbd-scan
                   11619: 0 value key-old
                   11620: 0 value expire-ms
                   11621: 0 value mps-int-in
                   11622: 0 value int-in-ep
                   11623: 0 value int-in-toggle
                   11624: kbd-addr                                    \ give speed bit to include file 
                   11625: s" usb-kbd-device-support.fs" included
                   11626: : control-cls-set-report ( reportvalue FuncAddr -- TRUE|FALSE )
                   11627: to temp1
                   11628: to temp2
                   11629: 2109000200000100 setup-packet ! 
                   11630: temp2 kbd-data l!-le  
                   11631: 1 kbd-data 1 setup-packet DEFAULT-CONTROL-MPS temp1 controlxfer  
                   11632: ;
                   11633: : control-cls-get-report ( data-buffer data-len MPS FuncAddr -- TRUE|FALSE )
                   11634: to temp1
                   11635: to temp2
                   11636: to temp3
                   11637: a101000100000000 setup-packet ! 
                   11638: temp3 setup-packet 6 + w!-le  
                   11639: 0 swap temp3 setup-packet temp2 temp1 controlxfer  
                   11640: ;
                   11641: : int-get-report ( -- )                                           \ get report for interrupt transfer
                   11642: 0 2 int-in-toggle kbd-report 8 mps-int-in
                   11643: kbd-addr int-in-ep 7 lshift or rw-endpoint                    \ get report 
                   11644: swap to int-in-toggle if
                   11645: kbd-report @ ff00000000000000 and 38 rshift to kbd-shift  \ store shift status
                   11646: kbd-report @ 0000ffffffffffff and to kbd-scan             \ store scan codes
                   11647: else
                   11648: 0 to kbd-shift                                            \ clear shift status 
                   11649: 0 to kbd-scan                                             \ clear scan code buffer
                   11650: then
                   11651: ;
                   11652: : ctl-get-report ( -- )                                           \ get report for control transfer      
                   11653: kbd-report 8 8 kbd-addr control-cls-get-report if             \ get report 
                   11654: kbd-report @ ff00000000000000 and 38 rshift to kbd-shift  \ store shift status
                   11655: kbd-report @ 0000ffffffffffff and to kbd-scan             \ store scan codes 
                   11656: else
                   11657: 0 to kbd-shift                                            \ clear shift status 
                   11658: 0 to kbd-scan                                             \ clear scan code buffer
                   11659: then
                   11660: ;
                   11661: : set-led ( led -- ) 
                   11662: dup to led-state  
                   11663: kbd-addr control-cls-set-report drop
                   11664: ;
                   11665: : is-shift ( -- true|false )
                   11666: kbd-shift 22 and if
                   11667: true
                   11668: else
                   11669: false
                   11670: then
                   11671: ;
                   11672: : is-alt ( -- true|false )
                   11673: kbd-shift 44 and if
                   11674: true
                   11675: else
                   11676: false
                   11677: then
                   11678: ;
                   11679: : is-ctrl ( -- true|false )
                   11680: kbd-shift 11 and if
                   11681: true
                   11682: else
                   11683: false
                   11684: then
                   11685: ;
                   11686: : ctrl_alt_del_key ( char -- )
                   11687: is-ctrl if                                           \ ctrl is pressed?
                   11688: is-alt if                                        \ alt is pressed?
                   11689: 4c = if                                      \ del is pressed?
                   11690: s" reboot.... " usb-debug-print 
                   11691: drop false                               \ invalidate del key on top of stack
                   11692: then
                   11693: false                                        \ dummy for last drop
                   11694: then
                   11695: then
                   11696: drop                                                 \ clear stack 
                   11697: ;
                   11698: : get-ukbd-char ( ScanCode -- char|false )
                   11699: dup ctrl_alt_del_key                                 \ check ctrl+alt+del 
                   11700: dup to scancode                                      \ store scan code
                   11701: case                                                 \ translate scan code --> char
                   11702: 04 of [char] a endof 
                   11703: 05 of [char] b endof 
                   11704: 06 of [char] c endof 
                   11705: 07 of [char] d endof 
                   11706: 08 of [char] e endof 
                   11707: 09 of [char] f endof 
                   11708: 0a of [char] g endof 
                   11709: 0b of [char] h endof 
                   11710: 0c of [char] i endof 
                   11711: 0d of [char] j endof 
                   11712: 0e of [char] k endof 
                   11713: 0f of [char] l endof 
                   11714: 10 of [char] m endof 
                   11715: 11 of [char] n endof 
                   11716: 12 of [char] o endof 
                   11717: 13 of [char] p endof 
                   11718: 14 of [char] q endof 
                   11719: 15 of [char] r endof 
                   11720: 16 of [char] s endof 
                   11721: 17 of [char] t endof 
                   11722: 18 of [char] u endof 
                   11723: 19 of [char] v endof 
                   11724: 1a of [char] w endof 
                   11725: 1b of [char] x endof 
                   11726: 1c of [char] y endof 
                   11727: 1d of [char] z endof 
                   11728: 1e of [char] 1 endof 
                   11729: 1f of [char] 2 endof 
                   11730: 20 of [char] 3 endof 
                   11731: 21 of [char] 4 endof 
                   11732: 22 of [char] 5 endof 
                   11733: 23 of [char] 6 endof 
                   11734: 24 of [char] 7 endof 
                   11735: 25 of [char] 8 endof 
                   11736: 26 of [char] 9 endof 
                   11737: 27 of [char] 0 endof 
                   11738: 28 of 0d endof                            \ Enter
                   11739: 29 of 1b endof                            \ ESC 
                   11740: 2a of 08 endof                            \ Backsace 
                   11741: 2b of 09 endof                            \ Tab
                   11742: 2c of 20 endof                            \ Space
                   11743: 2d of [char] - endof 
                   11744: 2e of [char] = endof 
                   11745: 2f of [char] [ endof 
                   11746: 30 of [char] ] endof 
                   11747: 31 of [char] \ endof 
                   11748: 33 of [char] ; endof 
                   11749: 34 of [char] ' endof 
                   11750: 35 of [char] ` endof 
                   11751: 36 of [char] , endof 
                   11752: 37 of [char] . endof 
                   11753: 38 of [char] / endof
                   11754: 39 of led-state CapsLk xor set-led false endof  \ CapsLk
                   11755: 3a of 1b 7e31315b to multi-key endof      \ F1
                   11756: 3b of 1b 7e32315b to multi-key endof      \ F2
                   11757: 3c of 1b 7e33315b to multi-key endof      \ F3
                   11758: 3d of 1b 7e34315b to multi-key endof      \ F4
                   11759: 3e of 1b 7e35315b to multi-key endof      \ F5
                   11760: 3f of 1b 7e37315b to multi-key endof      \ F6
                   11761: 40 of 1b 7e38315b to multi-key endof      \ F7
                   11762: 41 of 1b 7e39315b to multi-key endof      \ F8
                   11763: 42 of 1b 7e30315b to multi-key endof      \ F9
                   11764: 43 of 1b 7e31315b to multi-key endof      \ F10
                   11765: 44 of 1b 7e33315b to multi-key endof      \ F11
                   11766: 45 of 1b 7e34315b to multi-key endof      \ F12
                   11767: 47 of led-state ScrLk xor set-led false endof   \ ScrLk
                   11768: 49 of 1b 7e315b to multi-key endof        \ Ins
                   11769: 4a of 1b 7e325b to multi-key endof        \ Home
                   11770: 4b of 1b 7e335b to multi-key endof        \ PgUp
                   11771: 4c of 1b 7e345b to multi-key endof        \ Del
                   11772: 4d of 1b 7e355b to multi-key endof        \ End
                   11773: 4e of 1b 7e365b to multi-key endof        \ PgDn
                   11774: 4f of 1b 435b to multi-key endof          \ R-arrow
                   11775: 50 of 1b 445b to multi-key endof          \ L-arrow
                   11776: 51 of 1b 425b to multi-key endof          \ D-arrow
                   11777: 52 of 1b 415b to multi-key endof          \ U-arrow
                   11778: 53 of led-state NumLk xor set-led false endof   \ NumLk
                   11779: 54 of [char] / endof                      \ keypad / 
                   11780: 55 of [char] * endof                      \ keypad *
                   11781: 56 of [char] - endof                      \ keypad -
                   11782: 57 of [char] + endof                      \ keypad +
                   11783: 58 of 0d endof                            \ keypad Enter
                   11784: 89 of [char] \ endof                      \ japanese yen
                   11785: dup of false endof                        \ other keys are false
                   11786: endcase
                   11787: to ret                                        \ store char
                   11788: led-state CapsLk and 0 <> if                  \ if CapsLk is on
                   11789: scancode 03 > if                          \ from a to z ?
                   11790: scancode 1e < if
                   11791: ret 20 - to ret                   \ to Upper case
                   11792: then
                   11793: then
                   11794: then
                   11795: is-shift if                                   \ if shift is on
                   11796: scancode 03 > if                          \ from a to z ?
                   11797: scancode 1e < if
                   11798: ret 20 - to ret                   \ to Upper case
                   11799: else
                   11800: scancode
                   11801: case                              \ translate scan code --> char
                   11802: 1e of [char] ! endof
                   11803: 1f of [char] @ endof
                   11804: 20 of [char] # endof
                   11805: 21 of [char] $ endof
                   11806: 22 of [char] % endof
                   11807: 23 of [char] ^ endof
                   11808: 24 of [char] & endof
                   11809: 25 of [char] * endof
                   11810: 26 of [char] ( endof
                   11811: 27 of [char] ) endof
                   11812: 2d of [char] _ endof
                   11813: 2e of [char] + endof
                   11814: 2f of [char] { endof
                   11815: 30 of [char] } endof
                   11816: 31 of [char] | endof
                   11817: 33 of [char] : endof
                   11818: 34 of [char] " endof
                   11819: 35 of [char] ~ endof
                   11820: 36 of [char] < endof
                   11821: 37 of [char] > endof
                   11822: 38 of [char] ? endof
                   11823: dup of ret endof              \ other keys are no change
                   11824: endcase
                   11825: to ret                            \ overwrite new char    
                   11826: then
                   11827: then
                   11828: then
                   11829: led-state NumLk and 0 <> if                   \ if NumLk is on
                   11830: scancode 
                   11831: case                                        \ translate scan code --> char
                   11832: 59 of [char] 1 endof
                   11833: 5a of [char] 2 endof
                   11834: 5b of [char] 3 endof
                   11835: 5c of [char] 4 endof
                   11836: 5d of [char] 5 endof
                   11837: 5e of [char] 6 endof
                   11838: 5f of [char] 7 endof
                   11839: 60 of [char] 8 endof
                   11840: 61 of [char] 9 endof
                   11841: 62 of [char] 0 endof
                   11842: 63 of [char] . endof                      \ keypad .
                   11843: dup of ret endof                          \ other keys are no change
                   11844: endcase
                   11845: to ret                                      \ overwirte new char
                   11846: then
                   11847: ret                                           \ return char
                   11848: ;
                   11849: : key-available? ( -- true|false )
                   11850: multi-key 0 <> IF 
                   11851: true \ multi scan code key was pressed... so key is available
                   11852: EXIT \ done
                   11853: THEN
                   11854: kbd-scan 0 = IF \ if no kbd-scan code is currently available 
                   11855: int-get-report \ check for one using int-get-report 
                   11856: THEN
                   11857: kbd-scan 0 <> \ if a kbd-scan is available, report true, else false
                   11858: ;
                   11859: : usb-kread ( -- char|false )                            \ usb key read for control transfer
                   11860: multi-key 0 <> if                                    \ if multi scan code key is pressed
                   11861: multi-key ff and                                 \ read one byte from buffer
                   11862: multi-key 8 rshift to multi-key                  \ move to next byte 
                   11863: else                                                 \ normal key check
                   11864: kbd-scan 0 = IF
                   11865: int-get-report                                   \ read report (interrupt transfer)
                   11866: THEN
                   11867: kbd-scan 0 <> if                                 \ scan code exist?
                   11868: begin kbd-scan ff and dup 00 = while         \ get a last scancode in report buffer
                   11869: kbd-scan 8 rshift to kbd-scan        \ This algorithm is wrong --> must be fixed!
                   11870: drop                                 \ KBD doesn't set scancode in pressed order!!!
                   11871: repeat
                   11872: dup key-old <> if                            \ if the scancode is new
                   11873: dup to key-old                           \ save current scan code
                   11874: get-ukbd-char                            \ translate scan code --> char
                   11875: milliseconds fa + to expire-ms           \ set typematic delay 250ms       
                   11876: else                                         \ scan code is not changed
                   11877: milliseconds expire-ms > if              \ if timer is expired ... should be considered timer carry over
                   11878: get-ukbd-char                        \ translate scan code --> char
                   11879: milliseconds 21 + to expire-ms       \ set typematic rate 30cps
                   11880: else                                     \ timer is not expired 
                   11881: drop false                           \ do nothing
                   11882: then
                   11883: then
                   11884: kbd-scan 8 rshift to kbd-scan \ handled scan-code
                   11885: else
                   11886: 0 to key-old                                 \ clear privious key
                   11887: false                                        \ no scan code --> return false
                   11888: then
                   11889: then
                   11890: ;
                   11891: : key-read ( -- char )
                   11892: 0 begin drop usb-kread dup 0 <> until                \ read key input (Interrupt transfer)
                   11893: ;
                   11894: : read ( addr len -- actual )
                   11895: 0= IF drop 0 EXIT THEN
                   11896: usb-kread ?dup  IF  swap c! 1  ELSE  0 swap c! -2  THEN
                   11897: ;
                   11898: kbd-init                                                 \ keyboard initialize
                   11899: milliseconds to expire-ms                                \ Timer initialize
                   11900: 0 to multi-key                                           \ multi key buffer clear
                   11901: 7 set-led                                                \ flash leds
                   11902: 250 ms
                   11903: 0 set-led
                   11904: s" keyboard" get-node node>path set-alias
                   11905: : open ( -- true )
                   11906: 7 set-led
                   11907: 100 ms
                   11908: 3 set-led
                   11909: 100 ms
                   11910: 1 set-led
                   11911: 100 ms
                   11912: usb-kread drop
                   11913: 0 set-led
                   11914: true
                   11915: ;
                   11916: : close ;
                   11917: ��������`@usb-kbd-device-support.fs00 value kbd-addr
                   11918: to kbd-addr
                   11919: 8 alloc-mem to kbd-report
                   11920: 4 chars alloc-mem value kbd-data
                   11921: : rw-endpoint
                   11922: s" rw-endpoint" $call-parent ;
                   11923: : controlxfer
                   11924: s" controlxfer" $call-parent ;
                   11925: : control-std-get-device-descriptor
                   11926: s" control-std-get-device-descriptor" $call-parent ;
                   11927: : control-std-get-configuration-descriptor
                   11928: s" control-std-get-configuration-descriptor" $call-parent ;
                   11929: : control-std-set-configuration
                   11930: s" control-std-set-configuration" $call-parent ;
                   11931: : control-cls-set-protocol ( reportvalue FuncAddr -- TRUE|FALSE )
                   11932: to temp1
                   11933: to temp2
                   11934: 210b000000000100 setup-packet ! 
                   11935: temp2 kbd-data l!-le
                   11936: 1 kbd-data 1 setup-packet DEFAULT-CONTROL-MPS temp1 controlxfer  
                   11937: ;
                   11938: : control-cls-set-idle ( reportvalue FuncAddr -- TRUE|FALSE )
                   11939: to temp1
                   11940: to temp2
                   11941: 210a000000000000 setup-packet ! 
                   11942: temp2 kbd-data l!-le
                   11943: 0 kbd-data 0 setup-packet DEFAULT-CONTROL-MPS temp1 controlxfer  
                   11944: ;
                   11945: : control-std-get-report-descriptor ( data-buffer data-len MPS FuncAddr -- TRUE|FALSE )
                   11946: to temp1
                   11947: to temp2
                   11948: to temp3
                   11949: 8106002200000000 setup-packet ! 
                   11950: temp3 setup-packet 6 + w!-le
                   11951: 0 swap temp3 setup-packet temp2 temp1 controlxfer  
                   11952: ;
                   11953: : kbd-init
                   11954: s" Starting to initialize keyboard" usb-debug-print
                   11955: s" MPS-INTIN" get-my-property
                   11956: if
                   11957: s" not possible" usb-debug-print
                   11958: else
                   11959: decode-int nip nip to mps-int-in
                   11960: then
                   11961: s" INT-IN-EP-ADDR" get-my-property
                   11962: if
                   11963: s" not possible" usb-debug-print
                   11964: else
                   11965: decode-int nip nip to int-in-ep
                   11966: then
                   11967: 7f alloc-mem to cfg-buffer
                   11968: s" Allocated buffers!!" usb-debug-print
                   11969: cfg-buffer 12 8 kbd-addr                   \ get device descriptor
                   11970: control-std-get-device-descriptor
                   11971: drop
                   11972: cfg-buffer 9 8 kbd-addr                    \ get config descriptor  
                   11973: control-std-get-configuration-descriptor
                   11974: drop
                   11975: cfg-buffer 5 + c@ kbd-addr                 \ set configuration  
                   11976: control-std-set-configuration
                   11977: drop
                   11978: s" KBDS: Set config returned" usb-debug-print 
                   11979: 0 kbd-addr control-cls-set-idle drop       \ set idle  
                   11980: s" KBDS: Set idle returned" usb-debug-print
                   11981: cfg-buffer 40 8 kbd-addr                   \ get report descriptor
                   11982: control-std-get-report-descriptor
                   11983: drop
                   11984: s" Finished initializing keyboard" usb-debug-print 
                   11985: ;
                   11986: ��������&`&'0usb-mouse.fss" mouse" device-name
                   11987: s" mouse" device-type
                   11988: ."   USB Mouse" cr
                   11989: 1 encode-int s" configuration#" property
                   11990: 2 encode-int s" #buttons" property
                   11991: 4 encode-int s" assigned-addresses" property
                   11992: 2 encode-int s" reg" property
                   11993: : open true ;
                   11994: : close ;
                   11995: : get-event ( msec -- pos.x pos.y buttons true|false )
                   11996: ;
                   11997: ��������KHK       0scsi-support.fsvocabulary scsi-words                  \ create new word list named 'scsi-words'
                   11998: also scsi-words  definitions           \ place next definitions into new list
                   11999: false  value   scsi-param-debug        \ common debugging flag
                   12000: d# 0   value   scsi-param-size         \ length of CDB processed last
                   12001: h# 0   value   scsi-param-control      \ control word for CDBs as defined in SAM-4
                   12002: d# 0   value   scsi-param-errors       \ counter for detected errors
                   12003: : scsi-inc-errors
                   12004: scsi-param-errors 1 + to scsi-param-errors
                   12005: ;
                   12006: 00 CONSTANT scsi-cmd-test-unit-ready
                   12007: STRUCT
                   12008: /c     FIELD test-unit-ready>operation-code     \ 00h
                   12009: 4      FIELD test-unit-ready>reserved           \ unused
                   12010: /c     FIELD test-unit-ready>control            \ control byte as specified in SAM-4
                   12011: CONSTANT scsi-length-test-unit-ready
                   12012: : scsi-build-test-unit-ready  ( cdb -- )
                   12013: dup scsi-length-test-unit-ready erase  ( cdb )
                   12014: scsi-param-control swap test-unit-ready>control c!  ( )
                   12015: scsi-length-test-unit-ready to scsi-param-size   \ update CDB length
                   12016: ;
                   12017: 03 CONSTANT scsi-cmd-request-sense
                   12018: STRUCT
                   12019: /c     FIELD request-sense>operation-code     \ 03h
                   12020: 3      FIELD request-sense>reserved           \ unused
                   12021: /c     FIELD request-sense>allocation-length  \ buffer-length for data response
                   12022: /c     FIELD request-sense>control            \ control byte as specified in SAM-4
                   12023: CONSTANT scsi-length-request-sense
                   12024: : scsi-build-request-sense    ( alloc-len cdb -- )
                   12025: >r                         ( alloc-len )  ( R: -- cdb )
                   12026: r@ scsi-length-request-sense erase  ( alloc-len )
                   12027: scsi-cmd-request-sense r@           ( alloc-len cmd cdb )
                   12028: request-sense>operation-code c!     ( alloc-len )
                   12029: dup d# 252 >                        \ buffer length too big ?
                   12030: IF
                   12031: scsi-inc-errors
                   12032: drop d# 252                      \ replace with 252
                   12033: ELSE
                   12034: dup d# 18 <                      \ allocated buffer too small ?
                   12035: IF
                   12036: scsi-inc-errors
                   12037: drop 0                        \ reject return data
                   12038: THEN
                   12039: THEN                                      ( alloclen )
                   12040: r@ request-sense>allocation-length c!     (  )
                   12041: scsi-param-control r> request-sense>control c!  ( alloc-len cdb )  ( R: cdb -- )
                   12042: scsi-length-request-sense to scsi-param-size  \ update CDB length
                   12043: ;
                   12044: 70 CONSTANT scsi-response(request-sense-0)
                   12045: 71 CONSTANT scsi-response(request-sense-1)
                   12046: STRUCT
                   12047: /c FIELD sense-data>response-code   \ 70h (current errors) or 71h (deferred errors)
                   12048: /c FIELD sense-data>obsolete
                   12049: /c FIELD sense-data>sense-key       \ D3..D0 = sense key, D7 = EndOfMedium
                   12050: /l FIELD sense-data>info
                   12051: /c FIELD sense-data>alloc-length    \ <= 244 (for max size)
                   12052: /l FIELD sense-data>command-info
                   12053: /c FIELD sense-data>asc             \ additional sense key
                   12054: /c FIELD sense-data>ascq            \ additional sense key qualifier
                   12055: /c FIELD sense-data>unit-code
                   12056: 3  FIELD sense-data>key-specific
                   12057: /c FIELD sense-data>add-sense-bytes \ start of appended extra bytes
                   12058: CONSTANT scsi-length-sense-data
                   12059: : scsi-get-sense-data                  ( addr -- ascq asc sense-key )   
                   12060: >r                                  ( R: -- addr )
                   12061: r@ sense-data>response-code c@ 7f and 72 >= IF
                   12062: r@ 3 + c@                           ( ascq )
                   12063: r@ 2 + c@                           ( ascq asc ) 
                   12064: r> 1 + c@ 0f and                    ( ascq asc sense-key )
                   12065: ELSE
                   12066: r@ sense-data>ASCQ c@               ( ascq )
                   12067: r@ sense-data>ASC c@                ( ascq asc )
                   12068: r> sense-data>sense-key c@ 0f and   ( ascq asc sense-key ) ( R: addr -- )
                   12069: THEN
                   12070: ;
                   12071: : scsi-get-sense-data?                 ( addr -- false | ascq asc sense-key true )
                   12072: dup
                   12073: sense-data>response-code c@
                   12074: 7e AND 70 =          \ Response code (some devices have MSB set)
                   12075: IF
                   12076: scsi-get-sense-data TRUE
                   12077: ELSE
                   12078: drop FALSE        \ drop addr
                   12079: THEN
                   12080: ;
                   12081: : scsi-get-sense-ID?                 ( addr -- false | ascq asc sense-key true )
                   12082: dup
                   12083: sense-data>response-code c@
                   12084: 7e AND 70 =          \ Response code (some devices have MSB set)
                   12085: IF
                   12086: scsi-get-sense-data        ( ascq asc sense-key )
                   12087: 10 lshift                  ( ascq asc sense-key16 )
                   12088: swap 8 lshift or           ( ascq sense-key+asc )
                   12089: swap or                    \ 24-bit sense-ID ( sense-key+asc+ascq )
                   12090: TRUE
                   12091: ELSE
                   12092: drop FALSE        \ drop addr
                   12093: THEN
                   12094: ;
                   12095: 12 CONSTANT scsi-cmd-inquiry
                   12096: STRUCT
                   12097: /c     FIELD inquiry>operation-code     \ 0x12
                   12098: /c     FIELD inquiry>reserved           \ + EVPD-Bit (vital product data)
                   12099: /c     FIELD inquiry>page-code          \ page code for vital product data (if used)
                   12100: /w     FIELD inquiry>allocation-length  \ length of Data-In-Buffer
                   12101: /c     FIELD inquiry>control            \ control byte as specified in SAM-4
                   12102: CONSTANT scsi-length-inquiry
                   12103: : scsi-build-inquiry                   ( alloc-len cdb -- )
                   12104: dup scsi-length-inquiry erase       \ 6 bytes CDB
                   12105: scsi-cmd-inquiry over                             ( alloc-len cdb cmd cdb )
                   12106: inquiry>operation-code c!               ( alloc-len cdb )
                   12107: scsi-param-control over inquiry>control c! ( alloc-len cdb )
                   12108: inquiry>allocation-length w!         \ size of Data-In Buffer
                   12109: scsi-length-inquiry to scsi-param-size    \ update CDB length
                   12110: ;
                   12111: STRUCT
                   12112: /c        FIELD inquiry-data>peripheral       \ qualifier and device type
                   12113: /c        FIELD inquiry-data>reserved1
                   12114: /c        FIELD inquiry-data>version          \ supported SCSI version (1,2,3)
                   12115: /c        FIELD inquiry-data>data-format
                   12116: /c        FIELD inquiry-data>add-length       \ total block length - 4
                   12117: /c        FIELD inquiry-data>flags1
                   12118: /c        FIELD inquiry-data>flags2
                   12119: /c        FIELD inquiry-data>flags3
                   12120: d# 8   FIELD inquiry-data>vendor-ident     \ vendor string
                   12121: d# 16  FIELD inquiry-data>product-ident    \ device string
                   12122: /l     FIELD inquiry-data>product-revision \ revision string
                   12123: d# 20  FIELD inquiry-data>vendor-specific  \ optional params
                   12124: CONSTANT scsi-length-inquiry-data
                   12125: 25 CONSTANT scsi-cmd-read-capacity-10  \ command code
                   12126: STRUCT                                 \ SCSI 10-byte CDB structure
                   12127: /c     FIELD read-cap-10>operation-code
                   12128: /c     FIELD read-cap-10>reserved1
                   12129: /l     FIELD read-cap-10>lba
                   12130: /w     FIELD read-cap-10>reserved2
                   12131: /c     FIELD read-cap-10>reserved3
                   12132: /c     FIELD read-cap-10>control
                   12133: CONSTANT scsi-length-read-cap-10
                   12134: : scsi-build-read-cap-10                     ( cdb -- )
                   12135: dup scsi-length-read-cap-10 erase         ( cdb )
                   12136: scsi-cmd-read-capacity-10 over            ( cdb cmd cdb )
                   12137: read-cap-10>operation-code c!             ( cdb )
                   12138: scsi-param-control swap read-cap-10>control c! ( )
                   12139: scsi-length-read-cap-10 to scsi-param-size    \ update CDB length
                   12140: ;
                   12141: STRUCT
                   12142: /l     FIELD read-cap-10-data>max-lba
                   12143: /l     FIELD read-cap-10-data>block-size
                   12144: CONSTANT scsi-length-read-cap-10-data
                   12145: : scsi-get-capacity-10                 ( addr -- block-size #blocks )
                   12146: >r                                  ( addr -- ) ( R: -- addr )
                   12147: r@ read-cap-10-data>block-size l@   ( block-size )
                   12148: r> read-cap-10-data>max-lba l@      ( block-size #blocks ) ( R: addr -- )
                   12149: ;
                   12150: 9e CONSTANT scsi-cmd-read-capacity-16        \ command code
                   12151: STRUCT                                       \ SCSI 16-byte CDB structure
                   12152: /c     FIELD read-cap-16>operation-code
                   12153: /c     FIELD read-cap-16>service-action
                   12154: /l     FIELD read-cap-16>lba-high
                   12155: /l     FIELD read-cap-16>lba-low
                   12156: /l     FIELD read-cap-16>allocation-length    \ should be 32
                   12157: /c     FIELD read-cap-16>reserved
                   12158: /c     FIELD read-cap-16>control
                   12159: CONSTANT scsi-length-read-cap-16
                   12160: : scsi-build-read-cap-16  ( cdb -- )
                   12161: >r r@                                     ( R: -- cdb )
                   12162: scsi-length-read-cap-16 erase             (  )
                   12163: scsi-cmd-read-capacity-16                 ( code )
                   12164: r@ read-cap-16>operation-code c!          (  )
                   12165: 10 r@ read-cap-16>service-action c!
                   12166: d# 32                                     \ response size 32 bytes
                   12167: r@ read-cap-16>allocation-length l!       (  )
                   12168: scsi-param-control r> read-cap-16>control c! ( R: cdb -- )
                   12169: scsi-length-read-cap-16 to scsi-param-size \ update CDB length
                   12170: ;
                   12171: STRUCT
                   12172: /l     FIELD read-cap-16-data>max-lba-high    \ upper quadlet of Max-LBA
                   12173: /l     FIELD read-cap-16-data>max-lba-low     \ lower quadlet of Max-LBA
                   12174: /l     FIELD read-cap-16-data>block-size      \ logical block length in bytes
                   12175: /c     FIELD read-cap-16-data>protect         \ type of protection (4 bits)
                   12176: /c     FIELD read-cap-16-data>exponent        \ logical blocks per physical blocks
                   12177: /w     FIELD read-cap-16-data>lowest-aligned  \ first LBA of a phsy. block
                   12178: 10 FIELD read-cap-16-data>reserved        \ 16 reserved bytes
                   12179: CONSTANT scsi-length-read-cap-16-data        \ results in 32
                   12180: : scsi-get-capacity-16                       ( addr -- block-size #blocks )
                   12181: >r                                        ( R: -- addr )
                   12182: r@ read-cap-16-data>block-size l@         ( block-size )
                   12183: r@ read-cap-16-data>max-lba-high l@       ( block-size #blocks-high )
                   12184: d# 32 lshift                              ( block-size #blocks-upper )
                   12185: r> read-cap-16-data>max-lba-low l@ +      ( block-size #blocks ) ( R: addr -- )
                   12186: ;
                   12187: 5a CONSTANT scsi-cmd-mode-sense-10
                   12188: STRUCT
                   12189: /c     FIELD mode-sense-10>operation-code
                   12190: /c     FIELD mode-sense-10>res-llbaa-dbd-res
                   12191: /c     FIELD mode-sense-10>pc-page-code       \ page code + page control
                   12192: /c     FIELD mode-sense-10>sub-page-code
                   12193: 3      FIELD mode-sense-10>reserved2
                   12194: /w     FIELD mode-sense-10>allocation-length
                   12195: /c     FIELD mode-sense-10>control
                   12196: CONSTANT scsi-length-mode-sense-10
                   12197: : scsi-build-mode-sense-10                   ( alloc-len subpage page cdb -- )
                   12198: >r                                        ( alloc-len subpage page ) ( R: -- cdb )
                   12199: r@ scsi-length-mode-sense-10 erase        \ 10 bytes CDB
                   12200: scsi-cmd-mode-sense-10                    ( alloc-len subpage page cmd )
                   12201: r@  mode-sense-10>operation-code c!               ( alloc-len subpage page )
                   12202: 10 r@ mode-sense-10>res-llbaa-dbd-res c!  \ long LBAs accepted
                   12203: r@ mode-sense-10>pc-page-code c!                ( alloc-len subpage )
                   12204: r@ mode-sense-10>sub-page-code c!            ( alloc-len )
                   12205: r@ mode-sense-10>allocation-length w!     ( )
                   12206: scsi-param-control r> mode-sense-10>control c!  ( R: cdb -- )
                   12207: scsi-length-mode-sense-10 to scsi-param-size  \ update CDB length
                   12208: ;
                   12209: STRUCT
                   12210: /w     FIELD mode-sense-10-data>head-length
                   12211: /c     FIELD mode-sense-10-data>head-medium
                   12212: /c     FIELD mode-sense-10-data>head-param
                   12213: /c     FIELD mode-sense-10-data>head-longlba
                   12214: /c     FIELD mode-sense-10-data>head-reserved
                   12215: /w     FIELD mode-sense-10-data>head-descr-len
                   12216: CONSTANT scsi-length-mode-sense-10-data
                   12217: : .mode-sense-data   ( addr -- )
                   12218: cr
                   12219: dup mode-sense-10-data>head-length
                   12220: w@ ." Mode Length: " .d space
                   12221: dup mode-sense-10-data>head-medium
                   12222: c@ ." / Medium Type: " .d space
                   12223: dup mode-sense-10-data>head-longlba
                   12224: c@ ." / Long LBA: " .d space
                   12225: mode-sense-10-data>head-descr-len
                   12226: w@ ." / Descr. Length: " .d
                   12227: ;
                   12228: 08 CONSTANT scsi-cmd-read-6
                   12229: STRUCT
                   12230: /c FIELD read-6>operation-code      \ 08h
                   12231: /c FIELD read-6>block-address-msb   \ upper 5 bits
                   12232: /w FIELD read-6>block-address       \ lower 16 bits
                   12233: /c FIELD read-6>length              \ number of blocks to read
                   12234: /c FIELD read-6>control             \ CDB control
                   12235: CONSTANT scsi-length-read-6
                   12236: : scsi-build-read-6                    ( block# #blocks cdb -- )
                   12237: >r                                  ( block# #blocks ) ( R: -- cdb )
                   12238: r@ scsi-length-read-6 erase         \ 6 bytes CDB
                   12239: scsi-cmd-read-6 r@ read-6>operation-code c! ( block# #blocks )
                   12240: dup d# 255 >                        \ #blocks exceeded limit ?
                   12241: IF
                   12242: scsi-inc-errors
                   12243: drop 1                           \ replace with any valid number
                   12244: THEN
                   12245: r@ read-6>length c!                 \ set #blocks to read
                   12246: dup 1fffff >                        \ check address upper limit
                   12247: IF
                   12248: scsi-inc-errors
                   12249: drop                             \ remove original block#
                   12250: 1fffff                           \ replace with any valid address
                   12251: THEN
                   12252: dup d# 16 rshift
                   12253: r@ read-6>block-address-msb c!      \ set upper 5 bits
                   12254: ffff and
                   12255: r@ read-6>block-address w!                \ set lower 16 bits
                   12256: scsi-param-control r> read-6>control c!   ( R: cdb -- )
                   12257: scsi-length-read-6 to scsi-param-size     \ update CDB length
                   12258: ;
                   12259: 28 CONSTANT scsi-cmd-read-10
                   12260: STRUCT
                   12261: /c FIELD read-10>operation-code
                   12262: /c FIELD read-10>protect
                   12263: /l FIELD read-10>block-address      \ logical block address (32bits)
                   12264: /c FIELD read-10>group
                   12265: /w FIELD read-10>length             \ transfer length (16-bits)
                   12266: /c FIELD read-10>control
                   12267: CONSTANT scsi-length-read-10
                   12268: : scsi-build-read-10                         ( block# #blocks cdb -- )
                   12269: >r                                        ( block# #blocks )  ( R: -- cdb )
                   12270: r@ scsi-length-read-10 erase             \ 10 bytes CDB
                   12271: scsi-cmd-read-10 r@ read-10>operation-code c! ( block# #blocks )
                   12272: r@ read-10>length w!                      ( block# )
                   12273: r@ read-10>block-address l!               (  )
                   12274: scsi-param-control r> read-10>control c!  ( R: cdb -- )
                   12275: scsi-length-read-10 to scsi-param-size    \ update CDB length
                   12276: ;
                   12277: a8 CONSTANT scsi-cmd-read-12
                   12278: STRUCT
                   12279: /c FIELD read-12>operation-code     \ code: a8
                   12280: /c FIELD read-12>protect            \ RDPROTECT, DPO, FUA, FUA_NV
                   12281: /l FIELD read-12>block-address      \ lba
                   12282: /l FIELD read-12>length             \ transfer length (32bits)
                   12283: /c FIELD read-12>group              \ group number
                   12284: /c FIELD read-12>control
                   12285: CONSTANT scsi-length-read-12
                   12286: : scsi-build-read-12                         ( block# #blocks cdb -- )
                   12287: >r                                        ( block# #blocks )  ( R: -- cdb )
                   12288: r@ scsi-length-read-12 erase             \ 12 bytes CDB
                   12289: scsi-cmd-read-12 r@ read-12>operation-code c! ( block# #blocks )
                   12290: r@ read-12>length l!                      ( block# )
                   12291: r@ read-12>block-address l!               (  )
                   12292: scsi-param-control r> read-12>control c!  ( R: cdb -- )
                   12293: scsi-length-read-12 to scsi-param-size    \ update CDB length
                   12294: ;
                   12295: : scsi-build-read?   ( block# #blocks cdb -- length )
                   12296: over              ( block# #blocks cdb #blocks )
                   12297: fffe >            \ tx-length (#blocks) exceeds 16-bit limit ?
                   12298: IF
                   12299: scsi-build-read-12   ( block# #blocks cdb -- )
                   12300: scsi-length-read-12  ( length )
                   12301: ELSE                    ( block# #blocks cdb )
                   12302: scsi-build-read-10   ( block# #blocks cdb -- )
                   12303: scsi-length-read-10  ( length )
                   12304: THEN
                   12305: ;
                   12306: 1b CONSTANT scsi-cmd-start-stop-unit
                   12307: STRUCT
                   12308: /c FIELD start-stop-unit>operation-code
                   12309: /c FIELD start-stop-unit>immed
                   12310: /w FIELD start-stop-unit>reserved
                   12311: /c FIELD start-stop-unit>pow-condition
                   12312: /c FIELD start-stop-unit>control
                   12313: CONSTANT scsi-length-start-stop-unit
                   12314: f1 CONSTANT scsi-const-active-power    \ param used for start-stop-unit
                   12315: f2 CONSTANT scsi-const-idle-power      \ param used for start-stop-unit
                   12316: f3 CONSTANT scsi-const-standby-power   \ param used for start-stop-unit
                   12317: 3  CONSTANT scsi-const-load            \ param used for start-stop-unit
                   12318: 2  CONSTANT scsi-const-eject           \ param used for start-stop-unit
                   12319: 1  CONSTANT scsi-const-start
                   12320: 0  CONSTANT scsi-const-stop
                   12321: : scsi-build-start-stop-unit                 ( state# cdb -- )
                   12322: >r                                        ( state# )  ( R: -- cdb )
                   12323: r@ scsi-length-start-stop-unit erase      \ 6 bytes CDB
                   12324: scsi-cmd-start-stop-unit r@ start-stop-unit>operation-code c!
                   12325: dup 3 >
                   12326: IF
                   12327: 4 lshift                         \ shift to upper nibble
                   12328: THEN                                ( state )
                   12329: r@ start-stop-unit>pow-condition c!       (  )
                   12330: scsi-param-control r> start-stop-unit>control c!  ( R: cdb -- )
                   12331: scsi-length-start-stop-unit to scsi-param-size  \ update CDB length
                   12332: ;
                   12333: 2b CONSTANT scsi-cmd-seek
                   12334: STRUCT
                   12335: /c FIELD seek>operation-code
                   12336: /c FIELD seek>reserved1
                   12337: /l FIELD seek>lba
                   12338: 3  FIELD seek>reserved2
                   12339: /c FIELD seek>control
                   12340: CONSTANT scsi-length-seek
                   12341: : scsi-build-seek  ( lba cdb -- )
                   12342: >r              ( lba )  ( R: -- cdb )
                   12343: r@ scsi-length-seek erase           \ 10 bytes CDB
                   12344: scsi-cmd-seek r@ seek>operation-code c!
                   12345: r> seek>lba l!  (  )  ( R: cdb -- )
                   12346: scsi-length-seek to scsi-param-size \ update CDB length
                   12347: ;
                   12348: STRUCT
                   12349: /w FIELD media-event-data-len
                   12350: /c FIELD media-event-nea-class
                   12351: /c FIELD media-event-supp-class
                   12352: /l FIELD media-event-data
                   12353: CONSTANT scsi-length-media-event
                   12354: : scsi-build-get-media-event                     ( cdb -- )
                   12355: dup c erase                                     ( cdb )
                   12356: 4a over c!                                      ( cdb )
                   12357: 01 over 1 + c!
                   12358: 10 over 4 + c!
                   12359: 08 over 8 + c!
                   12360: drop
                   12361: ;
                   12362: : .sense-text ( scode -- )
                   12363: case
                   12364: 0    OF s" OK"               ENDOF
                   12365: 1    OF s" RECOVERED ERR"    ENDOF
                   12366: 2    OF s" NOT READY"        ENDOF
                   12367: 3    OF s" MEDIUM ERROR"     ENDOF
                   12368: 4    OF s" HARDWARE ERR"     ENDOF
                   12369: 5    OF s" ILLEGAL REQUEST"  ENDOF
                   12370: 6    OF s" UNIT ATTENTION"   ENDOF
                   12371: 7    OF s" DATA PROTECT"     ENDOF
                   12372: 8    OF s" BLANK CHECK"      ENDOF
                   12373: 9    OF s" VENDOR SPECIFIC"  ENDOF
                   12374: a    OF s" COPY ABORTED"     ENDOF
                   12375: b    OF s" ABORTED COMMAND"  ENDOF
                   12376: d    OF s" VOLUME OVERFLOW"  ENDOF
                   12377: e    OF s" MISCOMPARE"       ENDOF
                   12378: dup  OF s" UNKNOWN"          ENDOF
                   12379: endcase
                   12380: 5b emit type 5d emit
                   12381: ;
                   12382: : .status-text  ( stat -- )
                   12383: case
                   12384: 00  OF s" GOOD"                  ENDOF
                   12385: 02  OF s" CHECK CONDITION"       ENDOF
                   12386: 04  OF s" CONDITION MET"         ENDOF
                   12387: 08  OF s" BUSY"                  ENDOF
                   12388: 18  OF s" RESERVATION CONFLICT"  ENDOF
                   12389: 28  OF s" TASK SET FULL"         ENDOF
                   12390: 30  OF s" ACA ACTIVE"            ENDOF
                   12391: 40  OF s" TASK ABORTED"          ENDOF
                   12392: dup OF s" UNKNOWN"               ENDOF
                   12393: endcase
                   12394: 5b emit type 5d emit
                   12395: ;
                   12396: : .dec3-2 ( prenum postnum -- )
                   12397: swap
                   12398: base @ >r                           \ save actual base setting
                   12399: decimal                             \ show decimal values
                   12400: 4 .r 2e emit
                   12401: dup 9 <= IF 30 emit THEN .d         \ 3 pre-decimal, right aligned
                   12402: r> base !                           \ restore base
                   12403: ;
                   12404: : .capacity-text  ( block-size #blocks -- )
                   12405: scsi-param-debug                    \ debugging flag set ?
                   12406: IF                                  \ show additional info
                   12407: 2dup
                   12408: cr
                   12409: ." LBAs: " .d                    \ highest logical block number
                   12410: ." / Block-Size: " .d
                   12411: ." / Total Capacity: "
                   12412: THEN
                   12413: *                                   \ calculate total capacity
                   12414: dup d# 1000000000000 >=             \ check terabyte limit
                   12415: IF
                   12416: d# 1000000000000 /mod
                   12417: swap
                   12418: d# 10000000000 /                 \ limit remainder to two digits
                   12419: .dec3-2 ." TB"                   \ show terabytes as xxx.yy
                   12420: ELSE
                   12421: dup d# 1000000000 >=             \ check gigabyte limit
                   12422: IF
                   12423: d# 1000000000 /mod
                   12424: swap
                   12425: d# 10000000 /
                   12426: .dec3-2 ." GB"                \ show gigabytes as xxx.yy
                   12427: ELSE
                   12428: dup d# 1000000 >=
                   12429: IF
                   12430: d# 1000000 /mod            \ check mega byte limit
                   12431: swap
                   12432: d# 10000 /
                   12433: .dec3-2 ." MB"             \ show megabytes as xxx.yy
                   12434: ELSE
                   12435: dup d# 1000 >=             \ check kilo byte limit
                   12436: IF
                   12437: d# 1000 /mod
                   12438: swap
                   12439: d# 10 /
                   12440: .dec3-2 ." kB"
                   12441: ELSE
                   12442: .d ."  Bytes"
                   12443: THEN
                   12444: THEN
                   12445: THEN
                   12446: THEN
                   12447: ;
                   12448: : .inquiry-text  ( addr -- )
                   12449: 22 emit     \ enclose text with "
                   12450: dup inquiry-data>vendor-ident      8 type space
                   12451: dup inquiry-data>product-ident    10 type space
                   12452: inquiry-data>product-revision  4 type
                   12453: 22 emit
                   12454: ;
                   12455: : scsi-supp-init  ( -- )
                   12456: false   to scsi-param-debug         \ no debug strings
                   12457: h# 0   to scsi-param-size
                   12458: h# 0   to scsi-param-control        \ common CDB control byte
                   12459: d# 0   to scsi-param-errors         \ local errors (param limits)
                   12460: ;
                   12461: 0 VALUE scsi-context                   \ addr of word list on top
                   12462: : scsi-init  ( -- )
                   12463: also scsi-words                     \ append scsi word-list
                   12464: context  to scsi-context            \ save for close process
                   12465: scsi-supp-init                      \ preset all scsi-param-xxx values
                   12466: scsi-param-debug
                   12467: IF
                   12468: space ." SCSI-SUPPORT OPENED" cr
                   12469: .wordlists
                   12470: THEN
                   12471: ;
                   12472: : scsi-close  ( -- )
                   12473: scsi-param-debug
                   12474: IF
                   12475: space ." Closing SCSI-SUPPORT .. " cr
                   12476: THEN
                   12477: context scsi-context =              \ scsi word list still active ?
                   12478: IF
                   12479: scsi-param-errors 0<>          \ any errors occured ?
                   12480: IF
                   12481: cr ." ** WARNING: " scsi-param-errors .d
                   12482: ." SCSI Errors occured ** " cr
                   12483: THEN
                   12484: previous                         \ remove scsi word list on top
                   12485: 0 to scsi-context                \ prevent from being misinterpreted
                   12486: ELSE
                   12487: cr ." ** WARNING: Trying to close non-open SCSI-SUPPORT (1) ** " cr
                   12488: THEN
                   12489: scsi-param-debug
                   12490: IF
                   12491: .wordlists
                   12492: THEN
                   12493: ;
                   12494: s" scsi-init" $find drop               \ return execution pointer, when included
                   12495: previous                               \ remove scsi word list from search path
                   12496: definitions                            \ place next definitions into previous list
                   12497: ��������&p&80vio-hvterm.fs." Populating " pwd cr
                   12498: : open true ;
                   12499: : close ;
                   12500: : write ( adr len -- actual )  tuck type ;
                   12501: : read  ( adr len -- actual )
                   12502: 0= IF drop 0 EXIT THEN
                   12503: hvterm-key? 0= IF 0 swap c! -2 EXIT THEN
                   12504: hvterm-key swap c! 1
                   12505: ;
                   12506: : setup-alias
                   12507: " hvterm" find-alias 0= IF
                   12508: " hvterm" get-node node>path set-alias
                   12509: ELSE THEN 
                   12510: ;
                   12511: setup-alias
1.1.1.2 ! root     12512: ��������,P,0vio-vscsi.fs." Populating " pwd
1.1       root     12513: 0 CONSTANT vscsi-debug
                   12514: 0 VALUE vscsi-unit
                   12515: : l2dma ( laddr - dma_addr)      
                   12516: ;
                   12517: 0    VALUE     crq-base
                   12518: 0    VALUE     crq-dma
                   12519: 0    VALUE     crq-offset
                   12520: 1000 CONSTANT  CRQ-SIZE
                   12521: CREATE crq 10 allot
                   12522: : crq-alloc ( -- )
                   12523: CRQ-SIZE alloc-mem to crq-base 0 to crq-offset
                   12524: crq-base l2dma to crq-dma
                   12525: ;
                   12526: : crq-free ( -- )
                   12527: vscsi-unit hv-free-crq
                   12528: crq-base CRQ-SIZE free-mem 0 to crq-base
                   12529: ;
                   12530: : crq-init ( -- res )
                   12531: crq-alloc
                   12532: vscsi-debug IF
                   12533: ." VSCSI: allocated crq at " crq-base . cr
                   12534: THEN
                   12535: crq-base CRQ-SIZE erase
                   12536: vscsi-unit crq-dma CRQ-SIZE hv-reg-crq
                   12537: dup 0 <> IF
                   12538: ." VSCSI: Error " . ."  registering CRQ !" cr
                   12539: crq-free
                   12540: THEN
                   12541: ;
                   12542: : crq-cleanup ( -- )
                   12543: crq-base 0 = IF EXIT THEN
                   12544: vscsi-debug IF
                   12545: ." VSCSI: freeing crq at " crq-base . cr
                   12546: THEN
                   12547: crq-free
                   12548: ;
                   12549: : crq-send ( msgaddr -- true | false )
                   12550: vscsi-unit swap hv-send-crq 0 =
                   12551: ;
                   12552: : crq-poll ( -- true | false)
                   12553: crq-offset crq-base + dup
                   12554: vscsi-debug IF
                   12555: ." VSCSI: crq poll " dup .
                   12556: THEN
                   12557: c@
                   12558: vscsi-debug IF
                   12559: ."  value=" dup . cr
                   12560: THEN
                   12561: 80 and 0 <> IF
                   12562: dup crq 10 move
                   12563: 0 swap c!
                   12564: crq-offset 10 + dup CRQ-SIZE >= IF drop 0 THEN to crq-offset
                   12565: true
                   12566: ELSE drop false THEN
                   12567: ;
                   12568: : crq-wait ( -- true | false)
                   12569: 0 BEGIN drop crq-poll dup not WHILE d# 1 ms REPEAT
                   12570: dup not IF
                   12571: ." VSCSI: Timeout waiting response !" cr EXIT
                   12572: ELSE
                   12573: vscsi-debug IF
                   12574: ." VSCSI: got crq: " crq dup l@ . ."  " 4 + dup l@ . ."  "
                   12575: 4 + dup l@ . ."  " 4 + l@ . cr
                   12576: THEN
                   12577: THEN
                   12578: ;
                   12579: 01 CONSTANT VIOSRP_SRP_FORMAT
                   12580: 02 CONSTANT VIOSRP_MAD_FORMAT
                   12581: 03 CONSTANT VIOSRP_OS400_FORMAT
                   12582: 04 CONSTANT VIOSRP_AIX_FORMAT
                   12583: 06 CONSTANT VIOSRP_LINUX_FORMAT
                   12584: 07 CONSTANT VIOSRP_INLINE_FORMAT
                   12585: struct
                   12586: 1 field >crq-valid
                   12587: 1 field >crq-format
                   12588: 1 field >crq-reserved
                   12589: 1 field >crq-status
                   12590: 2 field >crq-timeout
                   12591: 2 field >crq-iu-len
                   12592: 8 field >crq-iu-data-ptr
                   12593: constant /crq
                   12594: : srp-send-crq ( addr len -- )
                   12595: 80                crq >crq-valid c!
                   12596: VIOSRP_SRP_FORMAT crq >crq-format c!
                   12597: 0                 crq >crq-reserved c!
                   12598: 0                 crq >crq-status c!
                   12599: 0                 crq >crq-timeout w!
                   12600: ( len )           crq >crq-iu-len w!
                   12601: ( addr ) l2dma    crq >crq-iu-data-ptr x!
                   12602: crq crq-send
                   12603: not IF
                   12604: ." VSCSI: Error sending CRQ !" cr
                   12605: THEN
                   12606: ;
                   12607: : srp-wait-crq ( -- [tag true] | false )
                   12608: crq-wait not IF false EXIT THEN
                   12609: crq >crq-format c@ VIOSRP_SRP_FORMAT <> IF
                   12610: ." VSCSI: Unsupported SRP response: "
                   12611: crq >crq-format c@ . cr
                   12612: false EXIT
                   12613: THEN
                   12614: crq >crq-iu-data-ptr x@ true
                   12615: ;
                   12616: scsi-open
                   12617: 0 VALUE >srp_opcode
                   12618: 00 CONSTANT SRP_LOGIN_REQ
                   12619: 01 CONSTANT SRP_TSK_MGMT
                   12620: 02 CONSTANT SRP_CMD
                   12621: 03 CONSTANT SRP_I_LOGOUT
                   12622: c0 CONSTANT SRP_LOGIN_RSP
                   12623: c1 CONSTANT SRP_RSP
                   12624: c2 CONSTANT SRP_LOGIN_REJ
                   12625: 80 CONSTANT SRP_T_LOGOUT
                   12626: 81 CONSTANT SRP_CRED_REQ
                   12627: 82 CONSTANT SRP_AER_REQ
                   12628: 41 CONSTANT SRP_CRED_RSP
                   12629: 42 CONSTANT SRP_AER_RSP
                   12630: 02 CONSTANT SRP_BUF_FORMAT_DIRECT
                   12631: 04 CONSTANT SRP_BUF_FORMAT_INDIRECT
                   12632: struct
                   12633: 1 field >srp-login-opcode
                   12634: 3 +
                   12635: 8 field >srp-login-tag
                   12636: 4 field >srp-login-req-it-iu-len
                   12637: 4 +
                   12638: 2 field >srp-login-req-buf-fmt
                   12639: 1 field >srp-login-req-flags
                   12640: 5 +
                   12641: 10 field >srp-login-init-port-ids
                   12642: 10 field >srp-login-trgt-port-ids
                   12643: constant /srp-login
                   12644: struct
                   12645: 1 field >srp-lresp-opcode
                   12646: 3 +
                   12647: 4 field >srp-lresp-req-lim-delta
                   12648: 8 field >srp-lresp-tag
                   12649: 4 field >srp-lresp-max-it-iu-len
                   12650: 4 field >srp-lresp-max-ti-iu-len
                   12651: 2 field >srp-lresp-buf-fmt
                   12652: 1 field >srp-lresp-flags
                   12653: constant /srp-login-resp
                   12654: struct
                   12655: 1 field >srp-lrej-opcode
                   12656: 3 +
                   12657: 4 field >srp-lrej-reason
                   12658: 8 field >srp-lrej-tag
                   12659: 8 +
                   12660: 2 field >srp-lrej-buf-fmt
                   12661: constant /srp-login-rej
                   12662: 00 CONSTANT SRP_NO_DATA_DESC
                   12663: 01 CONSTANT SRP_DATA_DESC_DIRECT
                   12664: 02 CONSTANT SRP_DATA_DESC_INDIRECT
                   12665: struct
                   12666: 1 field >srp-cmd-opcode
                   12667: 1 field >srp-cmd-sol-not
                   12668: 3 +
                   12669: 1 field >srp-cmd-buf-fmt
                   12670: 1 field >srp-cmd-dout-desc-cnt
                   12671: 1 field >srp-cmd-din-desc-cnt
                   12672: 8 field >srp-cmd-tag
                   12673: 4 +
                   12674: 8 field >srp-cmd-lun
                   12675: 1 +
                   12676: 1 field >srp-cmd-task-attr
                   12677: 1 +
                   12678: 1 field >srp-cmd-add-cdb-len
                   12679: 10 field >srp-cmd-cdb
                   12680: 0 field >srp-cmd-cdb-add
                   12681: constant /srp-cmd
                   12682: struct
                   12683: 1 field >srp-rsp-opcode
                   12684: 1 field >srp-rsp-sol-not
                   12685: 2 +
                   12686: 4 field >srp-rsp-req-lim-delta
                   12687: 8 field >srp-rsp-tag
                   12688: 2 +
                   12689: 1 field >srp-rsp-flags
                   12690: 1 field >srp-rsp-status
                   12691: 4 field >srp-rsp-dout-res-cnt
                   12692: 4 field >srp-rsp-din-res-cnt
                   12693: 4 field >srp-rsp-sense-len
                   12694: 4 field >srp-rsp-resp-len
                   12695: 0 field >srp-rsp-data
                   12696: constant /srp-rsp
                   12697: CREATE srp 100 allot
                   12698: 0 VALUE srp-len
                   12699: : srp-prep-cmd-nodata ( id lun -- )
                   12700: srp /srp-cmd erase
                   12701: SRP_CMD srp >srp-cmd-opcode c!
                   12702: 1 srp >srp-cmd-tag x!
1.1.1.2 ! root     12703: srp >srp-cmd-lun 1 + c!     \ lun
        !          12704: 80 or                       \ select logical unit addressing method
        !          12705: srp >srp-cmd-lun c!         \ id
1.1       root     12706: /srp-cmd to srp-len   
                   12707: ;
                   12708: : srp-prep-cmd-io ( addr len id lun -- )
                   12709: srp-prep-cmd-nodata            ( addr len )
                   12710: swap l2dma                     ( len dmaaddr )
                   12711: srp srp-len +                  ( len dmaaddr descaddr )
                   12712: dup >r x! r> 8 +               ( len descaddr+8 )
                   12713: dup 0 swap l! 4 +              ( len descaddr+c )
                   12714: l!    
                   12715: srp-len 10 + to srp-len
                   12716: ;
                   12717: : srp-prep-cmd-read ( addr len id lun -- )
                   12718: srp-prep-cmd-io
                   12719: 01 srp >srp-cmd-buf-fmt c!     \ in direct buffer
                   12720: 1 srp >srp-cmd-din-desc-cnt c!
                   12721: ;
                   12722: : srp-prep-cmd-write ( addr len id lun -- )
                   12723: srp-prep-cmd-io
                   12724: 10 srp >srp-cmd-buf-fmt c!     \ out direct buffer
                   12725: 1 srp >srp-cmd-dout-desc-cnt c!
                   12726: ;
                   12727: : srp-send-cmd ( -- )
                   12728: vscsi-debug IF
                   12729: ." VSCSI: Sending SCSI cmd " srp >srp-cmd-cdb c@ . cr
                   12730: THEN
                   12731: srp srp-len srp-send-crq
                   12732: ;
                   12733: : srp-rsp-find-sense ( -- addr )
                   12734: srp >srp-rsp-data
                   12735: ;
                   12736: : srp-wait-rsp ( -- true | [ ascq asc sense-key false ] )
                   12737: srp-wait-crq not IF false EXIT THEN
                   12738: dup 1 <> IF
                   12739: ." VSCSI: Invalid CRQ response tag, want 1 got " . cr
                   12740: false EXIT
                   12741: THEN drop
                   12742: srp >srp-rsp-tag x@ dup 1 <> IF
                   12743: ." VSCSI: Invalid SRP response tag, want 1 got " . cr
                   12744: false EXIT
                   12745: THEN drop
                   12746: srp >srp-rsp-status c@
                   12747: vscsi-debug IF
                   12748: ." VSCSI: Got response status: "
                   12749: dup .status-text cr
                   12750: THEN
                   12751: 0 <> IF
                   12752: srp-rsp-find-sense
                   12753: scsi-get-sense-data
                   12754: vscsi-debug IF
                   12755: ." VSCSI: Sense key: " dup .sense-text cr         
                   12756: THEN
                   12757: false EXIT
                   12758: THEN
                   12759: true
                   12760: ;
                   12761: CREATE sector d# 512 allot
1.1.1.2 ! root     12762: 0 INSTANCE VALUE current-id
        !          12763: 0 INSTANCE VALUE current-lun
1.1       root     12764: : test-unit-ready ( -- true | [ ascq asc sense-key false ] )
                   12765: current-id current-lun srp-prep-cmd-nodata
                   12766: srp >srp-cmd-cdb scsi-build-test-unit-ready
                   12767: srp-send-cmd
                   12768: srp-wait-rsp
                   12769: ;
                   12770: : inquiry ( -- true | false )
                   12771: sector ff current-id current-lun srp-prep-cmd-read
                   12772: ff srp >srp-cmd-cdb scsi-build-inquiry
                   12773: srp-send-cmd
                   12774: srp-wait-rsp
                   12775: dup not IF nip nip nip EXIT THEN \ swallow sense
                   12776: ;
                   12777: : read-capacity ( -- true | false )
                   12778: sector scsi-length-read-cap-10 current-id current-lun srp-prep-cmd-read
                   12779: srp >srp-cmd-cdb scsi-build-read-cap-10
                   12780: srp-send-cmd
                   12781: srp-wait-rsp
                   12782: dup not IF nip nip nip EXIT THEN \ swallow sense    
                   12783: ;
                   12784: : start-stop-unit ( state# -- true | false )
                   12785: current-id current-lun srp-prep-cmd-nodata
                   12786: srp >srp-cmd-cdb scsi-build-start-stop-unit
                   12787: srp-send-cmd
                   12788: srp-wait-rsp
                   12789: dup not IF nip nip nip EXIT THEN \ swallow sense    
                   12790: ;
                   12791: : get-media-event ( -- true | false )
                   12792: sector scsi-length-media-event current-id current-lun srp-prep-cmd-read
                   12793: srp >srp-cmd-cdb scsi-build-get-media-event
                   12794: srp-send-cmd
                   12795: srp-wait-rsp
                   12796: dup not IF nip nip nip EXIT THEN \ swallow sense    
                   12797: ;
                   12798: : read-blocks ( -- addr block# #blocks blksz -- [ #read-blocks true ] | false )
                   12799: over *                                         ( addr block# #blocks len )    
                   12800: >r rot r>                                      ( block# #blocks addr len )
                   12801: 5 0 DO
                   12802: 2dup current-id current-lun
                   12803: srp-prep-cmd-read                       ( block# #blocks addr len )
                   12804: 2swap                                  ( addr len block# #blocks )
                   12805: 2dup srp >srp-cmd-cdb scsi-build-read-10 ( addr len block# #blocks )
                   12806: 2swap                                   ( block# #blocks addr len )
                   12807: srp-send-cmd
                   12808: srp-wait-rsp
                   12809: IF 2drop nip true UNLOOP EXIT THEN
                   12810: srp >srp-rsp-status c@ 8 <> IF
                   12811: nip nip nip 2drop 2drop false EXIT
                   12812: THEN
                   12813: 3drop
                   12814: 100 ms
                   12815: LOOP
                   12816: 2drop 2drop false
                   12817: ;
                   12818: : vscsi-cleanup
                   12819: ." VSCSI: Cleaning up" cr
                   12820: crq-cleanup
                   12821: vscsi-unit 0 rtas-set-tce-bypass
                   12822: ;
                   12823: : vscsi-init ( -- true | false )
                   12824: ." VSCSI: Initializing" cr
                   12825: " reg" get-node get-package-property IF
                   12826: ." VSCSI: Not reg property !!!" 0
                   12827: THEN
                   12828: decode-int to vscsi-unit 2drop
                   12829: vscsi-unit 1 rtas-set-tce-bypass
                   12830: crq-init 0 <> IF false EXIT THEN
                   12831: " "(C0 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00)" drop
                   12832: crq-send not IF
                   12833: ." VSCSI: Error sending init command"
                   12834: crq-cleanup false EXIT
                   12835: THEN
                   12836: crq-wait not IF
                   12837: crq-cleanup false EXIT
                   12838: THEN
                   12839: crq c@ c0 <> crq 1 + c@ 02 <> or IF
                   12840: ." VSCSI: Initial handshake failed"
                   12841: crq-cleanup false EXIT
                   12842: THEN
                   12843: ['] vscsi-cleanup add-quiesce-xt
                   12844: true
                   12845: ;
                   12846: : set-address ( lun id -- )
1.1.1.2 ! root     12847: to current-id to current-lun 
1.1       root     12848: ;
                   12849: : dev-max-transfer ( -- n )
                   12850: 10000 \ Larger value seem to have problems with some CDROMs
                   12851: ;
                   12852: : dev-get-capacity ( -- blocksize #blocks )
1.1.1.2 ! root     12853: sector 10 erase
        !          12854: read-capacity not IF
        !          12855: 0 0 EXIT
        !          12856: THEN
1.1       root     12857: sector scsi-get-capacity-10
                   12858: ;
                   12859: : dev-read-blocks ( -- addr block# #blocks blksize -- #read-blocks )
                   12860: read-blocks    
                   12861: ;
                   12862: : initial-test-unit-ready ( -- true | [ ascq asc sense-key false ] )
                   12863: 0 0 0 false
                   12864: 3 0 DO
                   12865: 2drop 2drop
                   12866: test-unit-ready dup IF UNLOOP EXIT THEN
                   12867: LOOP    
                   12868: ;
                   12869: : compare-sense ( ascq asc key ascq2 asc2 key2 -- true | false )
                   12870: 3 pick =           ( ascq asc key ascq2 asc2 keycmp )
                   12871: swap 4 pick =   ( ascq asc key ascq2 keycmp asccmp )
                   12872: rot 5 pick =    ( ascq asc key keycmp asccmp ascqcmp )
                   12873: and and nip nip nip
                   12874: ;
                   12875: 0 CONSTANT CDROM-READY
                   12876: 1 CONSTANT CDROM-NOT-READY
                   12877: 2 CONSTANT CDROM-NO-DISK
                   12878: 3 CONSTANT CDROM-TRAY-OPEN
                   12879: 4 CONSTANT CDROM-INIT-REQUIRED
                   12880: 5 CONSTANT CDROM-TRAY-MAYBE-OPEN
                   12881: : cdrom-status ( -- status )
                   12882: initial-test-unit-ready
                   12883: IF CDROM-READY EXIT THEN
                   12884: vscsi-debug IF
                   12885: ." TestUnitReady sense: " 3dup . . . cr
                   12886: THEN
                   12887: 3dup 1 4 2 compare-sense IF
                   12888: 3drop CDROM-NOT-READY EXIT
                   12889: THEN
                   12890: get-media-event IF
                   12891: sector w@ 4 >= IF
                   12892: sector 2 + c@ 04 = IF
                   12893: sector 5 + c@
                   12894: dup 02 and 0<> IF drop 3drop CDROM-READY EXIT THEN
                   12895: dup 01 and 0<> IF drop 3drop CDROM-TRAY-OPEN EXIT THEN
                   12896: drop 3drop CDROM-NO-DISK EXIT
                   12897: THEN
                   12898: THEN
                   12899: THEN
                   12900: 3dup 2 4 2 compare-sense IF
                   12901: 3drop CDROM-INIT-REQUIRED EXIT
                   12902: THEN
                   12903: over 4 = over 2 = and IF
                   12904: 3drop CDROM-READY EXIT
                   12905: THEN
                   12906: over 3a = IF
                   12907: 3drop CDROM-NO-DISK EXIT
                   12908: THEN
                   12909: 3drop CDROM-TRAY-MAYBE-OPEN    
                   12910: ;
                   12911: : cdrom-try-close-tray ( -- )
                   12912: scsi-const-load start-stop-unit drop
                   12913: ;
                   12914: : cdrom-must-close-tray ( -- )
                   12915: scsi-const-load start-stop-unit not IF
                   12916: ." Tray open !" cr -65 throw
                   12917: THEN
                   12918: ;
                   12919: : dev-prep-cdrom ( -- )
                   12920: 5 0 DO
                   12921: cdrom-status CASE
                   12922: CDROM-READY           OF UNLOOP EXIT ENDOF
                   12923: CDROM-NO-DISK         OF ." No medium !" cr -65 THROW ENDOF
                   12924: CDROM-TRAY-OPEN       OF cdrom-must-close-tray ENDOF
                   12925: CDROM-INIT-REQUIRED   OF cdrom-try-close-tray ENDOF
                   12926: CDROM-TRAY-MAYBE-OPEN OF cdrom-try-close-tray ENDOF
                   12927: ENDCASE
                   12928: d# 1000 ms
                   12929: LOOP
                   12930: ." Drive not ready !" cr -65 THROW
                   12931: ;
                   12932: : dev-prep-disk ( -- )
1.1.1.2 ! root     12933: initial-test-unit-ready 0= IF
        !          12934: ." Disk not ready!" cr
        !          12935: 3drop
        !          12936: THEN
1.1       root     12937: ;
                   12938: : vscsi-create-disk    ( lun id -- )
                   12939: " disk" 0 " vio-vscsi-device.fs" included
                   12940: ;
                   12941: : vscsi-create-cdrom   ( lun id -- )
                   12942: " cdrom" 1 " vio-vscsi-device.fs" included
                   12943: ;
                   12944: : wrapped-inquiry ( -- true | false )
                   12945: inquiry not IF false EXIT THEN
                   12946: sector inquiry-data>peripheral c@ e0 and 0 =
                   12947: ;
                   12948: 8 CONSTANT #dev
                   12949: : vscsi-find-disks      ( -- )   
                   12950: ." VSCSI: Looking for disks" cr
                   12951: #dev 0 DO                                      \ check 8 devices (no LUNs)
1.1.1.2 ! root     12952: 0 i set-address
1.1       root     12953: wrapped-inquiry IF     
                   12954: ."   SCSI ID " i .
                   12955: sector inquiry-data>peripheral c@ CASE
                   12956: 0   OF ." DISK     : " 0 i vscsi-create-disk  ENDOF
                   12957: 5   OF ." CD-ROM   : " 0 i vscsi-create-cdrom ENDOF
                   12958: 7   OF ." OPTICAL  : " 0 i vscsi-create-cdrom ENDOF
                   12959: e   OF ." RED-BLOCK: " 0 i vscsi-create-disk  ENDOF
                   12960: dup dup OF ." ? (" . 8 emit 29 emit 5 spaces ENDOF
                   12961: ENDCASE
                   12962: sector .inquiry-text cr
                   12963: THEN
                   12964: LOOP
                   12965: ;
                   12966: scsi-close
                   12967: : setup-alias
                   12968: " scsi" find-alias 0= IF
                   12969: " scsi" get-node node>path set-alias
                   12970: ELSE THEN 
                   12971: ;
                   12972: : vscsi-init-and-scan  ( -- )
1.1.1.2 ! root     12973: 0 0 get-node open-node ?dup 0= IF EXIT THEN
        !          12974: my-self >r
        !          12975: dup to my-self
1.1       root     12976: vscsi-init IF
                   12977: vscsi-find-disks
                   12978: setup-alias
                   12979: THEN
1.1.1.2 ! root     12980: close-node
        !          12981: r> to my-self
1.1       root     12982: ;
                   12983: vscsi-init-and-scan
1.1.1.2 ! root     12984: ���������_8vio-vscsi-device.fsnew-device
1.1       root     12985: VALUE is_cdrom
                   12986: 2swap  ( $name lun id )
                   12987: 2dup set-unit encode-phys " reg" property
                   12988: 2dup device-name
                   12989: 2dup find-alias 0= IF
                   12990: get-node node>path set-alias
                   12991: ELSE 2drop THEN 
                   12992: s" block" device-type      
                   12993: 0 INSTANCE VALUE block-size
                   12994: 0 INSTANCE VALUE max-block-num
                   12995: 0 INSTANCE VALUE max-transfer
                   12996: : read-blocks ( addr block# #blocks -- #read )
                   12997: block-size " dev-read-blocks" $call-parent
                   12998: not IF
                   12999: ." Read blocks failed !" cr -1 throw
                   13000: THEN
                   13001: ;    
                   13002: INSTANCE VARIABLE deblocker
                   13003: : open ( -- true | false )
                   13004: my-unit " set-address" $call-parent
                   13005: is_cdrom IF " dev-prep-cdrom" ELSE " dev-prep-disk" THEN $call-parent
                   13006: " dev-max-transfer" $call-parent to max-transfer
1.1.1.2 ! root     13007: " dev-get-capacity" $call-parent to max-block-num to block-size
        !          13008: max-block-num 0=  block-size 0= OR IF
        !          13009: ." Failed to get disk capacity!" cr
        !          13010: FALSE EXIT
        !          13011: THEN
1.1       root     13012: 0 0 " deblocker" $open-package dup deblocker ! dup IF 
                   13013: " disk-label" find-package IF
                   13014: my-args rot interpose
                   13015: THEN
                   13016: THEN 0<>
                   13017: ;
                   13018: : close ( -- )
                   13019: deblocker @ close-package ;
                   13020: : seek ( pos.lo pos.hi -- status )
                   13021: s" seek" deblocker @ $call-method ;
                   13022: : read ( addr len -- actual )
                   13023: s" read" deblocker @ $call-method ;
                   13024: finish-device
1.1.1.2 ! root     13025: ��������8&�0vio-veth.fs." Populating " pwd cr
1.1       root     13026: " network" device-type
                   13027: INSTANCE VARIABLE obp-tftp-package
                   13028: : open  ( -- okay? )
                   13029: my-unit 1 rtas-set-tce-bypass
                   13030: my-args s" obp-tftp" $open-package obp-tftp-package ! true
                   13031: ;
                   13032: : close  ( -- )
                   13033: s" close" obp-tftp-package @ $call-method
                   13034: my-unit 0 rtas-set-tce-bypass
                   13035: ;
                   13036: : load  ( addr -- len )
                   13037: s" load" obp-tftp-package @ $call-method 
                   13038: ;
                   13039: : ping  ( -- )
                   13040: s" ping" obp-tftp-package @ $call-method
                   13041: ;
                   13042: : setup-alias
                   13043: " net" find-alias 0= IF
                   13044: " net" get-node node>path set-alias
                   13045: ELSE THEN 
                   13046: ;
                   13047: setup-alias
1.1.1.2 ! root     13048: ��������F0build_info.imgprintf t[CC]t%sn build_info.img; /opt/cross/gcc-4.4.5-nolibc/powerpc64-linux/bin/powerpc64-linux-gcc -m64
1.1       root     13049: Using built-in specs.
1.1.1.2 ! root     13050: Target: powerpc64-linux
        !          13051: Configured with: /home/tony/buildall/src/gcc/configure --target=powerpc64-linux --enable-targets=all --prefix=/home/tony/buildall/cross.x86_64/gcc-4.4.5-nolibc/powerpc64-linux/ --enable-languages=c --with-newlib --without-headers --with-system-libunwind --disable-nls --disable-threads --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --disable-decimal-float --enable-checking=release --with-mpfr=/home/tony/buildall/src/sys-x86_64 --with-gmp=/home/tony/buildall/src/sys-x86_64 --disable-bootstrap
        !          13052: Thread model: single
        !          13053: gcc version 4.4.5 (GCC) 
        !          13054: GNU ld (GNU Binutils) 2.20.1.20100303
1.1       root     13055:   Supported emulations:
1.1.1.2 ! root     13056:    elf64ppc
1.1       root     13057:    elf32ppclinux
                   13058:    elf32ppc
                   13059:    elf32ppcsim
1.1.1.2 ! root     13060: ��������Bu1N

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.