Stackcfg now has Russian interface

git-svn-id: svn://kolibrios.org@664 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
ataualpa 2007-10-22 18:43:00 +00:00
parent 81e27e05e7
commit 94cec78ecd

View File

@ -8,69 +8,69 @@
memsize = 100000h memsize = 100000h
org 0 org 0
PARAMS = memsize - 1024 PARAMS = memsize - 1024
use32 use32
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; header version dd 0x01 ; header version
dd START ; start of code dd START ; start of code
dd I_END ; size of image dd I_END ; size of image
dd memsize ; memory for app dd memsize ; memory for app
dd memsize - 1024 ; esp dd memsize - 1024 ; esp
dd PARAMS , 0x0 ; I_Param , I_Icon dd PARAMS , 0x0 ; I_Param , I_Icon
include 'lang.inc' include 'lang.inc'
include '..\..\..\macros.inc' include 'macros.inc'
START: ; start of execution START: ; start of execution
cmp [PARAMS], dword 'BOOT' cmp [PARAMS], dword 'BOOT'
jz boot_set_settings jz boot_set_settings
no_params: no_params:
red: red:
call draw_window ; at first, draw the window call draw_window ; at first, draw the window
still: still:
mov eax,10 ; wait here for event mov eax,10 ; wait here for event
mcall mcall
cmp eax,1 ; redraw request ? cmp eax,1 ; redraw request ?
jz red jz red
cmp eax,2 ; key in buffer ? cmp eax,2 ; key in buffer ?
jnz button jnz button
key: ; key key: ; key
; mov al,2 ; just read it and ignore ; mov al,2 ; just read it and ignore
mcall mcall
jmp still jmp still
button: ; button button: ; button
mov al,17 ; get id mov al,17 ; get id
mcall mcall
shr eax,8 shr eax,8
dec eax ; button id=1 ? dec eax ; button id=1 ?
jne noclose jne noclose
or eax,-1 ; close this program or eax,-1 ; close this program
mcall mcall
noclose: noclose:
dec eax dec eax
je read_stack_setup je read_stack_setup
dec eax dec eax
jne no_apply_stack_setup jne no_apply_stack_setup
call apply_stack_setup call apply_stack_setup
jmp still jmp still
no_apply_stack_setup: no_apply_stack_setup:
dec eax ; GET COM PORT dec eax ; GET COM PORT
dec eax dec eax
jne no_read_comport jne no_read_comport
mov [string_x],272 mov [string_x],272
@ -79,7 +79,7 @@ no_apply_stack_setup:
call read_string call read_string
movzx eax,byte [string] movzx eax,byte [string]
cmp eax,'A' cmp eax,'A'
jb gcp1 jb gcp1
sub eax,'A'-'9'-1 sub eax,'A'-'9'-1
gcp1: gcp1:
sub eax,48 sub eax,48
@ -87,7 +87,7 @@ no_apply_stack_setup:
mov ebx,eax mov ebx,eax
movzx eax,byte [string+1] movzx eax,byte [string+1]
cmp eax,'A' cmp eax,'A'
jb gcp2 jb gcp2
sub eax,'A'-'9'-1 sub eax,'A'-'9'-1
gcp2: gcp2:
sub eax,48 sub eax,48
@ -95,7 +95,7 @@ no_apply_stack_setup:
add ebx,eax add ebx,eax
movzx eax,byte [string+2] movzx eax,byte [string+2]
cmp eax,'A' cmp eax,'A'
jb gcp3 jb gcp3
sub eax,'A'-'9'-1 sub eax,'A'-'9'-1
gcp3: gcp3:
sub eax,48 sub eax,48
@ -104,7 +104,7 @@ no_apply_stack_setup:
jmp red jmp red
no_read_comport: no_read_comport:
dec eax ; GET COM IRQ dec eax ; GET COM IRQ
jne no_read_comirq jne no_read_comirq
mov [string_x],284 mov [string_x],284
mov [string_y],50 mov [string_y],50
@ -112,7 +112,7 @@ no_apply_stack_setup:
call read_string call read_string
movzx eax,byte [string] movzx eax,byte [string]
cmp eax,'A' cmp eax,'A'
jb gci1 jb gci1
sub eax,'A'-'9'-1 sub eax,'A'-'9'-1
gci1: gci1:
sub eax,48 sub eax,48
@ -120,7 +120,7 @@ no_apply_stack_setup:
jmp red jmp red
no_read_comirq: no_read_comirq:
dec eax ; GET IP dec eax ; GET IP
jne no_read_ip jne no_read_ip
mov [string_x],205 mov [string_x],205
mov [string_y],80 mov [string_y],80
@ -133,9 +133,9 @@ no_apply_stack_setup:
ip1: ip1:
inc esi inc esi
cmp [esi],byte '0' cmp [esi],byte '0'
jb ip2 jb ip2
cmp [esi],byte '9' cmp [esi],byte '9'
jg ip2 jg ip2
imul eax,10 imul eax,10
movzx ebx,byte [esi] movzx ebx,byte [esi]
sub ebx,48 sub ebx,48
@ -147,8 +147,8 @@ no_apply_stack_setup:
jbe ip0 jbe ip0
jmp red jmp red
no_read_ip: no_read_ip:
dec eax ; set gateway ip dec eax ; set gateway ip
jne no_set_gateway jne no_set_gateway
mov [string_x],205 mov [string_x],205
@ -162,9 +162,9 @@ no_apply_stack_setup:
gip1: gip1:
inc esi inc esi
cmp [esi],byte '0' cmp [esi],byte '0'
jb gip2 jb gip2
cmp [esi],byte '9' cmp [esi],byte '9'
jg gip2 jg gip2
imul eax,10 imul eax,10
movzx ebx,byte [esi] movzx ebx,byte [esi]
sub ebx,48 sub ebx,48
@ -192,9 +192,9 @@ no_apply_stack_setup:
sip1: sip1:
inc esi inc esi
cmp [esi],byte '0' cmp [esi],byte '0'
jb sip2 jb sip2
cmp [esi],byte '9' cmp [esi],byte '9'
jg sip2 jg sip2
imul eax,10 imul eax,10
movzx ebx,byte [esi] movzx ebx,byte [esi]
sub ebx,48 sub ebx,48
@ -221,9 +221,9 @@ no_apply_stack_setup:
dip1: dip1:
inc esi inc esi
cmp [esi],byte '0' cmp [esi],byte '0'
jb dip2 jb dip2
cmp [esi],byte '9' cmp [esi],byte '9'
jg dip2 jg dip2
imul eax,10 imul eax,10
movzx ebx,byte [esi] movzx ebx,byte [esi]
sub ebx,48 sub ebx,48
@ -238,17 +238,17 @@ no_apply_stack_setup:
no_set_dns: no_set_dns:
dec eax dec eax
jb no_set_interface jb no_set_interface
cmp eax,14-11 cmp eax,14-11
ja no_set_interface ja no_set_interface
mov [interface],eax mov [interface],eax
jmp red jmp red
no_set_interface: no_set_interface:
sub eax,21-11 sub eax,21-11
jb no_ip_sf jb no_ip_sf
cmp eax,22-21 cmp eax,22-21
ja no_ip_sf ja no_ip_sf
xor eax,1 xor eax,1
mov [assigned],eax mov [assigned],eax
jmp red jmp red
@ -282,21 +282,21 @@ read_stack_setup:
mcall mcall
mov dword [dns_ip],eax mov dword [dns_ip],eax
mov eax,[config] ; unwrap com IRQ mov eax,[config] ; unwrap com IRQ
shr eax,8 shr eax,8
and eax,0xf and eax,0xf
mov [com_irq],eax mov [com_irq],eax
mov eax,[config] ; unwrap com PORT mov eax,[config] ; unwrap com PORT
shr eax,16 shr eax,16
and eax,0xfff and eax,0xfff
mov [com_add],eax mov [com_add],eax
mov eax,[config] ; unwrap IRQ mov eax,[config] ; unwrap IRQ
and eax,0xf and eax,0xf
mov [interface],eax mov [interface],eax
mov eax,[config] ; unwrap com PORT mov eax,[config] ; unwrap com PORT
shr eax,7 shr eax,7
and eax,1 and eax,1
mov [assigned],eax mov [assigned],eax
@ -347,7 +347,7 @@ string_length dd 16
string_x dd 200 string_x dd 200
string_y dd 60 string_y dd 60
string db '________________' string db '________________'
read_string: read_string:
@ -369,11 +369,11 @@ read_string:
mcall mcall
shr eax,8 shr eax,8
cmp eax,13 cmp eax,13
je read_done je read_done
cmp eax,8 cmp eax,8
jnz nobsl jnz nobsl
cmp edi,string cmp edi,string
jz f11 jz f11
sub edi,1 sub edi,1
mov [edi],byte '_' mov [edi],byte '_'
call print_text call print_text
@ -382,7 +382,7 @@ read_string:
cmp eax,dword 31 cmp eax,dword 31
jbe f11 jbe f11
cmp eax,dword 95 cmp eax,dword 95
jb keyok jb keyok
sub eax,32 sub eax,32
keyok: keyok:
mov [edi],al mov [edi],al
@ -436,20 +436,20 @@ print_text:
draw_window: draw_window:
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw mov ebx,1 ; 1, start of draw
mcall mcall
; DRAW WINDOW ; DRAW WINDOW
mov eax,0 ; function 0 : define and draw window mov eax,0 ; function 0 : define and draw window
mov ebx,100*65536+330 ; [x start] *65536 + [x size] mov ebx,100*65536+330 ; [x start] *65536 + [x size]
mov ecx,100*65536+157 ; [y start] *65536 + [y size] mov ecx,100*65536+157 ; [y start] *65536 + [y size]
mov edx,0x14ffffff ; color of work area RRGGBB,8->color gl mov edx,0x14ffffff ; color of work area RRGGBB,8->color gl
mov edi,title ; WINDOW LABEL mov edi,title ; WINDOW LABEL
mcall mcall
mov eax,8 ; BUTTON : READ SETUP mov eax,8 ; BUTTON : READ SETUP
mov ebx,90*65536+65 mov ebx,90*65536+65
mov ecx,127*65536+12 mov ecx,127*65536+12
mov edx,2 mov edx,2
@ -471,9 +471,9 @@ draw_window:
add ecx,10*65536 add ecx,10*65536
inc edx inc edx
cmp edx,11+4 cmp edx,11+4
jb interface_select jb interface_select
mov ebx,[interface] ; PRINT SELECTED INTERFACE 'X' mov ebx,[interface] ; PRINT SELECTED INTERFACE 'X'
imul ebx,10 imul ebx,10
add ebx,31*65536+39 add ebx,31*65536+39
mov eax,4 mov eax,4
@ -482,7 +482,7 @@ draw_window:
mov esi,1 mov esi,1
mcall mcall
mov eax,8 ; BUTTONS 21-22 : SERVER / MANUAL IP mov eax,8 ; BUTTONS 21-22 : SERVER / MANUAL IP
mov ebx,143*65536+8 mov ebx,143*65536+8
mov ecx,69*65536+8 mov ecx,69*65536+8
mov edx,21 mov edx,21
@ -493,7 +493,7 @@ draw_window:
mov ecx,79*65536+8 mov ecx,79*65536+8
mov edx,22 mov edx,22
mcall mcall
mov ebx,[assigned] ; PRINT SELECTED SERVER/MANUAL 'X' mov ebx,[assigned] ; PRINT SELECTED SERVER/MANUAL 'X'
not ebx not ebx
and ebx,1 and ebx,1
imul ebx,10 imul ebx,10
@ -504,7 +504,7 @@ draw_window:
mov esi,1 mov esi,1
mcall mcall
mov eax,47 ; COM ADDRESS mov eax,47 ; COM ADDRESS
mov ebx,3*65536+1*256 mov ebx,3*65536+1*256
mov ecx,[com_add] mov ecx,[com_add]
mov edx,272*65536+40 mov edx,272*65536+40
@ -529,7 +529,7 @@ draw_window:
add edx,6*4*65536 add edx,6*4*65536
inc edi inc edi
cmp edi,ip_address+4 cmp edi,ip_address+4
jb ipdisplay jb ipdisplay
mov edi,gateway_ip mov edi,gateway_ip
mov edx,205*65536+90 mov edx,205*65536+90
@ -542,7 +542,7 @@ draw_window:
add edx,6*4*65536 add edx,6*4*65536
inc edi inc edi
cmp edi,gateway_ip+4 cmp edi,gateway_ip+4
jb gipdisplay jb gipdisplay
mov edi,subnet_mask mov edi,subnet_mask
mov edx,205*65536+100 mov edx,205*65536+100
@ -555,7 +555,7 @@ draw_window:
add edx,6*4*65536 add edx,6*4*65536
inc edi inc edi
cmp edi,subnet_mask+4 cmp edi,subnet_mask+4
jb sipdisplay jb sipdisplay
mov edi,dns_ip mov edi,dns_ip
mov edx,205*65536+110 mov edx,205*65536+110
@ -568,10 +568,10 @@ draw_window:
add edx,6*4*65536 add edx,6*4*65536
inc edi inc edi
cmp edi,dns_ip+4 cmp edi,dns_ip+4
jb dipdisplay jb dipdisplay
mov eax,8 ; BUTTON 5 : SET PORT mov eax,8 ; BUTTON 5 : SET PORT
mov ebx,299*65536+8 mov ebx,299*65536+8
mov ecx,39*65536+8 mov ecx,39*65536+8
mov edx,5 mov edx,5
@ -602,7 +602,7 @@ draw_window:
inc edx inc edx
mcall mcall
mov ebx,31*65536+40 ; draw info text with function 4 mov ebx,31*65536+40 ; draw info text with function 4
mov edx,text mov edx,text
mov esi,49 mov esi,49
mov eax,4 mov eax,4
@ -619,8 +619,8 @@ draw_window:
cmp [edx],byte 'x' cmp [edx],byte 'x'
jne newline jne newline
mov eax,12 ; function 12:tell os about windowdraw mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw mov ebx,2 ; 2, end of draw
mcall mcall
ret ret
@ -634,18 +634,18 @@ boot_set_settings:
mcall mcall
mov [config],eax mov [config],eax
shr eax,8 ; unwrap com IRQ shr eax,8 ; unwrap com IRQ
and eax,0xf and eax,0xf
mov [com_irq],eax mov [com_irq],eax
mov eax,[config] ; unwrap com PORT mov eax,[config] ; unwrap com PORT
shr eax,16 shr eax,16
and eax,0xfff and eax,0xfff
mov [com_add],eax mov [com_add],eax
call apply_stack_setup call apply_stack_setup
mov eax,-1 ; close this program mov eax,-1 ; close this program
mcall mcall
;****************************************************************************** ;******************************************************************************
@ -653,6 +653,22 @@ boot_set_settings:
; DATA AREA ; DATA AREA
if lang eq ru
title db '<27> áâனª  á¥â¥¢®£® á⥪ ',0
text:
db ' <20>¥ ªâ¨¢­ë© Œ®¤¥¬ ­  Com-¯®àâã: 0x < '
db ' Slip <20>à¥à뢠­¨¥ ¬®¤¥¬ : 0x < '
db ' PPP '
db ' „à ©¢¥à ¯ ª¥â®¢ IP server ­ §­ ç¥­­ë© '
db ' ”¨ªá. . . . < '
db ' ˜«î§: . . . < '
db ' <20>®¤á¥âì: . . . < '
db ' DNS IP: . . . < '
db ' '
db 'w —¨â âì <20>ਬ¥­¨âì '
else
title db 'Stack configuration',0
text: text:
db ' Not active Modem Com Port: 0x < ' db ' Not active Modem Com Port: 0x < '
db ' Slip Modem Com Irq: 0x < ' db ' Slip Modem Com Irq: 0x < '
@ -664,27 +680,26 @@ text:
db ' DNS IP: . . . < ' db ' DNS IP: . . . < '
db ' ' db ' '
db 'w READ APPLY ' db 'w READ APPLY '
end if
xx: db 'x' ;<- END MARKER, DONT DELETE xx: db 'x' ;<- END MARKER, DONT DELETE
button_color dd 0x2254b9 button_color dd 0x2254b9
title db 'STACK CONFIGURATION',0
;ENTER YOUR SETTINGS HERE: ;ENTER YOUR SETTINGS HERE:
ip_address db 010,005,004,175 ip_address db 010,005,004,175
gateway_ip db 010,005,000,001 gateway_ip db 010,005,000,001
subnet_mask db 255,255,000,000 subnet_mask db 255,255,000,000
dns_ip db 213,184,238,006 dns_ip db 213,184,238,006
com_irq dd 0 ; irq for slip/ppp com_irq dd 0 ; irq for slip/ppp
com_add dd 0 ; com port address for slip/ppp com_add dd 0 ; com port address for slip/ppp
interface dd 3 ; not active,slip,ppp,packet driver interface dd 3 ; not active,slip,ppp,packet driver
assigned dd 0 ; get ip from server assigned dd 0 ; get ip from server
config dd 0 config dd 0
I_END: I_END: