On at 2024-04-26 14:28 -0500, Jim Hall via Freedos-devel wrote:
On Fri, 26 Apr 2024, Bernd Böckmann via Freedos-devel wrote:

Microsoft and IBM released the source code of MS-DOS 4.0 under MIT
license [1]. To me, it looks fairly complete.

On Fri, Apr 26, 2024 at 2:25 AM Steve Nickolas via Freedos-devel
<freedos-devel@lists.sourceforge.net> wrote:

Everything but himem, dosshell, gwbasic, and parts of xmaem/xma2ems,
apparently.  I got most of it compiled using the tools in the archive.


How did you compile it? I'm having trouble getting the compile to work.

Here's what I'm doing: I've booted my system using FreeDOS but using
their tools. My C: drive is FreeDOS, and my D: drive is empty except
for the SRC directory from the MS-DOS 4.0 release on GitHub. I set up
my environment by editing the SETENV.BAT and running it:


@echo off
echo setting up system to build the MS-DOS 4.01 SOURCE BAK...
set COUNTRY=usa-ms
set BAKROOT=D:
rem BAKROOT points to the home drive/directory of the sources.
set LIB=%BAKROOT%\src\lib
set INIT=%BAKROOT%\src\tools
set INCLUDE=%BAKROOT%\src\inc
set PATH=%BAKROOT%\src\tools;C:\freedos\bin
set CL=%INIT%\CL.EXE
set LINK=%INIT%\LINK.EXE
set MASM=%INIT%\MASM.EXE


This is my PATH:

D:\>path
PATH=D:\src\tools;C:\freedos\bin


Yes, I'm really running the Microsoft NMAKE from their tree:

D:\>nmake

Microsoft (R) Program Maintenance Utility   Version 1.00.05
Copyright (c) Microsoft Corp 1987, 1988. All rights reserved.

NMAKE : fatal error U1051: usage : 'NMAKE' [-bcdeinpqrst -f makefile -x stderrfi
le] [macrodefs] [targets]
Stop.


But when I try to build it, it fails in the MAPPER directory with
"line too long":

D:\>cd src
D:\SRC>nmake

I had similar errors, in mapper/getmsg.asm, select/select2.asm, and select/usa.inf

For me these turned out to be errors involving a single-byte character being expanded to a three-byte UTF-8 encoded value. When nearly a whole line (of 80 columns) is filled with these EF BF BD strings then MASM (the version shipped with the repo) doesn't like the total line length in bytes. I eventually fixed this by running: (After manually deleting a few lines to work around the problem.)

> sed -i -re 's/\xEF\xBF\xBD|\xC4\xBF|\xC4\xB4/#/g' FILENAMES...

I had many more errors, starting with nosrvbld.exe running on eg boot/boot.skl complaining it couldn't find something. The something was named as a bunch of gibberish text however. This, and some other problems, turned out to be because git and/or Microsoft spat out text files with LF line endings whereas many of the DOS tools expect CR LF line endings. The following command worked for me:

> find -iname '*.bat' -o -iname '*.asm' -o -iname '*.skl' -o -iname 'zero.dat' -o -iname 'locscr' | xargs unix2dos -f

(The zero.dat and locscr files are used to redirect numbers into exe2bin's relocation number prompt. Failure to unix2dos those ended up hanging dosemu2 and/or ConnectBot, and spamming notifications to ConnectBot. Likely related to the old problem of int 21h service 0Ah not properly detecting and handling an EOF.)

To successfully compile the C program parts, I had to fix the setenv.bat script (apart from using another drive) to point to the headers and libraries that actually ship with the repo:

$ cat src/e.bat
@echo off
echo setting up system to build the MS-DOS 4.01 SOURCE BAK...
set CL=
set LINK=
set MASM=
set COUNTRY=usa-ms
set BAKROOT=e:
rem BAKROOT points to the home drive/directory of the sources.
set LIB=%BAKROOT%\src\tools\bld\lib
set INIT=%BAKROOT%\src\tools
set INCLUDE=%BAKROOT%\src\tools\bld\inc
set PATH=%BAKROOT%\src\tools;%PATH%


To boot the kernel, I used lDebug's command BOOT PROTOCOL MSDOS6 hda1/ to boot off a file system that I created using my bootimg.asm script. I had to set -D_OEM_NAME="'IBM 3.1'" to make the kernel accept my file system; with my default it calculated a wrong (at least) Sectors per Cluster value of 4 and failed to load the DOS module. This is my command line to create the image:

> nasm -I ../../lmacros/ -I ../../bootimg/ ../../bootimg/bootimg.asm -D_PAYLOADFILE="io.sys,msdos.sys,mem.exe,sys.com,../../ldebug/bin/callver.com,::rename,../../../.dosemu/drive_c/command.com,freecom.exe,command.com" -o disk.img -D_MEDIAID=0F8h -D_BPE=16 -D_ERROR_SMALL32=0 -D_SPF=256 -D_SPI=128000 -D_SPC=2 -D_MBR -D_MBR_PART_TYPE=fat16_chs -D_CHS_HEADS=128 -D_CHS_SECTORS=32 -D_OEM_NAME="'IBM 3.1'"


Regards,
ecm


_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to