Changeset 5481d1bb in mainline
- Timestamp:
- 2009-06-13T09:45:33Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d9f4c76
- Parents:
- 4f5caea
- Location:
- uspace/srv/bd/ata_bd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/ata_bd/ata_bd.c
r4f5caea r5481d1bb 69 69 static atomic_t dev_futex = FUTEX_INITIALIZER; 70 70 71 static disk_t disk[ 2];71 static disk_t disk[MAX_DISKS]; 72 72 73 73 static int ata_bd_init(void); … … 97 97 printf("Reset drives...\n"); 98 98 pio_write_8(&ctl->device_control, DCR_SRST); 99 /* printf("wait for busy\n"); 100 do { 101 status = pio_read_8(&cmd->status); 102 } while ((status & SR_BSY) == 0); 103 */ 99 /* FIXME: Find out how to do this properly. */ 104 100 async_usleep(100); 105 101 pio_write_8(&ctl->device_control, 0); … … 154 150 pio_write_8(&cmd->drive_head, ((disk_id != 0) ? DHR_DRV : 0)); 155 151 async_usleep(100); 156 pio_write_8(&cmd->command, 0xEC);152 pio_write_8(&cmd->command, CMD_IDENTIFY_DRIVE); 157 153 158 154 status = pio_read_8(&cmd->status); … … 170 166 } 171 167 172 for (i = 0; i < 256; i++) {168 for (i = 0; i < block_size / 2; i++) { 173 169 do { 174 170 status = pio_read_8(&cmd->status); … … 367 363 pio_write_8(&cmd->cylinder_low, c & 0xff); 368 364 pio_write_8(&cmd->cylinder_high, c >> 16); 369 pio_write_8(&cmd->command, 0x20);365 pio_write_8(&cmd->command, CMD_READ_SECTORS); 370 366 371 367 /* Read data from the disk buffer. */ 372 368 373 for (i = 0; i < 256; i++) {369 for (i = 0; i < block_size / 2; i++) { 374 370 do { 375 371 status = pio_read_8(&cmd->status); -
uspace/srv/bd/ata_bd/ata_bd.h
r4f5caea r5481d1bb 118 118 }; 119 119 120 enum ata_command { 121 CMD_IDENTIFY_DRIVE = 0xEC, 122 CMD_READ_SECTORS = 0x20, 123 CMD_WRITE_SECTORS = 0x30 124 }; 125 120 126 typedef struct { 121 127 bool present;
Note:
See TracChangeset
for help on using the changeset viewer.