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