Skip to content

Commit

Permalink
Add Host Interface library as abstraction to talk to the host system. #…
Browse files Browse the repository at this point in the history
  • Loading branch information
frehwagen committed Feb 14, 2024
1 parent 343625e commit 4693902
Show file tree
Hide file tree
Showing 13 changed files with 333 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CInclude/sockmisc.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,10 @@ typedef struct {
#define DOMAIN_SERVER 53 /* TCP/UDP */
#define FINGER 79 /* TCP */
#define POP3 110 /* TCP */
#define IMAP 143 /* TCP */
#define SMTPS 465 /* TCP */
#define IMAPS 993 /* TCP */
#define POP3S 995 /* TCP */

/*--------------------------------------------------------------------------
*
Expand Down
42 changes: 42 additions & 0 deletions Include/hostif.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Copyright (c) blueway.Softworks 2023 -- All Rights Reserved

PROJECT: PC GEOS
MODULE:
FILE: hostif.def

AUTHOR: Falk Rehwagen, Dec 21, 2023

REVISION HISTORY:
Name Date Description
---- ---- -----------
FR 12/21/23 Initial revision


DESCRIPTION:

This file contains constants and defines functions for the hostif
library.

$Id: hostif.def,v 1.1 97/04/04 14:24:16 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

SetDef __HOSTIF

StartLibrary hostif

EOF equ -1

SetGeosConvention

global HostIfDetect:far
global HOSTIFDETECT:far

SetDefaultConvention

EndLibrary hostif



4 changes: 4 additions & 0 deletions Include/sockmisc.def
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ WHOIS equ 43 ; TCP
DOMAIN_SERVER equ 53 ; TCP/UDP
FINGER equ 79 ; TCP
POP3 equ 110 ; TCP
IMAP equ 143 ; TCP
SMTPS equ 465 ; TCP
IMAPS equ 993 ; TCP
POP3S equ 995 ; TCP

;---------------------------------------------------------------------------
;
Expand Down
28 changes: 28 additions & 0 deletions Installed/Library/HostIf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# THIS FILE HAS BEEN GENERATED AUTOMATICALLY.
#
# If you edit it, you will lose your changes, should it be regenerated.
#
GEODE = hostif
ASM_TO_OBJS = hostif.asm
UI_TO_RDFS =
SRCS = hostif.asm
OBJS = hostif.obj
LOBJS =
LIBOBJ = $(DEVEL_DIR)/Include/$(GEODE).ldf
LIBNAME = hostif

SYSMAKEFILE = geode.mk

#include <geos.mk>
#include <gpath.mk>

#if exists(local.mk)
#include "local.mk"
#else
#include <$(SYSMAKEFILE)>
#endif

#if exists($(DEPFILE))
#include "$(DEPFILE)"
#endif
9 changes: 9 additions & 0 deletions Installed/Library/HostIf/dependencies.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
hostif.obj \
hostif.eobj: geos.def heap.def geode.def resource.def library.def \
ec.def vm.def dbase.def object.def lmem.def graphics.def \
fontID.def font.def color.def thread.def gstring.def \
text.def char.def Objects/inputC.def Objects/metaC.def \
chunkarr.def geoworks.def Objects/winC.def win.def \
hostif.def

hostifEC.geo hostif.geo : geos.ldf
5 changes: 4 additions & 1 deletion Installed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ minimalLibrary : kernel swap sound net ui isui motif spool text mailbox \
jpeg giflib gif htmlimpx n2txt inetmsg extui \
winword8 zlib dirlist minizip idialc eps impex_libs \
thumbdb ftplib flllib sitelist int8087 intx87\
basicdb gridlib gsol treplib
basicdb gridlib gsol treplib hostif
#ascii

prefLibs : prefvid prefts preftd \
Expand Down Expand Up @@ -340,6 +340,9 @@ Installed/Library/Spline: ui MAKELIB
ssmeta : Installed/Library/SSMeta
Installed/Library/SSMeta: ui math MAKELIB

hostif : Installed/Library/HostIf
Installed/Library/HostIf: kernel MAKELIB

# bsnwav will only be compiled (and is only referenced in WAV) if PRODUCT==NDO2000
wav : Installed/Library/Wav
Installed/Library/Wav: kernel sound MAKELIB
Expand Down
173 changes: 173 additions & 0 deletions Library/HostIf/hostif.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Copyright (c) blueway.Softworks 2023 -- All Rights Reserved

PROJECT: Host Interface Library
FILE: hostif.asm

AUTHOR: Falk Rehwagen, Dec 21, 2023

REVISION HISTORY:
Name Date Description
---- ---- -----------
fr 12/21/23 Initial revision

DESCRIPTION:

$Id: hostif.asm,v 1.1 97/04/05 01:06:34 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@


;------------------------------------------------------------------------------
; Include files
;------------------------------------------------------------------------------

include geos.def
include ec.def
include heap.def
include geode.def
include resource.def
include library.def
include ec.def
include vm.def
include dbase.def

include object.def
include graphics.def
include thread.def
include gstring.def
include Objects/inputC.def

include Objects/winC.def


DefLib hostif.def

COORDINATE_OVERFLOW enum FatalErrors
; Some internal error in TransformInkBlock

udata segment
udata ends

idata segment
idata ends

Code segment resource

COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HostIfEntry
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS: Determine what the protocol # of the pen library is, so we
know if we need to add our workarounds.

CALLED BY: GLOBAL
PASS: di - LibraryCallType
RETURN: nada
DESTROYED: nada
PSEUDO CODE/STRATEGY:

KNOWN BUGS/SIDE EFFECTS/IDEAS:

REVISION HISTORY:
Name Date Description
---- ---- -----------
atw 10/22/93 Initial version

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

HostIfEntry proc far
.enter
clc
.leave
ret
HostIfEntry endp

COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HostIfDetect
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS: Determine what the protocol # of the pen library is, so we
know if we need to add our workarounds.

CALLED BY: GLOBAL
PASS: nada
RETURN: ax - interface version, 0 mean no host interface found
DESTROYED: nada
PSEUDO CODE/STRATEGY:

KNOWN BUGS/SIDE EFFECTS/IDEAS:

REVISION HISTORY:
Name Date Description
---- ---- -----------
FR 12/21/23 Initial version

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@

.ioenable

baseboxID byte "XOBESAB1"

HostIfDetect proc far

;
; Check host call if SSL interface is available
;
uses cx, dx, si

.enter

mov si, 0
mov cx, 9
mov ah, cs:baseboxID[si]
next:
mov dx, 38FFh
in al, dx
dec cx

cmp al, ah
je start
cmp cx, 0
jne next
je error
start:
mov cx, 7
nextCompare:
inc si
mov ah, cs:baseboxID[si]
mov dx, 38FFh
in al, dx
cmp al, ah
jne error
dec cx
cmp cx, 0
jne nextCompare

; matched 8 chars
mov dx, 38FFh
in al, dx
clr ah
done:
.leave
ret
error:
mov ax, 0
jmp done

HostIfDetect endp

HOSTIFDETECT proc far
GOTO HostIfDetect
HOSTIFDETECT endp

Code ends


46 changes: 46 additions & 0 deletions Library/HostIf/hostif.gp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##############################################################################
#
# Copyright (c) blueway.Softworks 2023 -- All Rights Reserved
#
# PROJECT: PC GEOS
# FILE: hostif.gp
#
# AUTHOR: Falk Rehwagen, 12/23
#
#
# Parameters file for: hostif
#
# $Id: inkfix.gp,v 1.1 97/04/05 01:06:35 newdeal Exp $
#
##############################################################################
#
# Permanent name
#
name hostif.lib
#
# Long name
#
longname "Host Interface Library"
#
# DB Token
#
tokenchars "HSTI"
tokenid 0

entry HostIfEntry

#
# Specify geode type
#
type library, single

#
# Import kernel routine definitions
#
library geos

#
# Exported routines (and classes)
#
export HostIfDetect
export HOSTIFDETECT
2 changes: 2 additions & 0 deletions Library/HostIf/hostif.rev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
R 6.0.0.0 <bluewaysw> <15:25:21 Nov 19, 2023> <Prepare FreeGEOS 6.0 release.>
P 1.0 <canavese> <Sat Mar 29 06:35:46 PST 1997> <ReleaseNewDeal created>
1 change: 1 addition & 0 deletions Library/SSL/ssl.gp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ entry SSLLIBRARYENTRY
library geos
library ansic
library socket
library hostif

ifdef COMPILE_OPTION_MAP_HEAP
#library mapheap
Expand Down
11 changes: 9 additions & 2 deletions Library/SSL/ssl/sslManager.asm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ include geode.def
include ec.def
include file.def

UseLib hostif.def

include Internal/host.def

global SSLCALLHOST:far
Expand Down Expand Up @@ -72,15 +74,21 @@ REVISION HISTORY:
mzhu 11/30/98 initial version
-------------------------------------------------------------------------@
SetGeosConvention

SSLCHECKHOST proc far

;
; Check host call if SSL interface is available
;
uses cx
uses cx, dx, si

.enter

call HostIfDetect
cmp ax, 0
je error

; matched 8 chars
mov ax, 1
mov cx, 2
int 0xA0
Expand All @@ -95,7 +103,6 @@ done:
error:
mov ax, 0

jmp done

SSLCHECKHOST endp
Expand Down
Loading

0 comments on commit 4693902

Please sign in to comment.