Subversion Repositories Kolibri OS

Rev

Rev 1376 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1376 Rev 2382
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 1376 $
8
$Revision: 2382 $
9
 
9
 
10
 
10
 
Line 18... Line 18...
18
      test  [DRIVE_DATA+1],byte 0x40
18
        test    [DRIVE_DATA+1], byte 0x40
19
      jz   search_partitions_ide1
19
        jz      search_partitions_ide1
20
        mov   [hdbase],0x1f0
20
        mov     [hdbase], 0x1f0
21
        mov   [hdid],0x0
21
        mov     [hdid], 0x0
22
        mov   [hdpos],1
22
        mov     [hdpos], 1
23
      mov  [fat32part],1
23
        mov     [known_part], 1
24
 search_partitions_ide0_1:
24
 search_partitions_ide0_1:
25
      call  set_FAT32_variables
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
26
      cmp   [problem_partition],0
30
      ;cmp   [problem_partition],0
27
      jne   search_partitions_ide1
31
      ;jne   search_partitions_ide1
28
      inc   byte [DRIVE_DATA+2]
32
        inc     byte [DRIVE_DATA+2]
29
      call  partition_data_transfer
33
        call    partition_data_transfer
30
      add   [transfer_adress],100
34
        add     [transfer_adress], 100
-
 
35
    @@:
31
      inc   [fat32part]
36
        inc     [known_part]
32
      jmp   search_partitions_ide0_1
37
        jmp     search_partitions_ide0_1
Line 33... Line 38...
33
 
38
 
34
 search_partitions_ide1:
39
 search_partitions_ide1:
35
      test  [DRIVE_DATA+1],byte 0x10
40
        test    [DRIVE_DATA+1], byte 0x10
36
      jz   search_partitions_ide2
41
        jz      search_partitions_ide2
37
        mov   [hdbase],0x1f0
42
        mov     [hdbase], 0x1f0
38
        mov   [hdid],0x10
43
        mov     [hdid], 0x10
39
        mov   [hdpos],2
44
        mov     [hdpos], 2
40
      mov  [fat32part],1
45
        mov     [known_part], 1
41
 search_partitions_ide1_1:
46
 search_partitions_ide1_1:
-
 
47
        call    set_PARTITION_variables
-
 
48
        test    [problem_partition], 2
-
 
49
        jnz     search_partitions_ide2
-
 
50
        test    [problem_partition], 1
42
      call  set_FAT32_variables
51
        jnz     @F
43
      cmp   [problem_partition],0
52
      ;cmp   [problem_partition],0
44
      jne   search_partitions_ide2
53
      ;jne   search_partitions_ide2
45
      inc   byte [DRIVE_DATA+3]
54
        inc     byte [DRIVE_DATA+3]
46
      call  partition_data_transfer
55
        call    partition_data_transfer
-
 
56
        add     [transfer_adress], 100
47
      add   [transfer_adress],100
57
    @@:
48
      inc   [fat32part]
58
        inc     [known_part]
Line 49... Line 59...
49
      jmp   search_partitions_ide1_1
59
        jmp     search_partitions_ide1_1
50
 
60
 
51
 search_partitions_ide2:
61
 search_partitions_ide2:
52
      test  [DRIVE_DATA+1],byte 0x4
62
        test    [DRIVE_DATA+1], byte 0x4
53
      jz   search_partitions_ide3
63
        jz      search_partitions_ide3
54
        mov   [hdbase],0x170
64
        mov     [hdbase], 0x170
55
        mov   [hdid],0x0
65
        mov     [hdid], 0x0
56
        mov   [hdpos],3
66
        mov     [hdpos], 3
57
      mov  [fat32part],1
67
        mov     [known_part], 1
-
 
68
 search_partitions_ide2_1:
-
 
69
        call    set_PARTITION_variables
-
 
70
        test    [problem_partition], 2
-
 
71
        jnz     search_partitions_ide3
58
 search_partitions_ide2_1:
72
        test    [problem_partition], 1
59
      call  set_FAT32_variables
73
        jnz     @F
60
      cmp   [problem_partition],0
74
      ;cmp   [problem_partition],0
61
      jne   search_partitions_ide3
75
      ;jne   search_partitions_ide3
62
      inc   byte [DRIVE_DATA+4]
76
        inc     byte [DRIVE_DATA+4]
-
 
77
        call    partition_data_transfer
63
      call  partition_data_transfer
78
        add     [transfer_adress], 100
64
      add   [transfer_adress],100
79
    @@:
Line 65... Line 80...
65
      inc   [fat32part]
80
        inc     [known_part]
66
      jmp   search_partitions_ide2_1
81
        jmp     search_partitions_ide2_1
67
 
82
 
68
 search_partitions_ide3:
83
 search_partitions_ide3:
69
      test  [DRIVE_DATA+1],byte 0x1
84
        test    [DRIVE_DATA+1], byte 0x1
70
      jz   end_search_partitions_ide
85
        jz      end_search_partitions_ide
71
        mov   [hdbase],0x170
86
        mov     [hdbase], 0x170
72
        mov   [hdid],0x10
87
        mov     [hdid], 0x10
73
        mov   [hdpos],4
88
        mov     [hdpos], 4
-
 
89
        mov     [known_part], 1
-
 
90
 search_partitions_ide3_1:
-
 
91
        call    set_PARTITION_variables
-
 
92
        test    [problem_partition], 2
74
      mov  [fat32part],1
93
        jnz     end_search_partitions_ide
75
 search_partitions_ide3_1:
94
        test    [problem_partition], 1
76
      call  set_FAT32_variables
95
        jnz     @F
77
      cmp   [problem_partition],0
96
      ;cmp   [problem_partition],0
78
      jne   end_search_partitions_ide
97
      ;jne   end_search_partitions_ide
-
 
98
        inc     byte [DRIVE_DATA+5]
79
      inc   byte [DRIVE_DATA+5]
99
        call    partition_data_transfer
80
      call  partition_data_transfer
100
        add     [transfer_adress], 100
Line 81... Line 101...
81
      add   [transfer_adress],100
101
    @@:
82
      inc   [fat32part]
102
        inc     [known_part]
83
      jmp   search_partitions_ide3_1
103
        jmp     search_partitions_ide3_1
Line 89... Line 109...
89
        jz      end_search_partitions
109
        jz      end_search_partitions
90
start_search_partitions_bd:
110
start_search_partitions_bd:
91
        push    ecx
111
        push    ecx
92
        mov     eax, [hdpos]
112
        mov     eax, [hdpos]
93
        and     [BiosDiskPartitions+(eax-80h)*4], 0
113
        and     [BiosDiskPartitions+(eax-80h)*4], 0
94
        mov     [fat32part], 1
114
        mov     [known_part], 1
95
search_partitions_bd:
115
search_partitions_bd:
96
        call    set_FAT32_variables
116
        call    set_PARTITION_variables
-
 
117
        test    [problem_partition], 2
-
 
118
        jnz     end_search_partitions_bd
-
 
119
        test    [problem_partition], 1
-
 
120
        jnz     @F
97
        cmp     [problem_partition], 0
121
        ;cmp     [problem_partition], 0
98
        jne     end_search_partitions_bd
122
        ;jne     end_search_partitions_bd
99
        mov     eax, [hdpos]
123
        mov     eax, [hdpos]
100
        inc     [BiosDiskPartitions+(eax-80h)*4]
124
        inc     [BiosDiskPartitions+(eax-80h)*4]
101
        call    partition_data_transfer
125
        call    partition_data_transfer
102
        add     [transfer_adress], 100
126
        add     [transfer_adress], 100
-
 
127
    @@:
103
        inc     [fat32part]
128
        inc     [known_part]
104
        jmp     search_partitions_bd
129
        jmp     search_partitions_bd
105
end_search_partitions_bd:
130
end_search_partitions_bd:
106
        pop     ecx
131
        pop     ecx
107
        inc     [hdpos]
132
        inc     [hdpos]
108
        loop    start_search_partitions_bd
133
        loop    start_search_partitions_bd
109
        jmp     end_search_partitions
134
        jmp     end_search_partitions
Line 110... Line 135...
110
 
135
 
111
partition_data_transfer:
136
partition_data_transfer:
112
     mov edi,[transfer_adress]
137
        mov     edi, [transfer_adress]
113
     mov esi,PARTITION_START
138
        mov     esi, PARTITION_START            ;start of file_system_data
114
     mov ecx,(file_system_data_size+3)/4
139
        mov     ecx, (file_system_data_size+3)/4
115
     rep movsd
140
        rep movsd
116
     ret
141
        ret
117
uglobal
142
uglobal
Line 128... Line 153...
128
;     sti
153
;     sti
129
     ret
154
        ret
Line 130... Line 155...
130
 
155
 
Line 131... Line -...
131
 end_search_partitions:
-
 
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
;
-