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