Version of board that write log file.

git-svn-id: svn://kolibrios.org@1571 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Asper 2010-08-17 21:40:33 +00:00
parent dc2f932249
commit a74d0205d1

View File

@ -11,6 +11,7 @@ HSPACE equ 16
VSPACE equ 12 VSPACE equ 12
IPC_BUF equ 160 IPC_BUF equ 160
DR_GRID equ 0;1 DR_GRID equ 0;1
WRITE_LOG equ 1
FL_KRNL equ 1 FL_KRNL equ 1
@ -64,6 +65,10 @@ START: ; start of execution
mov ecx,sc mov ecx,sc
mov edx,sizeof.system_colors mov edx,sizeof.system_colors
mcall mcall
if WRITE_LOG
mov esi, filename
call CreateFile
end if
red: red:
call draw_window call draw_window
@ -91,6 +96,25 @@ still:
jne still jne still
new_data: new_data:
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
mov ebp,[targ] mov ebp,[targ]
.no4: .no4:
cmp al,13 cmp al,13
@ -503,6 +527,73 @@ dump_btn: ; ecx-length
.ex: .ex:
ret 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
krnl_msg db 'K : ' krnl_msg db 'K : '
duk db 'KernUserDump' duk db 'KernUserDump'
numb db 'Byte: Word: Dword: Hex:' numb db 'Byte: Word: Dword: Hex:'
@ -524,7 +615,7 @@ else
title db 'Allgemeines debug- & nachrichtenboard',0 title db 'Allgemeines debug- & nachrichtenboard',0
end if end if
krnl_cnt dd 0 krnl_cnt dd 0
vmode dd 0 vmode dd 1
targ dd text2 targ dd text2
I_END: I_END:
offs dd ? offs dd ?