Serial libraries added to DVX.

This commit is contained in:
Scott Duensing 2026-03-26 21:39:03 -05:00
parent 15019ef542
commit a630855b7e
4 changed files with 78 additions and 2 deletions

View file

@ -3,9 +3,9 @@
# Builds the full DVX stack: core library, task switcher,
# bootstrap loader, text help library, widgets, shell, and apps.
.PHONY: all clean core tasks loader texthelp listhelp widgets shell taskmgr apps tools
.PHONY: all clean core tasks loader texthelp listhelp widgets shell taskmgr serial apps tools
all: core tasks loader texthelp listhelp widgets shell taskmgr apps tools
all: core tasks loader texthelp listhelp widgets shell taskmgr serial apps tools
core:
$(MAKE) -C core
@ -31,6 +31,9 @@ shell: core tasks
taskmgr: shell
$(MAKE) -C taskmgr
serial: core tasks
$(MAKE) -C serial
tools:
$(MAKE) -C tools
@ -46,6 +49,7 @@ clean:
$(MAKE) -C widgets clean
$(MAKE) -C shell clean
$(MAKE) -C taskmgr clean
$(MAKE) -C serial clean
$(MAKE) -C apps clean
$(MAKE) -C tools clean
-rmdir obj 2>/dev/null

2
config/serial.dep Normal file
View file

@ -0,0 +1,2 @@
libtasks
libdvx

View file

@ -2323,6 +2323,10 @@ extern void *__emutls_get_address(void *);
// dvxLog lives in dvx.exe (loaderMain.c)
extern void dvxLog(const char *fmt, ...);
// DPMI/go32 internals needed by the serial driver (rs232)
#include <dpmi.h>
#include <go32.h>
extern void *stbds_arrgrowf(void *a, size_t elemsize, size_t addlen, size_t min_cap);
extern void stbds_arrfreef(void *a);
extern void stbds_hmfree_func(void *a, size_t elemsize);
@ -2389,6 +2393,16 @@ DXE_EXPORT_TABLE(sDxeExportTable)
// --- dvx logging (lives in dvx.exe, used by all modules) ---
DXE_EXPORT(dvxLog)
// --- DPMI/go32 (needed by rs232 serial driver) ---
DXE_EXPORT(__dpmi_get_segment_base_address)
DXE_EXPORT(__dpmi_lock_linear_region)
DXE_EXPORT(__dpmi_unlock_linear_region)
DXE_EXPORT(_go32_dpmi_allocate_iret_wrapper)
DXE_EXPORT(_go32_dpmi_free_iret_wrapper)
DXE_EXPORT(_go32_dpmi_get_protected_mode_interrupt_vector)
DXE_EXPORT(_go32_dpmi_set_protected_mode_interrupt_vector)
DXE_EXPORT(_go32_info_block)
// --- memory ---
// --- memory (tracked wrappers replace libc for DXE code) ---
{ "_calloc", (void *)dvxCalloc },

56
serial/Makefile Normal file
View file

@ -0,0 +1,56 @@
# DVX Serial Stack Makefile for DJGPP cross-compilation
#
# Builds serial.lib -- combines rs232, packet, security, and seclink
# into a single DXE library loaded by the DVX system.
DJGPP_PREFIX = $(HOME)/djgpp/djgpp
CC = $(DJGPP_PREFIX)/bin/i586-pc-msdosdjgpp-gcc
DXE3GEN = PATH=$(DJGPP_PREFIX)/bin:$(PATH) DJDIR=$(DJGPP_PREFIX)/i586-pc-msdosdjgpp $(DJGPP_PREFIX)/i586-pc-msdosdjgpp/bin/dxe3gen
CFLAGS = -O2 -Wall -Wextra -march=i486 -mtune=i586 -I../rs232 -I../packet -I../security -I../seclink -I../core -I../core/platform -I../tasks
OBJDIR = ../obj/serial
LIBSDIR = ../bin/libs
SRCS = ../rs232/rs232.c ../packet/packet.c ../security/security.c ../seclink/secLink.c
OBJS = $(OBJDIR)/rs232.o $(OBJDIR)/packet.o $(OBJDIR)/security.o $(OBJDIR)/secLink.o
TARGET = $(LIBSDIR)/serial.lib
.PHONY: all clean
all: $(TARGET) $(LIBSDIR)/serial.dep
$(LIBSDIR)/serial.dep: ../config/serial.dep | $(LIBSDIR)
sed 's/$$/\r/' $< > $@
$(TARGET): $(OBJS) | $(LIBSDIR)
$(DXE3GEN) -o $(LIBSDIR)/serial.dxe \
-E _rs232 -E _pkt -E _secLink -E _secDh -E _secCipher -E _secRng \
-U $(OBJS)
mv $(LIBSDIR)/serial.dxe $@
$(OBJDIR)/rs232.o: ../rs232/rs232.c | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/packet.o: ../packet/packet.c | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/security.o: ../security/security.c | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR)/secLink.o: ../seclink/secLink.c | $(OBJDIR)
$(CC) $(CFLAGS) -c -o $@ $<
$(OBJDIR):
mkdir -p $(OBJDIR)
$(LIBSDIR):
mkdir -p $(LIBSDIR)
# Dependencies
$(OBJDIR)/rs232.o: ../rs232/rs232.c ../rs232/rs232.h
$(OBJDIR)/packet.o: ../packet/packet.c ../packet/packet.h ../rs232/rs232.h
$(OBJDIR)/security.o: ../security/security.c ../security/security.h
$(OBJDIR)/secLink.o: ../seclink/secLink.c ../seclink/secLink.h ../rs232/rs232.h ../packet/packet.h ../security/security.h
clean:
rm -f $(OBJS) $(TARGET) $(LIBSDIR)/serial.dep