Subversion Repositories Kolibri OS

Rev

Rev 750 | Rev 2288 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 750 Rev 802
Line 8... Line 8...
8
;-------------------------------------------------------------------------
8
;-------------------------------------------------------------------------
9
;Loading configuration from ini file
9
;Loading configuration from ini file
10
;    {SPraid.simba}
10
;    {SPraid.simba}
11
;-------------------------------------------------------------------------
11
;-------------------------------------------------------------------------
Line 12... Line 12...
12
 
12
 
Line 13... Line 13...
13
$Revision: 750 $
13
$Revision: 802 $
Line 14... Line 14...
14
 
14
 
Line 15... Line 15...
15
 
15
 
16
conf_path_sect: db 'path',0
16
conf_path_sect: db 'path',0
17
 
17
 
18
conf_fname db '/sys/sys.conf',0
18
conf_fname db '/sys/sys.conf',0
19
 
19
 
-
 
20
; set soke kernel configuration
20
; set soke kernel configuration
21
proc set_kernel_conf
21
proc set_kernel_conf
22
        locals
22
locals
23
          par db 30 dup(?)
-
 
24
        endl
23
  par db 30 dup(?)
25
 
24
endl
26
        pushad
25
  pushad
27
;[gui]
-
 
28
;mouse_speed
26
  ;[gui]
29
 
27
  ;mouse_speed
30
        lea eax,[par]
28
  lea eax,[par]
31
        push eax
29
  push eax
32
        invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed,\
30
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def        
33
              eax,30, ugui_mouse_speed_def
31
  pop eax
34
        pop eax
32
  stdcall strtoint,eax
35
        stdcall strtoint,eax
33
        mov     [mouse_speed_factor], ax
36
        mov     [mouse_speed_factor], ax
-
 
37
 
34
  
38
;mouse_delay
35
  ;mouse_delay
39
        lea eax,[par]
36
  lea eax,[par]
40
        push eax
Line 37... Line -...
37
  push eax
-
 
38
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
-
 
39
  pop eax
-
 
40
  stdcall strtoint,eax
-
 
41
        mov     [mouse_delay], eax
-
 
42
 
-
 
43
  ;[dev]
-
 
44
  ;sb16
-
 
45
  lea eax,[par]
-
 
46
  push eax
-
 
47
  invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def
-
 
48
  pop eax
-
 
49
  stdcall strtoint,eax
-
 
50
        cmp     eax, 0x100
41
        invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay,\
51
        jb      @f
42
               eax,30, ugui_mouse_delay_def
52
        cmp     eax, 0x10000
43
        pop eax
53
        jae     @f
44
        stdcall strtoint,eax
54
        mov     [sb16], eax
45
        mov     [mouse_delay], eax
55
@@:
46
 
56
  
47
 
57
  ;sound_dma
-
 
58
  lea eax,[par]
-
 
59
  push eax
-
 
60
  invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def
-
 
61
  pop eax
48
;midibase
62
  stdcall strtoint,eax
-
 
63
        cmp     eax, 3
-
 
64
        ja      @f
-
 
65
        mov     [sound_dma], eax
-
 
66
@@:
-
 
67
  
-
 
68
  ;midibase
49
        lea eax,[par]
69
  lea eax,[par]
50
        push eax
70
  push eax
51
        invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
71
  invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
52
        pop eax
72
  pop eax
53
        stdcall strtoint,eax
73
  stdcall strtoint,eax
54
 
74
        cmp     eax, 0x100
55
        cmp     eax, 0x100
75
        jb      @f
56
        jb      @f
76
        cmp     eax, 0x10000
57
        cmp     eax, 0x10000
77
        jae     @f
-
 
78
        mov     [midi_base], ax
58
        jae     @f
79
        mov     [mididp], eax
59
        mov     [midi_base], ax
80
        inc     eax
60
        mov     [mididp], eax
Line 81... Line 61...
81
        mov     [midisp], eax
61
        inc     eax
82
@@:
62
        mov     [midisp], eax
83
  
63
@@:
84
  popad
64
        popad
85
  ret
65
        ret
Line 86... Line 66...
86
endp
66
endp
87
 
-
 
88
ugui db 'gui',0
-
 
89
ugui_mouse_speed db 'mouse_speed',0
-
 
90
ugui_mouse_speed_def db '2',0
-
 
91
ugui_mouse_delay db 'mouse_delay',0
67
 
92
ugui_mouse_delay_def db '0x00A',0
68
ugui db 'gui',0
Line 93... Line 69...
93
 
69
ugui_mouse_speed db 'mouse_speed',0
94
udev db 'dev',0
70
ugui_mouse_speed_def db '2',0
95
udev_sb16 db 'sb16',0
71
ugui_mouse_delay db 'mouse_delay',0
96
udev_sb16_def db '0x220',0
72
ugui_mouse_delay_def db '0x00A',0
97
udev_sound_dma db 'sound_dma',0
73
 
98
udev_sound_dma_def db '1',0
74
udev db 'dev',0
99
udev_midibase db 'midibase',0
75
udev_midibase db 'midibase',0
100
udev_midibase_def db '0x320',0
76
udev_midibase_def db '0x320',0
101
 
77
 
102
;set up netvork configuration
78
;set up netvork configuration
103
proc set_network_conf
79
proc set_network_conf
104
locals
80
locals
Line 115... Line 91...
115
        mov     eax, [stack_config]
91
        mov     eax, [stack_config]
116
        and     eax, 0xFFFFFF80
92
        and     eax, 0xFFFFFF80
117
        add     eax, 3
93
        add     eax, 3
118
        mov     [stack_config], eax
94
        mov     [stack_config], eax
119
        call    ash_eth_enable
95
        call    ash_eth_enable
120
  
96
 
121
  ;addr
97
  ;addr
122
  lea eax,[par]
98
  lea eax,[par]
123
  push eax
99
  push eax
124
  invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
100
  invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
125
  pop eax
101
  pop eax
126
  stdcall do_inet_adr,eax
102
  stdcall do_inet_adr,eax
127
        mov     [stack_ip], eax
103
        mov     [stack_ip], eax
128
  
104
 
129
  ;mask
105
  ;mask
130
  lea eax,[par]
106
  lea eax,[par]
131
  push eax
107
  push eax
132
  invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
108
  invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
133
  pop eax
109
  pop eax
134
  stdcall do_inet_adr,eax
110
  stdcall do_inet_adr,eax
135
        mov     [subnet_mask], eax
111
        mov     [subnet_mask], eax
136
  
112
 
137
  ;gate
113
  ;gate
138
  lea eax,[par]
114
  lea eax,[par]
139
  push eax
115
  push eax
140
  invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
116
  invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
141
  pop eax
117
  pop eax
142
  stdcall do_inet_adr,eax
118
  stdcall do_inet_adr,eax
143
        mov     [gateway_ip], eax
119
        mov     [gateway_ip], eax
144
.do_not_set_net: 
120
.do_not_set_net:
145
  popad
121
  popad
146
  ret
122
  ret
Line 147... Line 123...
147
 
123
 
Line 156... Line 132...
156
unet_def db 0
132
unet_def db 0
Line 157... Line 133...
157
 
133
 
158
; convert string to DWord
134
; convert string to DWord
159
proc strtoint stdcall,strs
135
proc strtoint stdcall,strs
160
  pushad
136
  pushad
161
  
137
 
162
  mov eax,[strs]
138
  mov eax,[strs]
163
  inc eax
139
  inc eax
164
  mov bl,[eax]
140
  mov bl,[eax]
165
  cmp bl,'x'
141
  cmp bl,'x'
Line 175... Line 151...
175
  dec eax
151
  dec eax
176
  stdcall strtoint_dec,eax
152
  stdcall strtoint_dec,eax
177
.exit:
153
.exit:
178
  mov [esp+28],eax
154
  mov [esp+28],eax
179
  popad
155
  popad
180
  ret  
156
  ret
181
endp
157
endp
Line 182... Line 158...
182
 
158
 
183
; convert string to DWord for decimal value
159
; convert string to DWord for decimal value
184
proc strtoint_dec stdcall,strs
160
proc strtoint_dec stdcall,strs
Line 204... Line 180...
204
  jmp @b
180
  jmp @b
205
@@:
181
@@:
Line 206... Line 182...
206
 
182
 
Line 207... Line 183...
207
 xchg ebx,ecx
183
 xchg ebx,ecx
208
 
184
 
209
  
-
 
Line -... Line 185...
-
 
185
 
210
  xor ecx,ecx
186
  xor ecx,ecx
211
  
187
 
212
 
188
 
213
@@:  
189
@@:
214
  xor eax,eax
190
  xor eax,eax
215
  lodsb
191
  lodsb
216
  cmp al,0
192
  cmp al,0
217
  je .eend
193
  je .eend
218
  
194
 
219
  sub al,30h
195
  sub al,30h
220
  imul ebx
196
  imul ebx
221
  add ecx,eax
197
  add ecx,eax
222
  push ecx
198
  push ecx
223
  xchg eax,ebx
199
  xchg eax,ebx
224
  mov ecx,10
200
  mov ecx,10
225
  div ecx
201
  div ecx
226
  xchg eax,ebx
202
  xchg eax,ebx
227
  pop ecx
203
  pop ecx
228
  jmp @b
204
  jmp @b
229
  
205
 
230
.eend:
206
.eend:
231
  mov [esp+28],ecx
207
  mov [esp+28],ecx
Line 250... Line 226...
250
  jmp @b
226
  jmp @b
251
@@:
227
@@:
252
  xor ecx,ecx
228
  xor ecx,ecx
253
  mov esi,[strs]
229
  mov esi,[strs]
Line 254... Line 230...
254
 
230
 
255
@@:  
231
@@:
256
  xor eax,eax
232
  xor eax,eax
257
  lodsb
233
  lodsb
258
  cmp al,0
234
  cmp al,0
259
  je .eend
235
  je .eend
260
  
236
 
261
  cmp al,'a'
237
  cmp al,'a'
262
  jae .bm
238
  jae .bm
263
  cmp al,'A'
239
  cmp al,'A'
264
  jae .bb
240
  jae .bb
265
  jmp .cc
241
  jmp .cc
266
.bm:    ; 57h
242
.bm:    ; 57h
267
  sub al,57h
243
  sub al,57h
268
  jmp .do
244
  jmp .do
269
 
245
 
270
.bb:    ; 37h
246
.bb:    ; 37h
271
  sub al,37h
247
  sub al,37h
Line 272... Line 248...
272
  jmp .do
248
  jmp .do
273
 
249
 
274
.cc:    ; 30h
250
.cc:    ; 30h
275
  sub al,30h
251
  sub al,30h
276
  
252
 
277
.do:  
253
.do:
278
  imul ebx
254
  imul ebx
Line 279... Line 255...
279
  add ecx,eax
255
  add ecx,eax
Line 280... Line 256...
280
  shr ebx,4
256
  shr ebx,4
281
 
257
 
282
  jmp @b
258
  jmp @b
283
 
259
 
284
.eend:
260
.eend:
Line 285... Line 261...
285
  mov [esp+28],ecx
261
  mov [esp+28],ecx
286
  popad
262
  popad
287
  ret
263
  ret
288
endp    
264
endp
289
 
265
 
290
 
266
 
291
; convert string to DWord for IP addres
267
; convert string to DWord for IP addres
292
proc do_inet_adr stdcall,strs
268
proc do_inet_adr stdcall,strs
293
  pushad
269
  pushad