2011-10-14 23:38:50 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2012-03-13 17:51:57 +01:00
|
|
|
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
2011-10-14 23:38:50 +02:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
;****************************************************
|
2013-05-28 00:16:00 +02:00
|
|
|
; поиск логических дисков на обнаруженных HDD
|
|
|
|
; и занесение данных в область таблицы
|
|
|
|
; автор Mario79
|
2011-10-14 23:38:50 +02:00
|
|
|
;****************************************************
|
|
|
|
mov [transfer_adress], DRIVE_DATA+0xa
|
|
|
|
search_partitions_ide0:
|
|
|
|
test [DRIVE_DATA+1], byte 0x40
|
|
|
|
jz search_partitions_ide1
|
2013-06-27 01:35:43 +02:00
|
|
|
mov eax, [hd_address_table]
|
|
|
|
mov [hdbase], eax ;0x1f0
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [hdid], 0x0
|
|
|
|
mov [hdpos], 1
|
|
|
|
mov [known_part], 1
|
|
|
|
search_partitions_ide0_1:
|
|
|
|
call set_PARTITION_variables
|
|
|
|
test [problem_partition], 2
|
|
|
|
jnz search_partitions_ide1 ; not found part
|
|
|
|
test [problem_partition], 1
|
|
|
|
jnz @F ; not found known_part
|
|
|
|
;cmp [problem_partition],0
|
|
|
|
;jne search_partitions_ide1
|
|
|
|
inc byte [DRIVE_DATA+2]
|
|
|
|
call partition_data_transfer
|
|
|
|
add [transfer_adress], 100
|
|
|
|
@@:
|
|
|
|
inc [known_part]
|
|
|
|
jmp search_partitions_ide0_1
|
|
|
|
|
|
|
|
search_partitions_ide1:
|
|
|
|
test [DRIVE_DATA+1], byte 0x10
|
|
|
|
jz search_partitions_ide2
|
2013-06-27 01:35:43 +02:00
|
|
|
mov eax, [hd_address_table]
|
|
|
|
mov [hdbase], eax ;0x1f0
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [hdid], 0x10
|
|
|
|
mov [hdpos], 2
|
|
|
|
mov [known_part], 1
|
|
|
|
search_partitions_ide1_1:
|
|
|
|
call set_PARTITION_variables
|
|
|
|
test [problem_partition], 2
|
|
|
|
jnz search_partitions_ide2
|
|
|
|
test [problem_partition], 1
|
|
|
|
jnz @F
|
|
|
|
;cmp [problem_partition],0
|
|
|
|
;jne search_partitions_ide2
|
|
|
|
inc byte [DRIVE_DATA+3]
|
|
|
|
call partition_data_transfer
|
|
|
|
add [transfer_adress], 100
|
|
|
|
@@:
|
|
|
|
inc [known_part]
|
|
|
|
jmp search_partitions_ide1_1
|
|
|
|
|
|
|
|
search_partitions_ide2:
|
|
|
|
test [DRIVE_DATA+1], byte 0x4
|
|
|
|
jz search_partitions_ide3
|
2013-06-27 01:35:43 +02:00
|
|
|
mov eax, [hd_address_table+16]
|
|
|
|
mov [hdbase], eax ;0x170
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [hdid], 0x0
|
|
|
|
mov [hdpos], 3
|
|
|
|
mov [known_part], 1
|
|
|
|
search_partitions_ide2_1:
|
2010-02-13 14:34:41 +01:00
|
|
|
call set_PARTITION_variables
|
2011-10-14 23:38:50 +02:00
|
|
|
test [problem_partition], 2
|
|
|
|
jnz search_partitions_ide3
|
|
|
|
test [problem_partition], 1
|
|
|
|
jnz @F
|
|
|
|
;cmp [problem_partition],0
|
|
|
|
;jne search_partitions_ide3
|
|
|
|
inc byte [DRIVE_DATA+4]
|
|
|
|
call partition_data_transfer
|
|
|
|
add [transfer_adress], 100
|
|
|
|
@@:
|
|
|
|
inc [known_part]
|
|
|
|
jmp search_partitions_ide2_1
|
|
|
|
|
|
|
|
search_partitions_ide3:
|
|
|
|
test [DRIVE_DATA+1], byte 0x1
|
|
|
|
jz end_search_partitions_ide
|
2013-06-27 01:35:43 +02:00
|
|
|
mov eax, [hd_address_table+16]
|
|
|
|
mov [hdbase], eax ;0x170
|
2011-10-14 23:38:50 +02:00
|
|
|
mov [hdid], 0x10
|
|
|
|
mov [hdpos], 4
|
|
|
|
mov [known_part], 1
|
|
|
|
search_partitions_ide3_1:
|
|
|
|
call set_PARTITION_variables
|
|
|
|
test [problem_partition], 2
|
|
|
|
jnz end_search_partitions_ide
|
|
|
|
test [problem_partition], 1
|
|
|
|
jnz @F
|
|
|
|
;cmp [problem_partition],0
|
|
|
|
;jne end_search_partitions_ide
|
|
|
|
inc byte [DRIVE_DATA+5]
|
|
|
|
call partition_data_transfer
|
|
|
|
add [transfer_adress], 100
|
|
|
|
@@:
|
|
|
|
inc [known_part]
|
|
|
|
jmp search_partitions_ide3_1
|
|
|
|
|
|
|
|
end_search_partitions_ide:
|
|
|
|
mov [hdpos], 80h
|
|
|
|
mov ecx, [NumBiosDisks]
|
|
|
|
test ecx, ecx
|
|
|
|
jz end_search_partitions
|
|
|
|
start_search_partitions_bd:
|
|
|
|
push ecx
|
|
|
|
mov eax, [hdpos]
|
|
|
|
and [BiosDiskPartitions+(eax-80h)*4], 0
|
|
|
|
mov [known_part], 1
|
|
|
|
search_partitions_bd:
|
|
|
|
call set_PARTITION_variables
|
|
|
|
test [problem_partition], 2
|
2010-02-13 14:34:41 +01:00
|
|
|
jnz end_search_partitions_bd
|
2011-10-14 23:38:50 +02:00
|
|
|
test [problem_partition], 1
|
|
|
|
jnz @F
|
|
|
|
;cmp [problem_partition], 0
|
|
|
|
;jne end_search_partitions_bd
|
|
|
|
mov eax, [hdpos]
|
|
|
|
inc [BiosDiskPartitions+(eax-80h)*4]
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
add [transfer_adress], 100
|
2011-10-14 23:38:50 +02:00
|
|
|
@@:
|
|
|
|
inc [known_part]
|
|
|
|
jmp search_partitions_bd
|
|
|
|
end_search_partitions_bd:
|
|
|
|
pop ecx
|
|
|
|
inc [hdpos]
|
|
|
|
loop start_search_partitions_bd
|
|
|
|
jmp end_search_partitions
|
|
|
|
|
2012-04-23 11:19:34 +02:00
|
|
|
problem_partition db 0 ; used for partitions search
|
|
|
|
|
|
|
|
include '../fs/part_set.inc'
|
|
|
|
|
2011-10-14 23:38:50 +02:00
|
|
|
partition_data_transfer:
|
|
|
|
mov edi, [transfer_adress]
|
|
|
|
mov esi, PARTITION_START ;start of file_system_data
|
|
|
|
mov ecx, (file_system_data_size+3)/4
|
|
|
|
rep movsd
|
|
|
|
ret
|
|
|
|
uglobal
|
|
|
|
transfer_adress dd 0
|
|
|
|
endg
|
|
|
|
partition_data_transfer_1:
|
|
|
|
; cli
|
|
|
|
push edi
|
|
|
|
mov edi, PARTITION_START
|
|
|
|
mov esi, [transfer_adress]
|
|
|
|
mov ecx, (file_system_data_size+3)/4
|
|
|
|
rep movsd
|
|
|
|
pop edi
|
|
|
|
; sti
|
|
|
|
ret
|
|
|
|
|
2010-02-13 14:34:41 +01:00
|
|
|
end_search_partitions:
|
|
|
|
|