static BOOL do_harddisk_read() { #if 0 static rgb_t color = { 0xff, 0xff, 0x66 }; static s32 x = 10; static s32 y = 10; draw_dec(hd_sect_to_read, x, y, color); x += 36; if (x >= 1000) { x = 0; y += 16; } #endif /* read from harddisk */ io_insl(HD_PORT_DATA, hd_read_buffer, 1 << 7); hd_read_buffer += 512; hd_sect_to_read--; /* 设置EOI,通知中断结束,以接收下一次中断 */ io_outb(0x20, 0x20); io_outb(0x20, 0xa0); return TRUE; }
static void ata_data_in(void *buf, unsigned count) { CLI_CRIT_BEGIN(1); io_insl(0x1f0, buf, count * SECTSIZE/4); CLI_CRIT_END(1); }