2006-01-03 10:43:31 +01:00
|
|
|
|
;
|
|
|
|
|
; DEBUG BOARD for APPLICATIONS and KERNEL DEVELOPMENT
|
|
|
|
|
;
|
|
|
|
|
; See f63
|
|
|
|
|
;
|
|
|
|
|
; Compile with FASM for Menuet
|
|
|
|
|
;
|
2010-08-17 23:40:33 +02:00
|
|
|
|
LMARGIN equ (15+5)
|
|
|
|
|
TMARGIN equ (35+5)
|
|
|
|
|
HSPACE equ 16
|
|
|
|
|
VSPACE equ 12
|
|
|
|
|
IPC_BUF equ 160
|
|
|
|
|
DR_GRID equ 0;1
|
|
|
|
|
WRITE_LOG equ 1
|
2006-08-18 15:32:18 +02:00
|
|
|
|
|
|
|
|
|
FL_KRNL equ 1
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
include 'lang.inc'
|
|
|
|
|
|
|
|
|
|
use32
|
2010-08-17 23:40:33 +02:00
|
|
|
|
org 0x0
|
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; start of code
|
|
|
|
|
dd I_END ; size of image
|
|
|
|
|
dd i_end+0x2000 ; memory for app (4 Kb)
|
|
|
|
|
dd i_end+0x2000 ; esp
|
|
|
|
|
dd 0x0 , 0x0 ; I_Param , I_Icon
|
2010-12-20 18:33:57 +01:00
|
|
|
|
include '\..\..\MACROS.INC'
|
2006-08-18 15:32:18 +02:00
|
|
|
|
include 'debug.inc'
|
|
|
|
|
purge newline
|
2006-01-03 10:43:31 +01:00
|
|
|
|
MAXSTRINGS = 16
|
2006-08-18 15:32:18 +02:00
|
|
|
|
TMP = 80*(MAXSTRINGS+1)
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
START: ; start of execution
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mcall 60,1,ipcbuff,IPC_BUF+20
|
|
|
|
|
mcall 40,1000111b
|
|
|
|
|
mov [ipcbuff+4],8
|
2010-01-04 00:41:11 +01:00
|
|
|
|
; allow user to see messages written before start
|
|
|
|
|
; mov ecx,4096
|
|
|
|
|
; flush:
|
|
|
|
|
; mov eax,63
|
|
|
|
|
; mov ebx,2
|
|
|
|
|
; mcall
|
|
|
|
|
; loop flush
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ecx, TMP
|
2006-01-03 10:43:31 +01:00
|
|
|
|
xor eax, eax
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov edi, [targ]
|
2006-01-03 10:43:31 +01:00
|
|
|
|
rep stosb
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov [tmp1],'x'
|
|
|
|
|
mov [tmp2],'x'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
mov eax,14
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
and eax,0xffff0000
|
2006-08-18 15:32:18 +02:00
|
|
|
|
sub eax,399 shl 16
|
|
|
|
|
add eax,399
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov [xstart],eax
|
2007-04-02 14:44:47 +02:00
|
|
|
|
|
|
|
|
|
mov eax,48
|
|
|
|
|
mov ebx,3
|
|
|
|
|
mov ecx,sc
|
|
|
|
|
mov edx,sizeof.system_colors
|
|
|
|
|
mcall
|
2010-08-17 23:40:33 +02:00
|
|
|
|
if WRITE_LOG
|
|
|
|
|
mov esi, filename
|
|
|
|
|
call CreateFile
|
|
|
|
|
end if
|
2007-04-02 14:44:47 +02:00
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
red:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window
|
|
|
|
|
|
|
|
|
|
still:
|
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mov eax,23 ; wait here for event
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ebx,1
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
|
je red
|
|
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
|
je key
|
|
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
|
je button
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp eax,7
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je ipc
|
2007-04-02 14:44:47 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov eax,63
|
|
|
|
|
mov ebx,2
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
cmp ebx,1
|
|
|
|
|
jne still
|
2010-08-17 23:40:33 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
new_data:
|
2010-08-17 23:40:33 +02:00
|
|
|
|
if WRITE_LOG
|
|
|
|
|
pusha
|
|
|
|
|
mov [tmp], al
|
|
|
|
|
mov edx, tmp
|
|
|
|
|
mov ecx, 1
|
|
|
|
|
mov esi, filename
|
|
|
|
|
.write_to_logfile:
|
|
|
|
|
call WriteToFile
|
|
|
|
|
cmp eax, 5
|
|
|
|
|
jne @f
|
|
|
|
|
mov esi, filename
|
|
|
|
|
mov [filepos], 0
|
|
|
|
|
call CreateFile
|
|
|
|
|
jmp .write_to_logfile
|
|
|
|
|
@@:
|
|
|
|
|
inc [filepos]
|
|
|
|
|
popa
|
|
|
|
|
end if
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ebp,[targ]
|
|
|
|
|
.no4:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
cmp al,13
|
|
|
|
|
jne no13
|
2006-08-18 15:32:18 +02:00
|
|
|
|
and dword[ebp-8],0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp new_check
|
|
|
|
|
no13:
|
|
|
|
|
cmp al,10
|
|
|
|
|
jne no10
|
2006-08-18 15:32:18 +02:00
|
|
|
|
inc dword[ebp-4]
|
|
|
|
|
cmp dword[ebp-4],MAXSTRINGS
|
|
|
|
|
jbe .noypos
|
|
|
|
|
mov dword[ebp-4],MAXSTRINGS
|
|
|
|
|
lea esi,[ebp+80]
|
|
|
|
|
mov edi,ebp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx,80*(MAXSTRINGS)
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov esi,[ebp-4]
|
2006-01-03 10:43:31 +01:00
|
|
|
|
imul esi,80
|
2006-08-18 15:32:18 +02:00
|
|
|
|
add esi,[ebp-8]
|
|
|
|
|
add esi,ebp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx,80
|
|
|
|
|
xor al,al
|
|
|
|
|
rep stosb
|
2006-08-18 15:32:18 +02:00
|
|
|
|
.noypos:
|
|
|
|
|
mov [targ],text2
|
|
|
|
|
and [krnl_cnt],0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp new_check
|
|
|
|
|
no10:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp ebp,text1
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je add2
|
|
|
|
|
mov ecx,[krnl_cnt]
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp al,[krnl_msg+ecx]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
jne .noknl
|
2006-08-18 15:32:18 +02:00
|
|
|
|
inc [krnl_cnt]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
cmp [krnl_cnt],4
|
|
|
|
|
jne new_check
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov [targ],text1
|
2010-08-17 23:40:33 +02:00
|
|
|
|
.noknl:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ebp,[targ]
|
|
|
|
|
jecxz .add
|
|
|
|
|
push eax
|
|
|
|
|
mov esi,krnl_msg
|
|
|
|
|
.l1:
|
|
|
|
|
lodsb
|
|
|
|
|
call add_char
|
|
|
|
|
loop .l1
|
|
|
|
|
pop eax
|
|
|
|
|
.add:
|
|
|
|
|
and [krnl_cnt],0
|
|
|
|
|
add2:
|
|
|
|
|
call add_char
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
new_check:
|
|
|
|
|
|
|
|
|
|
mov eax,63
|
|
|
|
|
mov ebx,2
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
cmp ebx,1
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je new_data
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp [vmode],2
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je still
|
2006-01-03 10:43:31 +01:00
|
|
|
|
call draw_window
|
|
|
|
|
|
|
|
|
|
jmp still
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
ipc:
|
|
|
|
|
mov [vmode],2
|
|
|
|
|
mov eax,ipcbuff
|
|
|
|
|
mov esi,[eax+8]
|
|
|
|
|
mov byte[eax],1
|
|
|
|
|
push dword[eax+12]
|
|
|
|
|
pop [dump_len]
|
|
|
|
|
mcall 9,work,-1
|
|
|
|
|
mov ecx,eax
|
|
|
|
|
.lp:
|
|
|
|
|
mcall 9
|
|
|
|
|
cmp [ebx+30],esi
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je .ok
|
2006-08-18 15:32:18 +02:00
|
|
|
|
loop .lp
|
|
|
|
|
and [dump_len],0
|
|
|
|
|
jmp red
|
|
|
|
|
.ok:
|
|
|
|
|
mov [pid],esi
|
|
|
|
|
lea esi,[ebx+10]
|
|
|
|
|
mov edi,dump_title+10
|
|
|
|
|
mov ecx,12
|
|
|
|
|
rep movsb
|
|
|
|
|
jmp red
|
2010-08-17 23:40:33 +02:00
|
|
|
|
key: ; key
|
|
|
|
|
mov al,2 ; just read it and ignore
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp ah,' '
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je button.no_krnl_flt
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp [vmode],2
|
|
|
|
|
jne still
|
|
|
|
|
cmp ah,176 ;left
|
2010-08-17 23:40:33 +02:00
|
|
|
|
jb still
|
2006-08-18 15:32:18 +02:00
|
|
|
|
cmp ah,179 ;right
|
2010-08-17 23:40:33 +02:00
|
|
|
|
ja still
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ecx,[offs]
|
|
|
|
|
shr eax,8
|
|
|
|
|
sub eax,176
|
|
|
|
|
add ecx,[arrows+eax*4]
|
|
|
|
|
shl ecx,12
|
|
|
|
|
shr cx,12
|
|
|
|
|
jmp button.check_sel
|
|
|
|
|
.nol:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
arrows dd -1,16,-16,1
|
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
button: ; button
|
|
|
|
|
mov al,17 ; get id
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
cmp ah,1 ; button id=1 ?
|
2006-08-18 15:32:18 +02:00
|
|
|
|
jne .noclose
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
or eax,-1 ; close this program
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-08-18 15:32:18 +02:00
|
|
|
|
.noclose:
|
2010-08-17 23:40:33 +02:00
|
|
|
|
shr eax,8
|
|
|
|
|
cmp eax,10
|
|
|
|
|
jb .nodump
|
2006-08-18 15:32:18 +02:00
|
|
|
|
lea edi,[eax-10]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mcall 37,1
|
2006-08-18 15:32:18 +02:00
|
|
|
|
sub eax,[edi*4+dump_cell_marg]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
sub eax,TMARGIN+VSPACE
|
|
|
|
|
push eax
|
2006-08-18 15:32:18 +02:00
|
|
|
|
and eax,0xffff
|
|
|
|
|
xor edx,edx
|
2010-08-17 23:40:33 +02:00
|
|
|
|
div word[edi*4+dump_cell_size+2]
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ecx,eax
|
|
|
|
|
shl ecx,16
|
2010-08-17 23:40:33 +02:00
|
|
|
|
xor edx,edx
|
2006-08-18 15:32:18 +02:00
|
|
|
|
pop eax
|
2010-08-17 23:40:33 +02:00
|
|
|
|
shr eax,16
|
|
|
|
|
div word[edi*4+dump_cell_size]
|
|
|
|
|
mov cx,ax
|
2006-08-18 15:32:18 +02:00
|
|
|
|
.check_sel:
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mov eax,ecx
|
2006-08-18 15:32:18 +02:00
|
|
|
|
shl ax,12
|
|
|
|
|
shr eax,12
|
|
|
|
|
inc eax
|
|
|
|
|
cmp eax,[dump_len]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
ja still;.nosel
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov dword[sel_byte],ecx
|
|
|
|
|
dec eax
|
|
|
|
|
mov [offs],eax
|
|
|
|
|
jmp red
|
|
|
|
|
|
|
|
|
|
.nodump:
|
|
|
|
|
cmp eax,2
|
|
|
|
|
jne .no_krnl_flt
|
|
|
|
|
xor [flag],FL_KRNL
|
2006-01-03 10:43:31 +01:00
|
|
|
|
jmp still
|
2006-08-18 15:32:18 +02:00
|
|
|
|
.no_krnl_flt:
|
|
|
|
|
mov [ipcbuff+4],8
|
|
|
|
|
and byte[ipcbuff],0
|
|
|
|
|
inc [vmode]
|
|
|
|
|
cmp [vmode],3
|
2010-08-17 23:40:33 +02:00
|
|
|
|
jb .vmok
|
2006-08-18 15:32:18 +02:00
|
|
|
|
and [vmode],0
|
|
|
|
|
.vmok:
|
|
|
|
|
jmp red
|
|
|
|
|
|
|
|
|
|
add_char:
|
|
|
|
|
push esi
|
|
|
|
|
mov esi,[ebp-4]
|
|
|
|
|
imul esi,80
|
|
|
|
|
add esi,[ebp-8]
|
|
|
|
|
mov [ebp+esi],al
|
|
|
|
|
inc dword[ebp-8]
|
|
|
|
|
cmp dword[ebp-8],80
|
2010-08-17 23:40:33 +02:00
|
|
|
|
jb .ok
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov dword[ebp-8],79
|
|
|
|
|
.ok:
|
|
|
|
|
pop esi
|
|
|
|
|
ret
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
draw_window:
|
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,1 ; 1, start of draw
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-08-17 23:40:33 +02:00
|
|
|
|
; DRAW WINDOW
|
|
|
|
|
xor eax,eax ; function 0 : define and draw window
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; mov ebx,50*65536+400 ; [x start] *65536 + [x size]
|
|
|
|
|
mov ebx,[xstart]
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mov ecx,MAXSTRINGS*10+45 ; [y start] *65536 + [y size]
|
|
|
|
|
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
|
|
|
|
or edx,0x13000000
|
|
|
|
|
mov edi,title ; WINDOW LABEL
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2010-08-17 23:40:33 +02:00
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov ecx,4
|
|
|
|
|
mov esi,[sc.work]
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mov ebx,296 shl 16+5*6
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov edx,3;+1 shl 30
|
|
|
|
|
mcall 8,,<5,12>
|
|
|
|
|
mov edx,[vmode]
|
|
|
|
|
lea edx,[edx*4+duk]
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall 4,<300,8>,,,4
|
2006-08-18 15:32:18 +02:00
|
|
|
|
|
|
|
|
|
cmp [vmode],2
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je no_mdbg
|
|
|
|
|
mov ebx,15*65536+33 ; draw info text with function 4
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov ecx,[sc.work_text]
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov edx,text1
|
|
|
|
|
cmp [vmode],0
|
2010-08-17 23:40:33 +02:00
|
|
|
|
je .kern
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mov edx,text2
|
|
|
|
|
.kern:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
mov esi,80
|
|
|
|
|
mov eax,4
|
2007-04-02 14:44:47 +02:00
|
|
|
|
newline:
|
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
add ebx,10
|
|
|
|
|
add edx,80
|
|
|
|
|
cmp [edx],byte 'x'
|
|
|
|
|
jne newline
|
2006-08-18 15:32:18 +02:00
|
|
|
|
jmp enddraw
|
|
|
|
|
no_mdbg:
|
|
|
|
|
if DUMP_TEST eq 1
|
|
|
|
|
mov esi,0
|
|
|
|
|
mov [dump_len],100;IPC_BUF
|
|
|
|
|
else
|
|
|
|
|
mov esi,ipcbuff+16
|
|
|
|
|
end if
|
|
|
|
|
mov ecx,[dump_len]
|
|
|
|
|
call dump_btn
|
2010-08-17 23:40:33 +02:00
|
|
|
|
call draw_dump
|
2006-08-18 15:32:18 +02:00
|
|
|
|
enddraw:
|
2010-08-17 23:40:33 +02:00
|
|
|
|
mov eax,12 ; function 12:tell os about windowdraw
|
|
|
|
|
mov ebx,2 ; 2, end of draw
|
2007-04-02 14:44:47 +02:00
|
|
|
|
mcall
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
if DR_GRID eq 1
|
|
|
|
|
draw_grid:
|
|
|
|
|
mov ecx,11
|
|
|
|
|
mov edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE
|
|
|
|
|
.l1:
|
|
|
|
|
push ecx
|
|
|
|
|
mov ebx,LMARGIN shl 16+LMARGIN+16*HSPACE
|
|
|
|
|
mcall 38,,edi,0
|
|
|
|
|
add edi,VSPACE shl 16+VSPACE
|
|
|
|
|
pop ecx
|
|
|
|
|
loop .l1
|
|
|
|
|
mov ecx,17
|
|
|
|
|
mov edi,(TMARGIN+VSPACE)shl 16+TMARGIN+VSPACE*10
|
|
|
|
|
mov ebx,LMARGIN shl 16+LMARGIN
|
|
|
|
|
.l2:
|
|
|
|
|
push ecx
|
|
|
|
|
mcall 38,,edi,0
|
|
|
|
|
add ebx,HSPACE shl 16+HSPACE
|
|
|
|
|
pop ecx
|
|
|
|
|
loop .l2
|
|
|
|
|
ret
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
draw_numbers:
|
|
|
|
|
mcall 4,(LMARGIN+2) shl 16+180,0,numb,numb_len-numb
|
|
|
|
|
mov eax,dword[sel_byte]
|
|
|
|
|
shl ax,12
|
|
|
|
|
shr eax,12
|
|
|
|
|
mov edi,eax
|
|
|
|
|
if ~ DUMP_TEST eq 1
|
|
|
|
|
add edi,ipcbuff+16
|
|
|
|
|
end if
|
|
|
|
|
mov edx,(LMARGIN+2+6*6)shl 16+180
|
|
|
|
|
mov ebx,0x30000
|
|
|
|
|
movzx ecx,byte[edi]
|
|
|
|
|
mcall 47,,,,0x4e00e7
|
|
|
|
|
add ebx,0x20000
|
|
|
|
|
add edx,(6*10)shl 16
|
|
|
|
|
movzx ecx,word[edi]
|
|
|
|
|
mcall
|
|
|
|
|
add ebx,0x50000
|
|
|
|
|
add edx,(6*13)shl 16
|
|
|
|
|
mov ecx,[edi]
|
|
|
|
|
mcall
|
|
|
|
|
mov ebx,0x80100
|
|
|
|
|
add edx,(6*19)shl 16
|
|
|
|
|
mcall
|
|
|
|
|
.ex:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
draw_dump:
|
|
|
|
|
; esi - data ptr, ecx - length
|
|
|
|
|
jecxz draw_numbers.ex
|
|
|
|
|
pusha
|
|
|
|
|
call draw_numbers
|
|
|
|
|
mcall 4,(LMARGIN+2) shl 16+27,0,dump_title,dump_t_len-dump_title
|
|
|
|
|
mcall 47,0x30101,ipcbuff+8,(LMARGIN+2+6*29)shl 16+27
|
2010-08-17 23:40:33 +02:00
|
|
|
|
add edx,(6*27) shl 16
|
|
|
|
|
mov ecx,offs
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mcall
|
2010-08-17 23:40:33 +02:00
|
|
|
|
sub edx,(5*6)shl 16
|
2006-08-18 15:32:18 +02:00
|
|
|
|
mcall ,0x30001
|
|
|
|
|
mov ecx,16
|
|
|
|
|
mov edi,HSPACE shl 16
|
|
|
|
|
mov ebx,(LMARGIN+5)shl 16+42
|
|
|
|
|
call draw_marks
|
|
|
|
|
mov ecx,[esp+24]
|
|
|
|
|
dec ecx
|
|
|
|
|
shr ecx,4
|
|
|
|
|
inc ecx
|
|
|
|
|
mov ebx,(LMARGIN-10)shl 16+TMARGIN+2+VSPACE
|
|
|
|
|
mov edi,VSPACE
|
|
|
|
|
call draw_marks
|
|
|
|
|
popa
|
|
|
|
|
mov edx,TMARGIN+2
|
|
|
|
|
mov edi,ecx
|
2010-08-17 23:40:33 +02:00
|
|
|
|
.lp:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
add edx,(LMARGIN+2) shl 16+VSPACE
|
|
|
|
|
mov ecx,16
|
|
|
|
|
cmp edi,ecx
|
|
|
|
|
jae .less
|
|
|
|
|
mov ecx,edi
|
2010-08-17 23:40:33 +02:00
|
|
|
|
.less:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
sub edi,ecx
|
|
|
|
|
push esi ecx
|
|
|
|
|
mov ebx,0x20100
|
2010-08-17 23:40:33 +02:00
|
|
|
|
.lp1:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
push ecx esi
|
|
|
|
|
movzx ecx,byte[esi]
|
|
|
|
|
mcall 47,,,,0
|
|
|
|
|
add edx,HSPACE shl 16
|
|
|
|
|
pop esi ecx
|
|
|
|
|
inc esi
|
|
|
|
|
loop .lp1
|
|
|
|
|
pusha
|
|
|
|
|
mov ebx,edx
|
|
|
|
|
and ebx,0xffff
|
|
|
|
|
add ebx,(LMARGIN+16*HSPACE+15)shl 16
|
|
|
|
|
mov edx,[esp+36]
|
|
|
|
|
mov esi,[esp+32]
|
|
|
|
|
mcall 4,,0
|
|
|
|
|
popa
|
|
|
|
|
add esp,8
|
|
|
|
|
and edx,0xffff
|
|
|
|
|
test edi,edi
|
|
|
|
|
jnz .lp
|
|
|
|
|
.ex:
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
draw_marks:
|
|
|
|
|
; ebx -xy, edi-addition, ecx -cycles
|
|
|
|
|
pusha
|
|
|
|
|
mov edx,__hexdigits
|
|
|
|
|
mov eax,4
|
|
|
|
|
mov esi,1
|
|
|
|
|
.tt:
|
|
|
|
|
push ecx
|
|
|
|
|
mcall ,,0xffffff
|
|
|
|
|
add ebx,edi
|
|
|
|
|
inc edx
|
|
|
|
|
pop ecx
|
|
|
|
|
loop .tt
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
dump_btn: ; ecx-length
|
|
|
|
|
jecxz draw_dump.ex
|
|
|
|
|
pusha
|
|
|
|
|
test ecx,0xffff
|
|
|
|
|
je .even
|
|
|
|
|
add ecx,16
|
2010-08-17 23:40:33 +02:00
|
|
|
|
.even:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
shr ecx,4
|
|
|
|
|
imul ecx,VSPACE
|
|
|
|
|
add ecx,(TMARGIN+VSPACE)shl 16-5
|
|
|
|
|
mcall 8,LMARGIN shl 16+16*HSPACE-5,,10+3 shl 29,[sc.work]
|
|
|
|
|
inc edx
|
|
|
|
|
mcall ,(LMARGIN+16*HSPACE+15)shl 16+6*16
|
|
|
|
|
mov edx,0xff0000
|
|
|
|
|
mov esi,dump_cell_size
|
|
|
|
|
xor eax,eax
|
|
|
|
|
movzx ebx,[sel_byte]
|
|
|
|
|
lodsw
|
|
|
|
|
imul bx,ax
|
|
|
|
|
shl ebx,16
|
|
|
|
|
lea ebx,[ebx+eax+LMARGIN shl 16]
|
|
|
|
|
movzx ecx,[sel_byte+2]
|
|
|
|
|
lodsw
|
|
|
|
|
imul cx,ax
|
|
|
|
|
shl ecx,16
|
|
|
|
|
lea ecx,[ecx+eax+(TMARGIN+VSPACE) shl 16]
|
|
|
|
|
mcall 13
|
|
|
|
|
movzx ebx,[sel_byte]
|
|
|
|
|
lodsw
|
|
|
|
|
imul bx,ax
|
|
|
|
|
shl ebx,16
|
|
|
|
|
lea ebx,[ebx+eax+(LMARGIN+16*HSPACE+15)shl 16]
|
|
|
|
|
mcall 13
|
|
|
|
|
popa
|
|
|
|
|
.ex:
|
2010-08-17 23:40:33 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if WRITE_LOG
|
|
|
|
|
;********************************************
|
|
|
|
|
;* input: esi = pointer to the file name *
|
|
|
|
|
;********************************************
|
|
|
|
|
|
|
|
|
|
CreateFile:
|
|
|
|
|
pusha
|
|
|
|
|
mov dword [InfoStructure], 2 ; create file
|
|
|
|
|
mov dword [InfoStructure+4], 0 ; reserved
|
|
|
|
|
mov dword [InfoStructure+8], 0 ; reserved
|
|
|
|
|
mov dword [InfoStructure+12], 0 ; 0 bytes to write (just create)
|
|
|
|
|
mov dword [InfoStructure+16], 0 ; NULL data pointer (no data)
|
|
|
|
|
mov dword [InfoStructure+20], 0 ; reserved
|
|
|
|
|
mov dword [InfoStructure+21], esi ; pointer to the file name
|
|
|
|
|
mcall 70, InfoStructure
|
|
|
|
|
clc
|
|
|
|
|
test eax, eax
|
|
|
|
|
jz .out
|
|
|
|
|
stc
|
|
|
|
|
.out:
|
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;********************************************
|
|
|
|
|
;* input: esi = pointer to the file name *
|
|
|
|
|
;* edx = pointer to data buffer *
|
|
|
|
|
;* ecx = data length *
|
|
|
|
|
;********************************************
|
|
|
|
|
|
|
|
|
|
WriteToFile:
|
|
|
|
|
push ebx
|
|
|
|
|
mov dword [InfoStructure], 3 ; write to file
|
|
|
|
|
mov eax, [filepos]
|
|
|
|
|
mov dword [InfoStructure+4], eax ; lower position addr
|
|
|
|
|
mov dword [InfoStructure+8], 0 ; upper position addr (0 for FAT)
|
|
|
|
|
mov dword [InfoStructure+12], ecx ; number of bytes to write
|
|
|
|
|
mov dword [InfoStructure+16], edx ; pointer to data buffer
|
|
|
|
|
mov dword [InfoStructure+20], 0 ; reserved
|
|
|
|
|
mov dword [InfoStructure+21], esi ; pointer to the file name
|
|
|
|
|
mcall 70, InfoStructure
|
|
|
|
|
clc
|
|
|
|
|
test eax, eax
|
|
|
|
|
jz .out
|
|
|
|
|
stc
|
|
|
|
|
.out:
|
|
|
|
|
pop ebx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InfoStructure:
|
|
|
|
|
dd 0x0 ; subfunction number
|
|
|
|
|
dd 0x0 ; position in the file in bytes
|
|
|
|
|
dd 0x0 ; upper part of the position address
|
|
|
|
|
dd 0x0 ; number of bytes to read
|
|
|
|
|
dd 0x0 ; pointer to the buffer to write data
|
|
|
|
|
db 0
|
|
|
|
|
dd 0 ; pointer to the filename
|
|
|
|
|
|
|
|
|
|
filepos dd 0
|
|
|
|
|
filename db '/sys/boardlog.txt',0
|
|
|
|
|
tmp db 0
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
|
|
|
|
|
krnl_msg db 'K : '
|
|
|
|
|
duk db 'KernUserDump'
|
|
|
|
|
numb db 'Byte: Word: Dword: Hex:'
|
|
|
|
|
numb_len:
|
|
|
|
|
dump_title db 'Dump from (pid= h) Offset: ( h)'
|
|
|
|
|
dump_t_len:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
; DATA AREA
|
|
|
|
|
|
2006-08-18 15:32:18 +02:00
|
|
|
|
dump_cell_marg dd LMARGIN shl 16,(LMARGIN+16*HSPACE+15)shl 16
|
|
|
|
|
dump_cell_size dw HSPACE,VSPACE,6,VSPACE
|
|
|
|
|
; 11,11 > 0,-1
|
|
|
|
|
; 5,11 > 0,-1
|
2006-01-03 10:43:31 +01:00
|
|
|
|
if lang eq ru
|
2010-08-17 23:40:33 +02:00
|
|
|
|
title db '<27><>᪠ <20>⫠<EFBFBD><E2ABA0><EFBFBD> <20> ᮮ<>饭<EFBFBD><E9A5AD>',0
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
else if lang eq en
|
2010-08-17 23:40:33 +02:00
|
|
|
|
title db 'General debug & message board',0
|
mv, gifview, jpegview: modified to use function 70
tinypad2: modified for new sysxtree
kernel, mv, board, calendar, cmd, copy2, cpu, end, icon, mhc, pcidev:
german translation from derPENGUIN
git-svn-id: svn://kolibrios.org@135 a494cfbc-eb01-0410-851d-a64ba20cac60
2006-08-25 15:06:57 +02:00
|
|
|
|
else
|
2010-08-17 23:40:33 +02:00
|
|
|
|
title db 'Allgemeines debug- & nachrichtenboard',0
|
2006-01-03 10:43:31 +01:00
|
|
|
|
end if
|
2006-11-02 15:18:23 +01:00
|
|
|
|
krnl_cnt dd 0
|
2010-08-17 23:40:33 +02:00
|
|
|
|
vmode dd 1
|
2006-08-18 15:32:18 +02:00
|
|
|
|
targ dd text2
|
2006-01-03 10:43:31 +01:00
|
|
|
|
I_END:
|
2006-08-18 15:32:18 +02:00
|
|
|
|
offs dd ?
|
|
|
|
|
flag rb 1
|
|
|
|
|
ipcbuff rb IPC_BUF+20
|
|
|
|
|
rd 2
|
|
|
|
|
; x1pos dd ?
|
|
|
|
|
; y1pos dd ?
|
|
|
|
|
text1 rb 80*(MAXSTRINGS+1)
|
|
|
|
|
tmp1 db ?
|
|
|
|
|
rd 2
|
|
|
|
|
; x2pos dd ?
|
|
|
|
|
; y2pos dd ?
|
|
|
|
|
text2 rb 80*(MAXSTRINGS+1)
|
|
|
|
|
tmp2 db ?
|
|
|
|
|
work rb 4096
|
|
|
|
|
sel_byte dw ?,?
|
|
|
|
|
pid dd ?
|
2006-01-03 10:43:31 +01:00
|
|
|
|
xstart dd ?
|
2006-08-18 15:32:18 +02:00
|
|
|
|
dump_len dd ?
|
|
|
|
|
sc system_colors
|
|
|
|
|
i_end:
|