Subversion Repositories Kolibri OS

Rev

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

Rev 551 Rev 625
Line 24... Line 24...
24
include 'lang.inc'
24
include 'lang.inc'
25
include '..\..\..\macros.inc'
25
include '..\..\..\macros.inc'
Line 26... Line 26...
26
 
26
 
Line 27... Line 27...
27
START:                          ; start of execution
27
START:                          ; start of execution
28
 
28
 
Line 29... Line 29...
29
    cmp     [PARAMS], byte 0
29
    cmp     [PARAMS], dword 'BOOT'
Line 30... Line 30...
30
    jne     check_parameters
30
    jz      boot_set_settings
31
 
31
 
Line 43... Line 43...
43
    jz   red
43
    jz   red
44
    cmp  eax,2                  ; key in buffer ?
44
    cmp  eax,2                  ; key in buffer ?
45
    jnz  button
45
    jnz  button
Line 46... Line 46...
46
 
46
 
47
  key:                          ; key
47
  key:                          ; key
48
    mov  al,2                  ; just read it and ignore
48
;    mov  al,2                  ; just read it and ignore
49
    mcall
49
    mcall
Line 50... Line 50...
50
    jmp  still
50
    jmp  still
51
 
51
 
52
  button:                       ; button
52
  button:                       ; button
Line 53... Line 53...
53
    mov  al,17                 ; get id
53
    mov  al,17                 ; get id
Line 54... Line 54...
54
    mcall
54
    mcall
55
 
55
 
56
    shr  eax,8
56
    shr  eax,8
57
 
57
 
58
    cmp  eax,1                   ; button id=1 ?
58
    dec  eax                     ; button id=1 ?
Line 59... Line 59...
59
    jne  noclose
59
    jne  noclose
60
    or   eax,-1                 ; close this program
60
    or   eax,-1                 ; close this program
Line 61... Line 61...
61
    mcall
61
    mcall
62
  noclose:
62
  noclose:
63
 
63
 
64
    cmp  eax,2
64
    dec  eax  
Line 65... Line 65...
65
    je   read_stack_setup
65
    je   read_stack_setup
66
 
-
 
67
    cmp  eax,3
-
 
68
    jne  no_apply_stack_setup
-
 
69
    call apply_stack_setup
-
 
70
    jmp  still
-
 
71
 
-
 
72
no_apply_stack_setup:
-
 
73
    cmp  eax,11
-
 
74
    jb   no_set_interface
-
 
75
    cmp  eax,14
-
 
76
    jg   no_set_interface
-
 
77
    sub  eax,11
-
 
78
    mov  [interface],eax
-
 
79
    call draw_window
-
 
80
    jmp  still
-
 
81
   no_set_interface:
-
 
82
 
-
 
83
    cmp  eax,21
-
 
84
    jb   no_ip_sf
-
 
85
    cmp  eax,22
-
 
86
    jg   no_ip_sf
-
 
87
    sub  eax,21
-
 
88
    not  eax
66
 
89
    and  eax,1
-
 
90
    mov  [assigned],eax
-
 
91
    call draw_window
-
 
92
    jmp  still
-
 
93
    no_ip_sf:
-
 
94
 
-
 
95
    cmp  eax,7                ; GET IP
-
 
96
    jne  no_read_ip
-
 
97
    mov  [string_x],205
-
 
98
    mov  [string_y],80
-
 
99
    mov  [string_length],15
-
 
100
    call read_string
-
 
101
    mov   esi,string-1
-
 
102
    mov   edi,ip_address
-
 
103
    xor   eax,eax
-
 
104
   ip1:
-
 
105
    inc   esi
-
 
106
    cmp   [esi],byte '0'
-
 
107
    jb    ip2
-
 
108
    cmp   [esi],byte '9'
-
 
109
    jg    ip2
-
 
110
    imul  eax,10
-
 
111
    movzx ebx,byte [esi]
67
    dec  eax  
112
    sub   ebx,48
-
 
113
    add   eax,ebx
-
 
114
    jmp   ip1
-
 
115
   ip2:
-
 
116
    mov   [edi],al
-
 
117
    xor   eax,eax
-
 
118
    inc   edi
-
 
119
    cmp   edi,ip_address+3
68
    jne  no_apply_stack_setup
120
    jbe   ip1
69
    call apply_stack_setup
121
    call draw_window
70
    jmp  still
122
    jmp  still
71
 
123
   no_read_ip:
72
no_apply_stack_setup:
Line 150... Line 99...
150
    sub  eax,'A'-'9'-1
99
    sub  eax,'A'-'9'-1
151
   gcp3:
100
   gcp3:
152
    sub  eax,48
101
    sub  eax,48
153
    add  ebx,eax
102
    add  ebx,eax
154
    mov  [com_add],ebx
103
    mov  [com_add],ebx
155
    call draw_window
-
 
156
    jmp  still
104
    jmp  red
157
   no_read_comport:
105
   no_read_comport:
Line 158... Line 106...
158
 
106
 
159
    cmp  eax,6                ; GET COM IRQ
107
    dec  eax                  ; GET COM IRQ
160
    jne  no_read_comirq
108
    jne  no_read_comirq
161
    mov  [string_x],284
109
    mov  [string_x],284
162
    mov  [string_y],50
110
    mov  [string_y],50
163
    mov  [string_length],1
111
    mov  [string_length],1
Line 167... Line 115...
167
    jb   gci1
115
    jb   gci1
168
    sub  eax,'A'-'9'-1
116
    sub  eax,'A'-'9'-1
169
   gci1:
117
   gci1:
170
    sub  eax,48
118
    sub  eax,48
171
    mov  [com_irq],eax
119
    mov  [com_irq],eax
172
    call draw_window
-
 
173
    jmp  still
120
    jmp  red
174
    no_read_comirq:
121
    no_read_comirq:
Line -... Line 122...
-
 
122
 
-
 
123
    dec  eax                  ; GET IP
-
 
124
    jne  no_read_ip
-
 
125
    mov  [string_x],205
-
 
126
    mov  [string_y],80
-
 
127
    mov  [string_length],15
-
 
128
    call read_string
-
 
129
    mov   esi,string-1
-
 
130
    mov   edi,ip_address
-
 
131
   ip0:
-
 
132
    xor   eax,eax
-
 
133
   ip1:
-
 
134
    inc   esi
-
 
135
    cmp   [esi],byte '0'
-
 
136
    jb    ip2
-
 
137
    cmp   [esi],byte '9'
-
 
138
    jg    ip2
-
 
139
    imul  eax,10
-
 
140
    movzx ebx,byte [esi]
-
 
141
    sub   ebx,48
-
 
142
    add   eax,ebx
-
 
143
    jmp   ip1
-
 
144
   ip2:
-
 
145
    stosb
-
 
146
    cmp   edi,ip_address+3
-
 
147
    jbe   ip0
-
 
148
    jmp   red
-
 
149
   no_read_ip:
175
 
150
    
176
    cmp     eax, 8              ; set gateway ip
151
    dec     eax                 ; set gateway ip
Line 177... Line 152...
177
    jne     no_set_gateway
152
    jne     no_set_gateway
178
 
153
 
179
    mov  [string_x],205
154
    mov  [string_x],205
180
    mov  [string_y],90
155
    mov  [string_y],90
181
    mov  [string_length],15
156
    mov  [string_length],15
182
    call read_string
157
    call read_string
-
 
158
    mov   esi,string-1
183
    mov   esi,string-1
159
    mov   edi,gateway_ip
184
    mov   edi,gateway_ip
160
   gip0:
185
    xor   eax,eax
161
    xor   eax,eax
186
   gip1:
162
   gip1:
187
    inc   esi
163
    inc   esi
Line 193... Line 169...
193
    movzx ebx,byte [esi]
169
    movzx ebx,byte [esi]
194
    sub   ebx,48
170
    sub   ebx,48
195
    add   eax,ebx
171
    add   eax,ebx
196
    jmp   gip1
172
    jmp   gip1
197
   gip2:
173
   gip2:
198
    mov   [edi],al
-
 
199
    xor   eax,eax
-
 
200
    inc   edi
174
    stosb
201
    cmp   edi,gateway_ip+3
175
    cmp   edi,gateway_ip+3
202
    jbe   gip1
176
    jbe   gip0
203
    call draw_window
-
 
204
 
-
 
205
    jmp     still
177
    jmp   red
Line 206... Line 178...
206
 
178
 
-
 
179
  no_set_gateway:
207
  no_set_gateway:
180
 
208
    cmp     eax, 9
181
    dec     eax
Line 209... Line 182...
209
    jne     no_set_subnet
182
    jne     no_set_subnet
210
 
183
 
211
    mov  [string_x],205
184
    mov  [string_x],205
212
    mov  [string_y],100
185
    mov  [string_y],100
213
    mov  [string_length],15
186
    mov  [string_length],15
214
    call read_string
187
    call read_string
-
 
188
    mov   esi,string-1
215
    mov   esi,string-1
189
    mov   edi,subnet_mask
216
    mov   edi,subnet_mask
190
   sip0:
217
    xor   eax,eax
191
    xor   eax,eax
218
   sip1:
192
   sip1:
219
    inc   esi
193
    inc   esi
Line 225... Line 199...
225
    movzx ebx,byte [esi]
199
    movzx ebx,byte [esi]
226
    sub   ebx,48
200
    sub   ebx,48
227
    add   eax,ebx
201
    add   eax,ebx
228
    jmp   sip1
202
    jmp   sip1
229
   sip2:
203
   sip2:
230
    mov   [edi],al
-
 
231
    xor   eax,eax
-
 
232
    inc   edi
204
    stosb
233
    cmp   edi,subnet_mask+3
205
    cmp   edi,subnet_mask+3
234
    jbe   sip1
206
    jbe   sip0
235
    call  draw_window
-
 
236
 
-
 
237
    jmp     still
207
    jmp   red
Line 238... Line 208...
238
 
208
 
239
  no_set_subnet:
209
  no_set_subnet:
240
    cmp     eax, 10
210
    dec     eax
Line 241... Line 211...
241
    jne     no_set_dns
211
    jne     no_set_dns
242
 
212
 
243
    mov  [string_x],205
213
    mov  [string_x],205
244
    mov  [string_y],110
214
    mov  [string_y],110
245
    mov  [string_length],15
215
    mov  [string_length],15
246
    call read_string
216
    call read_string
-
 
217
    mov   esi,string-1
247
    mov   esi,string-1
218
    mov   edi,dns_ip
248
    mov   edi,dns_ip
219
   dip0:
249
    xor   eax,eax
220
    xor   eax,eax
250
   dip1:
221
   dip1:
251
    inc   esi
222
    inc   esi
Line 257... Line 228...
257
    movzx ebx,byte [esi]
228
    movzx ebx,byte [esi]
258
    sub   ebx,48
229
    sub   ebx,48
259
    add   eax,ebx
230
    add   eax,ebx
260
    jmp   dip1
231
    jmp   dip1
261
   dip2:
232
   dip2:
262
    mov   [edi],al
-
 
263
    xor   eax,eax
-
 
264
    inc   edi
233
    stosb
265
    cmp   edi,dns_ip+3
234
    cmp   edi,dns_ip+3
266
    jbe   dip1
235
    jbe   dip0
267
    call  draw_window
-
 
268
 
-
 
269
    jmp     still
236
    jmp   red
Line 270... Line 237...
270
 
237
 
271
  no_set_dns:
-
 
Line -... Line 238...
-
 
238
  no_set_dns:
-
 
239
 
-
 
240
    dec  eax
-
 
241
    jb   no_set_interface
-
 
242
    cmp  eax,14-11
-
 
243
    ja   no_set_interface
-
 
244
    mov  [interface],eax
Line -... Line 245...
-
 
245
    jmp  red
-
 
246
   no_set_interface:
-
 
247
 
-
 
248
    sub  eax,21-11
-
 
249
    jb   no_ip_sf
-
 
250
    cmp  eax,22-21
-
 
251
    ja   no_ip_sf
-
 
252
    xor  eax,1
-
 
253
    mov  [assigned],eax
Line 272... Line 254...
272
    jmp  still
254
    jmp  red
Line 273... Line 255...
273
 
255
    no_ip_sf:
274
 
256
    jmp  still
Line 316... Line 298...
316
 
298
 
317
    mov  eax,[config]   ; unwrap com PORT
299
    mov  eax,[config]   ; unwrap com PORT
318
    shr  eax,7
300
    shr  eax,7
319
    and  eax,1
301
    and  eax,1
320
    mov  [assigned],eax
-
 
321
 
-
 
322
    call draw_window
-
 
323
 
302
    mov  [assigned],eax
324
    jmp  still
-
 
Line 325... Line 303...
325
 
303
    jmp  red
Line 326... Line 304...
326
 
304
 
327
apply_stack_setup:
305
apply_stack_setup:
Line 361... Line 339...
361
    mov  ebx,2
339
    mov  ebx,2
362
    mov  ecx,[config]
340
    mov  ecx,[config]
363
    mcall
341
    mcall
Line 364... Line 342...
364
 
342
 
365
    ret
-
 
Line 366... Line 343...
366
    jmp  still
343
    ret
367
 
344
 
368
 
345
 
Line 386... Line 363...
386
  f11:
363
  f11:
387
    mov  eax,10
364
    mov  eax,10
388
    mcall
365
    mcall
389
    cmp  eax,2
366
    cmp  eax,2
390
    jne  read_done
367
    jne  read_done
391
    mov  eax,2
368
;    mov  eax,2
392
    mcall
369
    mcall
393
    shr  eax,8
370
    shr  eax,8
394
    cmp  eax,13
371
    cmp  eax,13
395
    je   read_done
372
    je   read_done
396
    cmp  eax,8
373
    cmp  eax,8
Line 417... Line 394...
417
    cmp  esi,edi
394
    cmp  esi,edi
418
    jnz  f11
395
    jnz  f11
Line 419... Line 396...
419
 
396
 
Line 420... Line -...
420
  read_done:
-
 
421
 
-
 
422
    call print_text
-
 
423
 
-
 
424
    ret
-
 
425
 
397
  read_done:
Line 426... Line 398...
426
 
398
 
Line 427... Line 399...
427
print_text:
399
print_text:
Line 605... Line 577...
605
    mov  edx,5
577
    mov  edx,5
606
    mov  esi,[button_color]
578
    mov  esi,[button_color]
607
    mcall
579
    mcall
608
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
580
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
609
    mov  ecx,49*65536+8
581
    mov  ecx,49*65536+8
610
    mov  edx,6
582
    inc  edx
611
    mcall
583
    mcall
612
    ;mov  eax,8                     ; BUTTON 7 : SET IP
584
    ;mov  eax,8                     ; BUTTON 7 : SET IP
613
    mov  ecx,79*65536+8
585
    mov  ecx,79*65536+8
614
    mov  edx,7
586
    inc  edx
615
    mcall
587
    mcall
Line 616... Line 588...
616
 
588
 
617
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
589
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
618
    mov  ebx,299*65536+8
590
    mov  ebx,299*65536+8
619
    mov  ecx,89*65536+8
591
    mov  ecx,89*65536+8
620
    mov  edx,8
592
    inc  edx
Line 621... Line 593...
621
    mcall
593
    mcall
622
 
594
 
623
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
595
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
624
    mov  ecx,99*65536+8
596
    mov  ecx,99*65536+8
Line 625... Line 597...
625
    mov  edx,9
597
    inc  edx
626
    mcall
598
    mcall
627
 
599
 
628
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
600
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
Line 629... Line 601...
629
    mov  ecx,109*65536+8
601
    mov  ecx,109*65536+8
630
    mov  edx,10
602
    inc  edx
631
    mcall
603
    mcall
Line 653... Line 625...
653
 
625
 
Line 654... Line 626...
654
    ret
626
    ret
Line 655... Line -...
655
 
-
 
656
;******************************************************************************
-
 
657
 
-
 
658
check_parameters:
-
 
659
    cmp     [PARAMS], dword "BOOT" ; received BOOT parameter -> goto handler
-
 
660
    je      boot_set_settings
-
 
661
    jmp     no_params
-
 
662
 
627
 
Line 663... Line 628...
663
;******************************************************************************
628
;******************************************************************************
664
 
629
 
665
boot_set_settings:
630
boot_set_settings:
Line 721... Line 686...
721
assigned    dd      0   ; get ip from server
686
assigned    dd      0   ; get ip from server
Line 722... Line 687...
722
 
687
 
Line 723... Line 688...
723
config      dd      0
688
config      dd      0
724
 
-
 
725
I_END:
-