Commit Graph

317 Commits

Author SHA1 Message Date
Kenneth J Davis
1c25390e49
update deprecated set-output 2022-10-25 07:01:09 -04:00
Kenneth J Davis
e1b22c7035
update comments
(from Geoff Chappell blog and RBIL)
2022-10-24 20:19:32 -04:00
Kenneth J Davis
6f6e44e1b5
fix OW warning W115 in config.c 2022-10-24 18:08:27 -04:00
Kenneth J Davis
af52b0c8c3
fix OW warning W115 in dsk.c 2022-10-24 18:01:50 -04:00
Kenneth J Davis
c152d551de
fix OW warning W115
cast array using pointer to first element [newboot] instead of pointer to whole array [&newboot] to avoid OW error W115 "&array may not produce intended result" since the address of operator "&" is not required for getting the address of an array.
2022-10-24 17:56:33 -04:00
Kenneth J Davis
9d799c2a1e
Update ci-build.yml
enable ability to manually run workflow
2022-10-24 17:28:56 -04:00
tkchia
7149a8efe4 FCB (int 21h func 29h): should not accept field separator as "drive letter" 2022-07-16 07:20:24 -04:00
tkchia
031f17068a FCB (int 21h func 29h): should keep parsing name even if drive letter invalid 2022-07-15 09:45:10 -04:00
Kenneth J Davis
0e6d90cf82
build fixes, declare variables at start of block, use size_t to avoid int vs long errors 2022-06-03 23:29:37 -04:00
Kenneth J Davis
bfd5328183
fix building on Windows with Open Watcom, using OWWIN helper tools built as win32 executables instead of DOS executables as done using WATCOM for COMPILER 2022-06-03 23:28:51 -04:00
C. Masloch
9343e00f9a exeflat: try to fix CI displaying upx output before exeflat output 2022-05-30 17:37:26 -04:00
C. Masloch
b5299924c2 exeflat: update comments before prepending entry header 2022-05-30 17:37:26 -04:00
C. Masloch
70c498a309 exeflat: update usage screen with -E, -D, and -U switches 2022-05-30 17:37:26 -04:00
C. Masloch
e3e58ee3fd upxentry, upxdevic: add header comments 2022-05-30 17:37:26 -04:00
C. Masloch
77d3c7e1d7 exeflat: document UPX 3.96 exact DOS/SYS limit but use a lower number 2022-05-30 17:37:26 -04:00
C. Masloch
f23f035554 exeflat: allow to force either DOS/EXE or DOS/SYS compression format 2022-05-30 17:37:26 -04:00
C. Masloch
10b4d1581f exeflat: implement new-style UPX compression in DOS/SYS format 2022-05-30 17:37:26 -04:00
C. Masloch
9382d7ce00 exeflat: pass argv[3] to use as start_seg in write_header 2022-05-30 17:37:26 -04:00
C. Masloch
99614259ae exeflat: jump across nop slide when the stub is shorter than 192 bytes 2022-05-30 17:37:26 -04:00
C. Masloch
7f38303ade exeflat: shrink uncompressed stub size to 64 bytes
The code still allows for up to 192 bytes, should that
be useful. Simply by re-assembling upxentry.asm then
re-running exeflat, the changes will be picked up.
2022-05-30 17:37:26 -04:00
C. Masloch
45b3d9ef67 exeflat: move reading entry file into main, pass code to write_header 2022-05-30 17:37:26 -04:00
C. Masloch
992a898076 kernel.asm, exeflat: new format with UPX entry at 006C0h
This format has several advantages:

* The CONFIG block need not be moved.

* The entire compressed image (depacker and payload) need
not be moved another time before the UPX depacker's own
operation.

* The CONFIG block always lives at 00602h, and the kernel
need not be aware whether it was compressed for detecting
which CONFIG block to use.

* Support for compressed images beyond 64 KiB for free.
(The assembly define TEST_FILL_INIT_TEXT can be passed in
NASMENV to test this support with 32 KiB of LFSR output.)

* A subsequent commit will shorten the stub to 64 bytes,
compared to the prior 32 + 45 = 77 bytes, with no loss
of features. (The packed payload is a bit shorter too.)

* The new stub also sets ds and es to the segment value
that would point to the DOS/EXE process's PSP. This is
apparently not used by the UPX depacker but could be in
a future or past version, or if another packer is used.
2022-05-30 17:37:26 -04:00
C. Masloch
9dcd9ba051 mkfiles: add -Wall switch to host gcc variable
Refer to https://github.com/FDOS/kernel/pull/72#issuecomment-1133770757
2022-05-29 19:25:00 -04:00
C. Masloch
d91c14723a kernel: optimise A20 check and enable/disable calls
Some assembly tricks:

* SMC instead of checking the XMS driver address
in the DOS DS stub,

* SMC so that the address goes right into a
`call far immediate` instruction,

* use `repe cmpsw` to compare multiple words (saves
space over the individual word compares),

* near calls to far functions use push cs to build
a far-call stack frame,

* segments 0 and FFFFh generated by segment arithmetic
instead of loading from memory,

* common case (A20 already enabled) made to be the case
where the conditional branch just falls through, which
may be slightly better.
2022-05-29 19:24:00 -04:00
C. Masloch
72edabfdb7 gcc.mak: make sure to redirect more internal function calls in init
Refer to https://github.com/tkchia/gcc-ia16/issues/109#issuecomment-1133867169
2022-05-29 18:05:46 -04:00
C. Masloch
8e6fc98a94 config: bugfix, make struct array configcommands static (fixes #73)
A crash was introduced by the prior commit, ee255d2. I
tested that the kernel still did build with gcc, but I
failed to test whether it also still runs. Turns out that
apparently changing the pointers to static made it so gcc
put the structure into the init data segment and
implicitly called memcpy to put it on the stack. That's
wrong, however. We depend on #define to convert all calls
in init to the init text copies of memcpy etc. The
implicit call by gcc however attempts to call the HMA text
copy of memcpy which happens to be at another offset.

The fix is to make the entire array of structs static so
that memory for it is allocated only in the init data
segment, not on the stack. This seems to work for both
gcc and OpenWatcom (no warnings, it builds, it runs).
2022-05-22 13:16:39 -04:00
C. Masloch
ee255d2355 main, config: fix OW build (char not UBYTE, static file pointers) 2022-05-21 23:22:08 -04:00
C. Masloch
42b8e12bc7 ci_build.sh: fix CI build to correct OW file, wget --no-verbose
Refer to https://github.com/tkchia/gcc-ia16/issues/108
2022-05-21 23:22:08 -04:00
C. Masloch
5df9dbdbd7 mkfiles: fix compilation with current gcc-ia16
Refer to https://github.com/tkchia/gcc-ia16/issues/108
2022-05-21 23:22:08 -04:00
C. Masloch
c0b8aa2bf4 task: return Invalid format on empty executable (fixes #70) 2022-05-21 23:22:08 -04:00
C. Masloch
b562983222 config: add the CONFIG, ALTCONFIG, and OLDCONFIG kernel command line commands
CONFIG takes precedence and is by default initialised
to the empty string, that is, skipped. ALTCONFIG is
used to specify the 'alternative' filename and defaults
to fdconfig.sys. Finally, OLDCONFIG defaults to the
config.sys filename.
2022-05-21 23:22:08 -04:00
C. Masloch
4377a257e0 kernel, main: read kernel command line into init segment buffer
The protocol for this extension is based on what lDebug
already does given the PROTOCOL=FREEDOS with the switch
CMDLINE=1 (which was originally defined for the lDOS and
RxDOS load protocols). Therefore the stack frame mirrors
that of the lDOS protocol.
2022-05-21 23:22:08 -04:00
C. Masloch
49733547f1 kernel, main: add debugger_present variable and skip ints 0, 1, 3, 6
Also adds a CheckDebugger byte to the CONFIG block and
support for reading and writing this setting in the
SYS CONFIG program. Default is 0 (no check assume absent).
2022-05-21 23:22:08 -04:00
C. Masloch
7ff6c06814 kernel: copy CONFIG block from UPX help data early in kernel.asm
Here we depend on the signal instruction that is patched
by exeflat to indicate whether we were compressed. This
replaces the prior check that detected the UPX help data
solely by checking the CONFIG signature at 05E2h.
2022-05-21 23:22:08 -04:00
C. Masloch
b7345d9165 main: note that we want to set int 31h segment to DOS DS
This commit does not change the behaviour of the code
as it already did the right thing. However, it notes
that that should happen. (This is DR DOS compatible.
For example, SHSUCDX depends on DR DOS setting this
segment so that it can keep track of the DOS DS
across it being relocated. We do not yet relocate it
but keeping a reference here is still useful.)
2022-05-21 23:22:08 -04:00
C. Masloch
3b6d8362b3 exeflat: store original ss:sp in UPX help data 2022-05-21 23:22:08 -04:00
C. Masloch
ad368a4420 exeflat: support signal byte (clc/stc) to indicate compression to kernel 2022-05-21 23:22:08 -04:00
C. Masloch
f51c8a5304 exeflat: copy original CONFIG block to the depacker header 2022-05-21 23:22:08 -04:00
C. Masloch
6d23a787fb fdkrncfg: bugfix, version info check should not include signature 2022-05-21 23:22:08 -04:00
Andrew Bird
8c8d213119 Build: Don't flip video mode for -DDEBUG in Dosemu 2022-01-16 12:40:47 -05:00
Andrew Bird
9135a644c2 Build: Fix missing constant for -DDEBUG 2022-01-16 12:40:47 -05:00
Andrew Bird
7b6c8fb7fe Build: Fixup compile with GCC and -DDEBUG 2022-01-16 12:40:47 -05:00
Kenneth J Davis
a6781df62d Update copyright year 2022-01-12 17:59:54 -05:00
Andrew Bird
dd69862b93 CI: Remove Travis as it no longer works for us. 2022-01-10 17:58:30 -05:00
Andrew Bird
202e3c1c94 Build: Update country submodule 2021-12-31 17:27:32 -05:00
Andrew Bird
cd0a9dfe48 CI: Use Country.sys submodule 2021-12-30 11:55:17 -05:00
Andrew Bird
b7a65d9f73 Build: Build country.sys from submodule 2021-12-30 11:55:17 -05:00
Andrew Bird
bd5a68552e Build: Use country submodule data
Use table content from country submodule for
  "struct CountrySpecificInfoSmall specificCountriesSupported[]"
2021-12-30 11:55:17 -05:00
Andrew Bird
f2cf8220de Build: Add country submodule 2021-12-30 11:55:17 -05:00
lpproj
571cf11111 fix 2nd parameter of "DOS=" statement in config.sys does not take effect in some cases:
* preceding space(s): e.g. "DOS=UMB, HIGH"
* after unknown keyword: e.g. "DOS=NOUMB,HIGH"
2021-11-23 07:22:21 -05:00