forked from KolibriOS/kolibrios
Made Netstat application run on P5 processors
git-svn-id: svn://kolibrios.org@1528 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
c6d66896a5
commit
f01c3da0f2
@ -1,47 +1,47 @@
|
|||||||
@^ fix macro comment {
|
@^ fix macro comment {
|
||||||
^@ fix }
|
^@ fix }
|
||||||
|
|
||||||
; -------------------------
|
; -------------------------
|
||||||
macro library [lname,fname]
|
macro library [lname,fname]
|
||||||
{
|
{
|
||||||
forward
|
forward
|
||||||
dd __#lname#_library_table__,__#lname#_library_name__
|
dd __#lname#_library_table__,__#lname#_library_name__
|
||||||
common
|
common
|
||||||
dd 0
|
dd 0
|
||||||
forward
|
forward
|
||||||
align 4
|
align 4
|
||||||
__#lname#_library_name__ db fname,0
|
__#lname#_library_name__ db fname,0
|
||||||
}
|
}
|
||||||
|
|
||||||
macro import lname,[name,sname]
|
macro import lname,[name,sname]
|
||||||
{
|
{
|
||||||
common
|
common
|
||||||
align 4
|
align 4
|
||||||
__#lname#_library_table__:
|
__#lname#_library_table__:
|
||||||
forward
|
forward
|
||||||
if used name
|
if used name
|
||||||
name dd __#name#_import_name__
|
name dd __#name#_import_name__
|
||||||
end if
|
end if
|
||||||
common
|
common
|
||||||
dd 0
|
dd 0
|
||||||
forward
|
forward
|
||||||
if used name
|
if used name
|
||||||
align 4
|
align 4
|
||||||
__#name#_import_name__ db sname,0
|
__#name#_import_name__ db sname,0
|
||||||
end if
|
end if
|
||||||
}
|
}
|
||||||
|
|
||||||
macro export [name,sname]
|
macro export [name,sname]
|
||||||
{
|
{
|
||||||
forward
|
forward
|
||||||
dd __#name#_export_name__,name
|
dd __#name#_export_name__,name
|
||||||
common
|
common
|
||||||
dd 0
|
dd 0
|
||||||
forward
|
forward
|
||||||
align 4
|
align 4
|
||||||
__#name#_export_name__ db sname,0
|
__#name#_export_name__ db sname,0
|
||||||
}
|
}
|
||||||
; -------------------------
|
; -------------------------
|
||||||
|
|
||||||
macro m2m dest,src {
|
macro m2m dest,src {
|
||||||
push src
|
push src
|
||||||
@ -57,7 +57,7 @@ macro uglobal {
|
|||||||
UGlobals equ UGlobals,
|
UGlobals equ UGlobals,
|
||||||
macro __UGlobalBlock { }
|
macro __UGlobalBlock { }
|
||||||
|
|
||||||
endg fix } ; Use endg for ending iglobal and uglobal blocks.
|
endg fix } ; Use endg for ending iglobal and uglobal blocks.
|
||||||
|
|
||||||
|
|
||||||
macro IncludeIGlobals{
|
macro IncludeIGlobals{
|
||||||
@ -176,7 +176,7 @@ struc mls [sstring]
|
|||||||
db ssize
|
db ssize
|
||||||
db sstring
|
db sstring
|
||||||
common
|
common
|
||||||
db -1 ; mod
|
db -1 ; mod
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ macro __mov reg,a,b { ; mike.dld
|
|||||||
|
|
||||||
|
|
||||||
include 'config.inc'
|
include 'config.inc'
|
||||||
;__CPU_type equ p5
|
;__CPU_type equ p5
|
||||||
SYSENTER_VAR equ 0
|
SYSENTER_VAR equ 0
|
||||||
|
|
||||||
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
|
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
|
||||||
@ -481,7 +481,7 @@ struct process_information
|
|||||||
slot_state dw ? ; +50
|
slot_state dw ? ; +50
|
||||||
dw ? ; +52
|
dw ? ; +52
|
||||||
client_box BOX ; +54
|
client_box BOX ; +54
|
||||||
wnd_state db ? ; +70
|
wnd_state db ? ; +70
|
||||||
rb (1024-71)
|
rb (1024-71)
|
||||||
ends
|
ends
|
||||||
|
|
||||||
@ -518,6 +518,31 @@ struct FILEINFO
|
|||||||
Size dq ?
|
Size dq ?
|
||||||
ends
|
ends
|
||||||
|
|
||||||
|
|
||||||
|
if __CPU_type eq p5 ; CMOVcc isnt supported on the P5
|
||||||
|
|
||||||
|
cmove fix cmovz
|
||||||
|
macro cmovz reg1, reg2 {
|
||||||
|
|
||||||
|
local .jumpaddr
|
||||||
|
|
||||||
|
jnz .jumpaddr
|
||||||
|
mov reg1, reg2
|
||||||
|
.jumpaddr:
|
||||||
|
}
|
||||||
|
|
||||||
|
cmovne fix cmovnz
|
||||||
|
macro cmovnz reg1, reg2 {
|
||||||
|
|
||||||
|
local .jumpaddr
|
||||||
|
|
||||||
|
jz .jumpaddr
|
||||||
|
mov reg1, reg2
|
||||||
|
.jumpaddr:
|
||||||
|
}
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
; constants
|
; constants
|
||||||
|
|
||||||
; events
|
; events
|
||||||
@ -540,4 +565,4 @@ EVM_EXIT = 1000b
|
|||||||
EVM_BACKGROUND = 10000b
|
EVM_BACKGROUND = 10000b
|
||||||
EVM_MOUSE = 100000b
|
EVM_MOUSE = 100000b
|
||||||
EVM_IPC = 1000000b
|
EVM_IPC = 1000000b
|
||||||
EVM_STACK = 10000000b
|
EVM_STACK = 10000000b
|
||||||
|
@ -11,7 +11,7 @@ use32
|
|||||||
db 'MENUET01' ; 8 byte id
|
db 'MENUET01' ; 8 byte id
|
||||||
dd 0x01 ; header version
|
dd 0x01 ; header version
|
||||||
dd START ; start of code
|
dd START ; start of code
|
||||||
dd IM_END ; size of image
|
dd I_END ; size of image
|
||||||
dd (I_END+0x100) ; memory for app
|
dd (I_END+0x100) ; memory for app
|
||||||
dd (I_END+0x100) ; esp
|
dd (I_END+0x100) ; esp
|
||||||
dd I_PARAM , 0x0 ; I_Param , I_Icon
|
dd I_PARAM , 0x0 ; I_Param , I_Icon
|
||||||
@ -25,14 +25,12 @@ include '..\debug-fdo.inc'
|
|||||||
START: ; start of execution
|
START: ; start of execution
|
||||||
; TODO: check Parameters
|
; TODO: check Parameters
|
||||||
|
|
||||||
DEBUGF 1, 'Hello!\n'
|
DEBUGF 1, 'Netstat application loaded!\n'
|
||||||
|
|
||||||
|
|
||||||
redraw:
|
redraw:
|
||||||
|
|
||||||
mcall 12, 1
|
mcall 12, 1
|
||||||
|
|
||||||
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc, ,name
|
mcall 0, 100 shl 16 + 520, 100 shl 16 + 240, 0x34bcbcbc , , name
|
||||||
|
|
||||||
mov edx, 101
|
mov edx, 101
|
||||||
mov esi, 0x00aaaaff
|
mov esi, 0x00aaaaff
|
||||||
@ -42,7 +40,7 @@ START: ; start of execution
|
|||||||
cmove esi, edi
|
cmove esi, edi
|
||||||
mcall 8, 25 shl 16 + 65, 25 shl 16 + 20
|
mcall 8, 25 shl 16 + 65, 25 shl 16 + 20
|
||||||
|
|
||||||
@@:
|
.morebuttons:
|
||||||
inc edx
|
inc edx
|
||||||
add ebx, 75 shl 16
|
add ebx, 75 shl 16
|
||||||
mov esi, 0x00aaaaff
|
mov esi, 0x00aaaaff
|
||||||
@ -52,12 +50,12 @@ START: ; start of execution
|
|||||||
mcall
|
mcall
|
||||||
|
|
||||||
cmp edx, 105
|
cmp edx, 105
|
||||||
jle @r
|
jle .morebuttons
|
||||||
|
|
||||||
mcall 4, 28 shl 16 + 31, 0x80000000, modes
|
mcall 4, 28 shl 16 + 31, 0x80000000, modes
|
||||||
|
|
||||||
cmp [mode], 101
|
cmp [mode], 101
|
||||||
jne @f
|
jne .no_eth
|
||||||
|
|
||||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||||
add ebx, 18
|
add ebx, 18
|
||||||
@ -89,10 +87,10 @@ START: ; start of execution
|
|||||||
call draw_mac
|
call draw_mac
|
||||||
jmp end_of_draw
|
jmp end_of_draw
|
||||||
|
|
||||||
@@:
|
.no_eth:
|
||||||
|
|
||||||
cmp [mode], 102
|
cmp [mode], 102
|
||||||
jne @f
|
jne .no_ip
|
||||||
|
|
||||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||||
add ebx, 18
|
add ebx, 18
|
||||||
@ -146,10 +144,10 @@ START: ; start of execution
|
|||||||
|
|
||||||
jmp end_of_draw
|
jmp end_of_draw
|
||||||
|
|
||||||
@@:
|
.no_ip:
|
||||||
|
|
||||||
cmp [mode], 103
|
cmp [mode], 103
|
||||||
jne @f
|
jne .no_arp
|
||||||
|
|
||||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||||
add ebx, 18
|
add ebx, 18
|
||||||
@ -161,7 +159,7 @@ START: ; start of execution
|
|||||||
|
|
||||||
jmp end_of_draw
|
jmp end_of_draw
|
||||||
|
|
||||||
@@:
|
.no_arp:
|
||||||
|
|
||||||
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
mcall 4, 20 shl 16 + 75, 0x80000000, str_packets_tx
|
||||||
add ebx, 18
|
add ebx, 18
|
||||||
@ -176,7 +174,7 @@ START: ; start of execution
|
|||||||
|
|
||||||
mainloop:
|
mainloop:
|
||||||
|
|
||||||
mcall 23,50 ; wait for event with timeout (0,5 s)
|
mcall 23,500 ; wait for event with timeout (0,5 s)
|
||||||
|
|
||||||
cmp eax, 1
|
cmp eax, 1
|
||||||
je redraw
|
je redraw
|
||||||
@ -461,11 +459,9 @@ draw_mac:
|
|||||||
add edx, 15 shl 16
|
add edx, 15 shl 16
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
mov eax, [esp]
|
|
||||||
add esp, 6+4
|
|
||||||
sub edx, 5*15 shl 16
|
sub edx, 5*15 shl 16
|
||||||
|
|
||||||
jmp eax
|
ret 6
|
||||||
|
|
||||||
|
|
||||||
draw_ip:
|
draw_ip:
|
||||||
@ -493,15 +489,11 @@ draw_ip:
|
|||||||
mcall
|
mcall
|
||||||
|
|
||||||
sub edx, 3*30 shl 16
|
sub edx, 3*30 shl 16
|
||||||
mov eax, [esp]
|
ret 4
|
||||||
add esp, 8
|
|
||||||
jmp eax
|
|
||||||
|
|
||||||
|
|
||||||
; DATA AREA
|
; DATA AREA
|
||||||
|
|
||||||
IM_END:
|
|
||||||
|
|
||||||
name db 'Netstat',0
|
name db 'Netstat',0
|
||||||
mode db 101
|
mode db 101
|
||||||
device db 0
|
device db 0
|
||||||
|
Loading…
Reference in New Issue
Block a user