vaseboot/include/VasEBoot/i386/pc/biosdisk.h

110 lines
3.1 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_BIOSDISK_MACHINE_HEADER
#define VAS_EBOOT_BIOSDISK_MACHINE_HEADER 1
#include <VasEBoot/symbol.h>
#include <VasEBoot/types.h>
#define VAS_EBOOT_BIOSDISK_FLAG_LBA 1
#define VAS_EBOOT_BIOSDISK_FLAG_CDROM 2
#define VAS_EBOOT_BIOSDISK_CDTYPE_NO_EMUL 0
#define VAS_EBOOT_BIOSDISK_CDTYPE_1_2_M 1
#define VAS_EBOOT_BIOSDISK_CDTYPE_1_44_M 2
#define VAS_EBOOT_BIOSDISK_CDTYPE_2_88_M 3
#define VAS_EBOOT_BIOSDISK_CDTYPE_HARDDISK 4
#define VAS_EBOOT_BIOSDISK_CDTYPE_MASK 0xF
struct VasEBoot_biosdisk_data
{
int drive;
unsigned long cylinders;
unsigned long heads;
unsigned long sectors;
unsigned long flags;
};
/* Drive Parameters. */
struct VasEBoot_biosdisk_drp
{
VasEBoot_uint16_t size;
VasEBoot_uint16_t flags;
VasEBoot_uint32_t cylinders;
VasEBoot_uint32_t heads;
VasEBoot_uint32_t sectors;
VasEBoot_uint64_t total_sectors;
VasEBoot_uint16_t bytes_per_sector;
/* ver 2.0 or higher */
union
{
VasEBoot_uint32_t EDD_configuration_parameters;
/* Pointer to the Device Parameter Table Extension (ver 3.0+). */
VasEBoot_uint32_t dpte_pointer;
};
/* ver 3.0 or higher */
VasEBoot_uint16_t signature_dpi;
VasEBoot_uint8_t length_dpi;
VasEBoot_uint8_t reserved[3];
VasEBoot_uint8_t name_of_host_bus[4];
VasEBoot_uint8_t name_of_interface_type[8];
VasEBoot_uint8_t interface_path[8];
VasEBoot_uint8_t device_path[16];
VasEBoot_uint8_t reserved2;
VasEBoot_uint8_t checksum;
/* XXX: This is necessary, because the BIOS of Thinkpad X20
writes a garbage to the tail of drive parameters,
regardless of a size specified in a caller. */
VasEBoot_uint8_t dummy[16];
} VAS_EBOOT_PACKED;
struct VasEBoot_biosdisk_cdrp
{
VasEBoot_uint8_t size;
VasEBoot_uint8_t media_type;
VasEBoot_uint8_t drive_no;
VasEBoot_uint8_t controller_no;
VasEBoot_uint32_t image_lba;
VasEBoot_uint16_t device_spec;
VasEBoot_uint16_t cache_seg;
VasEBoot_uint16_t load_seg;
VasEBoot_uint16_t length_sec512;
VasEBoot_uint8_t cylinders;
VasEBoot_uint8_t sectors;
VasEBoot_uint8_t heads;
VasEBoot_uint8_t dummy[16];
} VAS_EBOOT_PACKED;
/* Disk Address Packet. */
struct VasEBoot_biosdisk_dap
{
VasEBoot_uint8_t length;
VasEBoot_uint8_t reserved;
VasEBoot_uint16_t blocks;
VasEBoot_uint32_t buffer;
VasEBoot_uint64_t block;
} VAS_EBOOT_PACKED;
#endif /* ! VAS_EBOOT_BIOSDISK_MACHINE_HEADER */