Rev 2434 | Rev 2987 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
431 | serge | 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
||
2465 | Serge | 3 | ;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; |
431 | serge | 4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
||
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
593 | mikedld | 7 | |
8 | $Revision: 2465 $ |
||
9 | |||
10 | |||
11 | ;**************************************************** |
||
1 | ha | 12 | ; поиск логических дисков на обнаруженных HDD |
13 | ; и занесение данных в область таблицы |
||
14 | ; автор Mario79 |
||
15 | ;**************************************************** |
||
2434 | Serge | 16 | mov [transfer_adress], DRIVE_DATA+0xa |
1 | ha | 17 | search_partitions_ide0: |
2434 | Serge | 18 | test [DRIVE_DATA+1], byte 0x40 |
19 | jz search_partitions_ide1 |
||
20 | mov [hdbase], 0x1f0 |
||
21 | mov [hdid], 0x0 |
||
22 | mov [hdpos], 1 |
||
23 | mov [known_part], 1 |
||
1 | ha | 24 | search_partitions_ide0_1: |
2434 | Serge | 25 | call set_PARTITION_variables |
26 | test [problem_partition], 2 |
||
27 | jnz search_partitions_ide1 ; not found part |
||
28 | test [problem_partition], 1 |
||
29 | jnz @F ; not found known_part |
||
1410 | turbanoff | 30 | ;cmp [problem_partition],0 |
31 | ;jne search_partitions_ide1 |
||
2434 | Serge | 32 | inc byte [DRIVE_DATA+2] |
33 | call partition_data_transfer |
||
34 | add [transfer_adress], 100 |
||
1410 | turbanoff | 35 | @@: |
2434 | Serge | 36 | inc [known_part] |
37 | jmp search_partitions_ide0_1 |
||
1 | ha | 38 | |
39 | search_partitions_ide1: |
||
2434 | Serge | 40 | test [DRIVE_DATA+1], byte 0x10 |
41 | jz search_partitions_ide2 |
||
42 | mov [hdbase], 0x1f0 |
||
43 | mov [hdid], 0x10 |
||
44 | mov [hdpos], 2 |
||
45 | mov [known_part], 1 |
||
1 | ha | 46 | search_partitions_ide1_1: |
2434 | Serge | 47 | call set_PARTITION_variables |
48 | test [problem_partition], 2 |
||
49 | jnz search_partitions_ide2 |
||
50 | test [problem_partition], 1 |
||
51 | jnz @F |
||
1410 | turbanoff | 52 | ;cmp [problem_partition],0 |
53 | ;jne search_partitions_ide2 |
||
2434 | Serge | 54 | inc byte [DRIVE_DATA+3] |
55 | call partition_data_transfer |
||
56 | add [transfer_adress], 100 |
||
1410 | turbanoff | 57 | @@: |
2434 | Serge | 58 | inc [known_part] |
59 | jmp search_partitions_ide1_1 |
||
1 | ha | 60 | |
61 | search_partitions_ide2: |
||
2434 | Serge | 62 | test [DRIVE_DATA+1], byte 0x4 |
63 | jz search_partitions_ide3 |
||
64 | mov [hdbase], 0x170 |
||
65 | mov [hdid], 0x0 |
||
66 | mov [hdpos], 3 |
||
67 | mov [known_part], 1 |
||
1 | ha | 68 | search_partitions_ide2_1: |
2434 | Serge | 69 | call set_PARTITION_variables |
70 | test [problem_partition], 2 |
||
71 | jnz search_partitions_ide3 |
||
72 | test [problem_partition], 1 |
||
73 | jnz @F |
||
1410 | turbanoff | 74 | ;cmp [problem_partition],0 |
75 | ;jne search_partitions_ide3 |
||
2434 | Serge | 76 | inc byte [DRIVE_DATA+4] |
77 | call partition_data_transfer |
||
78 | add [transfer_adress], 100 |
||
1410 | turbanoff | 79 | @@: |
2434 | Serge | 80 | inc [known_part] |
81 | jmp search_partitions_ide2_1 |
||
1 | ha | 82 | |
83 | search_partitions_ide3: |
||
2434 | Serge | 84 | test [DRIVE_DATA+1], byte 0x1 |
85 | jz end_search_partitions_ide |
||
86 | mov [hdbase], 0x170 |
||
87 | mov [hdid], 0x10 |
||
88 | mov [hdpos], 4 |
||
89 | mov [known_part], 1 |
||
1 | ha | 90 | search_partitions_ide3_1: |
2434 | Serge | 91 | call set_PARTITION_variables |
92 | test [problem_partition], 2 |
||
93 | jnz end_search_partitions_ide |
||
94 | test [problem_partition], 1 |
||
95 | jnz @F |
||
1410 | turbanoff | 96 | ;cmp [problem_partition],0 |
97 | ;jne end_search_partitions_ide |
||
2434 | Serge | 98 | inc byte [DRIVE_DATA+5] |
99 | call partition_data_transfer |
||
100 | add [transfer_adress], 100 |
||
1410 | turbanoff | 101 | @@: |
2434 | Serge | 102 | inc [known_part] |
103 | jmp search_partitions_ide3_1 |
||
1 | ha | 104 | |
709 | diamond | 105 | end_search_partitions_ide: |
106 | mov [hdpos], 80h |
||
107 | mov ecx, [NumBiosDisks] |
||
108 | test ecx, ecx |
||
109 | jz end_search_partitions |
||
110 | start_search_partitions_bd: |
||
111 | push ecx |
||
112 | mov eax, [hdpos] |
||
113 | and [BiosDiskPartitions+(eax-80h)*4], 0 |
||
1378 | turbanoff | 114 | mov [known_part], 1 |
709 | diamond | 115 | search_partitions_bd: |
2434 | Serge | 116 | call set_PARTITION_variables |
117 | test [problem_partition], 2 |
||
118 | jnz end_search_partitions_bd |
||
119 | test [problem_partition], 1 |
||
1410 | turbanoff | 120 | jnz @F |
121 | ;cmp [problem_partition], 0 |
||
122 | ;jne end_search_partitions_bd |
||
709 | diamond | 123 | mov eax, [hdpos] |
124 | inc [BiosDiskPartitions+(eax-80h)*4] |
||
125 | call partition_data_transfer |
||
2434 | Serge | 126 | add [transfer_adress], 100 |
1410 | turbanoff | 127 | @@: |
1378 | turbanoff | 128 | inc [known_part] |
709 | diamond | 129 | jmp search_partitions_bd |
130 | end_search_partitions_bd: |
||
131 | pop ecx |
||
132 | inc [hdpos] |
||
133 | loop start_search_partitions_bd |
||
134 | jmp end_search_partitions |
||
412 | serge | 135 | |
136 | partition_data_transfer: |
||
2434 | Serge | 137 | mov edi, [transfer_adress] |
138 | mov esi, PARTITION_START ;start of file_system_data |
||
139 | mov ecx, (file_system_data_size+3)/4 |
||
140 | rep movsd |
||
141 | ret |
||
321 | diamond | 142 | uglobal |
1 | ha | 143 | transfer_adress dd 0 |
321 | diamond | 144 | endg |
1 | ha | 145 | partition_data_transfer_1: |
321 | diamond | 146 | ; cli |
2434 | Serge | 147 | push edi |
148 | mov edi, PARTITION_START |
||
149 | mov esi, [transfer_adress] |
||
150 | mov ecx, (file_system_data_size+3)/4 |
||
151 | rep movsd |
||
152 | pop edi |
||
321 | diamond | 153 | ; sti |
2434 | Serge | 154 | ret |
1 | ha | 155 | |
2434 | Serge | 156 | end_search_partitions: |
157 |