mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Completed definition of struct int13_cdrom_specification, and moved to
int13.h.
This commit is contained in:
parent
013d381e3c
commit
0d9d2ccbae
@ -203,6 +203,34 @@ struct int13_disk_parameters {
|
||||
|
||||
/** @} */
|
||||
|
||||
/** Bootable CD-ROM specification packet */
|
||||
struct int13_cdrom_specification {
|
||||
/** Size of packet in bytes */
|
||||
uint8_t size;
|
||||
/** Boot media type */
|
||||
uint8_t media_type;
|
||||
/** Drive number */
|
||||
uint8_t drive;
|
||||
/** CD-ROM controller number */
|
||||
uint8_t controller;
|
||||
/** LBA of disk image to emulate */
|
||||
uint32_t lba;
|
||||
/** Device specification */
|
||||
uint16_t device;
|
||||
/** Segment of 3K buffer for caching CD-ROM reads */
|
||||
uint16_t cache_segment;
|
||||
/** Load segment for initial boot image */
|
||||
uint16_t load_segment;
|
||||
/** Number of 512-byte sectors to load */
|
||||
uint16_t load_sectors;
|
||||
/** Low 8 bits of cylinder number */
|
||||
uint8_t cyl;
|
||||
/** Sector number, plus high 2 bits of cylinder number */
|
||||
uint8_t cyl_sector;
|
||||
/** Head number */
|
||||
uint8_t head;
|
||||
} __attribute__ (( packed ));
|
||||
|
||||
/** A C/H/S address within a partition table entry */
|
||||
struct partition_chs {
|
||||
/** Head number */
|
||||
|
@ -317,15 +317,6 @@ static int int13_get_extended_parameters ( struct int13_drive *drive,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct int13_cdrom_specification {
|
||||
/** Size of packet in bytes */
|
||||
uint8_t size;
|
||||
/** Boot media type */
|
||||
uint8_t media_type;
|
||||
/** Drive number */
|
||||
uint8_t drive;
|
||||
};
|
||||
|
||||
/**
|
||||
* INT 13, 4b - Get CD-ROM status / terminate emulation
|
||||
*
|
||||
@ -336,6 +327,9 @@ struct int13_cdrom_specification {
|
||||
static int int13_cdrom_status_terminate ( struct int13_drive *drive,
|
||||
struct i386_all_regs *ix86 ) {
|
||||
struct int13_cdrom_specification specification;
|
||||
unsigned int max_cylinder = drive->cylinders - 1;
|
||||
unsigned int max_head = drive->heads - 1;
|
||||
unsigned int max_sector = drive->sectors_per_track; /* sic */
|
||||
|
||||
DBG ( "Get CD-ROM emulation parameters to %04x:%04x\n",
|
||||
ix86->segs.ds, ix86->regs.di );
|
||||
@ -343,6 +337,12 @@ static int int13_cdrom_status_terminate ( struct int13_drive *drive,
|
||||
memset ( &specification, 0, sizeof ( specification ) );
|
||||
specification.size = sizeof ( specification );
|
||||
specification.drive = drive->drive;
|
||||
specification.cyl = ( max_cylinder & 0xff );
|
||||
specification.cyl_sector = ( ( ( max_cylinder >> 8 ) << 6 ) |
|
||||
max_sector );
|
||||
specification.head = max_head;
|
||||
|
||||
DBG_HD ( &specification, sizeof ( specification ) );
|
||||
|
||||
copy_to_real ( ix86->segs.ds, ix86->regs.si, &specification,
|
||||
sizeof ( specification ) );
|
||||
|
Loading…
Reference in New Issue
Block a user