Subversion Repositories freemyipod

Rev

Rev 401 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 401 Rev 402
Line 19... Line 19...
19
#    You should have received a copy of the GNU General Public License
19
#    You should have received a copy of the GNU General Public License
20
#    along with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
20
#    along with emBIOS.  If not, see <http://www.gnu.org/licenses/>.
21
#
21
#
22
#
22
#
23
 
23
 
-
 
24
"""
-
 
25
    Command line interface to communicate with emBIOS devices.
-
 
26
    Run it without arguments to see usage information.
-
 
27
"""
-
 
28
 
24
import sys
29
import sys
25
import os
30
import os
26
import time
31
import time
27
import struct
32
import struct
28
import locale
33
import locale
Line 69... Line 74...
69
        if specific == False or specific == function:
74
        if specific == False or specific == function:
70
            logger.log(function + " ", 2)
75
            logger.log(function + " ", 2)
71
            for arg in doc[function]['args']:
76
            for arg in doc[function]['args']:
72
                logger.log("<" + arg + "> ")
77
                logger.log("<" + arg + "> ")
73
            if doc[function]['kwargs']:
78
            if doc[function]['kwargs']:
74
                for kwarg in doc[function]['kwargs']:
79
                for kwvalue, kwarg in enumerate(doc[function]['kwargs']):
75
                    logger.log("[" + kwarg + "] ")
80
                    logger.log("[" + kwarg + " = " + str(kwvalue) + "] ")
76
            if doc[function]['varargs']:
81
            if doc[function]['varargs']:
77
                logger.log("<db1> ... <dbN>")
82
                logger.log("<db1> ... <dbN>")
78
            logger.log("\n")
83
            logger.log("\n")
79
            if doc[function]['documentation']:
84
            if doc[function]['documentation']:
80
                logger.log(doc[function]['documentation']+"\n", 4)
85
                logger.log(doc[function]['documentation']+"\n", 4)
Line 233... Line 238...
233
    
238
    
234
    @command
239
    @command
235
    def reset(self, force=False):
240
    def reset(self, force=False):
236
        """
241
        """
237
            Resets the device"
242
            Resets the device"
238
            If <force> is 1, the reset will be forced, otherwise it will be gracefully,
243
            If [force] is 1, the reset will be forced, otherwise it will be gracefully,
239
            which may take some time.
244
            which may take some time.
240
        """
245
        """
241
        force = self._bool(force)
246
        force = self._bool(force)
242
        if force: self.logger.info("Resetting forcefully...\n")
247
        if force: self.logger.info("Resetting forcefully...\n")
243
        else: self.logger.info("Resetting...\n")
248
        else: self.logger.info("Resetting...\n")
Line 245... Line 250...
245
    
250
    
246
    @command
251
    @command
247
    def poweroff(self, force=False):
252
    def poweroff(self, force=False):
248
        """
253
        """
249
            Powers the device off
254
            Powers the device off
250
            If <force> is 1, the poweroff will be forced, otherwise it will be gracefully,
255
            If [force] is 1, the poweroff will be forced, otherwise it will be gracefully,
251
            which may take some time.
256
            which may take some time.
252
        """
257
        """
253
        force = self._bool(force)
258
        force = self._bool(force)
254
        if force: self.logger.info("Powering off forcefully...\n")
259
        if force: self.logger.info("Powering off forcefully...\n")
255
        else: self.logger.info("Powering off...\n")
260
        else: self.logger.info("Powering off...\n")
Line 326... Line 331...
326
 
331
 
327
    @command
332
    @command
328
    def i2cread(self, bus, slave, addr, size):
333
    def i2cread(self, bus, slave, addr, size):
329
        """
334
        """
330
            Reads data from an I2C device
335
            Reads data from an I2C device
331
            <bus> the bus index
336
            <bus>: the bus index
332
            <slave> the slave address
337
            <slave>: the slave address
333
            <addr> the start address on the I2C device
338
            <addr>: the start address on the I2C device
334
            <size> the number of bytes to read
339
            <size>: the number of bytes to read
335
        """
340
        """
336
        bus = self._hexint(bus)
341
        bus = self._hexint(bus)
337
        slave = self._hexint(slave)
342
        slave = self._hexint(slave)
338
        addr = self._hexint(addr)
343
        addr = self._hexint(addr)
339
        size = self._hexint(size)
344
        size = self._hexint(size)
Line 345... Line 350...
345
 
350
 
346
    @command
351
    @command
347
    def i2cwrite(self, bus, slave, addr, *args):
352
    def i2cwrite(self, bus, slave, addr, *args):
348
        """
353
        """
349
            Writes data to an I2C device
354
            Writes data to an I2C device
350
            <bus> the bus index
355
            <bus>: the bus index
351
            <slave> the slave address
356
            <slave>: the slave address
352
            <addr> the start address on the I2C device
357
            <addr>: the start address on the I2C device
353
            <db1> ... <dbN> the data in single bytes, encoded in hex,
358
            <db1> ... <dbN>: the data in single bytes, encoded in hex,
354
                seperated by whitespaces, eg. 37 5A 4F EB
359
                seperated by whitespaces, eg. 37 5A 4F EB
355
        """
360
        """
356
        bus = self._hexint(bus)
361
        bus = self._hexint(bus)
357
        slave = self._hexint(slave)
362
        slave = self._hexint(slave)
358
        addr = self._hexint(addr)
363
        addr = self._hexint(addr)
Line 508... Line 513...
508
 
513
 
509
    @command
514
    @command
510
    def createthread(self, nameptr, entrypoint, stackptr, stacksize, threadtype, priority, state):
515
    def createthread(self, nameptr, entrypoint, stackptr, stacksize, threadtype, priority, state):
511
        """
516
        """
512
            Creates a new thread and returns its thread ID
517
            Creates a new thread and returns its thread ID
513
            <namepointer> a pointer to the thread's name
518
            <namepointer>: a pointer to the thread's name
514
            <entrypoint> a pointer to the entrypoint of the thread
519
            <entrypoint>: a pointer to the entrypoint of the thread
515
            <stackpointer> a pointer to the stack of the thread
520
            <stackpointer>: a pointer to the stack of the thread
516
            <stacksize> the size of the thread's stack
521
            <stacksize>: the size of the thread's stack
517
            <type> the thread type, vaild are: 0 => user thread, 1 => system thread
522
            <type>: the thread type, vaild are: 0 => user thread, 1 => system thread
518
            <priority> the priority of the thread, from 1 to 255
523
            <priority>: the priority of the thread, from 1 to 255
519
            <state> the thread's initial state, valid are: 1 => ready, 0 => suspended
524
            <state>: the thread's initial state, valid are: 1 => ready, 0 => suspended
520
        """
525
        """
521
        nameptr = self._hexint(nameptr)
526
        nameptr = self._hexint(nameptr)
522
        entrypoint = self._hexint(entrypoint)
527
        entrypoint = self._hexint(entrypoint)
523
        stackpointer = self._hexint(stackpointer)
528
        stackpointer = self._hexint(stackpointer)
524
        stacksize = self._hexint(stacksize)
529
        stacksize = self._hexint(stacksize)
Line 584... Line 589...
584
            Writes <size> bytes from memory to bootflash.
589
            Writes <size> bytes from memory to bootflash.
585
            ATTENTION: Don't call this unless you really know what you're doing!
590
            ATTENTION: Don't call this unless you really know what you're doing!
586
            This may BRICK your device (unless it has a good recovery option)
591
            This may BRICK your device (unless it has a good recovery option)
587
            <addr_mem>: the address in memory to copy the data from
592
            <addr_mem>: the address in memory to copy the data from
588
            <addr_bootflsh>: the address in bootflash to write to
593
            <addr_bootflsh>: the address in bootflash to write to
589
            <force>: Use this flag to suppress the 5 seconds delay
594
            [force]: Use this flag to suppress the 5 seconds delay
590
        """
595
        """
591
        addr_flash = self._hexint(addr_flash)
596
        addr_flash = self._hexint(addr_flash)
592
        addr_mem = self._hexint(addr_mem)
597
        addr_mem = self._hexint(addr_mem)
593
        size = self._hexint(size)
598
        size = self._hexint(size)
594
        force = self._bool(force)
599
        force = self._bool(force)
Line 603... Line 608...
603
        self.embios.bootflashwrite(addr_mem, addr_flash, size)
608
        self.embios.bootflashwrite(addr_mem, addr_flash, size)
604
    
609
    
605
    @command
610
    @command
606
    def runfirmware(self, addr, filename):
611
    def runfirmware(self, addr, filename):
607
        """
612
        """
608
            Uploads the firmware in 'filename' to the beginning of the
613
            Uploads the firmware in <filename>
609
            user memory and executes it
614
            to the address at <addr> and executes it.
610
        """
615
        """
611
        addr = self._hexint(addr)
616
        addr = self._hexint(addr)
612
        self.uploadfile(addr, filename)
617
        self.uploadfile(addr, filename)
613
        self.execfirmware(addr)
618
        self.execfirmware(addr)
614
    
619
    
615
    @command
620
    @command
616
    def execfirmware(self, addr):
621
    def execfirmware(self, addr):
617
        """
622
        """
618
            Executes the firmware at addr
623
            Executes the firmware at <addr>
619
        """
624
        """
620
        addr = self._hexint(addr)
625
        addr = self._hexint(addr)
621
        self.logger.info("Running firmware at "+self._hex(addr)+". Bye.")
626
        self.logger.info("Running firmware at "+self._hex(addr)+". Bye.")
622
        self.embios.execfirmware(addr)
627
        self.embios.execfirmware(addr)
623
    
628
    
624
    @command
629
    @command
625
    def aesencrypt(self, addr, size, keyindex):
630
    def aesencrypt(self, addr, size, keyindex):
626
        """
631
        """
627
            Encrypts a buffer using a hardware key
632
            Encrypts a buffer using a hardware key
-
 
633
            <addr>: the starting address of the buffer
-
 
634
            <size>: the size of the buffer
-
 
635
            <keyindex>: the index of the key in the crypto unit
628
        """
636
        """
629
        addr = self._hexint(addr)
637
        addr = self._hexint(addr)
630
        size = self._hexint(size)
638
        size = self._hexint(size)
631
        keyindex = self._hexint(keyindex)
639
        keyindex = self._hexint(keyindex)
632
        self.embios.aesencrypt(addr, size, keyindex)
640
        self.embios.aesencrypt(addr, size, keyindex)
633
    
641
    
634
    @command
642
    @command
635
    def aesdecrypt(self, addr, size, keyindex):
643
    def aesdecrypt(self, addr, size, keyindex):
636
        """
644
        """
637
            Decrypts a buffer using a hardware key
645
            Decrypts a buffer using a hardware key
-
 
646
            <addr>: the starting address of the buffer
-
 
647
            <size>: the size of the buffer
-
 
648
            <keyindex>: the index of the key in the crypto unit
638
        """
649
        """
639
        addr = self._hexint(addr)
650
        addr = self._hexint(addr)
640
        size = self._hexint(size)
651
        size = self._hexint(size)
641
        keyindex = self._hexint(keyindex)
652
        keyindex = self._hexint(keyindex)
642
        self.embios.aesdecrypt(addr, size, keyindex)
653
        self.embios.aesdecrypt(addr, size, keyindex)
643
    
654
    
644
    @command
655
    @command
645
    def hmac_sha1(self, addr, size, destination):
656
    def hmac_sha1(self, addr, size, destination):
646
        """
657
        """
647
            Generates a HMAC-SHA1 hash of the buffer and saves it to 'destination'
658
            Generates a HMAC-SHA1 hash of the buffer
-
 
659
            <addr>: the starting address of the buffer
-
 
660
            <size>: the size of the buffer
-
 
661
            <destination>: the location where the key will be stored
648
        """
662
        """
649
        addr = self._hexint(addr)
663
        addr = self._hexint(addr)
650
        size = self._hexint(size)
664
        size = self._hexint(size)
651
        destination = self._hexint(destination)
665
        destination = self._hexint(destination)
652
        sha1size = 0x14
666
        sha1size = 0x14
Line 675... Line 689...
675
    @command
689
    @command
676
    def ipodnano2g_nandread(self, addr, start, count, doecc, checkempty):
690
    def ipodnano2g_nandread(self, addr, start, count, doecc, checkempty):
677
        """
691
        """
678
            Target-specific function: ipodnano2g
692
            Target-specific function: ipodnano2g
679
            Reads data from the NAND chip into memory
693
            Reads data from the NAND chip into memory
-
 
694
            <addr>: the memory location where the data is written to
-
 
695
            <start>: start block
-
 
696
            <count>: block count
-
 
697
            <doecc>: FIXME
-
 
698
            <checkempty>: FIXME
680
        """
699
        """
681
        addr = self._hexint(addr)
700
        addr = self._hexint(addr)
682
        start = self._hexint(start)
701
        start = self._hexint(start)
683
        count = self._hexint(count)
702
        count = self._hexint(count)
684
        doecc = int(doecc)
703
        doecc = int(doecc) # FIXME shouldn't this be bool?
685
        checkempty = int(checkempty)
704
        checkempty = int(checkempty)
686
        self.logger.info("Reading " + self._hex(count) + " NAND pages starting at " + \
705
        self.logger.info("Reading " + self._hex(count) + " NAND pages starting at " + \
687
                         self._hex(start) + " to " + self._hex(addr) + "...")
706
                         self._hex(start) + " to " + self._hex(addr) + "...")
688
        self.embios.ipodnano2g_nandread(addr, start, count, doecc, checkempty)
707
        self.embios.ipodnano2g_nandread(addr, start, count, doecc, checkempty)
689
        self.logger.info("done\n")
708
        self.logger.info("done\n")
Line 691... Line 710...
691
    @command
710
    @command
692
    def ipodnano2g_nandwrite(self, addr, start, count, doecc):
711
    def ipodnano2g_nandwrite(self, addr, start, count, doecc):
693
        """
712
        """
694
            Target-specific function: ipodnano2g
713
            Target-specific function: ipodnano2g
695
            Writes data to the NAND chip
714
            Writes data to the NAND chip
-
 
715
            <addr>: the memory location where the data is read from
-
 
716
            <start>: start block
-
 
717
            <count>: block count
-
 
718
            <doecc>: FIXME
696
        """
719
        """
697
        addr = self._hexint(addr)
720
        addr = self._hexint(addr)
698
        start = self._hexint(start)
721
        start = self._hexint(start)
699
        count = self._hexint(count)
722
        count = self._hexint(count)
700
        doecc = int(doecc)
723
        doecc = int(doecc) # FIXME shouldn't this be bool?
701
        self.logger.info("Writing " + self._hex(count) + " NAND pages starting at " + \
724
        self.logger.info("Writing " + self._hex(count) + " NAND pages starting at " + \
702
                         self._hex(start) + " from " + self._hex(addr) + "...")
725
                         self._hex(start) + " from " + self._hex(addr) + "...")
703
        self.embios.ipodnano2g_nandwrite(addr, start, count, doecc)
726
        self.embios.ipodnano2g_nandwrite(addr, start, count, doecc)
704
        self.logger.info("done\n")
727
        self.logger.info("done\n")
705
 
728
 
706
    @command
729
    @command
707
    def ipodnano2g_nanderase(self, addr, start, count):
730
    def ipodnano2g_nanderase(self, addr, start, count):
708
        """
731
        """
709
            Target-specific function: ipodnano2g
732
            Target-specific function: ipodnano2g
710
            Erases blocks on the NAND chip and stores the results to memory
733
            Erases blocks on the NAND chip and stores the results to memory
-
 
734
            <addr>: the memory location where the results are stored
-
 
735
            <start>: start block
-
 
736
            <count>: block count
711
        """
737
        """
712
        addr = self._hexint(addr)
738
        addr = self._hexint(addr)
713
        start = self._hexint(start)
739
        start = self._hexint(start)
714
        count = self._hexint(count)
740
        count = self._hexint(count)
715
        self.logger.info("Erasing " + self._hex(count) + " NAND blocks starting at " + \
741
        self.logger.info("Erasing " + self._hex(count) + " NAND blocks starting at " + \
Line 720... Line 746...
720
    @command
746
    @command
721
    def ipodnano2g_dumpnand(self, filenameprefix):
747
    def ipodnano2g_dumpnand(self, filenameprefix):
722
        """
748
        """
723
            Target-specific function: ipodnano2g
749
            Target-specific function: ipodnano2g
724
            Dumps the whole NAND chip to four files
750
            Dumps the whole NAND chip to four files
-
 
751
            <filenameprefix>: prefix of the files that will be created
725
        """
752
        """
726
        info = self.embios.ipodnano2g_getnandinfo()
753
        info = self.embios.ipodnano2g_getnandinfo()
727
        self.logger.info("Dumping NAND contents...")
754
        self.logger.info("Dumping NAND contents...")
728
        try:
755
        try:
729
            infofile = open(filenameprefix+"_info.txt", 'wb')
756
            infofile = open(filenameprefix+"_info.txt", 'wb')
Line 752... Line 779...
752
    @command
779
    @command
753
    def ipodnano2g_wipenand(self, filename, force=False):
780
    def ipodnano2g_wipenand(self, filename, force=False):
754
        """
781
        """
755
            Target-specific function: ipodnano2g
782
            Target-specific function: ipodnano2g
756
            Wipes the whole NAND chip and logs the result to a file
783
            Wipes the whole NAND chip and logs the result to a file
-
 
784
            <filename>: location of the log file
757
            <force>: Use this flag to suppress the 5 seconds delay
785
            [force]: use this flag to suppress the 5 seconds delay
758
        """
786
        """
759
        self.logger.warn("Wiping the whole NAND chip!\n")
787
        self.logger.warn("Wiping the whole NAND chip!\n")
760
        if force == False:
788
        if force == False:
761
            self.logger.warn("If this was not what you intended press Ctrl-C NOW")
789
            self.logger.warn("If this was not what you intended press Ctrl-C NOW")
762
            for i in range(10):
790
            for i in range(10):
Line 795... Line 823...
795
 
823
 
796
    @command
824
    @command
797
    def getvolumeinfo(self, volume):
825
    def getvolumeinfo(self, volume):
798
        """
826
        """
799
            Gathers some information about a storage volume used
827
            Gathers some information about a storage volume used
-
 
828
            <volume>: FIXME
800
        """
829
        """
801
        volume = self._hexint(volume)
830
        volume = self._hexint(volume)
802
        data = self.embios.storage_get_info(volume)
831
        data = self.embios.storage_get_info(volume)
803
        self.logger.info("Sector size: "+str(data["sectorsize"])+"\n")
832
        self.logger.info("Sector size: "+str(data["sectorsize"])+"\n")
804
        self.logger.info("Number of sectors: "+str(data["numsectors"])+"\n")
833
        self.logger.info("Number of sectors: "+str(data["numsectors"])+"\n")
Line 834... Line 863...
834
 
863
 
835
    @command
864
    @command
836
    def readrawstoragefile(self, volume, sector, count, file, buffer = False, buffsize = "100000"):
865
    def readrawstoragefile(self, volume, sector, count, file, buffer = False, buffsize = "100000"):
837
        """
866
        """
838
            Reads <count> sectors starting at <sector> from storage <volume> to file <file>,
867
            Reads <count> sectors starting at <sector> from storage <volume> to file <file>,
839
            buffering them in memory at <buffer> in chunks of <buffsize> bytes (both optional).
868
            buffering them in memory at [buffer] in chunks of [buffsize] bytes (both optional).
840
        """
869
        """
841
        volume = self._hexint(volume)
870
        volume = self._hexint(volume)
842
        sector = self._hexint(sector)
871
        sector = self._hexint(sector)
843
        count = self._hexint(count)
872
        count = self._hexint(count)
844
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
873
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
Line 861... Line 890...
861
 
890
 
862
    @command
891
    @command
863
    def writerawstoragefile(self, volume, sector, count, file, buffer = False, buffsize = "100000"):
892
    def writerawstoragefile(self, volume, sector, count, file, buffer = False, buffsize = "100000"):
864
        """
893
        """
865
            Writes contents of <file> to <count> sectors starting at <sector> on storage <volume>,
894
            Writes contents of <file> to <count> sectors starting at <sector> on storage <volume>,
866
            buffering them in memory at <buffer> in chunks of <buffsize> bytes (both optional).
895
            buffering them in memory at [buffer] in chunks of [buffsize] bytes (both optional).
867
        """
896
        """
868
        volume = self._hexint(volume)
897
        volume = self._hexint(volume)
869
        sector = self._hexint(sector)
898
        sector = self._hexint(sector)
870
        count = self._hexint(count)
899
        count = self._hexint(count)
871
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
900
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
Line 891... Line 920...
891
        self.logger.info("done\n")
920
        self.logger.info("done\n")
892
 
921
 
893
    @command
922
    @command
894
    def mkdir(self, dirname):
923
    def mkdir(self, dirname):
895
        """
924
        """
896
            Creates a directory
925
            Creates a directory with the name <dirname>
897
        """
926
        """
898
        self.logger.info("Creating directory " + dirname + "...")
927
        self.logger.info("Creating directory " + dirname + "...")
899
        self.embios.dir_create(dirname)
928
        self.embios.dir_create(dirname)
900
        self.logger.info(" done\n")
929
        self.logger.info(" done\n")
901
 
930
 
902
    @command
931
    @command
903
    def rmdir(self, dirname):
932
    def rmdir(self, dirname):
904
        """
933
        """
905
            Removes an empty directory
934
            Removes an empty directory with the name <dirname>
906
        """
935
        """
907
        self.logger.info("Removing directory " + dirname + "...")
936
        self.logger.info("Removing directory " + dirname + "...")
908
        self.embios.dir_remove(dirname)
937
        self.embios.dir_remove(dirname)
909
        self.logger.info(" done\n")
938
        self.logger.info(" done\n")
910
 
939
 
911
    @command
940
    @command
912
    def rm(self, filename):
941
    def rm(self, filename):
913
        """
942
        """
914
            Removes a file
943
            Removes a file with the name <filename>
915
        """
944
        """
916
        self.logger.info("Removing file " + filename + "...")
945
        self.logger.info("Removing file " + filename + "...")
917
        self.embios.file_unlink(filename)
946
        self.embios.file_unlink(filename)
918
        self.logger.info(" done\n")
947
        self.logger.info(" done\n")
919
 
948
 
920
    @command
949
    @command
921
    def mv(self, oldname, newname):
950
    def mv(self, oldname, newname):
922
        """
951
        """
923
            Renames or moves a file or directory
952
            Renames or moves file or directory <oldname> to <newname>
924
        """
953
        """
925
        self.logger.info("Renaming " + oldname + " to " + newname + "...")
954
        self.logger.info("Renaming " + oldname + " to " + newname + "...")
926
        self.embios.file_rename(oldname, newname)
955
        self.embios.file_rename(oldname, newname)
927
        self.logger.info(" done\n")
956
        self.logger.info(" done\n")
928
 
957
 
929
    @command
958
    @command
930
    def get(self, remotename, localname, buffer = False, buffsize = "10000"):
959
    def get(self, remotename, localname, buffer = False, buffsize = "10000"):
931
        """
960
        """
932
            Downloads a file
961
            Downloads a file
-
 
962
            <remotename>: filename on the device
-
 
963
            <localname>: filename on the computer
-
 
964
            [buffer]: buffer address (optional)
-
 
965
            [buffsize]: buffer size (optional)
933
        """
966
        """
934
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
967
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
935
        else: buffer = self._hexint(buffer)
968
        else: buffer = self._hexint(buffer)
936
        buffsize = self._hexint(buffsize)
969
        buffsize = self._hexint(buffsize)
937
        try:
970
        try:
Line 951... Line 984...
951
 
984
 
952
    @command
985
    @command
953
    def put(self, localname, remotename, buffer = False, buffsize = "10000"):
986
    def put(self, localname, remotename, buffer = False, buffsize = "10000"):
954
        """
987
        """
955
            Uploads a file
988
            Uploads a file
-
 
989
            <remotename>: filename on the device
-
 
990
            <localname>: filename on the computer
-
 
991
            [buffer]: buffer address (optional)
-
 
992
            [buffsize]: buffer size (optional)
956
        """
993
        """
957
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
994
        if buffer == False: buffer = self.embios.lib.dev.usermem.lower
958
        else: buffer = self._hexint(buffer)
995
        else: buffer = self._hexint(buffer)
959
        buffsize = self._hexint(buffsize)
996
        buffsize = self._hexint(buffsize)
960
        try:
997
        try:
Line 976... Line 1013...
976
 
1013
 
977
    @command
1014
    @command
978
    def ls(self, path = "/"):
1015
    def ls(self, path = "/"):
979
        """
1016
        """
980
            Lists all files in the specified path
1017
            Lists all files in the specified path
-
 
1018
            [path]: the path which is listed
981
        """
1019
        """
982
        handle = self.embios.dir_open(path)
1020
        handle = self.embios.dir_open(path)
983
        self.logger.info("Directory listing of " + path + ":\n")
1021
        self.logger.info("Directory listing of " + path + ":\n")
984
        while True:
1022
        while True:
985
            try:
1023
            try: