Subversion Repositories Kolibri OS

Rev

Rev 525 | Rev 530 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 525 Rev 529
-
 
1
$Revision$
1
;-------------------------------------------------------------------------
2
;-------------------------------------------------------------------------
2
;
3
;
3
;    ” ©« ª®­ä¨£ãà æ¨¨
4
;    ” ©« ª®­ä¨£ãà æ¨¨
4
;
5
;
5
;
6
;
6
;     SPraid
7
;     SPraid
7
;
8
;
8
;-------------------------------------------------------------------------
9
;-------------------------------------------------------------------------
9
 
10
 
10
conf_file_loaded: db 0			; ä« £ § £à㧪¨ ª®­ä¨£ 
11
conf_file_loaded: db 0			; ä« £ § £à㧪¨ ª®­ä¨£ 
11
conf_path_sect: db 'path',0
12
conf_path_sect: db 'path',0
12
 
13
 
13
conf_fname db '/sys/sys.conf',0
14
conf_fname db '/sys/sys.conf',0
14
 
15
 
15
 
16
 
16
 
17
 
17
proc set_kernel_conf
18
proc set_kernel_conf
18
locals
19
locals
19
  par db 30 dup(?)
20
  par db 30 dup(?)
20
endl
21
endl
21
  pushad
22
  pushad
22
  ;[gui]
23
  ;[gui]
23
  ;mouse_speed
24
  ;mouse_speed
24
  lea eax,[par]
25
  lea eax,[par]
25
  push eax
26
  push eax
26
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def        
27
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_speed, eax,30, ugui_mouse_speed_def        
27
  pop eax
28
  pop eax
28
  stdcall strtoint,eax 
29
  stdcall strtoint,eax 
29
  push eax
30
  push eax
30
  pop edx
31
  pop edx
31
  call _mouse_speed
32
  call _mouse_speed
32
 
33
 
33
  popad
34
  popad
34
  ret
35
  ret
35
  
36
  
36
  ;mouse_delay
37
  ;mouse_delay
37
  lea eax,[par]
38
  lea eax,[par]
38
  push eax
39
  push eax
39
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
40
  invoke ini.get_str,conf_fname, ugui, ugui_mouse_delay, eax,30, ugui_mouse_delay_def
40
  pop eax
41
  pop eax
41
  stdcall strtoint,eax
42
  stdcall strtoint,eax
42
  push eax
43
  push eax
43
  pop edx
44
  pop edx
44
  call _mouse_delay
45
  call _mouse_delay
45
 
46
 
46
  ;[dev]
47
  ;[dev]
47
  ;sb16
48
  ;sb16
48
  lea eax,[par]
49
  lea eax,[par]
49
  push eax
50
  push eax
50
  invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def
51
  invoke ini.get_str,conf_fname, udev, udev_sb16, eax,30, udev_sb16_def
51
  pop eax
52
  pop eax
52
  stdcall strtoint,eax
53
  stdcall strtoint,eax
53
  push eax
54
  push eax
54
  pop ecx
55
  pop ecx
55
  call _sb16
56
  call _sb16
56
  
57
  
57
  ;sound_dma
58
  ;sound_dma
58
  lea eax,[par]
59
  lea eax,[par]
59
  push eax
60
  push eax
60
  invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def
61
  invoke ini.get_str,conf_fname, udev, udev_sound_dma, eax,30, udev_sound_dma_def
61
  pop eax
62
  pop eax
62
  stdcall strtoint,eax
63
  stdcall strtoint,eax
63
  push eax
64
  push eax
64
  pop ecx
65
  pop ecx
65
  call _sound_dma  
66
  call _sound_dma  
66
  
67
  
67
  
68
  
68
  ;midibase
69
  ;midibase
69
  lea eax,[par]
70
  lea eax,[par]
70
  push eax
71
  push eax
71
  invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
72
  invoke ini.get_str,conf_fname, udev, udev_midibase, eax,30, udev_midibase_def
72
  pop eax
73
  pop eax
73
  stdcall strtoint,eax
74
  stdcall strtoint,eax
74
  push eax
75
  push eax
75
  pop ecx
76
  pop ecx
76
  call _midibase
77
  call _midibase
77
 
78
 
78
  
79
  
79
  popad
80
  popad
80
  ret
81
  ret
81
endp
82
endp
82
 
83
 
83
ugui db 'gui',0
84
ugui db 'gui',0
84
ugui_mouse_speed db 'mouse_speed',0
85
ugui_mouse_speed db 'mouse_speed',0
85
ugui_mouse_speed_def db '2',0
86
ugui_mouse_speed_def db '2',0
86
ugui_mouse_delay db 'mouse_delay',0
87
ugui_mouse_delay db 'mouse_delay',0
87
ugui_mouse_delay_def db '0x00A',0
88
ugui_mouse_delay_def db '0x00A',0
88
 
89
 
89
udev db 'dev',0
90
udev db 'dev',0
90
udev_sb16 db 'sb16',0
91
udev_sb16 db 'sb16',0
91
udev_sb16_def db '0x220',0
92
udev_sb16_def db '0x220',0
92
udev_sound_dma db 'sound_dma',0
93
udev_sound_dma db 'sound_dma',0
93
udev_sound_dma_def db '1',0
94
udev_sound_dma_def db '1',0
94
udev_midibase db 'midibase',0
95
udev_midibase db 'midibase',0
95
udev_midibase_def db '0x320',0
96
udev_midibase_def db '0x320',0
96
 
97
 
97
proc set_network_conf
98
proc set_network_conf
98
locals
99
locals
99
  par db 30 dup(?)
100
  par db 30 dup(?)
100
endl
101
endl
101
  pushad
102
  pushad
102
  
103
  
103
  ;[net]
104
  ;[net]
104
  ;active
105
  ;active
105
  lea eax,[par]
106
  lea eax,[par]
106
  invoke ini.get_int,conf_fname, unet, unet_active, 0
107
  invoke ini.get_int,conf_fname, unet, unet_active, 0
107
  or eax,eax
108
  or eax,eax
108
  jz .do_not_set_net
109
  jz .do_not_set_net
109
  call _net_up  
110
  call _net_up  
110
  
111
  
111
  ;addr
112
  ;addr
112
  lea eax,[par]
113
  lea eax,[par]
113
  push eax
114
  push eax
114
  invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
115
  invoke ini.get_str,conf_fname, unet, unet_addr, eax,30, unet_def
115
  pop eax
116
  pop eax
116
  stdcall do_inet_adr,eax
117
  stdcall do_inet_adr,eax
117
  push eax
118
  push eax
118
  pop ecx
119
  pop ecx
119
  call _net_addr
120
  call _net_addr
120
  
121
  
121
  ;mask
122
  ;mask
122
  lea eax,[par]
123
  lea eax,[par]
123
  push eax
124
  push eax
124
  invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
125
  invoke ini.get_str,conf_fname, unet, unet_mask, eax,30, unet_def
125
  pop eax
126
  pop eax
126
  stdcall do_inet_adr,eax
127
  stdcall do_inet_adr,eax
127
  push eax
128
  push eax
128
  pop ecx
129
  pop ecx
129
  call _net_mask  
130
  call _net_mask  
130
  
131
  
131
  ;gate
132
  ;gate
132
  lea eax,[par]
133
  lea eax,[par]
133
  push eax
134
  push eax
134
  invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
135
  invoke ini.get_str,conf_fname, unet, unet_gate, eax,30, unet_def
135
  pop eax
136
  pop eax
136
  stdcall do_inet_adr,eax
137
  stdcall do_inet_adr,eax
137
  push eax
138
  push eax
138
  pop ecx
139
  pop ecx
139
  call _net_gate
140
  call _net_gate
140
.do_not_set_net: 
141
.do_not_set_net: 
141
  popad
142
  popad
142
  ret
143
  ret
143
 
144
 
144
 
145
 
145
endp
146
endp
146
 
147
 
147
unet db 'net',0
148
unet db 'net',0
148
unet_active db 'active',0
149
unet_active db 'active',0
149
unet_addr db 'addr',0
150
unet_addr db 'addr',0
150
unet_mask db 'mask',0
151
unet_mask db 'mask',0
151
unet_gate db 'gate',0
152
unet_gate db 'gate',0
152
unet_def db 0
153
unet_def db 0
153
 
154
 
154
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax (¯® ¢â®à®¬ã ᨬ¢®«ã ®¯à¥¤¥«ï¥â á¨á⥬ã áç¨á«¥­¨ï)
155
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax (¯® ¢â®à®¬ã ᨬ¢®«ã ®¯à¥¤¥«ï¥â á¨á⥬ã áç¨á«¥­¨ï)
155
     
156
     
156
proc strtoint stdcall,strs
157
proc strtoint stdcall,strs
157
  pushad
158
  pushad
158
  
159
  
159
  mov eax,[strs]
160
  mov eax,[strs]
160
  inc eax
161
  inc eax
161
  mov bl,[eax]
162
  mov bl,[eax]
162
  cmp bl,'x'
163
  cmp bl,'x'
163
  je .hex
164
  je .hex
164
  cmp bl,'X'
165
  cmp bl,'X'
165
  je .hex
166
  je .hex
166
  jmp .dec
167
  jmp .dec
167
.hex:
168
.hex:
168
  inc eax
169
  inc eax
169
  stdcall strtoint_hex,eax
170
  stdcall strtoint_hex,eax
170
  jmp .exit
171
  jmp .exit
171
.dec:
172
.dec:
172
  dec eax
173
  dec eax
173
  stdcall strtoint_dec,eax
174
  stdcall strtoint_dec,eax
174
.exit:
175
.exit:
175
  mov [esp+28],eax
176
  mov [esp+28],eax
176
  popad
177
  popad
177
  ret  
178
  ret  
178
endp
179
endp
179
 
180
 
180
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax ¤«ï ¤¥áïâ¨ç­®£®
181
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax ¤«ï ¤¥áïâ¨ç­®£®
181
proc strtoint_dec stdcall,strs
182
proc strtoint_dec stdcall,strs
182
  pushad
183
  pushad
183
  xor edx,edx
184
  xor edx,edx
184
  ; ¯®¨áª ª®­æ 
185
  ; ¯®¨áª ª®­æ 
185
  mov esi,[strs]
186
  mov esi,[strs]
186
@@:
187
@@:
187
  lodsb
188
  lodsb
188
  or al,al
189
  or al,al
189
  jnz @b
190
  jnz @b
190
  mov ebx,esi
191
  mov ebx,esi
191
  mov esi,[strs]
192
  mov esi,[strs]
192
  dec ebx
193
  dec ebx
193
  sub ebx,esi
194
  sub ebx,esi
194
  mov ecx,1
195
  mov ecx,1
195
 
196
 
196
@@:
197
@@:
197
  dec ebx
198
  dec ebx
198
  or ebx,ebx
199
  or ebx,ebx
199
  jz @f
200
  jz @f
200
  imul ecx,ecx,10  ; ¯®à冷ª
201
  imul ecx,ecx,10  ; ¯®à冷ª
201
  jmp @b
202
  jmp @b
202
@@:
203
@@:
203
 
204
 
204
 xchg ebx,ecx
205
 xchg ebx,ecx
205
 
206
 
206
  
207
  
207
  xor ecx,ecx
208
  xor ecx,ecx
208
  
209
  
209
 
210
 
210
@@:  
211
@@:  
211
  xor eax,eax
212
  xor eax,eax
212
  lodsb
213
  lodsb
213
  cmp al,0
214
  cmp al,0
214
  je .eend
215
  je .eend
215
  
216
  
216
  sub al,30h
217
  sub al,30h
217
  imul ebx
218
  imul ebx
218
  add ecx,eax
219
  add ecx,eax
219
  push ecx
220
  push ecx
220
  xchg eax,ebx
221
  xchg eax,ebx
221
  mov ecx,10
222
  mov ecx,10
222
  div ecx
223
  div ecx
223
  xchg eax,ebx
224
  xchg eax,ebx
224
  pop ecx
225
  pop ecx
225
  jmp @b
226
  jmp @b
226
  
227
  
227
.eend:
228
.eend:
228
  mov [esp+28],ecx
229
  mov [esp+28],ecx
229
  popad
230
  popad
230
  ret
231
  ret
231
endp
232
endp
232
 
233
 
233
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax ¤«ï è¥á­ ¤æ â¨à¨ç­®£®
234
; ª®­¢¥à祭¨¥ áâப¨ ¢ DWord ¢ eax ¤«ï è¥á­ ¤æ â¨à¨ç­®£®
234
proc strtoint_hex stdcall,strs
235
proc strtoint_hex stdcall,strs
235
  pushad
236
  pushad
236
  xor edx,edx
237
  xor edx,edx
237
 
238
 
238
  mov esi,[strs]
239
  mov esi,[strs]
239
  mov ebx,1
240
  mov ebx,1
240
  add esi,1
241
  add esi,1
241
 
242
 
242
@@:
243
@@:
243
  lodsb
244
  lodsb
244
  or al,al
245
  or al,al
245
  jz @f
246
  jz @f
246
  shl ebx,4
247
  shl ebx,4
247
  jmp @b
248
  jmp @b
248
@@:
249
@@:
249
  xor ecx,ecx
250
  xor ecx,ecx
250
  mov esi,[strs]
251
  mov esi,[strs]
251
 
252
 
252
@@:  
253
@@:  
253
  xor eax,eax
254
  xor eax,eax
254
  lodsb
255
  lodsb
255
  cmp al,0
256
  cmp al,0
256
  je .eend
257
  je .eend
257
  
258
  
258
  cmp al,'a'
259
  cmp al,'a'
259
  jae .bm
260
  jae .bm
260
  cmp al,'A'
261
  cmp al,'A'
261
  jae .bb
262
  jae .bb
262
  jmp .cc
263
  jmp .cc
263
.bm:    ; 57h
264
.bm:    ; 57h
264
  sub al,57h
265
  sub al,57h
265
  jmp .do
266
  jmp .do
266
 
267
 
267
.bb:    ; 37h
268
.bb:    ; 37h
268
  sub al,37h
269
  sub al,37h
269
  jmp .do
270
  jmp .do
270
 
271
 
271
.cc:    ; 30h
272
.cc:    ; 30h
272
  sub al,30h
273
  sub al,30h
273
  
274
  
274
.do:  
275
.do:  
275
  imul ebx
276
  imul ebx
276
  add ecx,eax
277
  add ecx,eax
277
  shr ebx,4
278
  shr ebx,4
278
 
279
 
279
  jmp @b
280
  jmp @b
280
 
281
 
281
.eend:
282
.eend:
282
  mov [esp+28],ecx
283
  mov [esp+28],ecx
283
  popad
284
  popad
284
  ret
285
  ret
285
endp    
286
endp    
286
 
287
 
287
 
288
 
288
 ; ¯à¥®¡à §®¢ âì  ¤à¥á ¢ â® çâ® ­ ¤ , ¥á«¨ ¯ãáâ® â® ¢¥à­ãâì 0
289
 ; ¯à¥®¡à §®¢ âì  ¤à¥á ¢ â® çâ® ­ ¤ , ¥á«¨ ¯ãáâ® â® ¢¥à­ãâì 0
289
proc do_inet_adr stdcall,strs
290
proc do_inet_adr stdcall,strs
290
  pushad
291
  pushad
291
  
292
  
292
  mov esi,[strs]
293
  mov esi,[strs]
293
  mov ebx,0
294
  mov ebx,0
294
.next:
295
.next:
295
  push esi
296
  push esi
296
@@:
297
@@:
297
  lodsb
298
  lodsb
298
  or al,al
299
  or al,al
299
  jz @f
300
  jz @f
300
  cmp al,'.'
301
  cmp al,'.'
301
  jz @f
302
  jz @f
302
  jmp @b
303
  jmp @b
303
@@:
304
@@:
304
  mov cl, al
305
  mov cl, al
305
  mov [esi-1],byte 0
306
  mov [esi-1],byte 0
306
  ;pop eax
307
  ;pop eax
307
  call strtoint_dec
308
  call strtoint_dec
308
  rol eax,24
309
  rol eax,24
309
  ror ebx,8
310
  ror ebx,8
310
  add ebx,eax
311
  add ebx,eax
311
  or cl,cl
312
  or cl,cl
312
  jz @f
313
  jz @f
313
  jmp .next
314
  jmp .next
314
@@:
315
@@:
315
  mov [esp+28],ebx
316
  mov [esp+28],ebx
316
  popad
317
  popad
317
  ret
318
  ret
318
endp
319
endp
319
 
320
 
320
 
321
 
321
; ãáâ ­®¢ª¨ ¨§ setup
322
; ãáâ ­®¢ª¨ ¨§ setup
322
 
323
 
323
_mouse_speed:
324
_mouse_speed:
324
    mov  eax,18
325
    mov  eax,18
325
    mov  ebx,19
326
    mov  ebx,19
326
    mov  ecx,1
327
    mov  ecx,1
327
    int 0x40
328
    int 0x40
328
 ret
329
 ret
329
 
330
 
330
_mouse_delay:
331
_mouse_delay:
331
    mov  eax,18
332
    mov  eax,18
332
    mov  ebx,19
333
    mov  ebx,19
333
    mov  ecx,3
334
    mov  ecx,3
334
    int 0x40
335
    int 0x40
335
 ret
336
 ret
336
 
337
 
337
_sb16:
338
_sb16:
338
    mov  eax,21
339
    mov  eax,21
339
    mov  ebx,4
340
    mov  ebx,4
340
    int 0x40
341
    int 0x40
341
 ret
342
 ret
342
    
343
    
343
_sound_dma:
344
_sound_dma:
344
    mov  eax,21
345
    mov  eax,21
345
    mov  ebx,10
346
    mov  ebx,10
346
    int 0x40
347
    int 0x40
347
 ret
348
 ret
348
 
349
 
349
 
350
 
350
_midibase:
351
_midibase:
351
    mov  eax,21
352
    mov  eax,21
352
    mov  ebx,1
353
    mov  ebx,1
353
    int 0x40
354
    int 0x40
354
 ret
355
 ret
355
  
356
  
356
_net_addr:
357
_net_addr:
357
    mov eax,52
358
    mov eax,52
358
    mov ebx,3
359
    mov ebx,3
359
    int 0x40
360
    int 0x40
360
 ret
361
 ret
361
 
362
 
362
_net_mask:
363
_net_mask:
363
    mov eax,52
364
    mov eax,52
364
    mov ebx,12
365
    mov ebx,12
365
    int 0x40
366
    int 0x40
366
 ret
367
 ret
367
 
368
 
368
_net_gate:
369
_net_gate:
369
    mov eax,52
370
    mov eax,52
370
    mov ebx,11
371
    mov ebx,11
371
    int 0x40
372
    int 0x40
372
 ret
373
 ret
373
 
374
 
374
_net_up:
375
_net_up:
375
    mov eax,52
376
    mov eax,52
376
    mov ebx,0
377
    mov ebx,0
377
    int 0x40
378
    int 0x40
378
    and eax,0xFFFFFF80
379
    and eax,0xFFFFFF80
379
    add eax,3
380
    add eax,3
380
    mov ecx,eax
381
    mov ecx,eax
381
    
382
    
382
    mov eax,52
383
    mov eax,52
383
    mov ebx,2
384
    mov ebx,2
384
    int 0x40
385
    int 0x40
385
 ret
386
 ret