Lines Matching refs:ata
752 ata_t ata;
2488 write_byte(ebda_seg,&EbdaData->ata.channels[channel].iface,ATA_IFACE_NONE);
2489 write_word(ebda_seg,&EbdaData->ata.channels[channel].iobase1,0x0);
2490 write_word(ebda_seg,&EbdaData->ata.channels[channel].iobase2,0x0);
2491 write_byte(ebda_seg,&EbdaData->ata.channels[channel].irq,0);
2496 write_byte(ebda_seg,&EbdaData->ata.devices[device].type,ATA_TYPE_NONE);
2497 write_byte(ebda_seg,&EbdaData->ata.devices[device].device,ATA_DEVICE_NONE);
2498 write_byte(ebda_seg,&EbdaData->ata.devices[device].removable,0);
2499 write_byte(ebda_seg,&EbdaData->ata.devices[device].lock,0);
2500 write_byte(ebda_seg,&EbdaData->ata.devices[device].mode,ATA_MODE_NONE);
2501 write_word(ebda_seg,&EbdaData->ata.devices[device].blksize,0);
2502 write_byte(ebda_seg,&EbdaData->ata.devices[device].translation,ATA_TRANSLATION_NONE);
2503 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.heads,0);
2504 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.cylinders,0);
2505 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.spt,0);
2506 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.heads,0);
2507 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.cylinders,0);
2508 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.spt,0);
2510 write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_low,0L);
2511 write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_high,0L);
2516 write_byte(ebda_seg,&EbdaData->ata.hdidmap[device],BX_MAX_ATA_DEVICES);
2517 write_byte(ebda_seg,&EbdaData->ata.cdidmap[device],BX_MAX_ATA_DEVICES);
2520 write_byte(ebda_seg,&EbdaData->ata.hdcount,0);
2521 write_byte(ebda_seg,&EbdaData->ata.cdcount,0);
2586 write_byte(ebda_seg,&EbdaData->ata.channels[0].iface,ATA_IFACE_ISA);
2587 write_word(ebda_seg,&EbdaData->ata.channels[0].iobase1,0x1f0);
2588 write_word(ebda_seg,&EbdaData->ata.channels[0].iobase2,0x3f0);
2589 write_byte(ebda_seg,&EbdaData->ata.channels[0].irq,14);
2592 write_byte(ebda_seg,&EbdaData->ata.channels[1].iface,ATA_IFACE_ISA);
2593 write_word(ebda_seg,&EbdaData->ata.channels[1].iobase1,0x170);
2594 write_word(ebda_seg,&EbdaData->ata.channels[1].iobase2,0x370);
2595 write_byte(ebda_seg,&EbdaData->ata.channels[1].irq,15);
2598 write_byte(ebda_seg,&EbdaData->ata.channels[2].iface,ATA_IFACE_ISA);
2599 write_word(ebda_seg,&EbdaData->ata.channels[2].iobase1,0x1e8);
2600 write_word(ebda_seg,&EbdaData->ata.channels[2].iobase2,0x3e0);
2601 write_byte(ebda_seg,&EbdaData->ata.channels[2].irq,12);
2604 write_byte(ebda_seg,&EbdaData->ata.channels[3].iface,ATA_IFACE_ISA);
2605 write_word(ebda_seg,&EbdaData->ata.channels[3].iobase1,0x168);
2606 write_word(ebda_seg,&EbdaData->ata.channels[3].iobase2,0x360);
2607 write_byte(ebda_seg,&EbdaData->ata.channels[3].irq,11);
2624 iobase1 =read_word(ebda_seg,&EbdaData->ata.channels[channel].iobase1);
2625 iobase2 =read_word(ebda_seg,&EbdaData->ata.channels[channel].iobase2);
2644 write_byte(ebda_seg,&EbdaData->ata.devices[device].type,ATA_TYPE_UNKNOWN);
2659 write_byte(ebda_seg,&EbdaData->ata.devices[device].type,ATA_TYPE_ATAPI);
2661 write_byte(ebda_seg,&EbdaData->ata.devices[device].type,ATA_TYPE_ATA);
2663 write_byte(ebda_seg,&EbdaData->ata.devices[device].type,ATA_TYPE_NONE);
2668 type=read_byte(ebda_seg,&EbdaData->ata.devices[device].type);
2680 write_byte(ebda_seg,&EbdaData->ata.devices[device].device,ATA_DEVICE_HD);
2681 write_byte(ebda_seg,&EbdaData->ata.devices[device].mode, ATA_MODE_PIO16);
2704 write_byte(ebda_seg,&EbdaData->ata.devices[device].device,ATA_DEVICE_HD);
2705 write_byte(ebda_seg,&EbdaData->ata.devices[device].removable, removable);
2706 write_byte(ebda_seg,&EbdaData->ata.devices[device].mode, mode);
2707 write_word(ebda_seg,&EbdaData->ata.devices[device].blksize, blksize);
2708 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.heads, heads);
2709 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.cylinders, cylinders);
2710 write_word(ebda_seg,&EbdaData->ata.devices[device].pchs.spt, spt);
2711 write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_low, sectors_low);
2712 write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_high, sectors_high);
2719 write_byte(ebda_seg,&EbdaData->ata.devices[device].translation, translation);
2771 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.heads, heads);
2772 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.cylinders, cylinders);
2773 write_word(ebda_seg,&EbdaData->ata.devices[device].lchs.spt, spt);
2776 write_byte(ebda_seg,&EbdaData->ata.hdidmap[hdcount], device);
2790 write_byte(ebda_seg,&EbdaData->ata.devices[device].device,ATA_DEVICE_CDROM);
2791 write_byte(ebda_seg,&EbdaData->ata.devices[device].mode, ATA_MODE_PIO16);
2803 write_byte(ebda_seg,&EbdaData->ata.devices[device].device, type);
2804 write_byte(ebda_seg,&EbdaData->ata.devices[device].removable, removable);
2805 write_byte(ebda_seg,&EbdaData->ata.devices[device].mode, mode);
2806 write_word(ebda_seg,&EbdaData->ata.devices[device].blksize, blksize);
2809 write_byte(ebda_seg,&EbdaData->ata.cdidmap[cdcount], device);
2820 sizeinmb = (read_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_high) << 21)
2821 | (read_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_low) >> 11);
2864 if(read_byte(ebda_seg,&EbdaData->ata.devices[device].device)==ATA_DEVICE_CDROM)
2877 write_byte(ebda_seg,&EbdaData->ata.hdcount, hdcount);
2878 write_byte(ebda_seg,&EbdaData->ata.cdcount, cdcount);
2907 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
2908 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
2921 type=read_byte(ebda_seg,&EbdaData->ata.devices[device].type);
2976 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
2977 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
2978 mode = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
2984 write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
2985 write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
3076 write_word(ebda_seg, &EbdaData->ata.trsfsectors,current);
3125 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
3126 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
3127 mode = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
3133 write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
3134 write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
3227 write_word(ebda_seg, &EbdaData->ata.trsfsectors,current);
3289 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
3290 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
3291 mode = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
3299 write_word(ebda_seg, &EbdaData->ata.trsfsectors,0);
3300 write_dword(ebda_seg, &EbdaData->ata.trsfbytes,0L);
3510 write_dword(ebda_seg, &EbdaData->ata.trsfbytes,transfer);
3569 if (read_byte(ebda_seg,&EbdaData->ata.devices[device].type) != ATA_TYPE_ATAPI) {
3619 write_dword(ebda_seg,&EbdaData->ata.devices[device].blksize, block_len);
3629 if (sectors != read_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_low))
3631 write_dword(ebda_seg,&EbdaData->ata.devices[device].sectors_low, sectors);
3644 if (read_byte(ebda_seg,&EbdaData->ata.devices[device].type) != ATA_TYPE_ATAPI)
3647 if (read_byte(ebda_seg,&EbdaData->ata.devices[device].device) != ATA_DEVICE_CDROM)
3840 write_byte(ebda_seg, &EbdaData->ata.hdcount, read_byte(ebda_seg, &EbdaData->ata.hdcount) + 1);
5447 device=read_byte(ebda_seg,&EbdaData->ata.hdidmap[GET_ELDL()-0x80]);
5489 nlc = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.cylinders);
5490 nlh = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.heads);
5491 nlspt = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.spt);
5502 nph = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.heads);
5503 npspt = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.spt);
5518 SET_AL(read_word(ebda_seg, &EbdaData->ata.trsfsectors));
5538 nlc = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.cylinders);
5539 nlh = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.heads);
5540 nlspt = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.spt);
5541 count = read_byte(ebda_seg, &EbdaData->ata.hdcount);
5559 status = inb(read_word(ebda_seg, &EbdaData->ata.channels[device/2].iobase1) + ATA_CB_STAT);
5572 nlc = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.cylinders);
5573 nlh = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.heads);
5574 nlspt = read_word(ebda_seg, &EbdaData->ata.devices[device].lchs.spt);
5603 if (lba_high > read_dword(ebda_seg, &EbdaData->ata.devices[device].sectors_high) ) {
5610 if (lba_high == read_dword(ebda_seg, &EbdaData->ata.devices[device].sectors_high)
5611 && lba_low >= read_dword(ebda_seg, &EbdaData->ata.devices[device].sectors_low) ) {
5626 count=read_word(ebda_seg, &EbdaData->ata.trsfsectors);
5659 npc = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.cylinders);
5660 nph = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.heads);
5661 npspt = read_word(ebda_seg, &EbdaData->ata.devices[device].pchs.spt);
5662 lba_low = read_dword(ebda_seg, &EbdaData->ata.devices[device].sectors_low);
5663 lba_high = read_dword(ebda_seg, &EbdaData->ata.devices[device].sectors_high);
5664 blksize = read_word(ebda_seg, &EbdaData->ata.devices[device].blksize);
5692 write_word(DS, SI+(Bit16u)&Int13DPT->dpte_offset, &EbdaData->ata.dpte);
5696 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
5697 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
5698 irq = read_byte(ebda_seg, &EbdaData->ata.channels[channel].irq);
5699 mode = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
5700 translation = read_byte(ebda_seg, &EbdaData->ata.devices[device].translation);
5708 write_word(ebda_seg, &EbdaData->ata.dpte.iobase1, iobase1);
5709 write_word(ebda_seg, &EbdaData->ata.dpte.iobase2, iobase2 + ATA_CB_DC);
5710 write_byte(ebda_seg, &EbdaData->ata.dpte.prefix, (0xe | (device % 2))<<4 );
5711 write_byte(ebda_seg, &EbdaData->ata.dpte.unused, 0xcb );
5712 write_byte(ebda_seg, &EbdaData->ata.dpte.irq, irq );
5713 write_byte(ebda_seg, &EbdaData->ata.dpte.blkcount, 1 );
5714 write_byte(ebda_seg, &EbdaData->ata.dpte.dma, 0 );
5715 write_byte(ebda_seg, &EbdaData->ata.dpte.pio, 0 );
5716 write_word(ebda_seg, &EbdaData->ata.dpte.options, options);
5717 write_word(ebda_seg, &EbdaData->ata.dpte.reserved, 0);
5719 write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x11);
5721 write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x10);
5724 for (i=0; i<15; i++) checksum+=read_byte(ebda_seg, ((Bit8u*)(&EbdaData->ata.dpte)) + i);
5726 write_byte(ebda_seg, &EbdaData->ata.dpte.checksum, checksum);
5735 iface = read_byte(ebda_seg, &EbdaData->ata.channels[channel].iface);
5736 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
5854 device=read_byte(ebda_seg,&EbdaData->ata.cdidmap[GET_ELDL()-0xE0]);
5938 count = (Bit16u)(read_dword(ebda_seg, &EbdaData->ata.trsfbytes) >> 11);
5953 locks = read_byte(ebda_seg, &EbdaData->ata.devices[device].lock);
5962 write_byte(ebda_seg, &EbdaData->ata.devices[device].lock, ++locks);
5971 write_byte(ebda_seg, &EbdaData->ata.devices[device].lock, --locks);
5982 locks = read_byte(ebda_seg, &EbdaData->ata.devices[device].lock);
6024 blksize = read_word(ebda_seg, &EbdaData->ata.devices[device].blksize);
6044 write_word(DS, SI+(Bit16u)&Int13DPT->dpte_offset, &EbdaData->ata.dpte);
6048 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
6049 iobase2 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase2);
6050 irq = read_byte(ebda_seg, &EbdaData->ata.channels[channel].irq);
6051 mode = read_byte(ebda_seg, &EbdaData->ata.devices[device].mode);
6059 write_word(ebda_seg, &EbdaData->ata.dpte.iobase1, iobase1);
6060 write_word(ebda_seg, &EbdaData->ata.dpte.iobase2, iobase2 + ATA_CB_DC);
6061 write_byte(ebda_seg, &EbdaData->ata.dpte.prefix, (0xe | (device % 2))<<4 );
6062 write_byte(ebda_seg, &EbdaData->ata.dpte.unused, 0xcb );
6063 write_byte(ebda_seg, &EbdaData->ata.dpte.irq, irq );
6064 write_byte(ebda_seg, &EbdaData->ata.dpte.blkcount, 1 );
6065 write_byte(ebda_seg, &EbdaData->ata.dpte.dma, 0 );
6066 write_byte(ebda_seg, &EbdaData->ata.dpte.pio, 0 );
6067 write_word(ebda_seg, &EbdaData->ata.dpte.options, options);
6068 write_word(ebda_seg, &EbdaData->ata.dpte.reserved, 0);
6069 write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x11);
6072 for (i=0; i<15; i++) checksum+=read_byte(ebda_seg, ((Bit8u*)(&EbdaData->ata.dpte)) + i);
6074 write_byte(ebda_seg, &EbdaData->ata.dpte.checksum, checksum);
6083 iface = read_byte(ebda_seg, &EbdaData->ata.channels[channel].iface);
6084 iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);