2007-03-26 14:18:08 +02:00
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
;; ;;
|
2008-02-04 16:31:59 +01:00
|
|
|
|
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
|
2007-03-26 14:18:08 +02:00
|
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
|
;; ;;
|
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
2007-07-27 15:52:03 +02:00
|
|
|
|
|
|
|
|
|
$Revision$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;****************************************************
|
2005-10-06 19:56:22 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HDD
|
|
|
|
|
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Mario79
|
|
|
|
|
;****************************************************
|
2007-03-10 17:04:35 +01:00
|
|
|
|
mov [transfer_adress],DRIVE_DATA+0xa
|
2005-10-06 19:56:22 +02:00
|
|
|
|
search_partitions_ide0:
|
2007-03-10 17:04:35 +01:00
|
|
|
|
test [DRIVE_DATA+1],byte 0x40
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jz search_partitions_ide1
|
|
|
|
|
mov [hdbase],0x1f0
|
|
|
|
|
mov [hdid],0x0
|
|
|
|
|
mov [hdpos],1
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov [known_part],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
search_partitions_ide0_1:
|
2010-02-13 14:34:41 +01:00
|
|
|
|
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
|
2007-03-10 17:04:35 +01:00
|
|
|
|
inc byte [DRIVE_DATA+2]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
|
add [transfer_adress],100
|
|
|
|
|
@@:
|
2010-01-23 16:24:03 +01:00
|
|
|
|
inc [known_part]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jmp search_partitions_ide0_1
|
|
|
|
|
|
|
|
|
|
search_partitions_ide1:
|
2007-03-10 17:04:35 +01:00
|
|
|
|
test [DRIVE_DATA+1],byte 0x10
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jz search_partitions_ide2
|
|
|
|
|
mov [hdbase],0x1f0
|
|
|
|
|
mov [hdid],0x10
|
|
|
|
|
mov [hdpos],2
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov [known_part],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
search_partitions_ide1_1:
|
2010-02-13 14:34:41 +01:00
|
|
|
|
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
|
2007-03-10 17:04:35 +01:00
|
|
|
|
inc byte [DRIVE_DATA+3]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
|
add [transfer_adress],100
|
|
|
|
|
@@:
|
2010-01-23 16:24:03 +01:00
|
|
|
|
inc [known_part]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jmp search_partitions_ide1_1
|
|
|
|
|
|
|
|
|
|
search_partitions_ide2:
|
2007-03-10 17:04:35 +01:00
|
|
|
|
test [DRIVE_DATA+1],byte 0x4
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jz search_partitions_ide3
|
|
|
|
|
mov [hdbase],0x170
|
|
|
|
|
mov [hdid],0x0
|
|
|
|
|
mov [hdpos],3
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov [known_part],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
search_partitions_ide2_1:
|
2010-02-13 14:34:41 +01:00
|
|
|
|
call set_PARTITION_variables
|
|
|
|
|
test [problem_partition],2
|
|
|
|
|
jnz search_partitions_ide3
|
|
|
|
|
test [problem_partition],1
|
|
|
|
|
jnz @F
|
|
|
|
|
;cmp [problem_partition],0
|
|
|
|
|
;jne search_partitions_ide3
|
2007-03-10 17:04:35 +01:00
|
|
|
|
inc byte [DRIVE_DATA+4]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
|
add [transfer_adress],100
|
|
|
|
|
@@:
|
2010-01-23 16:24:03 +01:00
|
|
|
|
inc [known_part]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jmp search_partitions_ide2_1
|
|
|
|
|
|
|
|
|
|
search_partitions_ide3:
|
2007-03-10 17:04:35 +01:00
|
|
|
|
test [DRIVE_DATA+1],byte 0x1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jz end_search_partitions_ide
|
|
|
|
|
mov [hdbase],0x170
|
|
|
|
|
mov [hdid],0x10
|
|
|
|
|
mov [hdpos],4
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov [known_part],1
|
2005-10-06 19:56:22 +02:00
|
|
|
|
search_partitions_ide3_1:
|
2010-02-13 14:34:41 +01:00
|
|
|
|
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
|
2007-03-10 17:04:35 +01:00
|
|
|
|
inc byte [DRIVE_DATA+5]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
|
add [transfer_adress],100
|
|
|
|
|
@@:
|
2010-01-23 16:24:03 +01:00
|
|
|
|
inc [known_part]
|
2005-10-06 19:56:22 +02:00
|
|
|
|
jmp search_partitions_ide3_1
|
|
|
|
|
|
2008-02-04 16:31:59 +01:00
|
|
|
|
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
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov [known_part], 1
|
2008-02-04 16:31:59 +01:00
|
|
|
|
search_partitions_bd:
|
2010-02-13 14:34:41 +01:00
|
|
|
|
call set_PARTITION_variables
|
|
|
|
|
test [problem_partition],2
|
|
|
|
|
jnz end_search_partitions_bd
|
|
|
|
|
test [problem_partition],1
|
|
|
|
|
jnz @F
|
|
|
|
|
;cmp [problem_partition], 0
|
|
|
|
|
;jne end_search_partitions_bd
|
2008-02-04 16:31:59 +01:00
|
|
|
|
mov eax, [hdpos]
|
|
|
|
|
inc [BiosDiskPartitions+(eax-80h)*4]
|
|
|
|
|
call partition_data_transfer
|
2010-02-13 14:34:41 +01:00
|
|
|
|
add [transfer_adress], 100
|
|
|
|
|
@@:
|
2010-01-23 16:24:03 +01:00
|
|
|
|
inc [known_part]
|
2008-02-04 16:31:59 +01:00
|
|
|
|
jmp search_partitions_bd
|
|
|
|
|
end_search_partitions_bd:
|
|
|
|
|
pop ecx
|
|
|
|
|
inc [hdpos]
|
|
|
|
|
loop start_search_partitions_bd
|
|
|
|
|
jmp end_search_partitions
|
2007-03-10 17:04:35 +01:00
|
|
|
|
|
|
|
|
|
partition_data_transfer:
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov edi,[transfer_adress]
|
2010-01-23 16:24:03 +01:00
|
|
|
|
mov esi,PARTITION_START ;start of file_system_data
|
2007-02-05 15:20:36 +01:00
|
|
|
|
mov ecx,(file_system_data_size+3)/4
|
|
|
|
|
rep movsd
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
2007-02-05 15:20:36 +01:00
|
|
|
|
uglobal
|
2005-10-06 19:56:22 +02:00
|
|
|
|
transfer_adress dd 0
|
2007-02-05 15:20:36 +01:00
|
|
|
|
endg
|
2005-10-06 19:56:22 +02:00
|
|
|
|
partition_data_transfer_1:
|
2007-02-05 15:20:36 +01:00
|
|
|
|
; cli
|
2005-10-13 07:34:10 +02:00
|
|
|
|
push edi
|
2005-10-06 19:56:22 +02:00
|
|
|
|
mov edi,PARTITION_START
|
|
|
|
|
mov esi,[transfer_adress]
|
2007-02-05 15:20:36 +01:00
|
|
|
|
mov ecx,(file_system_data_size+3)/4
|
|
|
|
|
rep movsd
|
2005-10-13 07:34:10 +02:00
|
|
|
|
pop edi
|
2007-02-05 15:20:36 +01:00
|
|
|
|
; sti
|
2005-10-06 19:56:22 +02:00
|
|
|
|
ret
|
|
|
|
|
|
2010-02-13 14:34:41 +01:00
|
|
|
|
end_search_partitions:
|
|
|
|
|
|