Subversion Repositories Kolibri OS

Rev

Rev 2 | Rev 321 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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