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