Subversion Repositories Kolibri OS

Rev

Rev 3555 | Rev 3908 | 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: 3725 $
9
 
10
 
11
;****************************************************
3555 Serge 12
;     поиск логических дисков на обнаруженных HDD
13
;     и занесение данных в область таблицы
14
;     автор Mario79
1 ha 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
3725 Serge 20
        mov     eax, [hd_address_table]
21
        mov     [hdbase], eax   ;0x1f0
2434 Serge 22
        mov     [hdid], 0x0
23
        mov     [hdpos], 1
24
        mov     [known_part], 1
1 ha 25
 search_partitions_ide0_1:
2434 Serge 26
        call    set_PARTITION_variables
27
        test    [problem_partition], 2
28
        jnz     search_partitions_ide1  ; not found part
29
        test    [problem_partition], 1
30
        jnz     @F                      ; not found known_part
1410 turbanoff 31
      ;cmp   [problem_partition],0
32
      ;jne   search_partitions_ide1
2434 Serge 33
        inc     byte [DRIVE_DATA+2]
34
        call    partition_data_transfer
35
        add     [transfer_adress], 100
1410 turbanoff 36
    @@:
2434 Serge 37
        inc     [known_part]
38
        jmp     search_partitions_ide0_1
1 ha 39
 
40
 search_partitions_ide1:
2434 Serge 41
        test    [DRIVE_DATA+1], byte 0x10
42
        jz      search_partitions_ide2
3725 Serge 43
        mov     eax, [hd_address_table]
44
        mov     [hdbase], eax   ;0x1f0
2434 Serge 45
        mov     [hdid], 0x10
46
        mov     [hdpos], 2
47
        mov     [known_part], 1
1 ha 48
 search_partitions_ide1_1:
2434 Serge 49
        call    set_PARTITION_variables
50
        test    [problem_partition], 2
51
        jnz     search_partitions_ide2
52
        test    [problem_partition], 1
53
        jnz     @F
1410 turbanoff 54
      ;cmp   [problem_partition],0
55
      ;jne   search_partitions_ide2
2434 Serge 56
        inc     byte [DRIVE_DATA+3]
57
        call    partition_data_transfer
58
        add     [transfer_adress], 100
1410 turbanoff 59
    @@:
2434 Serge 60
        inc     [known_part]
61
        jmp     search_partitions_ide1_1
1 ha 62
 
63
 search_partitions_ide2:
2434 Serge 64
        test    [DRIVE_DATA+1], byte 0x4
65
        jz      search_partitions_ide3
3725 Serge 66
        mov     eax, [hd_address_table+16]
67
        mov     [hdbase], eax   ;0x170
2434 Serge 68
        mov     [hdid], 0x0
69
        mov     [hdpos], 3
70
        mov     [known_part], 1
1 ha 71
 search_partitions_ide2_1:
2434 Serge 72
        call    set_PARTITION_variables
73
        test    [problem_partition], 2
74
        jnz     search_partitions_ide3
75
        test    [problem_partition], 1
76
        jnz     @F
1410 turbanoff 77
      ;cmp   [problem_partition],0
78
      ;jne   search_partitions_ide3
2434 Serge 79
        inc     byte [DRIVE_DATA+4]
80
        call    partition_data_transfer
81
        add     [transfer_adress], 100
1410 turbanoff 82
    @@:
2434 Serge 83
        inc     [known_part]
84
        jmp     search_partitions_ide2_1
1 ha 85
 
86
 search_partitions_ide3:
2434 Serge 87
        test    [DRIVE_DATA+1], byte 0x1
88
        jz      end_search_partitions_ide
3725 Serge 89
        mov     eax, [hd_address_table+16]
90
        mov     [hdbase], eax   ;0x170
2434 Serge 91
        mov     [hdid], 0x10
92
        mov     [hdpos], 4
93
        mov     [known_part], 1
1 ha 94
 search_partitions_ide3_1:
2434 Serge 95
        call    set_PARTITION_variables
96
        test    [problem_partition], 2
97
        jnz     end_search_partitions_ide
98
        test    [problem_partition], 1
99
        jnz     @F
1410 turbanoff 100
      ;cmp   [problem_partition],0
101
      ;jne   end_search_partitions_ide
2434 Serge 102
        inc     byte [DRIVE_DATA+5]
103
        call    partition_data_transfer
104
        add     [transfer_adress], 100
1410 turbanoff 105
    @@:
2434 Serge 106
        inc     [known_part]
107
        jmp     search_partitions_ide3_1
1 ha 108
 
709 diamond 109
end_search_partitions_ide:
110
        mov     [hdpos], 80h
111
        mov     ecx, [NumBiosDisks]
112
        test    ecx, ecx
113
        jz      end_search_partitions
114
start_search_partitions_bd:
115
        push    ecx
116
        mov     eax, [hdpos]
117
        and     [BiosDiskPartitions+(eax-80h)*4], 0
1378 turbanoff 118
        mov     [known_part], 1
709 diamond 119
search_partitions_bd:
2434 Serge 120
        call    set_PARTITION_variables
121
        test    [problem_partition], 2
122
        jnz     end_search_partitions_bd
123
        test    [problem_partition], 1
1410 turbanoff 124
        jnz     @F
125
        ;cmp     [problem_partition], 0
126
        ;jne     end_search_partitions_bd
709 diamond 127
        mov     eax, [hdpos]
128
        inc     [BiosDiskPartitions+(eax-80h)*4]
129
        call    partition_data_transfer
2434 Serge 130
        add     [transfer_adress], 100
1410 turbanoff 131
    @@:
1378 turbanoff 132
        inc     [known_part]
709 diamond 133
        jmp     search_partitions_bd
134
end_search_partitions_bd:
135
        pop     ecx
136
        inc     [hdpos]
137
        loop    start_search_partitions_bd
138
        jmp     end_search_partitions
412 serge 139
 
2987 Serge 140
problem_partition db 0  ; used for partitions search
141
 
142
include  '../fs/part_set.inc'
143
 
412 serge 144
partition_data_transfer:
2434 Serge 145
        mov     edi, [transfer_adress]
146
        mov     esi, PARTITION_START            ;start of file_system_data
147
        mov     ecx, (file_system_data_size+3)/4
148
        rep movsd
149
        ret
321 diamond 150
uglobal
1 ha 151
transfer_adress dd 0
321 diamond 152
endg
1 ha 153
partition_data_transfer_1:
321 diamond 154
;     cli
2434 Serge 155
        push    edi
156
        mov     edi, PARTITION_START
157
        mov     esi, [transfer_adress]
158
        mov     ecx, (file_system_data_size+3)/4
159
        rep movsd
160
        pop     edi
321 diamond 161
;     sti
2434 Serge 162
        ret
1 ha 163
 
2434 Serge 164
 end_search_partitions:
165