Class: SlowFat::BootSector
- Inherits:
-
Object
- Object
- SlowFat::BootSector
- Defined in:
- lib/slowfat/bootsect.rb
Overview
BootSector handles accessing information inside the boot sector, such as BPB, signature, and boot code.
Defined Under Namespace
Classes: DataError
Instance Attribute Summary collapse
-
#oem_name ⇒ String
readonly
The OEM Name contained in this boot sector.
Instance Method Summary collapse
-
#bios_parameter_block ⇒ BiosParameterBlock
Parse out and return a BIOS Parameter Block from this boot sector.
-
#extended_bios_parameter_block ⇒ ExtendedBiosParameterBlock
Parse out and return an Extended BIOS Parameter Block from this boot sector.
-
#initialize(data) ⇒ BootSector
constructor
Initialize a new BootSector object (normally only called from Filesystem).
Constructor Details
#initialize(data) ⇒ BootSector
Initialize a new BootSector object (normally only called from Filesystem)
16 17 18 19 |
# File 'lib/slowfat/bootsect.rb', line 16 def initialize(data) (@jmp, @oem_name, @bpb, @ebpb, @boot_code, @boot_signature) = data.unpack('a3a8a25a26a448v') raise DataError, "Invalid boot signature in boot sector." if(@boot_signature != 0xAA55) end |
Instance Attribute Details
#oem_name ⇒ String (readonly)
Returns the OEM Name contained in this boot sector.
6 7 8 |
# File 'lib/slowfat/bootsect.rb', line 6 def oem_name @oem_name end |
Instance Method Details
#bios_parameter_block ⇒ BiosParameterBlock
Parse out and return a BIOS Parameter Block from this boot sector
24 25 26 |
# File 'lib/slowfat/bootsect.rb', line 24 def bios_parameter_block BiosParameterBlock.new @bpb end |
#extended_bios_parameter_block ⇒ ExtendedBiosParameterBlock
Parse out and return an Extended BIOS Parameter Block from this boot sector
31 32 33 |
# File 'lib/slowfat/bootsect.rb', line 31 def extended_bios_parameter_block ExtendedBiosParameterBlock.new @ebpb end |