SSUOS_P6/src/kernel/device/ata.c
/* Reads sector SEC_NO from disk D into BUFFER, which must have
   room for ATA_SECOR_SIZE bytes.
   Internally synchronizes accesses to disks, so external
   per-disk locking is unneeded. */
Reads sector SEC_NO from disk D into BUFFER, which must have
room for ATA_SECOR_SIZE bytes.
Internally synchronizes accesses to disks, so external
per-disk locking is unneeded.
Reads sector SEC_NO from disk D into BUFFER which must have room for ATA_SECOR_SIZE bytes . Internally synchronizes accesses to disks so external per - disk locking is unneeded .
static void
ata_read (void *dev, blk_sec_t sec_num, void *buf)
{
	struct ata_device *d = dev;
	 	ata_io_ready (d, sec_num);
	   ata_cmd (d, ATA_CMD_READ_PIO);
	   delay_ata_for (d, ATA_WAIT_IDLE);
	   sema_down (&d->sema);
	  while(!(inb(ATA_REG_STATUS(d->port_addr)) & 0x08));
	   sector_read (d, buf);
}
static void ata_read ( void * dev , blk_sec_t sec_num , void * buf ) { struct ata_device * d = dev ; ata_io_ready ( d , sec_num ) ; ata_cmd ( d , ATA_CMD_READ_PIO ) ; delay_ata_for ( d , ATA_WAIT_IDLE ) ; sema_down ( & d -> sema ) ; while ( ! ( inb ( ATA_REG_STATUS ( d -> port_addr ) ) & 0x08 ) ) ; sector_read ( d , buf ) ; }
Reads sector SEC_NO from disk D into BUFFER, which must have
room for ATA_SECOR_SIZE bytes.
Reads sector SEC_NO from disk D into BUFFER which must have room for ATA_SECOR_SIZE bytes .