Bladeren bron

Completed definition of struct int13_cdrom_specification, and moved to

int13.h.
tags/v0.9.3
Michael Brown 17 jaren geleden
bovenliggende
commit
0d9d2ccbae
2 gewijzigde bestanden met toevoegingen van 37 en 9 verwijderingen
  1. 28
    0
      src/arch/i386/include/int13.h
  2. 9
    9
      src/arch/i386/interface/pcbios/int13.c

+ 28
- 0
src/arch/i386/include/int13.h Bestand weergeven

@@ -203,6 +203,34 @@ struct int13_disk_parameters {
203 203
 
204 204
 /** @} */ 
205 205
 
206
+/** Bootable CD-ROM specification packet */
207
+struct int13_cdrom_specification {
208
+	/** Size of packet in bytes */
209
+	uint8_t size;
210
+	/** Boot media type */
211
+	uint8_t media_type;
212
+	/** Drive number */
213
+	uint8_t drive;
214
+	/** CD-ROM controller number */
215
+	uint8_t controller;
216
+	/** LBA of disk image to emulate */
217
+	uint32_t lba;
218
+	/** Device specification */
219
+	uint16_t device;
220
+	/** Segment of 3K buffer for caching CD-ROM reads */
221
+	uint16_t cache_segment;
222
+	/** Load segment for initial boot image */
223
+	uint16_t load_segment;
224
+	/** Number of 512-byte sectors to load */
225
+	uint16_t load_sectors;
226
+	/** Low 8 bits of cylinder number */
227
+	uint8_t cyl;
228
+	/** Sector number, plus high 2 bits of cylinder number */
229
+	uint8_t cyl_sector;
230
+	/** Head number */
231
+	uint8_t head;
232
+} __attribute__ (( packed ));
233
+
206 234
 /** A C/H/S address within a partition table entry */
207 235
 struct partition_chs {
208 236
 	/** Head number */

+ 9
- 9
src/arch/i386/interface/pcbios/int13.c Bestand weergeven

@@ -317,15 +317,6 @@ static int int13_get_extended_parameters ( struct int13_drive *drive,
317 317
 	return 0;
318 318
 }
319 319
 
320
-struct int13_cdrom_specification {
321
-	/** Size of packet in bytes */
322
-	uint8_t size;
323
-	/** Boot media type */
324
-	uint8_t media_type;
325
-	/** Drive number */
326
-	uint8_t drive;
327
-};
328
-
329 320
 /**
330 321
  * INT 13, 4b - Get CD-ROM status / terminate emulation
331 322
  *
@@ -336,6 +327,9 @@ struct int13_cdrom_specification {
336 327
 static int int13_cdrom_status_terminate ( struct int13_drive *drive,
337 328
 					  struct i386_all_regs *ix86 ) {
338 329
 	struct int13_cdrom_specification specification;
330
+	unsigned int max_cylinder = drive->cylinders - 1;
331
+	unsigned int max_head = drive->heads - 1;
332
+	unsigned int max_sector = drive->sectors_per_track; /* sic */
339 333
 
340 334
 	DBG ( "Get CD-ROM emulation parameters to %04x:%04x\n",
341 335
 	      ix86->segs.ds, ix86->regs.di );
@@ -343,6 +337,12 @@ static int int13_cdrom_status_terminate ( struct int13_drive *drive,
343 337
 	memset ( &specification, 0, sizeof ( specification ) );
344 338
 	specification.size = sizeof ( specification );
345 339
 	specification.drive = drive->drive;
340
+	specification.cyl = ( max_cylinder & 0xff );
341
+	specification.cyl_sector = ( ( ( max_cylinder >> 8 ) << 6 ) |
342
+				     max_sector );
343
+	specification.head = max_head;
344
+
345
+	DBG_HD ( &specification, sizeof ( specification ) );
346 346
 
347 347
 	copy_to_real ( ix86->segs.ds, ix86->regs.si, &specification,
348 348
 		       sizeof ( specification ) );

Laden…
Annuleren
Opslaan