Subversion Repositories Kolibri OS

Rev

Rev 1378 | Rev 2288 | 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: 1410 $
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:
1410 turbanoff 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
30
      ;cmp   [problem_partition],0
31
      ;jne   search_partitions_ide1
412 serge 32
      inc   byte [DRIVE_DATA+2]
1 ha 33
      call  partition_data_transfer
1410 turbanoff 34
      add   [transfer_adress],100
35
    @@:
1378 turbanoff 36
      inc   [known_part]
1 ha 37
      jmp   search_partitions_ide0_1
38
 
39
 search_partitions_ide1:
412 serge 40
      test  [DRIVE_DATA+1],byte 0x10
1 ha 41
      jz   search_partitions_ide2
42
        mov   [hdbase],0x1f0
43
        mov   [hdid],0x10
44
        mov   [hdpos],2
1378 turbanoff 45
      mov  [known_part],1
1 ha 46
 search_partitions_ide1_1:
1410 turbanoff 47
      call  set_PARTITION_variables
48
      test  [problem_partition],2
49
      jnz   search_partitions_ide2
50
      test  [problem_partition],1
51
      jnz   @F
52
      ;cmp   [problem_partition],0
53
      ;jne   search_partitions_ide2
412 serge 54
      inc   byte [DRIVE_DATA+3]
1 ha 55
      call  partition_data_transfer
1410 turbanoff 56
      add   [transfer_adress],100
57
    @@:
1378 turbanoff 58
      inc   [known_part]
1 ha 59
      jmp   search_partitions_ide1_1
60
 
61
 search_partitions_ide2:
412 serge 62
      test  [DRIVE_DATA+1],byte 0x4
1 ha 63
      jz   search_partitions_ide3
64
        mov   [hdbase],0x170
65
        mov   [hdid],0x0
66
        mov   [hdpos],3
1378 turbanoff 67
      mov  [known_part],1
1 ha 68
 search_partitions_ide2_1:
1410 turbanoff 69
      call  set_PARTITION_variables
70
      test  [problem_partition],2
71
      jnz   search_partitions_ide3
72
      test  [problem_partition],1
73
      jnz   @F
74
      ;cmp   [problem_partition],0
75
      ;jne   search_partitions_ide3
412 serge 76
      inc   byte [DRIVE_DATA+4]
1 ha 77
      call  partition_data_transfer
1410 turbanoff 78
      add   [transfer_adress],100
79
    @@:
1378 turbanoff 80
      inc   [known_part]
1 ha 81
      jmp   search_partitions_ide2_1
82
 
83
 search_partitions_ide3:
412 serge 84
      test  [DRIVE_DATA+1],byte 0x1
1 ha 85
      jz   end_search_partitions_ide
86
        mov   [hdbase],0x170
87
        mov   [hdid],0x10
88
        mov   [hdpos],4
1378 turbanoff 89
      mov  [known_part],1
1 ha 90
 search_partitions_ide3_1:
1410 turbanoff 91
      call  set_PARTITION_variables
92
      test  [problem_partition],2
93
      jnz   end_search_partitions_ide
94
      test  [problem_partition],1
95
      jnz   @F
96
      ;cmp   [problem_partition],0
97
      ;jne   end_search_partitions_ide
412 serge 98
      inc   byte [DRIVE_DATA+5]
1 ha 99
      call  partition_data_transfer
1410 turbanoff 100
      add   [transfer_adress],100
101
    @@:
1378 turbanoff 102
      inc   [known_part]
1 ha 103
      jmp   search_partitions_ide3_1
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:
1410 turbanoff 116
        call    set_PARTITION_variables
117
        test    [problem_partition],2
118
        jnz     end_search_partitions_bd
119
        test    [problem_partition],1
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
1410 turbanoff 126
        add     [transfer_adress], 100
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:
1 ha 137
     mov edi,[transfer_adress]
1378 turbanoff 138
     mov esi,PARTITION_START			;start of file_system_data
321 diamond 139
     mov ecx,(file_system_data_size+3)/4
140
     rep movsd
1 ha 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
5 halyavin 147
     push edi
1 ha 148
     mov edi,PARTITION_START
149
     mov esi,[transfer_adress]
321 diamond 150
     mov ecx,(file_system_data_size+3)/4
151
     rep movsd
5 halyavin 152
     pop  edi
321 diamond 153
;     sti
1 ha 154
     ret
155
 
1410 turbanoff 156
 end_search_partitions:
157