Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 341 → Rev 340

/programs/system/cpu/trunk/cpu.asm
126,7 → 126,7
;close program if we going to reboot
 
close:
or eax,-1 ; close this program
mov eax,-1 ; close this program
int 0x40
 
draw_next_process:
479,12 → 479,19
xor eax,eax ; function 0 : define and draw window
mov ebx,[winxpos] ; [x start] *65536 + [x size]
mov ecx,[winypos] ; [y start] *65536 + [y size]
mov edx,0x13ddffdd ;ffffff ; color of work area RRGGBB,8->color
mov edi,header ; WINDOW CAPTION;
mov edx,0x03ddffdd ;ffffff ; color of work area RRGGBB,8->color
mov esi,0x805080d0 ; color of grab bar RRGGBB,8->color gl
mov edi,0x005080d0 ; color of frames RRGGBB
int 0x40
 
; WINDOW CAPTION
mov eax,4 ; function 4 : write text to window
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ffffff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt ; pointer to text beginning
mov esi,labellen-labelt ; text length
int 0x40
mov eax,4 ; function 4 : write text to window
mov ebx,22*65536+35 ; draw info text with function 4
xor ecx,ecx
mov edx,text
594,7 → 601,9
tbts_3 db 'START'
tbte_2:
 
header db 'Prozesse - Ctrl/Alt/Del',0
labelt:
db 'Prozesse - Ctrl/Alt/Del'
labellen:
 
else if lang eq et
text:
608,7 → 617,9
tbts_3 db 'START'
tbte_2:
 
header db 'Protsessid - Ctrl/Alt/Del',0
labelt:
db 'Protsessid - Ctrl/Alt/Del'
labellen:
 
else
text:
622,7 → 633,9
tbts_3 db 'RUN'
tbte_2:
 
header db 'Processes - Ctrl/Alt/Del',0
labelt:
db 'Processes - Ctrl/Alt/Del'
labellen:
 
end if
 
/programs/system/end/trunk/end.asm
29,14 → 29,19
movzx ecx,ax
 
shr eax,17
; sub eax,110
shl eax,16
; mov ebx,eax
; add ebx,220
lea ebx,[eax-110*10000h+220]
 
shr ecx,1
; sub ecx,50
shl ecx,16
sub ecx,50*10000h - 120
; add ecx,100
sub ecx,50*10000h - 100
 
xor eax,eax ; define and draw window
mov eax,0 ; define and draw window
mov edx,[sc.work]
mov esi,edx
mov edi,edx
46,12 → 51,11
mov al,13
mcall ,18 shl 16+90,29 shl 16+27
push ebx
mcall ,121 shl 16+90
mcall ,121 shl 16+90,
xchg ebx,[esp]
mcall ,,63 shl 16+27
pop ebx
mcall
mcall ,179 shl 16+30,99 shl 16+15
 
xor edx,edx
mov al,8
63,38 → 67,38
mcall ,15 shl 16+87,60 shl 16+24,,0x9900
inc edx
mcall ,118 shl 16+87,,,0xaaaaaa ;cccccc
inc edx
mcall ,175 shl 16+30,95 shl 16+15,,[sc.work_button]
 
mov al,4 ; 0x00000004 = write text
mov ebx,75*65536+10
mov ecx,[sc.work_text] ; 8b window nro - RR GG BB color
or ecx,0x90000000
or ecx,0x10000000
mov edx,label1 ; pointer to text beginning
mov esi,label1_len ; text length
int 0x40
 
mov ebx,15*65536+101
mov edx,label4
int 0x40
 
mov ecx,0x90eeeeee ; 8b window nro - RR GG BB color
mov ecx,0xeeeeee ; 8b window nro - RR GG BB color
or ecx,0x10000000
mov ebx,25*65536+30
mov edx,label2 ; pointer to text beginning
mov esi,label2_len ; text length
int 0x40
 
mov ebx,20*65536+64
mov edx,label3
mov edx,label3 ; pointer to text beginning
mov esi,label3_len ; text length
int 0x40
 
mov ebx,45*65536+41
mov edx,label5
mov edx,label4 ; pointer to text beginning
mov esi,label4_len ; text length
int 0x40
 
mov ebx,40*65536+75
mov edx,label6
mov edx,label5 ; pointer to text beginning
mov esi,label5_len ; text length
int 0x40
 
mov al,12 ;end of redraw
mov al,12 ; tell os about redraw end
mov ebx,2
int 0x40
 
131,8 → 135,6
jz restart_kernel
dec eax
jz restart
dec eax
jnz run_rdsave
; we have only one button left, this is close button
; dec eax
; jnz still
155,67 → 157,75
mcall 18,9
jmp close_1
 
run_rdsave:
mov eax,70
mov ebx,rdsave
int 0x40
jmp still
 
data
 
if lang eq ru
 
label1:
db '‚ è ¢ë¡®à:',0
db '‚€˜ ‚›Ž:'
label1_len = $ - label1
 
label2:
db '‚몫îç¨âì Ÿ¤à®',0
db '‚›Š‹ž—ˆ’œ Ÿ„Ž'
label2_len = $ - label2
 
label3:
db '¥à¥§ ¯ã᪠Žâ¬¥­ ',0
label4:
db '‘®åà ­¨âì ­ áâனª¨',0
db '……‡€“‘Š Ž’Œ…€'
label3_len = $ - label3
 
else if lang eq en
 
label1:
db ' SELECT:',0
db ' SELECT:'
label1_len = $ - label1
 
label2:
db 'POWER OFF KERNEL',0
db 'POWER OFF KERNEL'
label2_len = $ - label2
 
label3:
db ' RESTART CANCEL',0
label4:
db 'Save settings',0
db ' RESTART CANCEL'
label3_len = $ - label3
 
else if lang eq et
 
label1:
db ' VALI:',0
db ' VALI:'
label1_len = $ - label1
 
label2:
db 'LÜLITA VÄLJA KERNEL',0
db 'LÜLITA VÄLJA KERNEL'
label2_len = $ - label2
 
label3:
db ' RESTART TÜHISTA',0
label4:
db 'Save settings',0
db ' RESTART TÜHISTA'
label3_len = $ - label3
 
else
 
label1:
db 'WAEHLEN:',0
db 'WAEHLEN:'
label1_len = $ - label1
 
label2:
db ' BEENDEN KERNEL',0
db ' BEENDEN KERNEL'
label2_len = $ - label2
 
label3:
db ' NEUSTART ABBRECHEN',0
db ' NEUSTART ABBRECHEN'
label3_len = $ - label3
 
end if
 
label4:
db 'Save settings',0
db '(End) (Home)'
label4_len = $ - label4
 
end if
label5:
db '(End) (Home)',0
label6:
db '(Enter) (Esc)',0
db '(Enter) (Esc)'
label5_len = $ - label5
 
rdsave:
dd 7
dd 0
dd 0
dd 0
dd 0
db '/rd/1/rdsave',0
 
udata
sc system_colors
 
/programs/system/rdsave/trunk/editbox.inc
File deleted
\ No newline at end of file
/programs/system/rdsave/trunk/rdsave.asm
1,182 → 1,109
;
; RDsave ¤«ï Kolibri (0.6.5.0 ¨ áâ àè¥)
;
; Save Ramdisk to HD and FD
; Mario79 2005
; Heavyiron 12.02.2007
; Compile with FASM for Menuet
;
; Š®¬¯¨«¨à®¢ âì FASM'®¬
;
;---------------------------------------------------------------------
 
include 'lang.inc'
include 'macros.inc'
 
appname equ 'RDsave '
version equ '1.2'
version equ '1.1'
use32 ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
org 0x0 ;  ¤à¥á æ¨ï á ­ã«ï
use32
org 0x0
 
db 'MENUET01' ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
dd 0x01 ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
dd START ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
dd I_END ; à §¬¥à ¯à®£à ¬¬ë
dd 0x1000 ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd 0x1000 ;  ¤à¥á ¢¥à設ë áâíª 
dd 0x0 ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
dd 0x0 ; § à¥§¥à¢¨à®¢ ­®
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x1000 ; memory for app
dd 0x1000 ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon
 
include 'editbox.inc'
use_edit_box
 
;---------------------------------------------------------------------
;--- €—€‹Ž Žƒ€ŒŒ› ----------------------------------------------
;---------------------------------------------------------------------
;******************************************************************************
 
START:
 
START: ; start of execution
xor eax,eax
mov edi,bootpath
mov ecx,128
rep stosd
 
mcall 6,filename,0,-1,bootpath
 
mov esi,bootpath+1
mov cx,512
start_search:
lodsb
cmp al,"'"
jz set_end_path
dec cx
cmp cx,0
ja start_search
set_end_path:
mov [esi-1],byte 0
 
mov eax, 40
mov ebx, 100111b
mov ebx,101b
int 0x40
red: ; ¯¥à¥à¨á®¢ âì ®ª­®
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
 
;---------------------------------------------------------------------
;--- –ˆŠ‹ Ž€Ž’Šˆ ‘Ž›’ˆ‰ ----------------------------------------
;---------------------------------------------------------------------
red:
call draw_window
 
still:
push 10
pop eax
int 40h
mov eax, 10 ; wait here for event
int 0x40
 
dec eax ; ¯¥à¥à¨á®¢ âì ®ª­®?
jz red ; ¥á«¨ ¤  - ­  ¬¥âªã red
dec eax
jz key
dec eax
jz button
dec eax ; redraw request ?
je red
; dec eax
; dec eax ; button in buffer ?
; je button
 
mouse:
mouse_edit_boxes editbox,editbox_end
jmp still
button:
mov al,17 ; ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
button: ; button
mov eax,17 ; get id
int 0x40
 
cmp ah,1 ; ª­®¯ª  á id=1("§ ªàëâì")?
jne noclose
or eax,-1 ; äã­ªæ¨ï -1: § ¢¥àè¨âì ¯à®£à ¬¬ã
int 0x40
 
noclose:
cmp ah,2
jne path_2
call clear_err
mov al,16
mov ebx,1
int 0x40
call check_for_error
jmp still
path_2:
jne ah_3
mcall 18,6,1
jmp red
ah_3:
cmp ah,3
jne path_3
call clear_err
mov al,16
mov ebx,2
int 0x40
call check_for_error
jmp still
path_3:
jne ah_4
mcall 18,6,2
jmp red
ah_4:
cmp ah,4
jne path_4
call clear_err
mov al,18
mov ebx,6
mov ecx,path3
int 0x40
call check_for_error
jmp still
path_4:
call clear_err
mov eax,18
mov ebx,6
mov ecx,path4
int 0x40
call check_for_error
jmp still
jne ah_5
mcall 18,6,3,bootpath+1
jmp red
ah_5:
cmp ah,5
jne ah_6
mcall 16,1
jmp red
ah_6:
cmp ah,6
jne ah_1
mcall 16,2
jmp red
 
key:
mov al,2
int 0x40
key_edit_boxes editbox,editbox_end
ah_1:
cmp ah,1
je exit
jmp still
 
 
check_for_error: ;Ž¡à ¡®â稪 ®è¨¡®ª
cmp eax,0
jne err1
mov ecx,[sc.work_text]
mov edx,ok
jmp print
err1:
cmp eax,1
jne err3
mov ecx,0xdd2222
mov edx,error11
jmp print
err3:
cmp eax,3
jne err5
mov ecx,0xdd2222
mov edx,error3
jmp print
err5:
cmp eax,5
jne err8
mov ecx,0xdd2222
mov edx,error5
jmp print
err8:
cmp eax,8
jne err9
mov ecx,0xdd2222
mov edx,error8
jmp print
err9:
cmp eax,9
jne err10
mov ecx,0xdd2222
mov edx,error9
jmp print
err10:
cmp eax,10
jne err11
mov ecx,0xdd2222
mov edx,error10
jmp print
err11:
mov ecx,0xdd2222
mov edx,error11
jmp print
 
print:
mov eax,4 ;­ ¤¯¨á¨
mov ebx,20 shl 16 + 148
or ecx,0x80000000
exit:
or eax,-1 ; close this program
int 0x40
ret
 
clear_err:
mov al,13
mov ebx,15 shl 16 + 240
mov ecx,145 shl 16 +15
mov edx,[sc.work]
int 0x40
ret
 
;---------------------------------------------------------------------
;--- Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ ----------------------------------
;---------------------------------------------------------------------
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
 
draw_window:
 
186,149 → 113,100
mov edx,sizeof.system_colors
int 0x40
 
mov eax,12 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
mov bl,1 ; 1 - ­ ç¨­ ¥¬ à¨á®¢ âì
mov eax, 12 ; function 12:tell os about windowdraw
mov ebx, 1 ; 1, start of draw
int 0x40
 
; ‘Ž‡„€ðŒ ŽŠŽ
xor eax,eax ; äã­ªæ¨ï 0 : ®¯à¥¤¥«¨âì ¨ ®âà¨á®¢ âì ®ª­®
mov ebx,200 shl 16 + 270 ; [x áâ àâ] *65536 + [x à §¬¥à]
mov ecx,200 shl 16 + 190 ; [y áâ àâ] *65536 + [y à §¬¥à]
mov edx,[sc.work] ; 梥â à ¡®ç¥© ®¡« á⨠RRGGBB,8->color gl
; DRAW WINDOW
mov eax, 0 ; function 0 : define and draw window
mov ebx, 200*65536+230 ; [x start] *65536 + [x size]
mov ecx, 200*65536+260 ; [y start] *65536 + [y size]
mov edx, [sc.work] ; color of work area RRGGBB,8->color gl
or edx,0x33000000
mov edi,header ; ‡€ƒŽ‹Ž‚ŽŠ ŽŠ€
mov edi,header ; WINDOW LABEL
int 0x40
 
draw_edit_boxes editbox,editbox_end ;à¨á®¢ ­¨¥ edit box'®¢
mcall 8,<11,17>,<26,17>,2,[sc.work_button]
inc edx
mcall , ,<56,17>, ,
inc edx
mcall , ,<86,17>, ,
inc edx
mcall , ,<166,17>, ,
inc edx
mcall , ,<196,17>, ,
 
mov al,13 ;®âà¨á®¢ª  ⥭¥© ª­®¯®ª
mov ebx,194 shl 16 + 60
mov ecx,34 shl 16 +15
mov edx,0x444444
int 0x40
mov ecx,[sc.work_button_text]
or ecx,0x10000000
mcall 4,<17,31>, ,text_123,1
add ebx,30
add edx,1
mcall
add ebx,30
add edx,1
mcall
add ebx,80
add edx,1
mcall
add ebx,30
add edx,1
mcall
 
add ecx,20 shl 16
int 0x40
 
add ecx,20 shl 16
int 0x40
 
add ecx,40 shl 16
int 0x40
 
mov eax,8 ;®âà¨á®¢ª  ª­®¯®ª
sub ebx,4 shl 16
sub ecx,4 shl 16
mov edx,5
mov esi,[sc.work_button]
int 0x40
 
sub ecx,40 shl 16
dec edx
int 0x40
 
sub ecx,20 shl 16
dec edx
int 0x40
 
sub ecx,20 shl 16
dec edx
int 0x40
 
mov al,4 ;­ ¤¯¨á¨
mov ebx,45 shl 16 + 12
mov ecx,[sc.work_text]
or ecx,0x80000000
mov edx,label1
int 0x40
mcall ,<40,31>, ,text_1,
add ebx,30
mcall , , ,text_2,
add ebx,30
mcall , , ,text_3,
mcall ,<15,115>, ,text_4,
mcall ,<35,125>, ,text_5,
 
mov ebx,150 shl 16 + 35
mov edx,path1
int 0x40
mcall ,<35,41>, ,text_6,
mcall ,<35,101>, ,text_6,
mcall ,<40,171>, ,text_7,
mcall ,<40,201>, ,text_8,
mcall ,<25,10>, ,text_9,
mcall ,<25,150>, ,text_10,
 
add ebx,20
mov edx,path2
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
ret
 
mov ebx,75 shl 16 + 75
mov edx,path3
int 0x40
 
mov ebx,30 shl 16 + 97
mov edx,label2
int 0x40
 
mov ebx,40 shl 16 + 135
mov edx,label3
int 0x40
 
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mov ebx,195 shl 16 + 35
mov edx,save
int 0x40
 
add ebx,20
int 0x40
 
add ebx,20
int 0x40
 
add ebx,40
int 0x40
 
mov al,12 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
mov ebx,2 ; 2, § ª®­ç¨«¨ à¨á®¢ âì
int 0x40
 
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
 
 
;---------------------------------------------------------------------
;--- „€›… Žƒ€ŒŒ› ----------------------------------------------
;---------------------------------------------------------------------
 
header db appname,version,0
 
editbox:
edit1 edit_box 170,10,113,0xffffff,0,0,0,1024,path4,ed_focus
editbox_end:
text_123 db '12345'
 
path1 db '/fd/1/',0
path2 db '/fd/2/',0
path3 db '/hd0/1/kolibri.img',0
 
if lang eq ru
save db '‘®åà ­¨âì',0
label1 db '‚ë¡¥à¨â¥ ®¤¨­ ¨§ ¢ à¨ ­â®¢:',0
label2 db 'ˆ«¨ ¢¢¥¤¨â¥ ¯®«­ë© ¯ãâì ª ä ©«ã:',0
label3 db '‚ᥠ¯ ¯ª¨ ¤®«¦­ë áãé¥á⢮¢ âì',0
ok db 'RAM-¤¨áª á®åà ­¥­ ãᯥ譮',0
error3 db '¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬ ',0
error5 db '¥áãé¥áâ¢ãî騩 ¯ãâì',0
error8 db '¥â ¬¥áâ  ­  ¤¨áª¥',0
error9 db '’ ¡«¨æ  FAT à §àã襭 ',0
error10 db '„®áâ㯠§ ¯à¥é¥­',0
error11 db 'Žè¨¡ª  ãáâனá⢠',0
 
text_1 db '‚ ¯ ¯ªã ‘:\KOLIBRI',0
text_2 db '‚ ª®à¥­ì ¤¨áª  ‘',0
text_3 db 'ãâì ¢ ä ©«¥ RD2HD.TXT',0
text_4 db '¯.3 ¤«ï १¥à¢­®£® á®åà ­¥­¨ï',0
text_5 db 'â.ª. ¢ ï¤à¥ ¥£® ­¥â.',0
text_6 db '(¯ ¯ª  ¤®«¦­  ¯à¨áãâá⢮¢ âì)',0
text_7 db '  /FD/1',0
text_8 db '  /FD/2',0
text_9 db '‘®åà ­¥­¨¥ ­  ¦¥á⪨© ¤¨áª:',0
text_10 db '‘®åà ­¥­¨¥ ­  ¤¨áª¥âã:',0
 
else
save db ' Save',0
label1 db 'Select one of the variants:',0
label2 db ' Or enter full path to file:',0
label3 db ' All folders must exist',0
ok db 'RAM-drive was saved successfully',0
error3 db 'Unknown file system',0
error5 db 'Incorrect path',0
error8 db 'Disk is full',0
error9 db 'FAT table corrupted',0
error10 db 'Access denied',0
error11 db 'Device error',0
 
text_1 db 'To the folder C:\KOLIBRI',0
text_2 db 'To the root of C',0
text_3 db 'To path in the file RD2HD.TXT',0
text_4 db 'p.3 for backup, as the kernel',0
text_5 db 'can not boot from there.',0
text_6 db '(folder must exist)',0
text_7 db 'To /FD/1',0
text_8 db 'To /FD/2',0
text_9 db 'Save to hard disk:',0
text_10 db 'Save to floppy:',0
 
end if
 
;---------------------------------------------------------------------
 
I_END: ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
 
filename db 'RD2HD TXT'
I_END:
sc system_colors
path4 rb 1025;1024+1
bootpath: