3,25 → 3,22 |
; See f63 |
; Compile with FASM for KolibriOS |
;------------------------------------------------------------------------------ |
include 'lang.inc' |
WRITE_LOG equ 1 |
P_LEN equ 11 |
;------------------------------------------------------------------------------ |
use32 |
org 0x0 |
org 0 |
db 'MENUET01' |
dd 0x01 |
dd 1 |
dd START |
dd I_END |
dd mem |
dd mem |
dd filename, 0x0 |
dd filename |
dd 0 |
;------------------------------------------------------------------------------ |
include 'lang.inc' |
include '../../../macros.inc' |
include '../../../debug.inc' |
purge newline |
MAXSTRINGS = 45 |
TMP = 80*(MAXSTRINGS+1) |
;------------------------------------------------------------------------------ |
START: |
call CheckUnique |
35,14 → 32,18 |
test al,al |
jnz @b |
param: |
mov ecx, TMP |
xor eax, eax |
mov edi, [targ] |
rep stosb |
mov ecx, (MAXSTRINGS+1)*20 |
mov edi, text1 |
mov eax, ' ' |
rep stosd |
|
mov [tmp1], 'x' |
mov [tmp2], 'x' |
mov ecx, (MAXSTRINGS+1)*20 |
mov edi, text2 |
rep stosd |
|
mov byte [tmp1], 'x' |
mov byte [tmp2], 'x' |
|
mcall 14 |
and eax, 0xffff0000 |
sub eax, 399 shl 16 |
84,16 → 85,16 |
mov [ebx+tmp], al |
inc [buffer_length] |
mov ebp, [targ] |
.no4: |
cmp al, 10 |
jz new_line |
cmp al, 13 |
jne no13 |
and [ebp-8], dword 0 |
jmp new_check |
jz new_check |
jmp char |
;------------------------------------------ |
write_buffer: |
pusha |
mov edx, tmp |
movzx ecx, byte[buffer_length] ;1 |
movzx ecx, byte[buffer_length] |
mov esi, filename |
.write_to_logfile: |
call WriteToFile |
111,9 → 112,7 |
popa |
ret |
;------------------------------------------ |
no13: |
cmp al, 10 |
jne no10 |
new_line: |
and [ebp-8], dword 0 |
inc dword [ebp-4] |
cmp [ebp-4], dword MAXSTRINGS |
121,23 → 120,23 |
mov [ebp-4], dword MAXSTRINGS |
lea esi, [ebp+80] |
mov edi, ebp |
mov ecx, 80*(MAXSTRINGS) |
mov ecx, 20*(MAXSTRINGS) |
cld |
rep movsb |
rep movsd |
|
mov esi, [ebp-4] |
imul esi, 80 |
add esi, [ebp-8] |
add esi, ebp |
mov ecx, 80 |
mov al ,' ' |
rep stosb |
mov ecx, 20 |
mov eax, ' ' |
rep stosd |
.noypos: |
mov [targ],text2 |
and [krnl_cnt],0 |
jmp new_check |
;------------------------------------------ |
no10: |
char: |
cmp ebp, text1 |
je add2 |
mov ecx, [krnl_cnt] |
399,22 → 398,9 |
.leave_check: |
ret |
|
;------------------------------------------------------------------------------ |
; DATA |
|
;------------------------------------------------------------------------------ |
;*********************************** DATA ************************************ |
;------------------------------------------------------------------------------ |
align 4 |
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 0x0 |
dd 0x0 ; pointer to the filename |
filepos dd 0x0 |
default_filename db '/sys/boardlog.txt',0 |
;------------------------------------------------------------------------------ |
if lang eq ru |
title db '®áª ®â« ¤ª¨ ¨ á®®¡é¥¨©',0 |
else if lang eq it |
424,40 → 410,46 |
else |
title db 'General debug & message board',0 |
end if |
;------------------------------------------------------------------------------ |
|
default_filename db '/sys/boardlog.txt',0 |
krnl_msg db 'K : ' |
duk db 'KernUser' |
krnl_cnt dd 0 |
my_name db 'board',0 |
my_name_size = $-my_name |
|
align 4 |
vmode dd 1 |
targ dd text2 |
my_name db 'board',0 |
my_name_size = $-my_name |
process_count dd 0x0 |
pid_tid dd 0x0 |
;------------------------------------------------------------------------------ |
|
I_END: |
;------------------------------------------------------------------------------ |
offs dd ? |
flag rb 1 |
|
InfoStructure: |
dd ? ; subfunction number |
dd ? ; position in the file in bytes |
dd ? ; upper part of the position address |
dd ? ; number of bytes to read |
dd ? ; pointer to the buffer to write data |
db ? |
dd ? ; pointer to the filename |
|
buffer_length rb 3 |
process_count dd ? |
krnl_cnt dd ? |
pid_tid dd ? |
filepos dd ? |
xstart dd ? |
sc sys_colors_new |
|
rd 2 |
text1 rb 80*(MAXSTRINGS+1) |
tmp1 db ? |
tmp1 dd ? |
|
rd 2 |
text2 rb 80*(MAXSTRINGS+1) |
tmp2 db ? |
xstart dd ? |
sc sys_colors_new |
i_end: |
buffer_length rb 1 |
;------------------------------------------------------------------------------ |
tmp2 dd ? |
|
tmp rb 256 |
filename rb 256 |
;------------------------------------------------------------------------------ |
align 4 |
procinfo: |
rb 1024 |
;------------------------------------------------------------------------------ |
align 4 |
procinfo rb 1024 |
stackbuf rb 2000h |
;------------------------------------------------------------------------------ |
mem: |
mem: |