Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1792 yogev_ezra 1
device_detect: ; f1811
2
    mcall 18,11,1,device_present_buffer
3
    mov   [device_present.rd],1
4
    cmp   [device_present_buffer.fd],0
5
    je	  @f
6
    mov   [device_present.fd],1
7
@@:
8
    mov   al,[device_present_buffer.hd_cd]
9
    test  al,10b
10
    je	  @f
11
    mov   [device_present.cd3],1
12
    jmp   .ide2
13
@@:
14
    test  al,1b
15
    je	  @f
16
    mov   [device_present.hd3],1
17
.ide2:
18
@@:
19
    test  al,1000b
20
    je	  @f
21
    mov   [device_present.cd2],1
22
    jmp   .ide1
23
@@:
24
    test  al,100b
25
    je	  @f
26
    mov   [device_present.hd2],1
27
.ide1:
28
@@:
29
    test  al,100000b
30
    je	  @f
31
    mov   [device_present.cd1],1
32
    jmp   .ide0
33
@@:
34
    test  al,10000b
35
    je	  @f
36
    mov   [device_present.hd1],1
37
.ide0:
38
@@:
39
    test  al,10000000b
40
    je	  @f
41
    mov   [device_present.cd0],1
42
    jmp   .end
43
@@:
44
    test  al,1000000b
45
    je	  @f
46
    mov   [device_present.hd0],1
47
.end:
48
@@:
49
    ret
50
;---------------------------------------------------------------------
51
device_detect_f70:
3755 mario79 52
    mov   ax,[select_disk_char]
53
    mov   [read_folder_2_name],ax
54
    mov   [read_folder_3_name],ax
55
;    mov   eax,left_folder_data_1
56
;    mov   [read_folder_2.return],eax
57
    mcall 70, read_folder_2
1792 yogev_ezra 58
    test  eax,eax
59
    jz    @f
60
    cmp   eax,6
61
    jne   read_folder_error
62
@@:
3755 mario79 63
    mov   [left_folder_block_1],ebx
1792 yogev_ezra 64
    mov   [temp_counter_1],0
65
    mov   [retrieved_devices_table_counter],0
66
.start_temp_counter_1:
67
    imul  esi,[temp_counter_1],304
3755 mario79 68
    add   esi,left_folder_data_1
1792 yogev_ezra 69
    add   esi,32+40   ;[eax+32+40]
3755 mario79 70
    call  copy_folder_name_3
71
;    mov   eax,right_folder_data_1
72
;    mov   [read_folder_3.return],eax
73
    mcall 70, read_folder_3
1792 yogev_ezra 74
    test  eax,eax
75
    jz    @f
76
    cmp   eax,6
77
    jne   read_folder_1_error
78
@@:
3755 mario79 79
    mov   eax,right_folder_data_1
1792 yogev_ezra 80
    cmp   [eax+4],dword 0
81
    je    .continue
3755 mario79 82
    mov   [right_folder_block_1],ebx
1792 yogev_ezra 83
    mov   ebp,0
84
.start_copy_device_patch:
85
    imul  edi,[retrieved_devices_table_counter],10
86
    add   edi,retrieved_devices_table
87
    mov   [edi],byte '/'
88
    inc   edi
89
    imul  esi,[temp_counter_1],304
3755 mario79 90
    add   esi,left_folder_data_1
1792 yogev_ezra 91
    add   esi,32+40  ;[eax+32+40]
92
    call  proc_copy_patch
93
    imul  esi,ebp,304
3755 mario79 94
    add   esi,right_folder_data_1
1792 yogev_ezra 95
    add   esi,32+40   ;[eax+32+40]
96
    mov   [edi-1],byte '/'
97
    call  proc_copy_patch
98
    inc   [retrieved_devices_table_counter]
99
    inc   ebp
3755 mario79 100
    cmp   ebp,[right_folder_block_1]
1792 yogev_ezra 101
    jb	  .start_copy_device_patch
102
.continue:
103
    inc   [temp_counter_1]
104
    mov   eax,[temp_counter_1]
3755 mario79 105
    cmp   eax,[left_folder_block_1]
1792 yogev_ezra 106
    jb	  .start_temp_counter_1
107
    mov   esi,retrieved_devices_table+1
108
    call  copy_folder_name
109
    mov   esi,retrieved_devices_table+3
110
    mov   ecx,0
111
@@:
112
    add   esi,8
113
    cld
114
    lodsw
115
    inc   ecx
116
    cmp   ecx,[retrieved_devices_table_counter]
117
    ja	  @f
118
    cmp   ax,'hd'
119
    jne   @r
120
    sub   esi,2
121
    call  copy_folder_name_1
122
    ret
123
@@:
124
;    mov   [read_folder_1.name+1],dword 0
125
;    mov   [read_folder_1_name+1],dword 0
126
    mov   esi,retrieved_devices_table+1
127
    call  copy_folder_name_1
128
;    mov   [read_folder_1_name],dword '/rd/'
129
;    mov   [read_folder_1_name+4],word '1/'
130
;    mov   [read_folder_1_name+6],byte 0
131
    ret
132
;---------------------------------------------------------------------
133
proc_copy_patch:
134
@@:
135
    cld
136
    lodsb
137
    stosb
138
    cmp   al,0
139
    jne   @r
140
    ret