Changeset 39610 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 14, 2011 2:09:59 PM (13 years ago)
- svn:sync-xref-src-repo-rev:
- 75390
- Location:
- trunk/src/VBox/Devices/PC/BIOS-new
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS-new/ahci.c
r39598 r39610 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 18 //@todo!!!! save/restore high bits of EAX/ECX and whatever else may be needed.19 17 20 18 #include <stdint.h> … … 87 85 /** Physical address of the sink buffer (for pre/post skip). */ 88 86 uint32_t sink_buf_phys; 87 /** Saved high bits of EAX. */ 88 uint16_t saved_eax_hi; 89 89 /** VDS EDDS DMA buffer descriptor structure. */ 90 90 vds_edds edds; … … 181 181 parm [dx] value [dx ax] modify nomemory; 182 182 183 /* Warning: Destroys high bits of EAX. */ 183 184 void outpd(uint16_t port, uint32_t val); 184 185 #pragma aux outpd = \ … … 191 192 192 193 194 /* Machinery to save/restore high bits of EAX. 32-bit port I/O needs to use 195 * EAX, but saving/restoring EAX around each port access would be inefficient. 196 * Instead, each externally callable routine must save the high bits before 197 * modifying them and restore the high bits before exiting. 198 */ 199 200 /* Note: Reading high EAX bits destroys them - *must* be restored later. */ 201 uint16_t eax_hi_rd(void); 202 #pragma aux eax_hi_rd = \ 203 ".386" \ 204 "shr eax, 16" \ 205 value [ax] modify nomemory; 206 207 void eax_hi_wr(uint16_t); 208 #pragma aux eax_hi_wr = \ 209 ".386" \ 210 "shl eax, 16" \ 211 parm [ax] modify nomemory; 212 213 void high_bits_save(ahci_t __far *ahci) 214 { 215 ahci->saved_eax_hi = eax_hi_rd(); 216 } 217 218 void high_bits_restore(ahci_t __far *ahci) 219 { 220 eax_hi_wr(ahci->saved_eax_hi); 221 } 222 193 223 /** 194 224 * Sets a given set of bits in a register. … … 333 363 334 364 ahci->cur_prd = prdt_idx; 365 366 #ifdef DEBUG_AHCI 367 for (prdt_idx = 0; prdt_idx < ahci->cur_prd; ++prdt_idx) { 368 DBG_AHCI("S/G entry %u: %5lu bytes @ %08lX\n", prdt_idx, 369 ahci->aPrdt[prdt_idx].len + 1, ahci->aPrdt[prdt_idx].phys_addr); 370 } 371 #endif 335 372 336 373 /* Build variable part of first command DWORD (reuses 'cmd'). */ … … 462 499 bios_dsk->ahcidev[device_id].port); 463 500 501 high_bits_save(bios_dsk->ahci_seg :> 0); 464 502 ahci_port_init(bios_dsk->ahci_seg :> 0, bios_dsk->ahcidev[device_id].port); 465 503 ahci_cmd_data(bios_dsk, AHCI_CMD_READ_DMA_EXT); … … 467 505 rep_movsw(bios_dsk->drqp.buffer, bios_dsk->drqp.buffer, bios_dsk->drqp.nsect * 512 / 2); 468 506 #endif 507 high_bits_restore(bios_dsk->ahci_seg :> 0); 469 508 return 0; //@todo!! 470 509 } … … 489 528 bios_dsk->ahcidev[device_id].port); 490 529 530 high_bits_save(bios_dsk->ahci_seg :> 0); 491 531 ahci_port_init(bios_dsk->ahci_seg :> 0, bios_dsk->ahcidev[device_id].port); 492 532 ahci_cmd_data(bios_dsk, AHCI_CMD_WRITE_DMA_EXT); 533 high_bits_restore(bios_dsk->ahci_seg :> 0); 493 534 return 0; //@todo!! 494 535 } … … 503 544 { 504 545 bio_dsk_t __far *bios_dsk = read_word(0x0040, 0x000E) :> &EbdaData->bdisk; 505 ahci_t __far *ahci = bios_dsk->ahci_seg :> 0;546 ahci_t __far *ahci; 506 547 507 548 /* Data out is currently not supported. */ … … 530 571 bios_dsk->drqp.nsect = length / bios_dsk->drqp.sect_sz; 531 572 // bios_dsk->drqp.sect_sz = 2048; 573 574 ahci = bios_dsk->ahci_seg :> 0; 575 high_bits_save(ahci); 532 576 533 577 ahci_port_init(bios_dsk->ahci_seg :> 0, bios_dsk->ahcidev[device_id].port); … … 554 598 rep_movsw(bios_dsk->drqp.buffer, bios_dsk->drqp.buffer, bios_dsk->drqp.trsfbytes / 2); 555 599 #endif 600 high_bits_restore(ahci); 601 556 602 return ahci->aCmdHdr[1] == 0 ? 4 : 0; 557 603 // return 0; //@todo!! -
trunk/src/VBox/Devices/PC/BIOS-new/disk.c
r39560 r39610 349 349 segment = i13_ext->segment; 350 350 offset = i13_ext->offset; 351 351 352 BX_DEBUG_INT13_HD("%s: %d sectors from lba %u @ %04x:%04x\n", __func__, 353 count, i13_ext->lba1, segment, offset); 354 352 355 // Can't use 64 bits lba 353 356 lba = i13_ext->lba2; … … 379 382 bios_dsk->drqp.sect_sz = 512; //@todo: device specific? 380 383 bios_dsk->drqp.sector = 0; /* Indicate LBA. */ 384 bios_dsk->drqp.dev_id = device; 381 385 382 386 // Execute the command -
trunk/src/VBox/Devices/PC/BIOS-new/eltorito.c
r39597 r39610 508 508 segment = ES; 509 509 offset = BX; 510 510 511 BX_DEBUG_INT13_ET("%s: read to %04x:%04x @ VCHS %u/%u/%u (%u sectors)\n", __func__, 512 ES, BX, cylinder, head, sector, nbsectors); 513 511 514 // no sector to read ? 512 515 if(nbsectors==0)
Note:
See TracChangeset
for help on using the changeset viewer.