101 #define int13_vector __use_text16 ( int13_vector ) 111 .sectors_per_track = 48,
113 #define int13_fdd_params __use_data16 ( int13_fdd_params ) 130 #define num_fdds __use_text16 ( num_fdds ) 140 #define num_drives __use_text16 ( num_drives ) 150 return ( ( capacity <= 0xffffffffUL ) ? capacity : 0xffffffff );
160 return ( ! ( sandev->
drive & 0x80 ) );
178 .system_id =
"EL TORITO SPECIFICATION",
186 DBGC ( sandev->
drive,
"INT13 drive %02x could not read El " 187 "Torito boot record volume descriptor: %s\n",
193 if (
memcmp ( boot, &boot_check,
sizeof ( boot_check ) ) == 0 ) {
195 DBGC ( sandev->
drive,
"INT13 drive %02x has an El Torito boot " 196 "catalog at LBA %08x\n", sandev->
drive,
197 int13->boot_catalog );
199 DBGC ( sandev->
drive,
"INT13 drive %02x has no El Torito boot " 200 "catalog\n", sandev->
drive );
223 unsigned int start_cylinder;
224 unsigned int start_head;
225 unsigned int start_sector;
226 unsigned int end_head;
227 unsigned int end_sector;
232 DBGC ( sandev->
drive,
"INT13 drive %02x could not read " 233 "partition table to guess geometry: %s\n",
239 DBGC ( sandev->
drive,
"INT13 drive %02x has signature %08x\n",
248 for ( i = 0 ; i < 4 ; i++ ) {
252 if ( ! partition->
type )
261 if ( ( start_cylinder == 0 ) && ( start_head != 0 ) ) {
264 DBGC ( sandev->
drive,
"INT13 drive %02x guessing " 265 "C/H/S xx/xx/%d based on partition %d\n",
274 if ( ( end_head + 1 ) > *
heads ) {
275 *
heads = ( end_head + 1 );
276 DBGC ( sandev->
drive,
"INT13 drive %02x guessing " 277 "C/H/S xx/%d/xx based on partition %d\n",
282 DBGC ( sandev->
drive,
"INT13 drive %02x guessing " 283 "C/H/S xx/xx/%d based on partition %d\n",
347 DBGC ( sandev->
drive,
"INT13 drive %02x guessing " 348 "C/H/S %d/%d/%d based on size %dK\n",
360 DBGC ( sandev->
drive,
"INT13 drive %02x guessing C/H/S xx/%d/%d " 375 unsigned int guessed_heads;
376 unsigned int guessed_sectors;
378 unsigned int blocks_per_cyl;
384 &guessed_sectors )) != 0)
389 &guessed_sectors )) != 0)
394 if ( !
int13->heads )
395 int13->heads = guessed_heads;
396 if ( !
int13->sectors_per_track )
397 int13->sectors_per_track = guessed_sectors;
398 if ( !
int13->cylinders ) {
401 blocks_per_cyl = (
int13->heads *
int13->sectors_per_track );
402 assert ( blocks_per_cyl != 0 );
403 int13->cylinders = ( blocks / blocks_per_cyl );
404 if (
int13->cylinders > 1024 )
405 int13->cylinders = 1024;
431 max_drive = sandev->
drive;
433 max_drive =
int13->natural_drive;
434 required = ( ( max_drive & 0x7f ) + 1 );
435 if ( *counter < required ) {
437 DBGC ( sandev->
drive,
"INT13 drive %02x added to " 438 "drive count: %d HDDs, %d FDDs\n",
447 ( ( (
num_fdds - 1 ) & 0x3 ) << 6 ) );
497 DBGC2 ( sandev->
drive,
"Get status of last operation\n" );
498 return int13->last_status;
530 DBGC ( sandev->
drive,
"\nINT 13 drive %02x invalid blocksize " 531 "(%zd) for non-extended read/write\n",
537 cylinder = ( ( ( ix86->
regs.
cl & 0xc0 ) << 2 ) | ix86->
regs.
ch );
540 if ( ( cylinder >=
int13->cylinders ) ||
543 DBGC ( sandev->
drive,
"C/H/S %d/%d/%d out of range for " 544 "geometry %d/%d/%d\n", cylinder,
head,
sector,
546 int13->sectors_per_track );
554 DBGC2 ( sandev->
drive,
"C/H/S %d/%d/%d = LBA %08lx <-> %04x:%04x " 560 DBGC ( sandev->
drive,
"INT13 drive %02x I/O failed: %s\n",
622 unsigned int max_cylinder =
int13->cylinders - 1;
623 unsigned int max_head =
int13->heads - 1;
624 unsigned int max_sector =
int13->sectors_per_track;
626 DBGC2 ( sandev->
drive,
"Get drive parameters\n" );
630 DBGC ( sandev->
drive,
"\nINT 13 drive %02x invalid blocksize " 631 "(%zd) for non-extended parameters\n",
637 ix86->
regs.
ch = ( max_cylinder & 0xff );
638 ix86->
regs.
cl = ( ( ( max_cylinder >> 8 ) << 6 ) | max_sector );
670 ix86->
regs.
cx = ( blocks >> 16 );
671 ix86->
regs.
dx = ( blocks & 0xffff );
689 DBGC2 ( sandev->
drive,
"INT13 extensions check\n" );
732 DBGC2 ( sandev->
drive,
"<invalid buffer size %#02x\n>\n",
742 ( (
unsigned long long )
lba ) );
743 if ( (
addr.count == 0xff ) ||
744 ( (
addr.buffer.segment == 0xffff ) &&
745 (
addr.buffer.offset == 0xffff ) ) ) {
748 ( (
unsigned long long )
addr.buffer_phys ) );
751 addr.buffer.offset );
753 addr.buffer.offset );
755 if (
addr.count <= 0x7f ) {
757 }
else if (
addr.count == 0xff ) {
767 DBGC ( sandev->
drive,
"INT13 drive %02x extended I/O failed: " 827 DBGC2 ( sandev->
drive,
"Verify: LBA %08llx (count %ld)\n",
828 ( (
unsigned long long )
lba ),
count );
854 DBGC2 ( sandev->
drive,
"Seek: LBA %08llx (count %ld)\n",
855 ( (
unsigned long long )
lba ),
count );
888 DBGC ( sandev->
drive,
"INT13 drive %02x cannot identify " 889 "hardware device\n", sandev->
drive );
895 switch (
desc->bus_type ) {
904 DBGC ( sandev->
drive,
"INT13 drive %02x unrecognised bus " 905 "type %d\n", sandev->
drive,
desc->bus_type );
912 DBGC ( sandev->
drive,
"INT13 drive %02x cannot identify " 919 dpi->
len =
sizeof ( *dpi );
920 for ( i = 0 ; i <
sizeof ( *dpi ) ; i++ )
939 size_t len =
sizeof ( params );
947 DBGC2 ( sandev->
drive,
"Get extended drive parameters to " 951 memset ( ¶ms, 0,
sizeof ( params ) );
953 if ( (
int13->cylinders < 1024 ) &&
964 DBGC ( sandev->
drive,
"INT13 drive %02x could not provide " 965 "device path information: %s\n",
982 DBGC ( sandev->
drive,
"INT 13 drive %02x described using extended " 983 "parameters:\n", sandev->
drive );
1007 DBGC2 ( sandev->
drive,
"Get CD-ROM emulation status to %04x:%04x%s\n",
1009 ( ix86->
regs.
al ?
"" :
" and terminate" ) );
1013 DBGC ( sandev->
drive,
"INT13 drive %02x is not a CD-ROM\n",
1019 memset ( &specification, 0,
sizeof ( specification ) );
1020 specification.
size =
sizeof ( specification );
1025 sizeof ( specification ) );
1048 DBGC2 ( sandev->
drive,
"Read CD-ROM boot catalog to %08x\n",
1052 if ( !
int13->boot_catalog ) {
1053 DBGC ( sandev->
drive,
"INT13 drive %02x has no boot catalog\n",
1062 DBGC ( sandev->
drive,
"INT13 drive %02x could not read boot " 1076 unsigned int bios_drive = ix86->
regs.
dl;
1087 if ( bios_drive != sandev->
drive ) {
1089 if ( bios_drive ==
int13->natural_drive ) {
1091 "remapped to (%02x)\n", ix86->
regs.
ah,
1092 bios_drive, sandev->
drive );
1095 }
else if ( ( ( bios_drive & 0x7f ) == 0x7f ) &&
1104 DBGC2 ( sandev->
drive,
"INT13,%02x (%02x): ",
1105 ix86->
regs.
ah, bios_drive );
1151 DBGC2 ( sandev->
drive,
"*** Unrecognised INT13 ***\n" );
1162 DBGC ( sandev->
drive,
"INT13,%02x (%02x) failed with " 1190 "movw %%sp, %%bp\n\t" 1200 "lcall *%%cs:int13_vector\n\t" 1211 "cmpb $0x15, -1(%%bp)\n\t" 1213 "testb $0x80, -4(%%bp)\n\t" 1216 "movb -4(%%bp), %%dl\n\t" 1217 "cmpb $0x08, -1(%%bp)\n\t" 1219 "testb $0x80, %%dl\n\t" 1220 "movb %%cs:num_drives, %%dl\n\t" 1222 "movb %%cs:num_fdds, %%dl\n\t" 1225 "movw %%bp, %%sp\n\t" 1266 if ( (
drive & 0x7f ) == 0x7f )
1280 DBGC (
drive,
"INT13 drive %02x could not register: %s\n",
1288 goto err_alloc_scratch;
1293 goto err_parse_eltorito;
1298 goto err_guess_geometry;
1300 DBGC (
drive,
"INT13 drive %02x (naturally %02x) registered with " 1301 "C/H/S geometry %d/%d/%d\n",
drive,
int13->natural_drive,
1389 "xorw %%ax, %%ax\n\t" 1392 :
"=a" (
status ),
"=b" ( discard_b ),
1394 :
"a" ( 0x0201 ),
"b" ( *
address ),
1395 "c" ( 1 ),
"d" (
drive ) );
1397 DBGC (
drive,
"INT13 drive %02x could not read MBR (status " 1407 DBGC (
drive,
"INT13 drive %02x does not contain a valid MBR\n",
1422 #define eltorito_cmd __use_data16 ( eltorito_cmd ) 1426 #define eltorito_address __use_data16 ( eltorito_address ) 1448 "xorw %%ax, %%ax\n\t" 1451 :
"a" ( 0x4d00 ),
"d" (
drive ),
1454 DBGC (
drive,
"INT13 drive %02x could not read El Torito boot " 1459 sizeof ( catalog ) );
1463 DBGC (
drive,
"INT13 drive %02x El Torito specifies unknown " 1464 "platform %02x\n",
drive, catalog.valid.platform_id );
1468 DBGC (
drive,
"INT13 drive %02x El Torito is not bootable\n",
1473 DBGC (
drive,
"INT13 drive %02x El Torito requires emulation " 1474 "type %02x\n",
drive, catalog.boot.media_type );
1477 DBGC (
drive,
"INT13 drive %02x El Torito boot image at LBA %08x " 1478 "(count %d)\n",
drive, catalog.boot.start, catalog.boot.length );
1479 address->segment = ( catalog.boot.load_segment ?
1480 catalog.boot.load_segment : 0x7c0 );
1482 DBGC (
drive,
"INT13 drive %02x El Torito boot image loads at " 1496 "xorw %%ax, %%ax\n\t" 1499 :
"a" ( 0x4200 ),
"d" (
drive ),
1502 DBGC (
drive,
"INT13 drive %02x could not read El Torito boot " 1545 DBGC (
drive,
"INT13 drive %02x boot returned: %s\n",
1554 #define XBFTAB_SIZE 768 1557 #define XBFTAB_ALIGN 16 1562 #define xbftab __use_data16 ( xbftab ) 1574 struct segoff xbft_address;
1581 DBGC (
acpi,
"INT13 out of space for %s table\n",
1594 sizeof ( installed->
oem_id ) );
1605 DBGC (
acpi,
"INT13 installed %s:\n",
1625 DBG (
"INT13 could not install ACPI tables: %s\n",
#define PCI_FUNC(busdevfn)
static int int13_extended_seek(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 44 - Extended seek.
uint64_t buffer_phys
Data buffer (EDD 3.0+ only)
#define PART_CYLINDER(chs)
uint8_t type
Descriptor type.
Bootable CD-ROM boot catalog command packet.
#define PCI_BUS(busdevfn)
int sandev_reset(struct san_device *sandev)
Reset SAN device.
int call_bootsector(unsigned int segment, unsigned int offset, unsigned int drive)
Jump to preloaded bootsector.
struct arbelprm_rc_send_wqe rc
#define INT13_GET_DISK_TYPE
Get disk type.
uint32_t signature
Disk signature.
void get_memmap(struct memory_map *memmap)
Get memory map.
struct i386_seg_regs segs
#define INT13_MBR_MAGIC
MBR magic signature.
static void devices_put(void)
Allow devices to be removed on shutdown.
static int int13_is_fdd(struct san_device *sandev)
Test if SAN device is a floppy disk drive.
#define INT13_FDD_SECTORS(geometry)
Get floppy disk number of sectors per track.
struct partition_table_entry partitions[4]
Partition table.
uint8_t size
Size of packet in bytes.
A bootable entry in the El Torito Boot Catalog.
int san_describe(void)
Describe SAN devices for SAN-booted operating system.
static int int13_install(struct acpi_header *acpi)
Install ACPI table.
int san_hook(unsigned int drive, struct uri **uris, unsigned int count, unsigned int flags)
Hook SAN device.
#define VIRT_CALL(function)
Call C function from real-mode code.
unsigned int cylinders
Number of cylinders.
uint32_t heads
Number of heads.
static struct int13_disk_address __bss16(eltorito_address)
El Torito disk address packet.
static int int13_load_eltorito(unsigned int drive, struct segoff *address)
Load and verify El Torito boot record from INT 13 drive.
#define XBFTAB_SIZE
Maximum size of boot firmware table(s)
static __asmcall __used void int13(struct i386_all_regs *ix86)
INT 13 handler.
struct partition_chs chs_end
C/H/S end address.
static void int13_unhook(unsigned int drive)
Unhook INT 13 SAN device.
#define INT13_EXTENSION_CHECK
Extensions installation check.
static int sandev_rw(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer, int(*block_rw)(struct interface *control, struct interface *data, uint64_t lba, unsigned int count, userptr_t buffer, size_t len))
Read from or write to SAN device.
static int int13_get_last_status(struct san_device *sandev, struct i386_all_regs *ix86 __unused)
INT 13, 01 - Get status of last operation.
#define INT13_EXTENDED_WRITE
Extended write.
uint32_t start
Linear start address.
static int int13_get_parameters(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 08 - Get drive parameters.
uint64_t address
Base address.
#define ENOEXEC
Exec format error.
x86 bootsector image format
An INT 13 disk address packet.
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
int edd_describe(struct interface *intf, struct edd_interface_type *type, union edd_device_path *path)
Describe a disk device using EDD.
void unregister_sandev(struct san_device *sandev)
Unregister SAN device.
int san_boot(unsigned int drive, struct san_boot_config *config)
Attempt to boot from a SAN device.
uint64_t desc
Microcode descriptor list physical address.
static int int13_extended_write(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 43 - Extended write.
An El Torito Boot Catalog Validation Entry.
struct interface block
Underlying block device interface.
#define ISO9660_ID
ISO9660 identifier.
#define EDD_BUS_TYPE_PCI
EDD PCI bus type.
unsigned long long uint64_t
userptr_t phys_to_user(unsigned long phys_addr)
Convert physical address to user pointer.
#define INT13_EXTENSION_EDD
EDD functions supported.
static void sandev_put(struct san_device *sandev)
Drop reference to SAN device.
static int int13_device_path_info(struct san_device *sandev, struct edd_device_path_information *dpi)
Build device path information.
#define EDD_DEVICE_PATH_INFO_KEY
EDD device path information key.
#define ELTORITO_BOOTABLE
Boot indicator for a bootable ISO image.
uint8_t channel
Channel number.
#define INT13_DISK_TYPE_HDD
Hard disk.
static int sandev_needs_reopen(struct san_device *sandev)
Check if SAN device needs to be reopened.
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
uint32_t sectors_per_track
Number of sectors per track.
#define INT13_EXTENDED_VERIFY
Verify sectors.
#define INT13_FDD_HEADS(geometry)
Get floppy disk number of heads.
uint8_t drive
Drive number.
#define offsetof(type, field)
Get offset of a field within a structure.
static int int13_guess_geometry_fdd(struct san_device *sandev, unsigned int *heads, unsigned int *sectors)
Guess INT 13 floppy disk drive geometry.
uint16_t device
Device ID.
struct segoff dpte
Device parameter table extension.
#define INT13_STATUS_READ_ERROR
Read error.
static int int13_extended_verify(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 44 - Verify sectors.
static void int13_hook_vector(void)
Hook INT 13 handler.
#define INT13_BLKSIZE
Block size for non-extended INT 13 calls.
static struct int13_fdd_parameters __data16(int13_fdd_params)
Dummy floppy disk parameter table.
uint8_t type
System indicator (partition type)
static void int13_sync_num_drives(void)
Update BIOS drive count.
#define ECANCELED
Operation canceled.
#define ENOTSUP
Operation not supported.
static void int13_check_num_drives(void)
Check number of drives.
A hardware device description.
uint32_t sector
Boot catalog sector.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
El Torito bootable CD-ROM specification.
static int int13_parse_eltorito(struct san_device *sandev, void *scratch)
Parse El Torito parameters.
An El Torito Boot Record Volume Descriptor.
uint32_t start
Starting offset.
static int have_sandevs(void)
There exist some SAN devices.
char * strncpy(char *dest, const char *src, size_t max)
Copy string.
#define INT13_READ_SECTORS
Read sectors.
static const struct int13_fdd_geometry int13_fdd_geometries[]
Recognised floppy disk geometries.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
int last_status
Status of last operation.
#define ENOMEM
Not enough space.
static int int13_get_disk_type(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 15 - Get disk type.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define INT13_FDD_CYLINDERS(geometry)
Get floppy disk number of cylinders.
#define __asmcall
Declare a function with standard calling conventions.
uint32_t userptr_t
A pointer to a user buffer.
#define INT13_EXTENSION_LINEAR
Extended disk access functions supported.
#define BUS_TYPE_PCI
PCI bus type.
#define __used
Declare a function as used.
#define INT13_EXTENDED_SEEK
Extended seek.
#define INT13_GET_PARAMETERS
Get drive parameters.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static int int13_load_mbr(unsigned int drive, struct segoff *address)
Load and verify master boot record from INT 13 drive.
#define __unused
Declare a variable or data structure as unused.
static void devices_get(void)
Prevent devices from being removed on shutdown.
static EFI_ACPI_TABLE_PROTOCOL * acpi
ACPI table protocol protocol.
unsigned int drive
Drive number.
SAN boot configuration parameters.
int register_sandev(struct san_device *sandev, unsigned int drive, unsigned int flags)
Register SAN device.
uint32_t heads
Number of heads.
static uint64_t sandev_capacity(struct san_device *sandev)
Calculate SAN device capacity.
#define INT13_MAX_CHS_SECTORS
Maximum number of sectors for which CHS geometry is allowed to be valid.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
uint16_t count
Number of entries.
struct edd_device_path_information dpi
Device path information.
An El Torito Boot Record Volume Descriptor (fixed portion)
#define INT13_EXTENSION_VER_3_0
INT13 extensions version 3.0 (EDD-3.0)
void acpi_fix_checksum(struct acpi_header *acpi)
Fix up ACPI table checksum.
#define INT13_STATUS_INVALID
Invalid function or parameter.
static int int13_describe(void)
Describe SAN devices for SAN-booted operating system.
static void int13_unhook_vector(void)
Unhook INT 13 handler.
uint16_t bufsize
Size of this structure.
static int int13_rw_sectors(struct san_device *sandev, struct i386_all_regs *ix86, int(*sandev_rw)(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer))
Read / write sectors.
static int int13_read_sectors(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 02 - Read sectors.
uint32_t cylinders
Number of cylinders.
int acpi_install(int(*install)(struct acpi_header *acpi))
Install ACPI tables.
uint32_t sector
Boot catalog sector.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static int int13_guess_geometry_hdd(struct san_device *sandev, void *scratch, unsigned int *heads, unsigned int *sectors)
Guess INT 13 hard disk drive geometry.
static int int13_get_extended_parameters(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 48 - Get extended parameters.
static int int13_extended_read(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 42 - Extended read.
int is_cdrom
Drive is a CD-ROM.
static size_t xbftab_used
Total used length of boot firmware tables.
#define PCI_SLOT(busdevfn)
#define INT13_FDD_TYPE_1M44
1.44M
A floppy drive parameter table.
int sandev_read(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer)
Read from SAN device.
static int int13_cdrom_read_boot_catalog(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 4d - Read CD-ROM boot catalog.
unsigned int boot_catalog
Address of El Torito boot catalog (if any)
static int int13_cdrom_status_terminate(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 4b - Get status or terminate CD-ROM emulation.
void int13_wrapper(void)
Assembly wrapper.
#define XBFTAB_ALIGN
Alignment of boot firmware table entries.
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
#define ENODEV
No such device.
uint64_t lba
Starting block number.
#define for_each_sandev(sandev)
Iterate over all SAN devices.
struct partition_chs chs_start
C/H/S start address.
#define INT13_DISK_TYPE_FDD
Floppy without change-line support.
static int int13_write_sectors(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 03 - Write sectors.
uint16_t magic
Magic signature.
#define BDA_EQUIPMENT_WORD
#define INT13_STATUS_RESET_FAILED
Reset failed.
void * malloc(size_t size)
Allocate memory.
#define INT13_FL_DMA_TRANSPARENT
DMA boundary errors handled transparently.
static int int13_reset(struct san_device *sandev, struct i386_all_regs *ix86 __unused)
INT 13, 00 - Reset disk system.
#define INT13_CDROM_STATUS_TERMINATE
Get CD-ROM status / terminate emulation.
uint64_t sectors
Total number of sectors on drive.
#define INT13_EXTENSION_64BIT
64-bit extensions are present
static struct segoff __text16(int13_vector)
Vector for chaining to other INT 13 handlers.
#define ISO9660_TYPE_BOOT
ISO9660 Boot Volume Descriptor type.
void san_unhook(unsigned int drive)
Unhook SAN device.
Bootable CD-ROM specification packet.
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")
#define ENOSPC
No space left on device.
uint8_t function
Function.
struct san_device * sandev_find(unsigned int drive)
Find SAN device by drive number.
unsigned int heads
Number of heads.
#define __from_data16(pointer)
uint32_t cylinders
Number of cylinders.
#define INT13_FL_CHS_VALID
CHS information is valid.
static int int13_hook(unsigned int drive, struct uri **uris, unsigned int count, unsigned int flags)
Hook INT 13 SAN device.
void * priv
Driver private data.
#define INT13_CDROM_READ_BOOT_CATALOG
Read CD-ROM boot catalog.
unsigned int natural_drive
BIOS natural drive number (0x00-0xff)
#define EIO
Input/output error.
#define ELTORITO_LBA
El Torito Boot Record Volume Descriptor block address.
struct edd_device_path_information dpi
Device path information.
#define INT13_GET_EXTENDED_PARAMETERS
Get extended drive parameters.
static const char * acpi_name(uint32_t signature)
Transcribe ACPI table signature (for debugging)
userptr_t virt_to_user(volatile const void *addr)
Convert virtual address to user pointer.
struct segoff dpte
Device parameter table extension.
#define INT13_RESET
Reset disk system.
static uint8_t __bss16_array(xbftab, [XBFTAB_SIZE])
The boot firmware table(s) generated by iPXE.
#define INT13_GET_LAST_STATUS
Get status of last operation.
struct device_description desc
Device description.
PROVIDE_SANBOOT(pcbios, san_hook, int13_hook)
static size_t sandev_blksize(struct san_device *sandev)
Calculate SAN device block size.
static int int13_extended_rw(struct san_device *sandev, struct i386_all_regs *ix86, int(*sandev_rw)(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer))
Extended read / write.
static int int13_boot(unsigned int drive, struct san_boot_config *config __unused)
Attempt to boot from an INT 13 drive.
A Uniform Resource Identifier.
static __always_inline userptr_t real_to_user(unsigned int segment, unsigned int offset)
Convert segment:offset address to user buffer.
struct device * identify_device(struct interface *intf)
Identify a device behind an interface.
uint64_t sectors
Total number of sectors on drive.
uint8_t drive
Drive number.
struct san_path * active
Current active path.
typeof(acpi_finder=acpi_find)
ACPI table finder.
static uint32_t int13_capacity32(struct san_device *sandev)
Calculate SAN device capacity (limited to 32 bits)
static int int13_extension_check(struct san_device *sandev, struct i386_all_regs *ix86)
INT 13, 41 - Extensions installation check.
#define INT13_WRITE_SECTORS
Write sectors.
unsigned int sectors_per_track
Number of sectors per track.
#define INT13_EXTENDED_READ
Extended read.
#define DBG(...)
Print a debugging message.
uint8_t bufsize
Size of the packet, in bytes.
A partition table entry within the MBR.
static uint16_t equipment_word
Equipment word.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define REAL_CODE(asm_code_str)
int sandev_reopen(struct san_device *sandev)
(Re)open SAN device
#define NULL
NULL pointer (VOID *)
uint16_t sector_size
Bytes per sector.
int sandev_write(struct san_device *sandev, uint64_t lba, unsigned int count, userptr_t buffer)
Write to SAN device.
#define INT13_FDD_GEOMETRY(cylinders, heads, sectors)
Define a floppy disk geometry.
#define TEXT16_CODE(asm_code_str)
struct san_device * alloc_sandev(struct uri **uris, unsigned int count, size_t priv_size)
Allocate SAN device.
static int int13_guess_geometry(struct san_device *sandev, void *scratch)
Guess INT 13 drive geometry.
INT 13 SAN device private data.
void * memset(void *dest, int character, size_t len) __nonnull