freemyipod r135 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r134‎ | r135 | r136 >
Date:11:14, 14 August 2010
Author:benedikt93
Status:new
Tags:
Comment:
add libembios execfirmware command
Modified paths:
  • /embios/trunk/tools/embios.py (modified) (history)
  • /embios/trunk/tools/libembios.py (modified) (history)

Diff [purge]

Index: embios/trunk/tools/embios.py
@@ -174,7 +174,10 @@
175175 print " execimage <offset>"
176176 print " Executes the emBIOS executable image at <offset>."
177177 print ""
 178+ print " execfirmware <offset>"
 179+ print " Executes the firmware image at the specified address <offset>."
178180 print ""
 181+ print ""
179182 print " readrawbootflash <addr_bootflsh> <addr_mem> <size>"
180183 print " Reads <size> bytes from bootflash to memory."
181184 print " <addr_bootflsh>: the address in bootflash to read from"
Index: embios/trunk/tools/libembios.py
@@ -925,6 +925,18 @@
926926 return struct.unpack("<I", response[4:8])[0]
927927
928928
 929+ def execfirmware(self, offset, silent = 0):
 930+ self.__myprint("Executing firmware image at 0x%08x..." % offset, silent)
 931+
 932+ self.handle.bulkWrite(self.__coutep, struct.pack("<IIII", 24, offset, 0, 0))
 933+ response = self.__getbulk(self.handle, self.__cinep, 0x10)
 934+ self.__checkstatus(response)
 935+
 936+ self.__myprint(" done\n", silent)
 937+
 938+ return
 939+
 940+
929941 #=====================================================================================
930942
931943