class SlowFat::BootSector
BootSector
handles accessing information inside the boot sector, such as BPB, signature, and boot code.
Attributes
oem_name[R]
@return [String] the OEM Name contained in this boot sector.
Public Class Methods
new(data)
click to toggle source
Initialize a new BootSector
object (normally only called from Filesystem
) @param data [String] raw data making up this boot sector
# 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
Public Instance Methods
bios_parameter_block()
click to toggle source
Parse out and return a BIOS Parameter Block from this boot sector @return [BiosParameterBlock] the BPB parsed out of this boot sector
# File lib/slowfat/bootsect.rb, line 24 def bios_parameter_block BiosParameterBlock.new @bpb end
extended_bios_parameter_block()
click to toggle source
Parse out and return an Extended BIOS Parameter Block from this boot sector @return [ExtendedBiosParameterBlock] the EBPB parsed out of this boot sector
# File lib/slowfat/bootsect.rb, line 31 def extended_bios_parameter_block ExtendedBiosParameterBlock.new @ebpb end