forked from KolibriOS/kolibrios
Changed net branch specific kernel function numbers to make room for function 73 in main branch.
git-svn-id: svn://kolibrios.org@2364 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
0ec151c852
commit
e8a8f9b75d
@ -43,7 +43,7 @@ START: ; start of execution
|
|||||||
mov [last],0
|
mov [last],0
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
mcall 75, 0x06080003, [last],,,ARP_ENTRY
|
mcall 76, 0x06080003, [last],,,ARP_ENTRY
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je mainloop
|
je mainloop
|
||||||
|
|
||||||
|
@ -676,13 +676,13 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
|
|||||||
mov eax, 0x01000100
|
mov eax, 0x01000100
|
||||||
stosd
|
stosd
|
||||||
; 7. Get DNS server address.
|
; 7. Get DNS server address.
|
||||||
mcall 75, 0x00000004 ; protocol IP=0, device number=0, function=get DNS address
|
mcall 76, 0x00000004 ; protocol IP=0, device number=0, function=get DNS address
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je .ret.dnserr
|
je .ret.dnserr
|
||||||
mov esi, eax ; put server address to esi
|
mov esi, eax ; put server address to esi
|
||||||
; 8. Open UDP socketnum to DNS server, port 53.
|
; 8. Open UDP socketnum to DNS server, port 53.
|
||||||
; 8a. Create new socketnum.
|
; 8a. Create new socketnum.
|
||||||
mcall 74, 0, AF_INET4, SOCK_DGRAM
|
mcall 75, 0, AF_INET4, SOCK_DGRAM
|
||||||
cmp eax, -1 ; error?
|
cmp eax, -1 ; error?
|
||||||
jz .ret.dnserr
|
jz .ret.dnserr
|
||||||
mov ecx, eax ; put socketnum handle to ecx
|
mov ecx, eax ; put socketnum handle to ecx
|
||||||
@ -693,7 +693,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
|
|||||||
push AF_INET4 + (53 shl 16)
|
push AF_INET4 + (53 shl 16)
|
||||||
; sin_family and sin_port in network byte order
|
; sin_family and sin_port in network byte order
|
||||||
; 8c. Connect.
|
; 8c. Connect.
|
||||||
mcall 74, 4, , esp, sizeof.sockaddr_in
|
mcall 75, 4, , esp, sizeof.sockaddr_in
|
||||||
; 8d. Restore the stack, undo 8b.
|
; 8d. Restore the stack, undo 8b.
|
||||||
add esp, esi
|
add esp, esi
|
||||||
; 8e. Check result.
|
; 8e. Check result.
|
||||||
@ -703,7 +703,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
|
|||||||
sub edi, esp ; get packet length
|
sub edi, esp ; get packet length
|
||||||
mov esi, edi
|
mov esi, edi
|
||||||
xor edi, edi
|
xor edi, edi
|
||||||
mcall 74, 6, , esp
|
mcall 75, 6, , esp
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
jz .ret.close
|
jz .ret.close
|
||||||
mov eax, [.reqdata]
|
mov eax, [.reqdata]
|
||||||
@ -712,7 +712,7 @@ lock xadd [DNSrequestID], eax ; atomically increment ID, get old value
|
|||||||
pop eax ; return status: more processing required
|
pop eax ; return status: more processing required
|
||||||
jmp .ret.dns
|
jmp .ret.dns
|
||||||
.ret.close:
|
.ret.close:
|
||||||
mcall 74, 1
|
mcall 75, 1
|
||||||
.ret.dnserr:
|
.ret.dnserr:
|
||||||
push EAI_AGAIN
|
push EAI_AGAIN
|
||||||
pop eax
|
pop eax
|
||||||
@ -762,7 +762,7 @@ end virtual
|
|||||||
; 2. Read UDP datagram.
|
; 2. Read UDP datagram.
|
||||||
mov ecx, [edi+__gai_reqdata.socketnum]
|
mov ecx, [edi+__gai_reqdata.socketnum]
|
||||||
push edi
|
push edi
|
||||||
mcall 74, 7, , , 512, 0
|
mcall 75, 7, , , 512, 0
|
||||||
pop edi
|
pop edi
|
||||||
; 3. Ignore events for other socketnums (return if no data read)
|
; 3. Ignore events for other socketnums (return if no data read)
|
||||||
test eax, eax
|
test eax, eax
|
||||||
@ -923,7 +923,7 @@ end virtual
|
|||||||
push eax
|
push eax
|
||||||
mov ecx, [.reqdata]
|
mov ecx, [.reqdata]
|
||||||
mov ecx, [ecx+__gai_reqdata.socketnum]
|
mov ecx, [ecx+__gai_reqdata.socketnum]
|
||||||
mcall 74, 1
|
mcall 75, 1
|
||||||
pop eax
|
pop eax
|
||||||
; 16. Restore used registers, destroy stack frame and return.
|
; 16. Restore used registers, destroy stack frame and return.
|
||||||
.ret:
|
.ret:
|
||||||
@ -1223,7 +1223,7 @@ getaddrinfo_abort: ;;
|
|||||||
; 1. Allocated resources: only socketnum, so close it and return.
|
; 1. Allocated resources: only socketnum, so close it and return.
|
||||||
mov eax, [esp+8]
|
mov eax, [esp+8]
|
||||||
mov ecx, [eax+__gai_reqdata.socketnum]
|
mov ecx, [eax+__gai_reqdata.socketnum]
|
||||||
mcall 74, 1
|
mcall 75, 1
|
||||||
; 2. Restore used registers and return.
|
; 2. Restore used registers and return.
|
||||||
pop ebx
|
pop ebx
|
||||||
ret 4
|
ret 4
|
||||||
|
@ -143,13 +143,13 @@ hook:
|
|||||||
|
|
||||||
reset:
|
reset:
|
||||||
movzx ebx, byte[drivernumber]
|
movzx ebx, byte[drivernumber]
|
||||||
mcall 73,,2
|
mcall 74,,2
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
unload:
|
unload:
|
||||||
movzx ebx, byte[drivernumber]
|
movzx ebx, byte[drivernumber]
|
||||||
mcall 73,,3
|
mcall 74,,3
|
||||||
|
|
||||||
jmp still
|
jmp still
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ START: ; start of execution
|
|||||||
|
|
||||||
mov ebx,1337 shl 16 + 4
|
mov ebx,1337 shl 16 + 4
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
mcall 75
|
mcall 76
|
||||||
push eax
|
push eax
|
||||||
push bx
|
push bx
|
||||||
|
|
||||||
@ -112,22 +112,22 @@ START: ; start of execution
|
|||||||
|
|
||||||
mov ebx, 0 shl 16 + 8
|
mov ebx, 0 shl 16 + 8
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
mcall 75
|
mcall 76
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
dec bl
|
dec bl
|
||||||
dec bl
|
dec bl
|
||||||
mcall 75
|
mcall 76
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
dec bl
|
dec bl
|
||||||
dec bl
|
dec bl
|
||||||
mcall 75
|
mcall 76
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
dec bl
|
dec bl
|
||||||
dec bl
|
dec bl
|
||||||
mcall 75
|
mcall 76
|
||||||
push eax
|
push eax
|
||||||
|
|
||||||
mov edx, 135 shl 16 + 75 + 2*18
|
mov edx, 135 shl 16 + 75 + 2*18
|
||||||
@ -199,7 +199,7 @@ START: ; start of execution
|
|||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
@@:
|
@@:
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -211,7 +211,7 @@ START: ; start of execution
|
|||||||
|
|
||||||
@@:
|
@@:
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -252,12 +252,12 @@ START: ; start of execution
|
|||||||
mov ebx, 0 shl 16
|
mov ebx, 0 shl 16
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -284,17 +284,17 @@ START: ; start of execution
|
|||||||
mov ebx, 0x0608 shl 16 + 0
|
mov ebx, 0x0608 shl 16 + 0
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -323,12 +323,12 @@ not_103:
|
|||||||
mov ebx, 1 shl 16 + 0
|
mov ebx, 1 shl 16 + 0
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -354,12 +354,12 @@ not_104:
|
|||||||
mov ebx, 17 shl 16 + 0
|
mov ebx, 17 shl 16 + 0
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
@ -385,12 +385,12 @@ not_105:
|
|||||||
mov ebx, 6 shl 16 + 0
|
mov ebx, 6 shl 16 + 0
|
||||||
mov bh, [device]
|
mov bh, [device]
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
push ebx
|
push ebx
|
||||||
mcall 75
|
mcall 76
|
||||||
pop ebx
|
pop ebx
|
||||||
push eax
|
push eax
|
||||||
inc bl
|
inc bl
|
||||||
|
@ -61,12 +61,12 @@ EAI_BADHINTS = 12
|
|||||||
EAI_PROTOCOL = 13
|
EAI_PROTOCOL = 13
|
||||||
EAI_OVERFLOW = 14
|
EAI_OVERFLOW = 14
|
||||||
|
|
||||||
socket fix 74, 0
|
socket fix 75, 0
|
||||||
close fix 74, 1
|
close fix 75, 1
|
||||||
bind fix 74, 2
|
bind fix 75, 2
|
||||||
listen fix 74, 3
|
listen fix 75, 3
|
||||||
connect fix 74, 4
|
connect fix 75, 4
|
||||||
accept fix 74, 5
|
accept fix 75, 5
|
||||||
send fix 74, 6
|
send fix 75, 6
|
||||||
recv fix 74, 7
|
recv fix 75, 7
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ START: ; start of execution
|
|||||||
|
|
||||||
DEBUGF 1,">Zero-config service:\n"
|
DEBUGF 1,">Zero-config service:\n"
|
||||||
|
|
||||||
mcall 75, 1337 shl 16 + 4
|
mcall 76, 1337 shl 16 + 4
|
||||||
|
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je exit
|
je exit
|
||||||
@ -169,22 +169,22 @@ START: ; start of execution
|
|||||||
invoke ini.get_str, path, str_ipconfig, str_ip, inibuf, 16, 0
|
invoke ini.get_str, path, str_ipconfig, str_ip, inibuf, 16, 0
|
||||||
mov edx, inibuf
|
mov edx, inibuf
|
||||||
call Ip2dword
|
call Ip2dword
|
||||||
mcall 75, 3, edx
|
mcall 76, 3, edx
|
||||||
|
|
||||||
invoke ini.get_str, path, str_ipconfig, str_gateway, inibuf, 16, 0
|
invoke ini.get_str, path, str_ipconfig, str_gateway, inibuf, 16, 0
|
||||||
mov edx, inibuf
|
mov edx, inibuf
|
||||||
call Ip2dword
|
call Ip2dword
|
||||||
mcall 75, 9, edx
|
mcall 76, 9, edx
|
||||||
|
|
||||||
invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0
|
invoke ini.get_str, path, str_ipconfig, str_dns, inibuf, 16, 0
|
||||||
mov edx, inibuf
|
mov edx, inibuf
|
||||||
call Ip2dword
|
call Ip2dword
|
||||||
mcall 75, 5, edx
|
mcall 76, 5, edx
|
||||||
|
|
||||||
invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0
|
invoke ini.get_str, path, str_ipconfig, str_subnet, inibuf, 16, 0
|
||||||
mov edx, inibuf
|
mov edx, inibuf
|
||||||
call Ip2dword
|
call Ip2dword
|
||||||
mcall 75, 7, edx
|
mcall 76, 7, edx
|
||||||
|
|
||||||
|
|
||||||
mcall -1
|
mcall -1
|
||||||
@ -194,20 +194,20 @@ skip_ini:
|
|||||||
|
|
||||||
DEBUGF 1,"->Skip ini\n"
|
DEBUGF 1,"->Skip ini\n"
|
||||||
|
|
||||||
mcall 74, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved)
|
mcall 75, 0, AF_INET4, SOCK_DGRAM, 0 ; open socket (parameters: domain, type, reserved)
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je error
|
je error
|
||||||
mov [socketNum], eax
|
mov [socketNum], eax
|
||||||
|
|
||||||
DEBUGF 1,"->socket %x opened\n", eax
|
DEBUGF 1,"->socket %x opened\n", eax
|
||||||
|
|
||||||
mcall 74, 2, [socketNum], sockaddr1, 18 ; bind socket to local port 68
|
mcall 75, 2, [socketNum], sockaddr1, 18 ; bind socket to local port 68
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je error
|
je error
|
||||||
|
|
||||||
DEBUGF 1,"->Socket Bound to local port 68\n"
|
DEBUGF 1,"->Socket Bound to local port 68\n"
|
||||||
|
|
||||||
mcall 74, 4, [socketNum], sockaddr2, 18 ; connect to 255.255.255.255 on port 67
|
mcall 75, 4, [socketNum], sockaddr2, 18 ; connect to 255.255.255.255 on port 67
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
je error
|
je error
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ request_options:
|
|||||||
mov [dhcpMsgLen], dword 268
|
mov [dhcpMsgLen], dword 268
|
||||||
|
|
||||||
send_request:
|
send_request:
|
||||||
mcall 74, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request )
|
mcall 75, 6, [socketNum], [dhcpMsg], [dhcpMsgLen] ; write to socket ( send broadcast request )
|
||||||
|
|
||||||
mov eax, [dhcpMsg] ; Setup the DHCP buffer to receive response
|
mov eax, [dhcpMsg] ; Setup the DHCP buffer to receive response
|
||||||
mov [dhcpMsgLen], eax ; Used as a pointer to the data
|
mov [dhcpMsgLen], eax ; Used as a pointer to the data
|
||||||
@ -291,12 +291,12 @@ send_request:
|
|||||||
mcall 23, TIMEOUT*10 ; wait for data
|
mcall 23, TIMEOUT*10 ; wait for data
|
||||||
|
|
||||||
read_data: ; we have data - this will be the response
|
read_data: ; we have data - this will be the response
|
||||||
mcall 74, 7, [socketNum], [dhcpMsg], BUFFER ; read data from socket
|
mcall 75, 7, [socketNum], [dhcpMsg], BUFFER ; read data from socket
|
||||||
|
|
||||||
DEBUGF 1,"->%d bytes received\n", eax
|
DEBUGF 1,"->%d bytes received\n", eax
|
||||||
|
|
||||||
push eax
|
push eax
|
||||||
mcall 74, 1, [socketNum] ; exit the socket
|
mcall 75, 1, [socketNum] ; exit the socket
|
||||||
pop eax
|
pop eax
|
||||||
|
|
||||||
cmp eax, -1
|
cmp eax, -1
|
||||||
@ -355,7 +355,7 @@ parseResponse:
|
|||||||
mov edx, [dhcpMsg]
|
mov edx, [dhcpMsg]
|
||||||
|
|
||||||
pusha
|
pusha
|
||||||
mcall 75, 3, [edx+16]
|
mcall 76, 3, [edx+16]
|
||||||
mov eax,[edx]
|
mov eax,[edx]
|
||||||
mov [dhcpClientIP],eax
|
mov [dhcpClientIP],eax
|
||||||
DEBUGF 1,"Client: %u.%u.%u.%u\n",[edx+16]:1,[edx+17]:1,[edx+18]:1,[edx+19]:1
|
DEBUGF 1,"Client: %u.%u.%u.%u\n",[edx+16]:1,[edx+17]:1,[edx+18]:1,[edx+19]:1
|
||||||
@ -409,7 +409,7 @@ pr001:
|
|||||||
jne @f
|
jne @f
|
||||||
|
|
||||||
pusha
|
pusha
|
||||||
mcall 75, 7, [edx]
|
mcall 76, 7, [edx]
|
||||||
DEBUGF 1,"Subnet: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
DEBUGF 1,"Subnet: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
||||||
popa
|
popa
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ pr001:
|
|||||||
jne @f
|
jne @f
|
||||||
|
|
||||||
pusha
|
pusha
|
||||||
mcall 75, 9, [edx]
|
mcall 76, 9, [edx]
|
||||||
DEBUGF 1,"Gateway: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
DEBUGF 1,"Gateway: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
||||||
popa
|
popa
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ pr001:
|
|||||||
jne next_option
|
jne next_option
|
||||||
|
|
||||||
pusha
|
pusha
|
||||||
mcall 75, 5, [edx]
|
mcall 76, 5, [edx]
|
||||||
DEBUGF 1,"DNS: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
DEBUGF 1,"DNS: %u.%u.%u.%u\n",[edx]:1,[edx+1]:1,[edx+2]:1,[edx+3]:1
|
||||||
popa
|
popa
|
||||||
|
|
||||||
@ -452,11 +452,11 @@ link_local:
|
|||||||
call random
|
call random
|
||||||
mov ecx,0xfea9 ; IP 169.254.0.0 link local net, see RFC3927
|
mov ecx,0xfea9 ; IP 169.254.0.0 link local net, see RFC3927
|
||||||
mov cx,ax
|
mov cx,ax
|
||||||
mcall 75, 3, ecx ; mask is 255.255.0.0
|
mcall 76, 3, ecx ; mask is 255.255.0.0
|
||||||
DEBUGF 1,"Link Local IP assinged: 169.254.%u.%u\n",[generator+2]:1,[generator+3]:1
|
DEBUGF 1,"Link Local IP assinged: 169.254.%u.%u\n",[generator+2]:1,[generator+3]:1
|
||||||
mcall 75, 5, 0xffff
|
mcall 76, 5, 0xffff
|
||||||
mcall 75, 9, 0x0
|
mcall 76, 9, 0x0
|
||||||
mcall 75, 7, 0x0
|
mcall 76, 7, 0x0
|
||||||
|
|
||||||
mcall 5, PROBE_WAIT*100
|
mcall 5, PROBE_WAIT*100
|
||||||
|
|
||||||
|
@ -10,15 +10,15 @@ $Revision$
|
|||||||
; Old style system call converter
|
; Old style system call converter
|
||||||
align 16
|
align 16
|
||||||
cross_order:
|
cross_order:
|
||||||
; load all registers in crossed order
|
; load all registers in crossed order
|
||||||
mov eax, ebx
|
mov eax, ebx
|
||||||
mov ebx, ecx
|
mov ebx, ecx
|
||||||
mov ecx, edx
|
mov ecx, edx
|
||||||
mov edx, esi
|
mov edx, esi
|
||||||
mov esi, edi
|
mov esi, edi
|
||||||
movzx edi, byte[esp+28 + 4]
|
movzx edi, byte[esp+28 + 4]
|
||||||
call dword [servetable+edi*4]
|
call dword [servetable+edi*4]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
@ -28,28 +28,28 @@ cross_order:
|
|||||||
|
|
||||||
align 32
|
align 32
|
||||||
sysenter_entry:
|
sysenter_entry:
|
||||||
; Íàñòðàèâàåì ñòåê
|
; Íàñòðàèâàåì ñòåê
|
||||||
mov esp, [ss:tss._esp0]
|
mov esp, [ss:tss._esp0]
|
||||||
sti
|
sti
|
||||||
push ebp ; save app esp + 4
|
push ebp ; save app esp + 4
|
||||||
mov ebp, [ebp] ; ebp - original ebp
|
mov ebp, [ebp] ; ebp - original ebp
|
||||||
;------------------
|
;------------------
|
||||||
pushad
|
pushad
|
||||||
cld
|
cld
|
||||||
|
|
||||||
movzx eax, al
|
movzx eax, al
|
||||||
call dword [servetable2 + eax * 4]
|
call dword [servetable2 + eax * 4]
|
||||||
|
|
||||||
popad
|
popad
|
||||||
;------------------
|
;------------------
|
||||||
xchg ecx, [ss:esp] ; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
|
xchg ecx, [ss:esp] ; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
|
||||||
sub ecx, 4
|
sub ecx, 4
|
||||||
xchg edx, [ecx] ; edx - return point, & save original edx
|
xchg edx, [ecx] ; edx - return point, & save original edx
|
||||||
push edx
|
push edx
|
||||||
mov edx, [ss:esp + 4]
|
mov edx, [ss:esp + 4]
|
||||||
mov [ecx + 4], edx ; save original ecx
|
mov [ecx + 4], edx ; save original ecx
|
||||||
pop edx
|
pop edx
|
||||||
sysexit
|
sysexit
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
@ -59,12 +59,12 @@ sysenter_entry:
|
|||||||
|
|
||||||
align 16
|
align 16
|
||||||
i40:
|
i40:
|
||||||
pushad
|
pushad
|
||||||
cld
|
cld
|
||||||
movzx eax, al
|
movzx eax, al
|
||||||
call dword [servetable2 + eax * 4]
|
call dword [servetable2 + eax * 4]
|
||||||
popad
|
popad
|
||||||
iretd
|
iretd
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; ;;
|
;; ;;
|
||||||
@ -74,25 +74,25 @@ i40:
|
|||||||
align 32
|
align 32
|
||||||
syscall_entry:
|
syscall_entry:
|
||||||
; cli syscall clear IF
|
; cli syscall clear IF
|
||||||
xchg esp, [ss:tss._esp0]
|
xchg esp, [ss:tss._esp0]
|
||||||
push ecx
|
push ecx
|
||||||
lea ecx, [esp+4]
|
lea ecx, [esp+4]
|
||||||
xchg ecx, [ss:tss._esp0]
|
xchg ecx, [ss:tss._esp0]
|
||||||
sti
|
sti
|
||||||
push ecx
|
push ecx
|
||||||
mov ecx, [ecx]
|
mov ecx, [ecx]
|
||||||
;------------------
|
;------------------
|
||||||
pushad
|
pushad
|
||||||
cld
|
cld
|
||||||
|
|
||||||
movzx eax, al
|
movzx eax, al
|
||||||
call dword [servetable2 + eax * 4]
|
call dword [servetable2 + eax * 4]
|
||||||
|
|
||||||
popad
|
popad
|
||||||
;------------------
|
;------------------
|
||||||
mov ecx, [ss:esp+4]
|
mov ecx, [ss:esp+4]
|
||||||
pop esp
|
pop esp
|
||||||
sysret
|
sysret
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -157,22 +157,22 @@ iglobal
|
|||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd sound_interface ; 55-Sound interface
|
dd sound_interface ; 55-Sound interface
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd file_system ; 58-Common file system interface
|
dd file_system ; 58-Common file system interface
|
||||||
dd 0
|
dd 0
|
||||||
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 sys_pci ; 62-PCI functions
|
dd sys_pci ; 62-PCI functions
|
||||||
dd sys_msg_board ; 63-System message board
|
dd sys_msg_board ; 63-System message board
|
||||||
dd 0
|
dd 0
|
||||||
dd syscall_putimage_palette; 65-PutImagePalette
|
dd syscall_putimage_palette; 65-PutImagePalette
|
||||||
dd sys_process_def ; 66-Process definitions - keyboard
|
dd sys_process_def ; 66-Process definitions - keyboard
|
||||||
dd sys_window_move ; 67-Window move or resize
|
dd sys_window_move ; 67-Window move or resize
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd file_system_lfn ; 70-Common file system interface, version 2
|
dd file_system_lfn ; 70-Common file system interface, version 2
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; NEW SYSTEM FUNCTIONS TABLE ;;
|
;; NEW SYSTEM FUNCTIONS TABLE ;;
|
||||||
@ -180,83 +180,84 @@ iglobal
|
|||||||
align 4
|
align 4
|
||||||
servetable2:
|
servetable2:
|
||||||
|
|
||||||
dd sys_drawwindow ; 0-DrawWindow
|
dd sys_drawwindow ; 0-DrawWindow
|
||||||
dd syscall_setpixel ; 1-SetPixel
|
dd syscall_setpixel ; 1-SetPixel
|
||||||
dd sys_getkey ; 2-GetKey
|
dd sys_getkey ; 2-GetKey
|
||||||
dd sys_clock ; 3-GetTime
|
dd sys_clock ; 3-GetTime
|
||||||
dd syscall_writetext ; 4-WriteText
|
dd syscall_writetext ; 4-WriteText
|
||||||
dd delay_hs ; 5-DelayHs
|
dd delay_hs ; 5-DelayHs
|
||||||
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
||||||
dd syscall_putimage ; 7-PutImage
|
dd syscall_putimage ; 7-PutImage
|
||||||
dd syscall_button ; 8-DefineButton
|
dd syscall_button ; 8-DefineButton
|
||||||
dd sys_cpuusage ; 9-GetProcessInfo
|
dd sys_cpuusage ; 9-GetProcessInfo
|
||||||
dd sys_waitforevent ; 10-WaitForEvent
|
dd sys_waitforevent ; 10-WaitForEvent
|
||||||
dd sys_getevent ; 11-CheckForEvent
|
dd sys_getevent ; 11-CheckForEvent
|
||||||
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
dd sys_redrawstat ; 12-BeginDraw and EndDraw
|
||||||
dd syscall_drawrect ; 13-DrawRect
|
dd syscall_drawrect ; 13-DrawRect
|
||||||
dd syscall_getscreensize ; 14-GetScreenSize
|
dd syscall_getscreensize ; 14-GetScreenSize
|
||||||
dd sys_background ; 15-bgr
|
dd sys_background ; 15-bgr
|
||||||
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
dd sys_cachetodiskette ; 16-FlushFloppyCache
|
||||||
dd sys_getbutton ; 17-GetButton
|
dd sys_getbutton ; 17-GetButton
|
||||||
dd sys_system ; 18-System Services
|
dd sys_system ; 18-System Services
|
||||||
dd paleholder ; 19-reserved
|
dd paleholder ; 19-reserved
|
||||||
dd sys_midi ; 20-ResetMidi and OutputMidi
|
dd sys_midi ; 20-ResetMidi and OutputMidi
|
||||||
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
||||||
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
||||||
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
||||||
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
||||||
dd undefined_syscall ; 25-reserved
|
dd undefined_syscall ; 25-reserved
|
||||||
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
||||||
dd undefined_syscall ; 27-reserved
|
dd undefined_syscall ; 27-reserved
|
||||||
dd undefined_syscall ; 28-reserved
|
dd undefined_syscall ; 28-reserved
|
||||||
dd sys_date ; 29-GetDate
|
dd sys_date ; 29-GetDate
|
||||||
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
dd sys_current_directory ; 30-Get/SetCurrentDirectory
|
||||||
dd undefined_syscall ; 31-reserved
|
dd undefined_syscall ; 31-reserved
|
||||||
dd undefined_syscall ; 32-reserved
|
dd undefined_syscall ; 32-reserved
|
||||||
dd undefined_syscall ; 33-reserved
|
dd undefined_syscall ; 33-reserved
|
||||||
dd undefined_syscall ; 34-reserved
|
dd undefined_syscall ; 34-reserved
|
||||||
dd syscall_getpixel ; 35-GetPixel
|
dd syscall_getpixel ; 35-GetPixel
|
||||||
dd syscall_getarea ; 36-GetArea
|
dd syscall_getarea ; 36-GetArea
|
||||||
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
dd readmousepos ; 37-GetMousePosition_ScreenRelative,.
|
||||||
dd syscall_drawline ; 38-DrawLine
|
dd syscall_drawline ; 38-DrawLine
|
||||||
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
dd sys_getbackground ; 39-GetBackgroundSize,ReadBgrData,.
|
||||||
dd set_app_param ; 40-WantEvents
|
dd set_app_param ; 40-WantEvents
|
||||||
dd syscall_getirqowner ; 41-GetIrqOwner
|
dd syscall_getirqowner ; 41-GetIrqOwner
|
||||||
dd get_irq_data ; 42-ReadIrqData
|
dd get_irq_data ; 42-ReadIrqData
|
||||||
dd sys_outport ; 43-SendDeviceData
|
dd sys_outport ; 43-SendDeviceData
|
||||||
dd sys_programirq ; 44-ProgramIrqs
|
dd sys_programirq ; 44-ProgramIrqs
|
||||||
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
dd reserve_free_irq ; 45-ReserveIrq and FreeIrq
|
||||||
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
dd syscall_reserveportarea ; 46-ReservePortArea and FreePortArea
|
||||||
dd display_number ; 47-WriteNum
|
dd display_number ; 47-WriteNum
|
||||||
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType
|
dd syscall_display_settings ; 48-SetRedrawType and SetButtonType
|
||||||
dd sys_apm ; 49-Advanced Power Management (APM)
|
dd sys_apm ; 49-Advanced Power Management (APM)
|
||||||
dd syscall_set_window_shape ; 50-Window shape & scale
|
dd syscall_set_window_shape ; 50-Window shape & scale
|
||||||
dd syscall_threads ; 51-Threads
|
dd syscall_threads ; 51-Threads
|
||||||
dd undefined_syscall ; 52-Stack driver status
|
dd undefined_syscall ; 52-Stack driver status
|
||||||
dd undefined_syscall ; 53-Socket interface
|
dd undefined_syscall ; 53-Socket interface
|
||||||
dd undefined_syscall ; 54-reserved
|
dd undefined_syscall ; 54-reserved
|
||||||
dd cross_order ; 55-Sound interface
|
dd cross_order ; 55-Sound interface
|
||||||
dd undefined_syscall ; 56-reserved
|
dd undefined_syscall ; 56-reserved
|
||||||
dd sys_pcibios ; 57-PCI BIOS32
|
dd sys_pcibios ; 57-PCI BIOS32
|
||||||
dd cross_order ; 58-Common file system interface
|
dd cross_order ; 58-Common file system interface
|
||||||
dd undefined_syscall ; 59-reserved
|
dd undefined_syscall ; 59-reserved
|
||||||
dd cross_order ; 60-Inter Process Communication
|
dd cross_order ; 60-Inter Process Communication
|
||||||
dd cross_order ; 61-Direct graphics access
|
dd cross_order ; 61-Direct graphics access
|
||||||
dd cross_order ; 62-PCI functions
|
dd cross_order ; 62-PCI functions
|
||||||
dd cross_order ; 63-System message board
|
dd cross_order ; 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 cross_order ; 65-PutImagePalette
|
dd cross_order ; 65-PutImagePalette
|
||||||
dd cross_order ; 66-Process definitions - keyboard
|
dd cross_order ; 66-Process definitions - keyboard
|
||||||
dd cross_order ; 67-Window move or resize
|
dd cross_order ; 67-Window move or resize
|
||||||
dd f68 ; 68-Some internal services
|
dd f68 ; 68-Some internal services
|
||||||
dd sys_debug_services ; 69-Debug
|
dd sys_debug_services ; 69-Debug
|
||||||
dd cross_order ; 70-Common file system interface, version 2
|
dd cross_order ; 70-Common file system interface, version 2
|
||||||
dd syscall_windowsettings ; 71-Window settings
|
dd syscall_windowsettings ; 71-Window settings
|
||||||
dd sys_sendwindowmsg ; 72-Send window message
|
dd sys_sendwindowmsg ; 72-Send window message
|
||||||
dd sys_network ; 73-Network stack
|
dd undefined_syscall ; 73-reserved for blitter
|
||||||
dd sys_socket ; 74-Sockets
|
dd sys_network ; 74-Network stack
|
||||||
dd sys_protocols ; 75-Protocols
|
dd sys_socket ; 75-Sockets
|
||||||
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
dd sys_protocols ; 76-Protocols
|
||||||
dd sys_end ; -1-end application
|
times 255 - ( ($-servetable2) /4 ) dd undefined_syscall
|
||||||
|
dd sys_end ; -1-end application
|
||||||
|
|
||||||
endg
|
endg
|
||||||
|
Loading…
Reference in New Issue
Block a user