| Index: embios/trunk/tools/embios.py |
| — | — | @@ -112,6 +112,8 @@ |
| 113 | 113 | print " Optional params <offset> <length>: specify the range in <file> to write"
|
| 114 | 114 | print " writeusbconsole direct <i1> <i2> ... <iN>"
|
| 115 | 115 | print " Writes the integers <i1> ... <iN> to the USB console."
|
| | 116 | + print " writeusbconsole string <str>"
|
| | 117 | + print " Writes the string <str> to the USB console."
|
| 116 | 118 | print ""
|
| 117 | 119 | print " readdevconsole <bitmask> <size> <outtype> <file>"
|
| 118 | 120 | print " Reads data from one or more of the device's consoles."
|
| — | — | @@ -130,6 +132,8 @@ |
| 131 | 133 | print " writedevconsole direct <bitmask> <i1> <i2> ... <iN>"
|
| 132 | 134 | print " Writes the integers <i1> ... <iN> to the device consoles specified"
|
| 133 | 135 | print " by <bitmask>"
|
| | 136 | + print " writedevconsole string <bitmask> <str>"
|
| | 137 | + print " Writes the string <str> to the device consoles specified by <bitmask>"
|
| 134 | 138 | print ""
|
| 135 | 139 | print " flushconsolebuffers <bitmask>"
|
| 136 | 140 | print " flushes one or more of the device consoles' buffers."
|
| — | — | @@ -286,6 +290,12 @@ |
| 287 | 291 | data += struct.pack("<I", int(argv[ptr], 16))
|
| 288 | 292 | ptr += 1
|
| 289 | 293 | dev.writeusbcon(data)
|
| | 294 | +
|
| | 295 | + if argv[2] == "string":
|
| | 296 | + if len(argv) > 4: usage()
|
| | 297 | + dev.writeusbcon(argv[3])
|
| | 298 | +
|
| | 299 | + else: usage()
|
| 290 | 300 |
|
| 291 | 301 | elif argv[1] == "readdevconsole":
|
| 292 | 302 | if len(argv) not in [5, 6]: usage()
|
| — | — | @@ -318,6 +328,12 @@ |
| 319 | 329 | data += struct.pack("<I", int(argv[ptr], 16))
|
| 320 | 330 | ptr += 1
|
| 321 | 331 | dev.writeusbcon(int(argv[3], 16), data)
|
| | 332 | +
|
| | 333 | + if argv[2] == "string":
|
| | 334 | + if len(argv) > 5: usage()
|
| | 335 | + dev.writedevcon(int(argv[3], 16), argv[4])
|
| | 336 | +
|
| | 337 | + else: usage()
|
| 322 | 338 |
|
| 323 | 339 | elif argv[1] == "flushconsolebuffers":
|
| 324 | 340 | if len(argv) != 3: usage()
|
| Index: embios/trunk/tools/libembios.py |
| — | — | @@ -814,15 +814,15 @@ |
| 815 | 815 | processinfoprint = ""
|
| 816 | 816 | ptr = 0
|
| 817 | 817 | while structver == 1 and ptr < len(procinfolist): # Process information struct version == 1
|
| 818 | | - processinfoprint += "--------------------------------------------------------------------------------"
|
| 819 | | - processinfoprint += "R0: 0x%08x, R1: 0x%08x, R2: 0x%08x, R3: 0x%08x,\n\
|
| 820 | | - R4: 0x%08x, R5: 0x%08x, R6: 0x%08x, R7: 0x%08x,\n\
|
| 821 | | - R8: 0x%08x, R9: 0x%08x, R10: 0x%08x, R11: 0x%08x,\n\
|
| 822 | | - R12: 0x%08x, SP: 0x%08x, LR: 0x%08x, PC: 0x%08x\n" \
|
| 823 | | - % (procinfolist[ptr]['regs'][0], procinfolist[ptr]['regs'][1], procinfolist[ptr]['regs'][2], procinfolist[ptr]['regs'][3], \
|
| 824 | | - procinfolist[ptr]['regs'][4], procinfolist[ptr]['regs'][5], procinfolist[ptr]['regs'][6], procinfolist[ptr]['regs'][7], \
|
| 825 | | - procinfolist[ptr]['regs'][8], procinfolist[ptr]['regs'][9], procinfolist[ptr]['regs'][10], procinfolist[ptr]['regs'][11], \
|
| 826 | | - procinfolist[ptr]['regs'][12], procinfolist[ptr]['regs'][13], procinfolist[ptr]['regs'][14], procinfolist[ptr]['regs'][15] )
|
| | 818 | + processinfoprint += "--------------------------------------------------------------------------------\n"
|
| | 819 | + processinfoprint += "R0: 0x%08x, R1: 0x%08x, R2: 0x%08x, R3: 0x%08x,\n"\
|
| | 820 | + % (procinfolist[ptr]['regs'][0], procinfolist[ptr]['regs'][1], procinfolist[ptr]['regs'][2], procinfolist[ptr]['regs'][3])\
|
| | 821 | + + "R4: 0x%08x, R5: 0x%08x, R6: 0x%08x, R7: 0x%08x,\n"\
|
| | 822 | + % (procinfolist[ptr]['regs'][4], procinfolist[ptr]['regs'][5], procinfolist[ptr]['regs'][6], procinfolist[ptr]['regs'][7])\
|
| | 823 | + + "R8: 0x%08x, R9: 0x%08x, R10: 0x%08x, R11: 0x%08x,\n"\
|
| | 824 | + % (procinfolist[ptr]['regs'][8], procinfolist[ptr]['regs'][9], procinfolist[ptr]['regs'][10], procinfolist[ptr]['regs'][11])\
|
| | 825 | + + "R12: 0x%08x, SP: 0x%08x, LR: 0x%08x, PC: 0x%08x\n" \
|
| | 826 | + % (procinfolist[ptr]['regs'][12], procinfolist[ptr]['regs'][13], procinfolist[ptr]['regs'][14], procinfolist[ptr]['regs'][15])
|
| 827 | 827 | processinfoprint += "cpsr: 0x%08x " % (procinfolist[ptr]['cpsr'])
|
| 828 | 828 | states = ("THREAD_FREE", "THREAD_SUSPENDED", "THREAD_READY", "THREAD_RUNNING", "THREAD_BLOCKED", "THREAD_DEFUNCT", "THREAD_DEFUNCT_ACK")
|
| 829 | 829 | processinfoprint += "state: %s " % (states[procinfolist[ptr]['state']])
|
| — | — | @@ -835,7 +835,6 @@ |
| 836 | 836 | processinfoprint += "blocked since: 0x%08x " % (procinfolist[ptr]['blocked_since'])
|
| 837 | 837 | processinfoprint += "blocked by ptr: 0x%08x\n" % (procinfolist[ptr]['blocked_by_ptr'])
|
| 838 | 838 | processinfoprint += "err_no: 0x%08x " % (procinfolist[ptr]['err_no'])
|
| 839 | | - processinfoprint += "nameptr: 0x%08x\n" % (procinfolist[ptr]['namepointer'])
|
| 840 | 839 | blocktype = ("THREAD_NOT_BLOCKED", "THREAD_BLOCK_SLEEP", "THREAD_BLOCK_MUTEX", "THREAD_BLOCK_WAKEUP", "THREAD_DEFUNCT_STKOV", "THREAD_DEFUNCT_PANIC")
|
| 841 | 840 | processinfoprint += "block type: %s\n" % (blocktype[procinfolist[ptr]['block_type']])
|
| 842 | 841 | threadtype = ("USER_THREAD", "SYSTEM_THREAD")
|
| — | — | @@ -842,11 +841,11 @@ |
| 843 | 842 | processinfoprint += "thread type: %s\n" % (threadtype[procinfolist[ptr]['thread_type']])
|
| 844 | 843 | processinfoprint += "priority: 0x%02x " % (procinfolist[ptr]['priority'])
|
| 845 | 844 | processinfoprint += "cpu load: 0x%02x\n" % (procinfolist[ptr]['cpuload'])
|
| | 845 | +
|
| | 846 | + ptr += 1
|
| 846 | 847 |
|
| 847 | | - ptr += 1
|
| 848 | | -
|
| 849 | | - processinfoprint += "--------------------------------------------------------------------------------"
|
| 850 | | -
|
| | 848 | + processinfoprint += "--------------------------------------------------------------------------------\n"
|
| | 849 | +
|
| 851 | 850 | return processinfoprint
|
| 852 | 851 |
|
| 853 | 852 |
|
| — | — | @@ -864,11 +863,14 @@ |
| 865 | 864 | self.__checkstatus(response)
|
| 866 | 865 |
|
| 867 | 866 | tablesize = struct.unpack("<I", response[8:12])[0]
|
| 868 | | - procinfo += response[0x10:0x10 + blocklen]
|
| 869 | 867 |
|
| 870 | 868 | if tablesize <= offset + blocklen:
|
| | 869 | + blocklen = tablesize - offset
|
| | 870 | + procinfo += response[0x10:0x10 + blocklen]
|
| 871 | 871 | structversion = struct.unpack("<I", response[4:8])[0]
|
| 872 | 872 | tablesize = struct.unpack("<I", response[8:12])[0]
|
| | 873 | + else:
|
| | 874 | + procinfo += response[0x10:0x10 + blocklen]
|
| 873 | 875 |
|
| 874 | 876 | offset += blocklen
|
| 875 | 877 |
|
| — | — | @@ -879,12 +881,11 @@ |
| 880 | 882 |
|
| 881 | 883 | out = (structversion, tablesize, procinfotolist(procinfo, structversion))
|
| 882 | 884 |
|
| 883 | | - self.__myprint(" done\n\
|
| 884 | | - Process information struct version: 0x%08x\n\
|
| 885 | | - Total size of process information table: 0x%08x\n\
|
| 886 | | - %s\n\n"
|
| 887 | | - % (out[0], out[1], procinfotostring(out[2], structversion))
|
| 888 | | - , silent)
|
| | 885 | + self.__myprint(" done\n"\
|
| | 886 | + + "Process information struct version: 0x%08x\n" % out[0]\
|
| | 887 | + + "Total size of process information table: 0x%08x\n" % out[1]\
|
| | 888 | + + procinfotostring(out[2], 1)\
|
| | 889 | + + "\n\n")
|
| 889 | 890 |
|
| 890 | 891 | return out
|
| 891 | 892 |
|