From 249063a9c558adda81aa11d5f33f62f1bbb61c2e Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Mon, 1 Sep 2025 18:28:18 +0100 Subject: [PATCH 1/7] CI: Setup NASM in consistent manner for DOS --- ci_build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index b10882f3..b040049e 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -47,9 +47,9 @@ mv -n bin/country.sys _output/wc/. # echo set MAKE=make # echo set XCPU=386 # echo set XFAT=32 -# echo set XNASM='C:\\devel\\nasm\\nasm' +# echo set XNASM=nasm # echo set OLDPATH=%PATH% -# echo set PATH='C:\\devel\\i16gnu\\bin;C:\\bin;%OLDPATH%' +# echo set PATH='C:\\devel\\i16gnu\\bin;C:\\devel\\nasm;C:\\bin;%OLDPATH%' #} | unix2dos > config.bat #dosemu -td -q -K . -E "build.bat" @@ -63,10 +63,10 @@ git clean -x -d -f -e test -e _output -e _downloads -e _watcom echo set MAKE=wmake /ms echo set XCPU=386 echo set XFAT=32 - echo set XNASM='C:\\devel\\nasm\\nasm' + echo set XNASM=nasm echo set XUPX=upx --8086 --best echo set OLDPATH=%PATH% - echo set PATH='%WATCOM%\\binw;C:\\bin;%OLDPATH%' + echo set PATH='%WATCOM%\\binw;C:\\devel\\nasm;C:\\bin;%OLDPATH%' echo set DOS4G=QUIET } | unix2dos > config.bat From 468fec5e4e4288bfc83f7083453ab71d07c5775e Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Tue, 2 Sep 2025 00:32:22 +0100 Subject: [PATCH 2/7] CI: Update to use 1.4 repos --- ci_prereq.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ci_prereq.sh b/ci_prereq.sh index 3f6113c9..3dbe97ab 100755 --- a/ci_prereq.sh +++ b/ci_prereq.sh @@ -23,8 +23,7 @@ HERE=$(pwd) [ -f ow-snapshot.tar.xz ] || wget --no-verbose https://github.com/open-watcom/open-watcom-v2/releases/download/Current-build/ow-snapshot.tar.xz tar -C ../_watcom -xf ow-snapshot.tar.xz -#IBIBLIO_PATH='http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos' -IBIBLIO_PATH='https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.3' +IBIBLIO_PATH='https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/repositories/1.4' BASE=${IBIBLIO_PATH}/base @@ -37,7 +36,7 @@ BASE=${IBIBLIO_PATH}/base DEVEL=${IBIBLIO_PATH}/devel # get gnumake for DOS -[ -f djgpp_mk.zip ] || wget --no-verbose ${DEVEL}/djgpp_mk.zip +[ -f dj_make.zip ] || wget --no-verbose ${DEVEL}/dj_make.zip # get nasm for DOS [ -f nasm.zip ] || wget --no-verbose ${DEVEL}/nasm.zip @@ -67,7 +66,7 @@ cd ${HOME}/.dosemu/drive_c && ( cp -p /usr/share/dosemu/dosemu2-cmds-0.3/c/fdconfig.sys . # Development files - unzip -LL -q ${HERE}/djgpp_mk.zip + unzip -LL -q ${HERE}/dj_make.zip cp -p devel/djgpp/bin/make.exe bin/. unzip -LL -q ${HERE}/upx.zip cp -p devel/upx/upx.exe bin/. From f0ddbc0c126fd65df22920aab254db384d59e954 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Tue, 2 Sep 2025 00:55:51 +0100 Subject: [PATCH 3/7] CI: Build with Turbo C 2.01 if available --- .github/workflows/ci-build.yml | 4 ++++ ci_prereq.sh | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index ed4bc31a..ef675fb1 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -23,6 +23,10 @@ jobs: - name: Package install run: ./ci_prereq.sh + env: + TC201_ARCHIVE_PATHNAME: ${{ vars.TC201_ARCHIVE_PATHNAME }} + TC201_ARCHIVE_FILENAME: ${{ vars.TC201_ARCHIVE_FILENAME }} + TC201_ARCHIVE_PASSPHRASE: ${{ secrets.TC201_ARCHIVE_PASSPHRASE }} - name: build run: ./ci_build.sh diff --git a/ci_prereq.sh b/ci_prereq.sh index 3dbe97ab..c8bf0329 100755 --- a/ci_prereq.sh +++ b/ci_prereq.sh @@ -53,6 +53,12 @@ DEVEL=${IBIBLIO_PATH}/devel # get watcom for DOS [ -f watcomc.zip ] || wget --no-verbose ${DEVEL}/watcomc.zip +# get Turbo C 2.01 (maybe encrypted) tar file +if [ -n "${TC201_ARCHIVE_FILENAME}" ] && [ ! -f ${TC201_ARCHIVE_FILENAME} ] ; then + echo "Downloading Turbo C 2.01" + wget --no-verbose ${TC201_ARCHIVE_PATHNAME}/${TC201_ARCHIVE_FILENAME} +fi + mkdir -p ${HOME}/.dosemu/drive_c cd ${HOME}/.dosemu/drive_c && ( @@ -83,4 +89,15 @@ cd ${HOME}/.dosemu/drive_c && ( unzip -LL -q ${HERE}/watcomc.zip echo PATH to watcom binaries is 'c:/devel/watcomc/binw' + + # Turbo C + if [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] && [ -n "${TC201_ARCHIVE_PASSPHRASE}" ] ; then + echo Decrypting and unpacking Turbo C 2.01 + echo "${TC201_ARCHIVE_PASSPHRASE}" | gpg --decrypt --batch --passphrase-fd 0 ${HERE}/${TC201_ARCHIVE_FILENAME} | tar -jxf - + elif [ -f ${HERE}/${TC201_ARCHIVE_FILENAME} ] ; then + echo Unpacking Turbo C 2.01 + tar -jxf ${HERE}/${TC201_ARCHIVE_FILENAME} + else + echo No Turbo C 2.01 archive available + fi ) From 70a8f6aaa1b294f34750047bf3252c34256a05e6 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 28 Dec 2024 19:32:23 +0000 Subject: [PATCH 4/7] CI: Turbo C 2.01 doesn't do 386 instructions --- ci_build.sh | 2 +- ci_test.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci_build.sh b/ci_build.sh index b040049e..500bac8e 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -83,7 +83,7 @@ if [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then echo set COMPILER=TC2 echo set TC2_BASE='C:\\tc201' echo set MAKE=make - echo set XCPU=386 + echo set XCPU=86 echo set XFAT=32 echo set XNASM=nasm echo set OLDPATH=%PATH% diff --git a/ci_test.sh b/ci_test.sh index 6f0b6391..ed56975f 100755 --- a/ci_test.sh +++ b/ci_test.sh @@ -17,7 +17,7 @@ if [ ! -f _output/wc_dos/KWC38632.sys ] ; then exit 1 fi -if [ ! -f _output/tc_dos/KTC38632.sys ] && [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then +if [ ! -f _output/tc_dos/KTC8632.sys ] && [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then echo Turbo C 2.01 built kernel not present exit 1 fi @@ -42,7 +42,7 @@ then exit 2 fi if [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then - if ! ./test.sh ../_output/tc_dos/KTC38632.sys disktcd boottcd 'boot tcd: ' + if ! ./test.sh ../_output/tc_dos/KTC8632.sys disktcd boottcd 'boot tcd: ' then echo 'Turbo C 2.01 boot test failed' exit 2 From 6df42cc94369d999cde1177b02232fc869285f0b Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Sat, 28 Dec 2024 19:39:24 +0000 Subject: [PATCH 5/7] CI: Dont use LFNAPI --- ci_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci_build.sh b/ci_build.sh index 500bac8e..db33986a 100755 --- a/ci_build.sh +++ b/ci_build.sh @@ -90,7 +90,7 @@ if [ -d ${HOME}/.dosemu/drive_c/tc201 ] ; then echo set PATH='%TC2_BASE%;C:\\devel\\nasm;C:\\bin;%OLDPATH%' } | unix2dos > config.bat - dosemu -td -q -K . -E "build.bat lfn" + dosemu -td -q -K . -E "build.bat" mv -n bin/KTC*.map bin/KTC*.sys _output/tc_dos/. mv -n bin/country.sys _output/tc_dos/. # TC share From 4035080dddbfe81f6bfe1d112cab4b6be5c869ec Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Tue, 2 Sep 2025 20:44:18 +0100 Subject: [PATCH 6/7] CI: Turbo C doesn't like C++ comments --- kernel/dosfns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dosfns.c b/kernel/dosfns.c index 4c613ebd..4bfcbe3b 100644 --- a/kernel/dosfns.c +++ b/kernel/dosfns.c @@ -1434,7 +1434,7 @@ struct dhdr FAR *IsDevice(const char FAR * fname) BOOL IsShareInstalled(BOOL recheck) { extern unsigned char ASMPASCAL share_check(void); - //DebugPrintf(("Share_check at %p and share_installed at %p\n", (void far *)&share_check, (void far *)&share_installed)); + /*DebugPrintf(("Share_check at %p and share_installed at %p\n", (void far *)&share_check, (void far *)&share_installed));*/ if (recheck == FALSE) return share_installed; if (share_check() == 0xff) From 8ef48766a2b5136940b21cbb5f45a2f240d1dc74 Mon Sep 17 00:00:00 2001 From: Andrew Bird Date: Wed, 3 Sep 2025 15:31:29 +0100 Subject: [PATCH 7/7] CI: Temporarily override country MAKE for TC2 Unfortunately the make supplied with Turbo C 2.01 doesn't like variables being passed in on the command line, so use GNU make instead. Note: As 'country' is a submodule it can't do `!include "../mkfiles/generic.mak"` as that would be outside its repository and would break the standalone build, hence the reason its DIRSEP and CP vars are set on the outside. As its 'production' target is used by the main makefile, there's no opportunity to hardcode those values to DOS specific ones there either. --- build.bat | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.bat b/build.bat index 1c5caa90..c200b3a9 100644 --- a/build.bat +++ b/build.bat @@ -131,7 +131,9 @@ echo. echo Process COUNTRY +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ echo. cd ..\country -%MAKE% DIRSEP=\ CP=copy production +set TMAKE=%MAKE% +if "%COMPILER%" == "TC2" set TMAKE=c:\bin\make +%TMAKE% DIRSEP=\ CP=copy production if errorlevel 1 goto abort-cd echo.