From ab98cf7eab631b550406a9b5e71b4906e173bf03 Mon Sep 17 00:00:00 2001 From: "Marat Zakiyanov (Mario79)" Date: Fri, 24 Oct 2014 05:13:52 +0000 Subject: [PATCH] Support for all IDE controllers (e.g. PCI 0101EE). Previously supported only PCI 01018x. git-svn-id: svn://kolibrios.org@5147 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/detect/init_ata.inc | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/kernel/trunk/detect/init_ata.inc b/kernel/trunk/detect/init_ata.inc index 2df61fdac0..b976ee0ebe 100644 --- a/kernel/trunk/detect/init_ata.inc +++ b/kernel/trunk/detect/init_ata.inc @@ -21,8 +21,10 @@ align 4 jz find_IDE_controller_done mov eax, [esi+PCIDEV.class] - shr eax, 4 - cmp eax, 0x01018 +; shr eax, 4 +; cmp eax, 0x01018 + shr eax, 7 + cmp eax, 0x010180 shr 7 jnz .loop ;-------------------------------------- .found: @@ -362,11 +364,14 @@ Init_IDE_ATA_controller_2: call boot_log ;-------------------------------------- mov eax, [ecx+IDE_DATA.ProgrammingInterface] - cmp ax, 0x0180 - je .pata_ide +; cmp ax, 0x0180 +; je .pata_ide - cmp ax, 0x018a - jne .sata_ide +; cmp ax, 0x018a +; jne .sata_ide + + test al, 1 ; 0 - legacy PCI mode, 1 - native PCI mode + jnz .sata_ide ;-------------------------------------- .pata_ide: cmp [ecx+IDE_DATA.RegsBaseAddres], 0 @@ -382,13 +387,13 @@ Init_IDE_ATA_controller_2: jmp .end_set_interrupts ;-------------------------------------- .sata_ide: - cmp ax, 0x0185 - je .sata_ide_1 +; cmp ax, 0x0185 +; je .sata_ide_1 - cmp ax, 0x018f - jne .end_set_interrupts +; cmp ax, 0x018f +; jne .end_set_interrupts ;-------------------------------------- -.sata_ide_1: +;.sata_ide_1: ; Some weird controllers generate an interrupt even if IDE interrupts ; are disabled and no IDE devices. For example, notebook ASUS K72F - ; IDE controller 010185 generates false interrupt when we work with