FDOS / share

Installs file-sharing and locking capabilities for FreeDOS kernel. (Not compatible with other DOS kernels.)
11 stars 5 forks source link

AMIS general uninstaller support and enable/disable resident program #16

Closed ecm-pushbx closed 2 years ago

andrewbird commented 2 years ago

It seems the turbo-c compilation is broken by these changes

ajb@polly:/clients/common/fdos/share.git$ env COMPILER=tcc2-emu ./build.sh 
Warning: Turbo C 2.01 doesn't process files with Unix line endings
         Converting ...
unix2dos: converting file share.c to DOS format...
fluidsynth: warning: SDL2 not initialized, SDL2 audio driver won't be usable
FDPP kernel 1.6 [GIT: ] (compiled May 11 2022)
Kernel compatibility 7.10 - clang - FAT32 support

Written by Stas Sergeev, FDPP project.
Based on FreeDOS sources (C) Pasquale J. Villani and The FreeDOS Project.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

C: HD1, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
D: HD2, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
E: HD3, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
F: HD4, Pri[ 1], CHS=    0-1-1, start=     0 MB, size=  2000 MB
dosemu XMS 3.0 & UMB support enabled                                           
dosemu EMS driver rev 0.9 installed.
EMUFS host file and print access available
dosemu CDROM driver installed (V0.2)
Kernel: allocated 115 Diskbuffers = 62560 Bytes in HMA
Process 0 starting: c:\command.com /e:384 /p

FreeCom version 0.84-pre2 XMS_Swap [Aug 28 2006 00:29:00]
BLASTER=A220 I5 D1 H5 P330 T6
MIDI=SYNTH:2 MAP:E MODE:0
Welcome to dosemu2!
    Build 2.0pre9
G:\>rem Call this batch file with an argument of tcc3 or tcc2 to select compiler
G:\>goto tcc2
G:\>rem ############# Turbo C 2.01 ########################
G:\>set PATH=C:\bin;C:\tc201;c:\dosemu;c:\bin
G:\>set LIBS=C:\tc201\lib
G:\>set CC=tcc
G:\>set LD=tlink
G:\>rem Small
G:\>rem set COPT=-c -ms -1 share.c
G:\>rem set LOPT=/m /s /c $(LIBS)\c0s.obj share.obj,share.com,,$(LIBS)\cs.lib
G:\>rem Tiny
G:\>set COPT=-c -mt -1 share.c
G:\>set LOPT=/m /s /c /t $(LIBS)\c0t.obj share.obj,share.com,,$(LIBS)\cs.lib
G:\>goto doit
G:\>rem We use GNU make for all targets
G:\>make
tcc -c -mt -1 share.c
Turbo C  Version 2.01  Copyright (c) 1987, 1988 Borland International
share.c:
Error share.c 938: Undefined symbol 'status_struct' in function main
Warning share.c 938: Code has no effect in function main
Error share.c 938: Statement missing ; in function main
Error share.c 939: Improper use of a typedef symbol in function main
Error share.c 939: Statement missing ; in function main
Error share.c 940: Improper use of a typedef symbol in function main
Error share.c 940: Statement missing ; in function main
Error share.c 941: Improper use of a typedef symbol in function main
Error share.c 941: Statement missing ; in function main
Error share.c 942: Improper use of a typedef symbol in function main
Error share.c 942: Statement missing ; in function main
Error share.c 943: Expression syntax in function main
Error share.c 948: Expression syntax in function main
Error share.c 949: Improper use of a typedef symbol in function main
Error share.c 949: Statement missing ; in function main
Error share.c 982: Undefined symbol 'installed' in function main
Error share.c 987: Undefined symbol 'i' in function main
Error share.c 1164: Undefined symbol 'installed' in function main
Error share.c 1266: Undefined symbol 'ii' in function main
*** 18 errors in Compile ***

        Available memory 389542
make.exe: *** [Makefile:5: share.obj] Error 1
dos2unix: converting file share.c to Unix format...
andrewbird commented 2 years ago

Actually it was quite trivial

ajb@polly:/clients/common/fdos/share.git$ git diff
diff --git a/share.c b/share.c
index bae0d02..1c1e28e 100644
--- a/share.c
+++ b/share.c
@@ -935,13 +935,13 @@ int displaystatus(uint16_t mpx) {
 int main(int argc, char **argv) {
        unsigned short far *usfptr;
        unsigned short top_of_tsr;
-       status_struct s;
-       uint8_t far * share_installed = NULL;
-       uint8_t priorflag = 0;
        uint16_t rc;
        uint16_t mpx;
        int installed = 0;
 #if defined(__GNUC__)
+       status_struct s;
+       uint8_t far * share_installed = NULL;
+       uint8_t priorflag = 0;
        int uninstallrequested = 0, statusrequested = 0, onlyoptions = 0;
        int enablerequested = 0, disablerequested = 0;
 #endif
ecm-pushbx commented 2 years ago

Made my last commit ("disabled" typo, AMIS version number documentation, push/pop ds in asm_enable) and the fix for Turbo C into fixups to the enable/disable commit. Thanks for testing!