]> Zhao Yanbai Git Server - kernel.git/commitdiff
在读硬盘IDENTIFY的时候禁止硬盘触发中断
authoracevest <zhaoyanbai@126.com>
Sun, 14 Nov 2021 13:10:11 +0000 (21:10 +0800)
committeracevest <zhaoyanbai@126.com>
Sun, 14 Nov 2021 13:10:11 +0000 (21:10 +0800)
drivers/ata.c

index 5ccdbbfea72e3fc4f51f2f3d756eca9f991475a4..20a03610234ecb8fc160f92ac0d8142fc933d0bd 100644 (file)
@@ -39,6 +39,7 @@ void ata_test(uint64_t nr) {
 u16 identify[256];
 void ata_read_identify(int dev) {  // 这里所用的dev是逻辑编号 ATA0、ATA1下的Master、Salve的dev分别为0,1,2,3
 
+    outb(ATA_CTL_NIEN, REG_CTL(dev));                   // 在读IDENTIFY的时候禁用硬盘中断
     outb(0x00 | ((dev & 0x01) << 4), REG_DEVICE(dev));  // 根据文档P113,这里不用指定bit5, bit7,直接指示DRIVE就行
     outb(ATA_CMD_IDENTIFY, REG_CMD(dev));
     while (1) {