Class: SlowFat::BiosParameterBlock
- Inherits:
-
Object
- Object
- SlowFat::BiosParameterBlock
- Defined in:
- lib/slowfat/bootsect.rb
Overview
BiosParameterBlock holds information from a BPB.
Instance Attribute Summary collapse
-
#bytes_per_logsect ⇒ Object
readonly
Returns the value of attribute bytes_per_logsect.
-
#fats ⇒ Object
readonly
Returns the value of attribute fats.
-
#heads ⇒ Object
readonly
Returns the value of attribute heads.
-
#hidden_logsects ⇒ Object
readonly
Returns the value of attribute hidden_logsects.
-
#large_total_logsects ⇒ Object
readonly
Returns the value of attribute large_total_logsects.
-
#logsects ⇒ Object
readonly
Returns the value of attribute logsects.
-
#logsects_per_cluster ⇒ Object
readonly
Returns the value of attribute logsects_per_cluster.
-
#logsects_per_fat ⇒ Object
readonly
Returns the value of attribute logsects_per_fat.
-
#media_descriptor ⇒ Object
readonly
Returns the value of attribute media_descriptor.
-
#physects_per_track ⇒ Object
readonly
Returns the value of attribute physects_per_track.
-
#reserved_logsects ⇒ Object
readonly
Returns the value of attribute reserved_logsects.
-
#root_entries ⇒ Object
readonly
Returns the value of attribute root_entries.
Instance Method Summary collapse
-
#initialize(data) ⇒ BiosParameterBlock
constructor
A new instance of BiosParameterBlock.
-
#media_descriptor_type ⇒ Symbol
Return the type of media this boot sector is on.
Constructor Details
#initialize(data) ⇒ BiosParameterBlock
Returns a new instance of BiosParameterBlock.
41 42 43 |
# File 'lib/slowfat/bootsect.rb', line 41 def initialize(data) (@bytes_per_logsect, @logsects_per_cluster, @reserved_logsects, @fats, @root_entries, @total_logsects, @media_descriptor, @logsects_per_fat, @physects_per_track, @heads, @hidden_logsects, @large_total_logsects) = data.unpack('vCvCvvCvvvVV') end |
Instance Attribute Details
#bytes_per_logsect ⇒ Object (readonly)
Returns the value of attribute bytes_per_logsect.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def bytes_per_logsect @bytes_per_logsect end |
#fats ⇒ Object (readonly)
Returns the value of attribute fats.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def fats @fats end |
#heads ⇒ Object (readonly)
Returns the value of attribute heads.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def heads @heads end |
#hidden_logsects ⇒ Object (readonly)
Returns the value of attribute hidden_logsects.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def hidden_logsects @hidden_logsects end |
#large_total_logsects ⇒ Object (readonly)
Returns the value of attribute large_total_logsects.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def large_total_logsects @large_total_logsects end |
#logsects ⇒ Object (readonly)
Returns the value of attribute logsects.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def logsects @logsects end |
#logsects_per_cluster ⇒ Object (readonly)
Returns the value of attribute logsects_per_cluster.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def logsects_per_cluster @logsects_per_cluster end |
#logsects_per_fat ⇒ Object (readonly)
Returns the value of attribute logsects_per_fat.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def logsects_per_fat @logsects_per_fat end |
#media_descriptor ⇒ Object (readonly)
Returns the value of attribute media_descriptor.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def media_descriptor @media_descriptor end |
#physects_per_track ⇒ Object (readonly)
Returns the value of attribute physects_per_track.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def physects_per_track @physects_per_track end |
#reserved_logsects ⇒ Object (readonly)
Returns the value of attribute reserved_logsects.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def reserved_logsects @reserved_logsects end |
#root_entries ⇒ Object (readonly)
Returns the value of attribute root_entries.
39 40 41 |
# File 'lib/slowfat/bootsect.rb', line 39 def root_entries @root_entries end |
Instance Method Details
#media_descriptor_type ⇒ Symbol
Return the type of media this boot sector is on
48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/slowfat/bootsect.rb', line 48 def media_descriptor_type case @media_descriptor_id when 0xE5 :floppy_8inch when 0xF0 :floppy_35inch_hd when 0xF8 :fixed_disk when 0xFD :floppy_525inch_ld else :unknown end end |