Giter Site home page Giter Site logo

Comments (13)

davidly avatar davidly commented on August 28, 2024

Which .exe are you running when you see this error? Also, which version of Quick Basic are you using? Thanks.

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

What I assumed was the command line BASIC compiler in the 'qbx' folder.

$ ls
djl8086d.hxx   djl_durat.hxx  djl_perf.hxx  gwbasic    LICENSE  mgr.bat  msc_v1  m.sh       qbx         tasm       wordstar
djl_con.hxx    djl_kslog.hxx  djl_thrd.hxx  i8086.cxx  m.bat    mr.bat   msc_v2  ntvdm      QCL250.DOS  turbo3dos
djl_cycle.hxx  djl_os.hxx     djltrace.hxx  i8086.hxx  mg.bat   mr.sh    msc_v3  ntvdm.cxx  README.md   turbodos
$ cd qbx
$ ls
BC.EXE        BCL71ANR.LIB  BCL71ENR.LIB  BRT71ANR.EXE  BRT71ENR.EXE  LIB.EXE   QBX.EXE       TP.BAS
BCL71AFR.LIB  BCL71EFR.LIB  BRT71AFR.EXE  BRT71EFR.EXE  comptp.bat    LINK.EXE  STARTREK.BAS  TREKINST.BAS
$ ../ntvdm BC.EXE 
SYS2090: The system is unable to load the program.
$ 

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

With regards to path names it might be more logical if (on Linux) you assumed that current working folder was actually 'C:' when launching 'ntvdm' as Linux has no concept of drive letters?

from ntvdm.

davidly avatar davidly commented on August 28, 2024

When BC.EXE starts, it opens BC.EXE, allocates some RAM, and reads parts of BC.EXE into various locations. I suspect that the file open fails due to case differences in the path.

NTVDM makes the DOS current directory the Linux current directory, but in the form C:\CURRENT\LINUX\FOLDER. I tried making C:\ be the current folder, but that makes apps that look for paths like "..\INCLUDE" fail. The best workaround I've found
is to make a new root folder (I called my /DOSLAND) and make everything below that be uppercase. Copy the qbx folder contents to /DOSLAND/QBX and use the -u switch with NTVDM, and it'll work.

Different apps attempt to open files with all permutations of case in path and filenames. Some apps uppercase parts of paths
and other apps lowercase parts of paths seemingly at random. It's all very painful without just forcing everything to be
uppercase on the filesystem and with -u.

Build an app like TP.BAS like this:

../ntvdm -u BC.EXE tp.bas tp.obj tp.lst /O
../ntvdm -u LINK.EXE tp,,tp,,nul.def

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

You are right the current working folder wouldn't work but using the folder containing 'ntvdm' might. (Or just specify the root folder as a parameter).

So (on Linux) if you had

<some path>\ntvdm 
<some path>\lib\ EM.LIB
<some path>\bin\BC.EXE
<some path>\usr\TP.BAS

This would appear to the DOS programs be

C:/ntvdm 
C:/LIB/EM.LIB
C:/BIN/BC.EXE
C:/USR/TP.BAS

from ntvdm.

davidly avatar davidly commented on August 28, 2024

Ooh -- a command line argument makes sense!

Also, I discovered when building ntvdm on RISC-V that I have to force g++ to use signed char via -fsigned-char -- without this there were failures executing some instructions. I'm not sure on Debian if the default is signed, but that may explain some odd behavior of NTVDM.

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

I give that a try.

In the mean time I thought I'd try just tidying up the help text and README to make them a bit more Linux like, and I've added a couple of options to display the version/build and to display the usage information using -v and -? (I know the latter is not very Linux like but I wasn't going to rewrite the whole command line parser!).

I've left the usage details (almost) unchanged on Windows

C:> ntvdm -?
NT Virtual DOS Machine: emulates an 8086 MS-DOS 3.00 runtime environment enough to run COM/EXE apps
usage: ntvdm [arguments] <DOS executable> [arg1] [arg2]
  notes:
            -c     don't auto-detect apps that want 80x25 then set window to that size;
                   stay in teletype/console mode.
            -C     always set window to 80x25; don't use teletype mode.
            -d     don't clear the display on app exit when in 80x25 mode
            -e     comma-separated list of environment variables. e.g. -e:include=..\include,lib=..\lib
            -h     workaround for Packed File Corrupt error: load apps High, above 64k
            -i     trace instructions as they are executed to ntvdm.log (this is verbose!)
            -p     show performance information
            -s:X   speed in Hz. Default is to run as fast as possible.
                   for 4.77Mhz, use -s:4770000
                   to roughly match a 4.77Mhz 8088, use -s:4500000
            -t     enable debug tracing to ntvdm.log
            -z:X   applies X as a hex mask to SetProcessAffinityMask, e.g.:
                     /z:11    2 performance cores on an i7-1280P
                     /z:3000  2 efficiency cores on an i7-1280P
                     /z:11    2 random good cores on a 5950x
            -v     output version information and exit.
            -?     output this help and exit.
 [arg1] [arg2]     arguments after the .COM/.EXE file are passed to that command
  examples:
      ntvdm -c -t app.com foo bar
      ntvdm -s:4770000 turbo.com
      ntvdm s:\github\MS-DOS\v2.0\bin\masm small,,,small
      ntvdm s:\github\MS-DOS\v2.0\bin\link small,,,small
      ntvdm -t b -k myfile.asm
C:>

However, on Linux it looks a bit more Linux like (and perhaps a bit too terse) with the example commands modified to show how to use the escape characters to allow the use of the MSDOS backslash and a semi-colon.

Windows specific option are omitted.

$ ./ntvdm -?
Usage: ntvdm [OPTION]... PROGRAM [ARGUMENT]...
Emulates an 8086 and MS-DOS 3.00 runtime environment.

  -c               don't automatically change window size.
  -C               change text area to 80x25 (don't use tty mode).
  -d               don't clear the display on exit
  -u               force DOS paths to be uppercase
  -l               force DOS paths to be lowercase
  -e:env,...       define environment variables.
  -h               load high above 64k.
  -i               trace instructions to ntvdm.log.
  -t               enable debug tracing to ntvdm.log
  -p               show performance stats on exit.
  -s:X             set processor speed in Hz.
                     for 4.77 MHz 8086 use -s:4770000.
                     for 4.77 MHz 8088 use -s:4500000.
  -v               output version information and exit.
  -?               output this help and exit.

Examples:
  ntvdm -u -e:include=.\\inc msc.exe demo.c,,\;
  ntvdm -u -e:lib=.\\lib link.exe demo,,\;
  ntvdm -u -e:include=.\\inc,lib=.\\lib demo.exe one two three
  ntvdm -s:4770000 turbo.com
$

On both operating systems the version is shown along with a copyright and licence (I manged to get rid of the extra spaces in the date but it is very 'English' - you may which to change that! :-) )

$ ./ntvdm -v
Copyright(C) DJL 2023
License CC0 1.0 Universal <https://creativecommons.org/publicdomain/zero/1.0/>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Built for amd64 release on 2 Oct 23 23:16:32 by g++ on linux

$ 

If that looks OK to you I'll submit a pull request (if I can figure out how) when I've updated the README with a separate section for Linux users including how to get the META (Alt) key to work and some Linux specific examples...

from ntvdm.

davidly avatar davidly commented on August 28, 2024

Very cool -- yes, please submit a PR as this looks great!

from ntvdm.

davidly avatar davidly commented on August 28, 2024

Sorry @mike632t I was busy with my day job. Please resubmit the PR and I'll approve it tonight.

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

No worries - I think I messed up any way! New PR submitted (which should include your latest changes) which should make merging (a bit) easier...

from ntvdm.

davidly avatar davidly commented on August 28, 2024

Is the original issue now resolved? I'm guessing it is. If not, please reactivate this item. Thanks!

from ntvdm.

davidly avatar davidly commented on August 28, 2024

With regards to path names it might be more logical if (on Linux) you assumed that current working folder was actually 'C:' when launching 'ntvdm' as Linux has no concept of drive letters?

@mike632t I've added a /r argument that takes a folder that gets mapped to C:\ That should make it easier to run apps on Linux without creating a new top-level folder that's all uppercase.

from ntvdm.

mike632t avatar mike632t commented on August 28, 2024

That's awesome.

I can't wait to try it out!

from ntvdm.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.