/** @} */
+/** 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 */
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
*
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 );
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 ) );