Esempio n. 1
0
 def get_info(self, total_blks=0):
     """return a string line with typical info about this partition"""
     p = self.part_blk
     de = p.dos_env
     name = "'%s'" % p.drv_name
     part_blks = self.get_num_blocks()
     part_bytes = self.get_num_bytes()
     extra = ""
     if total_blks != 0:
         ratio = 100.0 * part_blks / total_blks
         extra += "%6.2f%%  " % ratio
     # add dos type
     dos_type = de.dos_type
     extra += DosType.num_to_tag_str(dos_type)
     extra += "/0x%04x" % dos_type
     # max transfer
     extra += " max_transfer=0x%x" % de.max_transfer
     extra += " mask=0x%x" % de.mask
     extra += " num_buffer=%d" % de.num_buffer
     # add flags
     flags = p.flags
     if flags & PartitionBlock.FLAG_BOOTABLE == PartitionBlock.FLAG_BOOTABLE:
         extra += " bootable pri=%d" % de.boot_pri
     if flags & PartitionBlock.FLAG_NO_AUTOMOUNT == PartitionBlock.FLAG_NO_AUTOMOUNT:
         extra += " no_automount"
     return "Partition: #%d %-06s %8d %8d  %10d  %s  %s" \
       % (self.num, name, de.low_cyl, de.high_cyl, part_blks, ByteSize.to_byte_size_str(part_bytes), extra)
Esempio n. 2
0
 def get_info(self):
     flags = self.get_flags_info()
     dt = self.fshd.dos_type
     dt_str = DosType.num_to_tag_str(dt)
     return "FileSystem #%d %s/0x%04x version=%s size=%d %s" % (
         self.num, dt_str, dt, self.fshd.get_version_string(), len(
             self.data), flags)
Esempio n. 3
0
 def get_info(self, total_blks=0):
   """return a string line with typical info about this partition"""
   p = self.part_blk
   de = p.dos_env
   name = "'%s'" % p.drv_name
   part_blks = self.get_num_blocks()
   part_bytes = self.get_num_bytes()
   extra = ""
   if total_blks != 0:
     ratio = 100.0 * part_blks / total_blks
     extra += "%6.2f%%  " % ratio
   # add dos type
   dos_type = de.dos_type
   extra += DosType.num_to_tag_str(dos_type)
   extra += "/0x%04x" % dos_type
   # max transfer
   extra += " max_transfer=0x%x" % de.max_transfer
   extra += " mask=0x%x" % de.mask
   extra += " num_buffer=%d" % de.num_buffer
   # add flags
   flags = p.flags
   if flags & PartitionBlock.FLAG_BOOTABLE == PartitionBlock.FLAG_BOOTABLE:
     extra += " bootable pri=%d" % de.boot_pri
   if flags & PartitionBlock.FLAG_NO_AUTOMOUNT == PartitionBlock.FLAG_NO_AUTOMOUNT:
     extra += " no_automount"
   return "Partition: #%d %-06s %8d %8d  %10d  %s  %s" \
     % (self.num, name, de.low_cyl, de.high_cyl, part_blks, ByteSize.to_byte_size_str(part_bytes), extra)
Esempio n. 4
0
 def dump(self):
     print("DosEnv")
     print(" size:           %d" % self.size)
     print(" block_size:     %d" % self.block_size)
     print(" sec_org:        %d" % self.sec_org)
     print(" surfaces:       %d" % self.surfaces)
     print(" sec_per_blk:    %d" % self.sec_per_blk)
     print(" blk_per_trk:    %d" % self.blk_per_trk)
     print(" reserved:       %d" % self.reserved)
     print(" pre_alloc:      %d" % self.pre_alloc)
     print(" interleave:     %d" % self.interleave)
     print(" low_cyl:        %d" % self.low_cyl)
     print(" high_cyl:       %d" % self.high_cyl)
     print(" num_buffer:     %d" % self.num_buffer)
     print(" buf_mem_type:   0x%08x" % self.buf_mem_type)
     print(" max_transfer:   0x%08x" % self.max_transfer)
     print(" mask:           0x%08x" % self.mask)
     print(" boot_pri:       %d" % self.boot_pri)
     print(
         " dos_type:       0x%08x = %s"
         % (self.dos_type, DosType.num_to_tag_str(self.dos_type))
     )
     print(" baud:           %d" % self.baud)
     print(" control:        %d" % self.control)
     print(" boot_blocks:    %d" % self.boot_blocks)
Esempio n. 5
0
  def dump(self):
    Block.dump(self, "FSHeader")

    print(" size:           %d" % self.size)
    print(" host_id:        %d" % self.host_id)
    print(" next:           %s" % self._dump_ptr(self.next))
    print(" flags:          0x%08x" % self.flags)
    print(" dos_type:       0x%08x = %s" % (self.dos_type, DosType.num_to_tag_str(self.dos_type)))
    print(" version:        0x%08x = %s" % (self.version, self.get_version_string()))
    print(" patch_flags:    0x%08x" % self.patch_flags)

    self.dev_node.dump()
Esempio n. 6
0
  def dump(self):
    Block.dump(self, "FSHeader")

    print " size:           %d" % self.size
    print " host_id:        %d" % self.host_id
    print " next:           %s" % self._dump_ptr(self.next)
    print " flags:          0x%08x" % self.flags
    print " dos_type:       0x%08x = %s" % (self.dos_type, DosType.num_to_tag_str(self.dos_type))
    print " version:        0x%08x = %s" % (self.version, self.get_version_string())
    print " patch_flags:    0x%08x" % self.patch_flags

    self.dev_node.dump()
Esempio n. 7
0
 def dump(self):
   print "BootBlock(%d):" % self.blk_num
   print " dos_type:  0x%08x %s (valid: %s) is_ffs=%s is_intl=%s is_dircache=%s" \
     % (self.dos_type, DosType.num_to_tag_str(self.dos_type), 
        self.valid_dos_type, 
        DosType.is_ffs(self.dos_type), 
        DosType.is_intl(self.dos_type),
        DosType.is_dircache(self.dos_type))
   print " root_blk:  %d (got %d)" % (self.calc_root_blk, self.got_root_blk)
   print " chksum:    0x%08x (got) 0x%08x (calc) -> bootable: %s" % (self.got_chksum, self.calc_chksum, self.valid_chksum)
   print " valid:     %s" % self.valid
   if self.boot_code != None:
       print " boot_code: %d bytes" % len(self.boot_code)
Esempio n. 8
0
 def get_info(self, total_blks=0):
     """return a string line with typical info about this partition"""
     p = self.part_blk
     de = p.dos_env
     name = "'%s'" % p.drv_name
     part_blks = self.get_num_blocks()
     part_bytes = self.get_num_bytes()
     extra = ""
     if total_blks != 0:
         ratio = 100.0 * part_blks / total_blks
         extra += "%6.2f%%  " % ratio
     # add dos type
     dos_type = de.dos_type
     extra += DosType.num_to_tag_str(dos_type)
     extra += "/0x%04x" % dos_type
     return "Partition: #%d %-06s %8d %8d  %10d  %s  %s" \
       % (self.num, name, de.low_cyl, de.high_cyl, part_blks, ByteSize.to_byte_size_str(part_bytes), extra)
Esempio n. 9
0
 def get_info(self, total_blks=0):
   """return a string line with typical info about this partition"""
   p = self.part_blk
   de = p.dos_env
   name = "'%s'" % p.drv_name
   part_blks = self.get_num_blocks()
   part_bytes = self.get_num_bytes()
   extra = ""
   if total_blks != 0:
     ratio = 100.0 * part_blks / total_blks
     extra += "%6.2f%%  " % ratio
   # add dos type
   dos_type = de.dos_type
   extra += DosType.num_to_tag_str(dos_type)
   extra += "/0x%04x" % dos_type
   return "Partition: #%d %-06s %8d %8d  %10d  %s  %s" \
     % (self.num, name, de.low_cyl, de.high_cyl, part_blks, ByteSize.to_byte_size_str(part_bytes), extra)
Esempio n. 10
0
 def dump(self):
   print "DosEnv"
   print " size:           %d" % self.size
   print " block_size:     %d" % self.block_size
   print " sec_org:        %d" % self.sec_org
   print " surfaces:       %d" % self.surfaces
   print " sec_per_blk:    %d" % self.sec_per_blk
   print " blk_per_trk:    %d" % self.blk_per_trk
   print " reserved:       %d" % self.reserved
   print " pre_alloc:      %d" % self.pre_alloc
   print " interleave:     %d" % self.interleave
   print " low_cyl:        %d" % self.low_cyl
   print " high_cyl:       %d" % self.high_cyl
   print " num_buffer:     %d" % self.num_buffer
   print " buf_mem_type:   0x%08x" % self.buf_mem_type
   print " max_transfer:   0x%08x" % self.max_transfer
   print " mask:           0x%08x" % self.mask
   print " boot_pri:       %d" % self.boot_pri
   print " dos_type:       0x%08x = %s" % (self.dos_type, DosType.num_to_tag_str(self.dos_type))
   print " baud:           %d" % self.baud
   print " control:        %d" % self.control
   print " boot_blocks:    %d" % self.boot_blocks
 def dump(self):
   print("DosEnv")
   print(" size:           %d" % self.size)
   print(" block_size:     %d" % self.block_size)
   print(" sec_org:        %d" % self.sec_org)
   print(" surfaces:       %d" % self.surfaces)
   print(" sec_per_blk:    %d" % self.sec_per_blk)
   print(" blk_per_trk:    %d" % self.blk_per_trk)
   print(" reserved:       %d" % self.reserved)
   print(" pre_alloc:      %d" % self.pre_alloc)
   print(" interleave:     %d" % self.interleave)
   print(" low_cyl:        %d" % self.low_cyl)
   print(" high_cyl:       %d" % self.high_cyl)
   print(" num_buffer:     %d" % self.num_buffer)
   print(" buf_mem_type:   0x%08x" % self.buf_mem_type)
   print(" max_transfer:   0x%08x" % self.max_transfer)
   print(" mask:           0x%08x" % self.mask)
   print(" boot_pri:       %d" % self.boot_pri)
   print(" dos_type:       0x%08x = %s" % (self.dos_type, DosType.num_to_tag_str(self.dos_type)))
   print(" baud:           %d" % self.baud)
   print(" control:        %d" % self.control)
   print(" boot_blocks:    %d" % self.boot_blocks)
Esempio n. 12
0
 def dump(self):
     print "DosEnv"
     print " size:           %d" % self.size
     print " block_size:     %d" % self.block_size
     print " sec_org:        %d" % self.sec_org
     print " surfaces:       %d" % self.surfaces
     print " sec_per_blk:    %d" % self.sec_per_blk
     print " blk_per_trk:    %d" % self.blk_per_trk
     print " reserved:       %d" % self.reserved
     print " pre_alloc:      %d" % self.pre_alloc
     print " interleave:     %d" % self.interleave
     print " low_cyl:        %d" % self.low_cyl
     print " high_cyl:       %d" % self.high_cyl
     print " num_buffer:     %d" % self.num_buffer
     print " buf_mem_type:   0x%08x" % self.buf_mem_type
     print " max_tramsfer:   0x%08x" % self.max_transfer
     print " mask:           0x%08x" % self.mask
     print " boot_pri:       %d" % self.boot_pri
     print " dos_type:       0x%08x = %s" % (
         self.dos_type, DosType.num_to_tag_str(self.dos_type))
     print " baud:           %d" % self.baud
     print " control:        %d" % self.control
     print " boot_blocks:    %d" % self.boot_blocks
Esempio n. 13
0
 def get_info(self):
   flags = self.get_flags_info()
   return "FileSystem #%d %s version=%s size=%d %s" % (self.num, DosType.num_to_tag_str(self.fshd.dos_type), self.fshd.get_version_string(), len(self.data), flags)
Esempio n. 14
0
 def get_info(self):
   flags = self.get_flags_info()
   dt = self.fshd.dos_type
   dt_str = DosType.num_to_tag_str(dt)
   return "FileSystem #%d %s/0x%04x version=%s size=%d %s" % (self.num, dt_str, dt, self.fshd.get_version_string(), len(self.data), flags)
Esempio n. 15
0
 def get_info(self):
     flags = self.get_flags_info()
     return "FileSystem #%d %s version=%s size=%d %s" % (
         self.num, DosType.num_to_tag_str(self.fshd.dos_type),
         self.fshd.get_version_string(), len(self.data), flags)