Fixed sys_msg_board (fn 63) to not rely on cross_order and take arguments in original order.

git-svn-id: svn://kolibrios.org@3614 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
shikhin 2013-06-07 14:12:54 +00:00
parent 37b9069351
commit d4216492e1
10 changed files with 53 additions and 46 deletions

View File

@ -71,7 +71,7 @@ kernel_export \
HwCursorCreate,\ HwCursorCreate,\
\ \
SysMsgBoardStr,\ SysMsgBoardStr,\
SysMsgBoardChar,\ SysMsgBoard,\
GetCurrentTask,\ GetCurrentTask,\
LoadFile,\ LoadFile,\
SendEvent,\ SendEvent,\

View File

@ -234,26 +234,26 @@ macro DEBUGH_N _sign,_num,_hex {
debug_func fdo_debug_outchar debug_func fdo_debug_outchar
debug_beginf debug_beginf
pushad pushad
movzx ebx,al movzx ecx,al
mov eax,1 mov ebx,1
; mov ecx,sys_msg_board ; mov ecx,sys_msg_board
; call ecx ; sys_msg_board ; call ecx ; sys_msg_board
stdcall SysMsgBoardChar stdcall SysMsgBoard
popad popad
ret ret
debug_endf debug_endf
debug_func fdo_debug_outstr debug_func fdo_debug_outstr
debug_beginf debug_beginf
mov eax,1 mov ebx,1
.l1: dec esi .l1: dec esi
js .l2 js .l2
movzx ebx,byte[edx] movzx ecx,byte[edx]
or bl,bl or cl,cl
jz .l2 jz .l2
; mov ecx,sys_msg_board ; mov ecx,sys_msg_board
; call ecx ; sys_msg_board ; call ecx ; sys_msg_board
stdcall SysMsgBoardChar stdcall SysMsgBoard
inc edx inc edx
jmp .l1 jmp .l1
.l2: ret .l2: ret

View File

@ -75,7 +75,7 @@ kernel_export \
HwCursorCreate,\ HwCursorCreate,\
\ \
SysMsgBoardStr,\ SysMsgBoardStr,\
SysMsgBoardChar,\ SysMsgBoard,\
GetCurrentTask,\ GetCurrentTask,\
LoadFile,\ LoadFile,\
SendEvent,\ SendEvent,\

View File

@ -66,7 +66,7 @@ iglobal
szLoadCursor db 'LoadCursor',0 szLoadCursor db 'LoadCursor',0
szSysMsgBoardStr db 'SysMsgBoardStr', 0 szSysMsgBoardStr db 'SysMsgBoardStr', 0
szSysMsgBoardChar db 'SysMsgBoardChar', 0 szSysMsgBoard db 'SysMsgBoard', 0
szGetCurrentTask db 'GetCurrentTask',0 szGetCurrentTask db 'GetCurrentTask',0
szLFBAddress db 'LFBAddress',0 szLFBAddress db 'LFBAddress',0
szLoadFile db 'LoadFile',0 szLoadFile db 'LoadFile',0
@ -163,7 +163,7 @@ kernel_export:
dd szLoadCursor , load_cursor ;stdcall dd szLoadCursor , load_cursor ;stdcall
dd szSysMsgBoardStr , sys_msg_board_str dd szSysMsgBoardStr , sys_msg_board_str
dd szSysMsgBoardChar , sys_msg_board dd szSysMsgBoard , sys_msg_board
dd szGetCurrentTask , get_curr_task dd szGetCurrentTask , get_curr_task
dd szLoadFile , load_file ;retval eax, ebx dd szLoadFile , load_file ;retval eax, ebx
dd szSendEvent , send_event ;see EVENT.inc for specification dd szSendEvent , send_event ;see EVENT.inc for specification

View File

@ -121,8 +121,8 @@ iglobal
dd 0 dd 0
dd 0 dd 0
dd 0 dd 0
dd 0 ; 62-PCI functions dd 0
dd sys_msg_board ; 63-System message board dd 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; NEW SYSTEM FUNCTIONS TABLE ;; ;; NEW SYSTEM FUNCTIONS TABLE ;;
@ -192,8 +192,8 @@ iglobal
dd undefined_syscall ; 59-reserved dd undefined_syscall ; 59-reserved
dd sys_IPC ; 60-Inter Process Communication dd sys_IPC ; 60-Inter Process Communication
dd sys_gs ; 61-Direct graphics access dd sys_gs ; 61-Direct graphics access
dd pci_api ;cross_order ; 62-PCI functions dd pci_api ; 62-PCI functions
dd cross_order ; 63-System message board dd sys_msg_board ; 63-System message board
dd sys_resize_app_memory ; 64-Resize application memory usage dd sys_resize_app_memory ; 64-Resize application memory usage
dd sys_putimage_palette ; 65-PutImagePalette dd sys_putimage_palette ; 65-PutImagePalette
dd sys_process_def ; 66-Process definitions - keyboard dd sys_process_def ; 66-Process definitions - keyboard

View File

@ -248,27 +248,27 @@ macro DEBUGH_N _sign,_num,_hex {
debug_func fdo_debug_outchar debug_func fdo_debug_outchar
debug_beginf debug_beginf
pushad pushad
movzx ebx, al movzx ecx, al
mov eax, 1 mov ebx, 1
; mov ecx,sys_msg_board ; mov ecx,sys_msg_board
; call ecx ; sys_msg_board ; call ecx ; sys_msg_board
stdcall SysMsgBoardChar stdcall SysMsgBoard
popad popad
ret ret
debug_endf debug_endf
debug_func fdo_debug_outstr debug_func fdo_debug_outstr
debug_beginf debug_beginf
mov eax, 1 mov ebx, 1
.l1: .l1:
dec esi dec esi
js .l2 js .l2
movzx ebx, byte[edx] movzx ecx, byte[edx]
or bl, bl or cl, cl
jz .l2 jz .l2
; mov ecx,sys_msg_board ; mov ecx,sys_msg_board
; call ecx ; sys_msg_board ; call ecx ; sys_msg_board
stdcall SysMsgBoardChar stdcall SysMsgBoard
inc edx inc edx
jmp .l1 jmp .l1
.l2: .l2:

View File

@ -75,7 +75,7 @@ kernel_export \
HwCursorCreate,\ HwCursorCreate,\
\ \
SysMsgBoardStr,\ SysMsgBoardStr,\
SysMsgBoardChar,\ SysMsgBoard,\
GetCurrentTask,\ GetCurrentTask,\
LoadFile,\ LoadFile,\
SendEvent,\ SendEvent,\

View File

@ -241,25 +241,23 @@ esp equ _esp
debug_func fdo_debug_outchar debug_func fdo_debug_outchar
debug_beginf debug_beginf
pushad pushad
movzx ebx, al movzx ecx, al
mov eax, 1 mov ebx, 1
mov ecx, sys_msg_board call sys_msg_board
call ecx ; sys_msg_board
popad popad
ret ret
debug_endf debug_endf
debug_func fdo_debug_outstr debug_func fdo_debug_outstr
debug_beginf debug_beginf
mov eax, 1 mov ebx, 1
.l1: .l1:
dec esi dec esi
js .l2 js .l2
movzx ebx, byte[edx] movzx ecx, byte[edx]
or bl, bl or cl, cl
jz .l2 jz .l2
mov ecx, sys_msg_board call sys_msg_board
call ecx ; sys_msg_board
inc edx inc edx
jmp .l1 jmp .l1
.l2: .l2:

View File

@ -4680,8 +4680,8 @@ sys_msg_board_str:
@@: @@:
cmp [esi], byte 0 cmp [esi], byte 0
je @f je @f
mov eax, 1 mov ebx, 1
movzx ebx, byte [esi] movzx ecx, byte [esi]
call sys_msg_board call sys_msg_board
inc esi inc esi
jmp @b jmp @b
@ -4721,9 +4721,9 @@ sys_msg_board_dword:
cmp al, 10 cmp al, 10
sbb al, 69h sbb al, 69h
das das
mov bl, al mov cl, al
xor eax, eax xor ebx, ebx
inc eax inc ebx
call sys_msg_board call sys_msg_board
pop eax pop eax
pop ecx pop ecx
@ -4740,8 +4740,12 @@ endg
sys_msg_board: sys_msg_board:
; eax=1 : write : bl byte to write ; ebx=1 : write : bl byte to write
; eax=2 : read : ebx=0 -> no data, ebx=1 -> data in al ; ebx=2 : read : ebx=0 -> no data, ebx=1 -> data in al
push eax ebx ; Save eax and ebx, since we're restoring their order required.
mov eax, ebx
mov ebx, ecx
mov ecx, [msg_board_count] mov ecx, [msg_board_count]
cmp eax, 1 cmp eax, 1
@ -4799,24 +4803,29 @@ end if
inc ecx inc ecx
and ecx, msg_board_data_size - 1 and ecx, msg_board_data_size - 1
mov [msg_board_count], ecx mov [msg_board_count], ecx
pop ebx eax
ret ret
.smbl1: .smbl1:
cmp eax, 2 cmp eax, 2
jne .smbl2 jne .smbl2
test ecx, ecx test ecx, ecx
jz .smbl21 jz .smbl21
add esp, 8 ; Returning data in ebx and eax, so no need to restore them.
mov eax, msg_board_data+1 mov eax, msg_board_data+1
mov ebx, msg_board_data mov ebx, msg_board_data
movzx edx, byte [ebx] movzx edx, byte [ebx]
call memmove call memmove
dec [msg_board_count] dec [msg_board_count]
mov [esp + 36], edx ;eax mov [esp + 32], edx ;eax
mov [esp + 24], dword 1 mov [esp + 20], dword 1
ret ret
.smbl21: .smbl21:
mov [esp+36], ecx mov [esp+32], ecx
mov [esp+24], ecx mov [esp+20], ecx
.smbl2: .smbl2:
pop ebx eax
ret ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -62,7 +62,7 @@ debug_outchar: ; al - char
;int 0x40 ;int 0x40
mov bl, al mov bl, al
mov eax, 1 mov eax, 1
call SysMsgBoardChar call SysMsgBoard
popad popad
popf popf
ret ret
@ -138,7 +138,7 @@ debug_outhex:
popf popf
ret ret
SysMsgBoardChar: SysMsgBoard:
push eax ebx ecx push eax ebx ecx
mov cl, al mov cl, al
mov eax, 63 mov eax, 63
@ -153,7 +153,7 @@ SysMsgBoardStr:
lodsb lodsb
or al, al or al, al
jz @f jz @f
call SysMsgBoardChar call SysMsgBoard
jmp @b jmp @b
@@: @@:
pop eax pop eax