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,
"INT13 drive %02x could not read El Torito boot " 187 "record volume descriptor: %s\n",
193 if (
memcmp ( boot, &boot_check,
sizeof ( boot_check ) ) == 0 ) {
195 DBGC ( sandev,
"INT13 drive %02x has an El Torito boot catalog " 196 "at LBA %08x\n", sandev->
drive,
int13->boot_catalog );
198 DBGC ( sandev,
"INT13 drive %02x has no El Torito boot " 199 "catalog\n", sandev->
drive );
222 unsigned int start_cylinder;
223 unsigned int start_head;
224 unsigned int start_sector;
225 unsigned int end_head;
226 unsigned int end_sector;
231 DBGC ( sandev,
"INT13 drive %02x could not read " 232 "partition table to guess geometry: %s\n",
236 DBGC2 ( sandev,
"INT13 drive %02x has MBR:\n", sandev->
drive );
237 DBGC2_HDA ( sandev, 0, mbr,
sizeof ( *mbr ) );
238 DBGC ( sandev,
"INT13 drive %02x has signature %08x\n",
247 for ( i = 0 ; i < 4 ; i++ ) {
251 if ( ! partition->
type )
260 if ( ( start_cylinder == 0 ) && ( start_head != 0 ) ) {
263 DBGC ( sandev,
"INT13 drive %02x guessing C/H/S " 264 "xx/xx/%d based on partition %d\n",
273 if ( ( end_head + 1 ) > *
heads ) {
274 *
heads = ( end_head + 1 );
275 DBGC ( sandev,
"INT13 drive %02x guessing C/H/S " 276 "xx/%d/xx based on partition %d\n",
281 DBGC ( sandev,
"INT13 drive %02x guessing C/H/S " 282 "xx/xx/%d based on partition %d\n",
346 DBGC ( sandev,
"INT13 drive %02x guessing C/H/S " 347 "%d/%d/%d based on size %dK\n", sandev->
drive,
358 DBGC ( sandev,
"INT13 drive %02x guessing C/H/S xx/%d/%d based on size " 372 unsigned int guessed_heads;
373 unsigned int guessed_sectors;
375 unsigned int blocks_per_cyl;
381 &guessed_sectors )) != 0)
386 &guessed_sectors )) != 0)
391 if ( !
int13->heads )
392 int13->heads = guessed_heads;
393 if ( !
int13->sectors_per_track )
394 int13->sectors_per_track = guessed_sectors;
395 if ( !
int13->cylinders ) {
398 blocks_per_cyl = (
int13->heads *
int13->sectors_per_track );
399 assert ( blocks_per_cyl != 0 );
401 if (
int13->cylinders > 1024 )
402 int13->cylinders = 1024;
428 max_drive = sandev->
drive;
430 max_drive =
int13->natural_drive;
431 required = ( ( max_drive & 0x7f ) + 1 );
432 if ( *counter < required ) {
434 DBGC ( sandev,
"INT13 drive %02x added to drive count: " 435 "%d HDDs, %d FDDs\n",
444 ( ( (
num_fdds - 1 ) & 0x3 ) << 6 ) );
475 DBGC2 ( sandev,
"Reset drive\n" );
494 DBGC2 ( sandev,
"Get status of last operation\n" );
495 return int13->last_status;
527 DBGC ( sandev,
"\nINT 13 drive %02x invalid blocksize (%zd) " 528 "for non-extended read/write\n",
534 cylinder = ( ( ( ix86->
regs.
cl & 0xc0 ) << 2 ) | ix86->
regs.
ch );
537 if ( ( cylinder >=
int13->cylinders ) ||
540 DBGC ( sandev,
"C/H/S %d/%d/%d out of range for geometry " 550 DBGC2 ( sandev,
"C/H/S %d/%d/%d = LBA %08lx <-> %04x:%04x (count %d)\n",
556 DBGC ( sandev,
"INT13 drive %02x I/O failed: %s\n",
580 DBGC2 ( sandev,
"Read: " );
600 DBGC2 ( sandev,
"Write: " );
618 unsigned int max_cylinder =
int13->cylinders - 1;
619 unsigned int max_head =
int13->heads - 1;
620 unsigned int max_sector =
int13->sectors_per_track;
622 DBGC2 ( sandev,
"Get drive parameters\n" );
626 DBGC ( sandev,
"\nINT 13 drive %02x invalid blocksize (%zd) " 627 "for non-extended parameters\n",
633 ix86->
regs.
ch = ( max_cylinder & 0xff );
634 ix86->
regs.
cl = ( ( ( max_cylinder >> 8 ) << 6 ) | max_sector );
660 DBGC2 ( sandev,
"Get disk type\n" );
685 DBGC2 ( sandev,
"INT13 extensions installation check\n" );
728 DBGC2 ( sandev,
"<invalid buffer size %#02x\n>\n",
bufsize );
736 DBGC2 ( sandev,
"LBA %08llx <-> ", ( (
unsigned long long )
lba ) );
737 if ( (
addr.count == 0xff ) ||
738 ( (
addr.buffer.segment == 0xffff ) &&
739 (
addr.buffer.offset == 0xffff ) ) ) {
741 DBGC2 ( sandev,
"%08llx",
742 ( (
unsigned long long )
addr.buffer_phys ) );
745 addr.buffer.offset );
746 DBGC2 ( sandev,
"%04x:%04x",
addr.buffer.segment,
747 addr.buffer.offset );
749 if (
addr.count <= 0x7f ) {
751 }
else if (
addr.count == 0xff ) {
754 DBGC2 ( sandev,
" <invalid count %#02x>\n",
addr.count );
761 DBGC ( sandev,
"INT13 drive %02x extended I/O failed: %s\n",
784 DBGC2 ( sandev,
"Extended read: " );
798 DBGC2 ( sandev,
"Extended write: " );
821 DBGC2 ( sandev,
"Verify: LBA %08llx (count %ld)\n",
822 ( (
unsigned long long )
lba ),
count );
848 DBGC2 ( sandev,
"Seek: LBA %08llx (count %ld)\n",
849 ( (
unsigned long long )
lba ),
count );
882 DBGC ( sandev,
"INT13 drive %02x cannot identify hardware " 883 "device\n", sandev->
drive );
898 DBGC ( sandev,
"INT13 drive %02x unrecognised bus type %d\n",
906 DBGC ( sandev,
"INT13 drive %02x cannot identify block device: " 913 dpi->
len =
sizeof ( *dpi );
914 for ( i = 0 ; i <
sizeof ( *dpi ) ; i++ )
933 size_t len =
sizeof ( params );
941 DBGC2 ( sandev,
"Get extended drive parameters to %04x:%04x+%02x\n",
945 memset ( ¶ms, 0,
sizeof ( params ) );
947 if ( (
int13->cylinders < 1024 ) &&
958 DBGC ( sandev,
"INT13 drive %02x could not provide device " 959 "path information: %s\n",
976 DBGC ( sandev,
"INT 13 drive %02x described using extended " 977 "parameters:\n", sandev->
drive );
1001 DBGC2 ( sandev,
"Get CD-ROM emulation status to %04x:%04x%s\n",
1003 ( ix86->
regs.
al ?
"" :
" and terminate" ) );
1007 DBGC ( sandev,
"INT13 drive %02x is not a CD-ROM\n",
1013 memset ( &specification, 0,
sizeof ( specification ) );
1014 specification.
size =
sizeof ( specification );
1019 sizeof ( specification ) );
1042 DBGC2 ( sandev,
"Read CD-ROM boot catalog to %08x\n",
command.buffer );
1045 if ( !
int13->boot_catalog ) {
1046 DBGC ( sandev,
"INT13 drive %02x has no boot catalog\n",
1055 DBGC ( sandev,
"INT13 drive %02x could not read boot catalog: " 1069 unsigned int bios_drive = ix86->
regs.
dl;
1080 if ( bios_drive != sandev->
drive ) {
1082 if ( bios_drive ==
int13->natural_drive ) {
1083 DBGC2 ( sandev,
"INT13,%02x (%02x) remapped to " 1084 "(%02x)\n", ix86->
regs.
ah,
1085 bios_drive, sandev->
drive );
1088 }
else if ( ( ( bios_drive & 0x7f ) == 0x7f ) &&
1097 DBGC2 ( sandev,
"INT13,%02x (%02x): ",
1098 ix86->
regs.
ah, bios_drive );
1144 DBGC2 ( sandev,
"*** Unrecognised INT13 ***\n" );
1155 DBGC ( sandev,
"INT13,%02x (%02x) failed with status " 1182 "movw %%sp, %%bp\n\t" 1192 "lcall *%%cs:int13_vector\n\t" 1203 "cmpb $0x15, -1(%%bp)\n\t" 1205 "testb $0x80, -4(%%bp)\n\t" 1208 "movb -4(%%bp), %%dl\n\t" 1209 "cmpb $0x08, -1(%%bp)\n\t" 1211 "testb $0x80, %%dl\n\t" 1212 "movb %%cs:num_drives, %%dl\n\t" 1214 "movb %%cs:num_fdds, %%dl\n\t" 1217 "movw %%bp, %%sp\n\t" 1258 if ( (
drive & 0x7f ) == 0x7f )
1272 DBGC ( sandev,
"INT13 drive %02x could not register: %s\n",
1280 goto err_alloc_scratch;
1285 goto err_parse_eltorito;
1290 goto err_guess_geometry;
1292 DBGC ( sandev,
"INT13 drive %02x (naturally %02x) registered with " 1293 "C/H/S geometry %d/%d/%d\n",
1335 DBG (
"INT13 cannot find drive %02x\n",
drive );
1346 DBGC ( sandev,
"INT13 drive %02x unregistered\n", sandev->
drive );
1382 "xorw %%ax, %%ax\n\t" 1385 :
"=a" (
status ),
"=b" ( discard_b ),
1387 :
"a" ( 0x0201 ),
"b" ( *
address ),
1388 "c" ( 1 ),
"d" (
drive ) );
1390 DBG (
"INT13 drive %02x could not read MBR (status %04x)\n",
1400 DBG (
"INT13 drive %02x does not contain a valid MBR\n",
1415 #define eltorito_cmd __use_data16 ( eltorito_cmd ) 1419 #define eltorito_address __use_data16 ( eltorito_address ) 1441 "xorw %%ax, %%ax\n\t" 1444 :
"a" ( 0x4d00 ),
"d" (
drive ),
1447 DBG (
"INT13 drive %02x could not read El Torito boot catalog " 1452 sizeof ( catalog ) );
1456 DBG (
"INT13 drive %02x El Torito specifies unknown platform " 1457 "%02x\n",
drive, catalog.valid.platform_id );
1461 DBG (
"INT13 drive %02x El Torito is not bootable\n",
drive );
1465 DBG (
"INT13 drive %02x El Torito requires emulation " 1466 "type %02x\n",
drive, catalog.boot.media_type );
1469 DBG (
"INT13 drive %02x El Torito boot image at LBA %08x (count %d)\n",
1470 drive, catalog.boot.start, catalog.boot.length );
1471 address->segment = ( catalog.boot.load_segment ?
1472 catalog.boot.load_segment : 0x7c0 );
1474 DBG (
"INT13 drive %02x El Torito boot image loads at %04x:%04x\n",
1488 "xorw %%ax, %%ax\n\t" 1491 :
"a" ( 0x4200 ),
"d" (
drive ),
1494 DBG (
"INT13 drive %02x could not read El Torito boot image " 1536 DBG (
"INT13 drive %02x boot returned: %s\n",
1545 #define XBFTAB_SIZE 768 1548 #define XBFTAB_ALIGN 16 1553 #define xbftab __use_data16 ( xbftab ) 1565 struct segoff xbft_address;
1572 DBGC (
acpi,
"INT13 out of space for %s table\n",
1585 sizeof ( installed->
oem_id ) );
1596 DBGC (
acpi,
"INT13 installed %s:\n",
1616 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.
uint32_t lba
Start address.
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.
int san_boot(unsigned int drive, const char *filename)
Attempt to boot from a SAN device.
#define INT13_EXTENSION_CHECK
Extensions installation check.
uint32_t blocks
Number of blocks within the block description.
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.
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.
uint32_t magic
Magic signature.
#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.
static int int13_boot(unsigned int drive, const char *filename __unused)
Attempt to boot from an INT 13 drive.
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.
#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.
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.
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)
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.
unsigned int location
Location.
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.
#define ENODEV
No such device.
#define for_each_sandev(sandev)
Iterate over all SAN devices.
struct partition_chs chs_start
C/H/S start address.
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
#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.
#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 __unused
Declare a variable or data structure as unused.
#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.
unsigned int bus_type
Bus type.
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.
uint16_t count
Number of entries.
#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.
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.
unsigned long userptr_t
A pointer to a user buffer.
INT 13 SAN device private data.
void * memset(void *dest, int character, size_t len) __nonnull