From f9aaa5bb039b6f6682fd630bd89a12aee7ceead8 Mon Sep 17 00:00:00 2001 From: Falk Rehwagen Date: Mon, 1 Jul 2024 11:32:52 +0200 Subject: [PATCH] Take Host If library in use. #149 --- Driver/Socket/HstTCPIP/hsttcpipManager.asm | 1 - Driver/Socket/HstTCPIP/tcpipEntry.asm | 40 ++++------------ Driver/Socket/HstTCPIP/tcpipGlobal.def | 2 +- Include/Internal/host.def | 46 ------------------- Include/hostif.def | 21 +++++++++ .../Driver/Socket/HstTCPIP/dependencies.mk | 10 ++-- bin/target.cmd | 2 +- 7 files changed, 37 insertions(+), 85 deletions(-) delete mode 100644 Include/Internal/host.def diff --git a/Driver/Socket/HstTCPIP/hsttcpipManager.asm b/Driver/Socket/HstTCPIP/hsttcpipManager.asm index fa185a878..2dab15083 100644 --- a/Driver/Socket/HstTCPIP/hsttcpipManager.asm +++ b/Driver/Socket/HstTCPIP/hsttcpipManager.asm @@ -54,7 +54,6 @@ include sem.def include Internal/heapInt.def include Internal/im.def include Internal/threadIn.def -include Internal/host.def include file.def include localize.def diff --git a/Driver/Socket/HstTCPIP/tcpipEntry.asm b/Driver/Socket/HstTCPIP/tcpipEntry.asm index 10e1bb145..627f36052 100644 --- a/Driver/Socket/HstTCPIP/tcpipEntry.asm +++ b/Driver/Socket/HstTCPIP/tcpipEntry.asm @@ -497,28 +497,6 @@ EC < Assert thread bx > TcpipReceiveInterrupt endp - SetGeosConvention - -TCPIPRECEIVESTOP proc far connection:word -;regs local PMRealModeRegister - uses cx, ax, ds -newBuffer local optr - .enter - - mov cx, connection - mov bx, handle dgroup - call MemDerefES - -EC < WARNING TCPIP_RECEIVE_STOP > - - ; close the socket on host side - mov ax, 1007 - int GEOS_HOST_API -done: - .leave - ret -TCPIPRECEIVESTOP endp - TCPIPRECEIVESTART proc far connection:word ;regs local PMRealModeRegister @@ -728,9 +706,9 @@ TcpipInit proc far cmp ax, 0 je straightError - mov ax, 1 - mov cx, 1 - int GEOS_HOST_API + mov ax, HIF_CHECK + mov cx, 1 ; check function group networking + call HostIfCall cmp ax, 0 jne error @@ -740,8 +718,8 @@ TcpipInit proc far ; segmov es, mov bx, offset ResidentCode:TcpipReceiveInterrupt - mov ax, 2 - int GEOS_HOST_API + mov ax, HIF_SET_RECEIVE_HANDLE + call HostIfCall ; ; Create the input queue. @@ -850,8 +828,8 @@ TcpipExit proc far clr bx mov es, bx - mov ax, 2 - int GEOS_HOST_API + mov ax, HIF_SET_RECEIVE_HANDLE + call HostIfCall mov bx, handle dgroup call MemDerefDS @@ -1186,8 +1164,8 @@ EC < call ECCheckCallerThread > EC < call ECCheckClientHandle > ;call TSocketCreateConnection ; ax = error or handle - mov ax, HF_NC_ALLOC_CONNECTION - int HOST_INT + mov ax, HIF_NC_ALLOC_CONNECTION + call HostIfCall cmp bx, 0 je success mov ax, SDE_INSUFFICIENT_MEMORY diff --git a/Driver/Socket/HstTCPIP/tcpipGlobal.def b/Driver/Socket/HstTCPIP/tcpipGlobal.def index a48f5dd45..debd6ca19 100644 --- a/Driver/Socket/HstTCPIP/tcpipGlobal.def +++ b/Driver/Socket/HstTCPIP/tcpipGlobal.def @@ -194,4 +194,4 @@ global TCPIPDHCPSTARTRENEW:far global TCPIPDHCPTIMERHANDLER:far global TCPIPRECEIVESTART:far -global TCPIPRECEIVESTOP:far + diff --git a/Include/Internal/host.def b/Include/Internal/host.def deleted file mode 100644 index 1f6c1a29a..000000000 --- a/Include/Internal/host.def +++ /dev/null @@ -1,46 +0,0 @@ -COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - - Copyright (c) blueway.Softworks 2022 -- All Rights Reserved - -PROJECT: PC/GEOS -FILE: host.def - - -REVISION HISTORY: - - Name Date Description - ---- ---- ----------- - FR 3/13/22 Initial revision - - -DESCRIPTION: - Contains directives for the host API interface. - - $Id: host.def,v 1.1 97/04/04 14:13:55 newdeal Exp $ - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ - -SetDef __HOST - -HostFunctions etype word - HF_CHECK enum HostFunctions, 1 - HF_SET_RECEIVE_HANDLE enum HostFunctions, 2 - HF_SET_SSL_CALLBACK enum HostFunctions, 3 - - HF_NETWORKING_BASE enum HostFunctions, 1000 - HF_NC_RESOLVE_ADDR enum HostFunctions, HF_NETWORKING_BASE - HF_NC_ALLOC_CONNECTION enum HostFunctions, HF_NETWORKING_BASE+1 - HF_NC_CONNECT_REQUEST enum HostFunctions, HF_NETWORKING_BASE+2 - HF_NC_SEND_DATA enum HostFunctions, HF_NETWORKING_BASE+3 - HF_NC_NEXT_RECV_SIZE enum HostFunctions, HF_NETWORKING_BASE+4 - HF_NC_RECV_NEXT enum HostFunctions, HF_NETWORKING_BASE+5 - HF_NC_RECV_NEXT_CLOSE enum HostFunctions, HF_NETWORKING_BASE+6 - HF_NC_CLOSE enum HostFunctions, HF_NETWORKING_BASE+7 - - HF_NETWORKING_END enum HostFunctions, 1199 - - HF_SSL_BASE enum HostFunctions, 1200 - HF_SSL3_GET_CLIENT_METHOD enum HostFunctions, HF_SSL_BASE - -HOST_INT equ 0xA0 - diff --git a/Include/hostif.def b/Include/hostif.def index 7b7d192cc..e29448e04 100644 --- a/Include/hostif.def +++ b/Include/hostif.def @@ -32,9 +32,30 @@ EOF equ -1 SetGeosConvention global HostIfDetect:far +; +; Detect if host interface is available and what version is supported. +; +; Pass: nothing +; +; Return: ax - version number or 0 for not host interface available +; + global HOSTIFDETECT:far global HostIfCall:far +; +; Call an host interface method. +; +; Pass: ax - Interface function to call. +; si - data1 low (optional, depends on function called) +; bx - data1 high (optional, depends on function called) +; cx - data2 low (optional, depends on function called) +; dx - data2 high (optional, depends on function called) +; di - data3 (optional, depends on function called) +; +; Return: ax:dx - result (depends on function called, see function contract) +; + global HOSTIFCALL:far HostIfFunctions etype word diff --git a/Installed/Driver/Socket/HstTCPIP/dependencies.mk b/Installed/Driver/Socket/HstTCPIP/dependencies.mk index 6ee5683c8..62b905888 100644 --- a/Installed/Driver/Socket/HstTCPIP/dependencies.mk +++ b/Installed/Driver/Socket/HstTCPIP/dependencies.mk @@ -35,11 +35,11 @@ hsttcpipManager.eobj: geos.def heap.def geode.def Internal/interrup.def \ driver.def thread.def Internal/semInt.def sem.def \ Internal/heapInt.def sysstats.def Internal/im.def \ Objects/processC.def Objects/metaC.def chunkarr.def \ - geoworks.def Internal/threadIn.def Internal/host.def \ - file.def initfile.def assert.def disk.def drive.def \ - medium.def ui.def vm.def text.def fontID.def graphics.def \ - font.def color.def char.def win.def input.def hwr.def \ - gcnlist.def Objects/Text/tCommon.def stylesh.def iacp.def \ + geoworks.def Internal/threadIn.def file.def initfile.def \ + assert.def disk.def drive.def medium.def ui.def vm.def \ + text.def fontID.def graphics.def font.def color.def \ + char.def win.def input.def hwr.def gcnlist.def \ + Objects/Text/tCommon.def stylesh.def iacp.def \ Objects/uiInputC.def Objects/visC.def Objects/vCompC.def \ Objects/vCntC.def Internal/vUtils.def Objects/genC.def \ uDialog.def Objects/gInterC.def token.def \ diff --git a/bin/target.cmd b/bin/target.cmd index 92cef25a2..385c1232b 100644 --- a/bin/target.cmd +++ b/bin/target.cmd @@ -22,7 +22,7 @@ IF DEFINED GEOS_CDROM_DRIVE ( IF EXIST ensemble\init.bat ( echo swatgo >> ensemble\init.bat ) -start /B %BASEBOX% -conf %ROOT_DIR%\bin\basebox.conf -conf %LOCAL_ROOT%\basebox_user.conf -noconsole +start /B %BASEBOX% -conf %ROOT_DIR%\bin\basebox.conf -conf %LOCAL_ROOT%\basebox_user.conf -noconsole > nul 2>&1 cd %OLD_PATH% @cls :waitForFile