Example #1
0
 public BootInitialEntry(byte[] buffer, int offset)
 {
     BootIndicator = buffer[offset + 0x00];
     BootMediaType = (BootDeviceEmulation)buffer[offset + 0x01];
     LoadSegment   = Utilities.ToUInt16LittleEndian(buffer, offset + 0x02);
     SystemType    = buffer[offset + 0x04];
     SectorCount   = Utilities.ToUInt16LittleEndian(buffer, offset + 0x06);
     ImageStart    = Utilities.ToUInt32LittleEndian(buffer, offset + 0x08);
 }
Example #2
0
 public BootInitialEntry(byte[] buffer, int offset)
 {
     BootIndicator = buffer[offset + 0x00];
     BootMediaType = (BootDeviceEmulation)buffer[offset + 0x01];
     LoadSegment = Utilities.ToUInt16LittleEndian(buffer, offset + 0x02);
     SystemType = buffer[offset + 0x04];
     SectorCount = Utilities.ToUInt16LittleEndian(buffer, offset + 0x06);
     ImageStart = Utilities.ToUInt32LittleEndian(buffer, offset + 0x08);
 }
Example #3
0
        /// <summary>
        /// Sets the boot image for the ISO image.
        /// </summary>
        /// <param name="image">Stream containing the boot image.</param>
        /// <param name="emulation">The type of emulation requested of the BIOS.</param>
        /// <param name="loadSegment">The memory segment to load the image to (0 for default).</param>
        public void SetBootImage(Stream image, BootDeviceEmulation emulation, int loadSegment)
        {
            if (_bootEntry != null)
            {
                throw new InvalidOperationException("Boot image already set");
            }

            _bootEntry = new BootInitialEntry();
            _bootEntry.BootIndicator = 0x88;
            _bootEntry.BootMediaType = emulation;
            _bootEntry.LoadSegment   = (ushort)loadSegment;
            _bootEntry.SystemType    = 0;
            _bootImage = image;
        }
        /// <summary>
        /// Sets the boot image for the ISO image.
        /// </summary>
        /// <param name="image">Stream containing the boot image.</param>
        /// <param name="emulation">The type of emulation requested of the BIOS.</param>
        /// <param name="loadSegment">The memory segment to load the image to (0 for default).</param>
        public void SetBootImage(Stream image, BootDeviceEmulation emulation, int loadSegment)
        {
            if (_bootEntry != null)
            {
                throw new InvalidOperationException("Boot image already set");
            }

            _bootEntry = new BootInitialEntry();
            _bootEntry.BootIndicator = 0x88;
            _bootEntry.BootMediaType = emulation;
            _bootEntry.LoadSegment = (ushort)loadSegment;
            _bootEntry.SystemType = 0;
            _bootImage = image;
        }