Hi Jim,
I apologize for not having properly shared all the details before, but I
was not able and I'm still not able to copy from the VirtualBox window
the text from the FreeDOS session - it let me save pictures of the
screen but not selecting the text; anyway I've used a workaround: I've
redirect the output of the DOS commands to text files ( "... >
textfile"), copy them to A: (so in the IMG file attached to FreeDOS
session in VB) and opening the IMG file from outside VirtualBox, then
copy&paste the content of the "textfile" here below.
Here below the content of OWSETENV.BAT that I've not changed:
@echo off
if "%WATCOM%" == "" goto SetEnv
if not exist %DOSDIR%\BIN\VFDUTIL.COM goto SetEnv
VFDUTIL /T WFC.EXE /T WFL.EXE
if errorlevel 1 goto SetEnv
goto End
:SetEnv
echo Open Watcom C/C++ Build Environment
SET PATH=C:\DEVEL\WATCOMC\BINW;%PATH%
SET INCLUDE=C:\DEVEL\WATCOMC\H;%INCLUDE%
SET WATCOM=C:\DEVEL\WATCOMC
SET EDPATH=C:\DEVEL\WATCOMC\EDDAT
SET WIPFC=C:\DEVEL\WATCOMC\WIPFC
:End
Here below the PATH, after having called OWSETENV.BAT file:
PATH=C:\DEVEL\WATCOMC\BINW;C:\FreeDOS\BIN;C:\FreeDOS\LINKS
Here below the content of the file output.txt after the "wcl prova.c >
output.txt" command run from C: with prova.c file in C:
Open Watcom C/C++16 Compile and Link Utility Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc PROVA.C
Open Watcom C16 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
PROVA.C: 7 lines, included 771, 0 warnings, 0 errors
Code size: 19
wlink @__wcl__.lnk
Open Watcom Linker Version 1.9
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
loading object files
searching libraries
creating a DOS executable
Here below the content of the file output.txt after the "wcl prova.c >
c:\output.txt" command run from A: with prova.c file in A: (note: output
redirect to output.txt on C:)
Open Watcom C/C++16 Compile and Link Utility Version 1.9
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
wcc PROVA.C
Open Watcom C16 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
PROVA.C: 7 lines, included 771, 0 warnings, 0 errors
Code size: 19
wlink @__wcl__.lnk
Open Watcom Linker Version 1.9
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Error! E3033: file __wcl__.lnk: line(1): directive error near ''
Error: Linker returned a bad status
Here below the content of the file output.txt after the "wcl prova.c >
output.txt" command run from A: with prova.c file in A: (note: output
redirect to output.txt on A:)
, included 771, 0 warnings, 0 errors
Code size: 19
wlink @__wcl__.lnk
Open Watcom Linker Version 1.9
Portions Copyright (c) 1985-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://wOpen Watcom C16 Optimizing Compiler Version 1.9
Portions Copyright (c) 1984-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
<Ä]üFÚštFâ&ëé
What has been writeen in the output.txt file IS NOT what I see on the
screen when I run the "wcl prova.c" command run from A: with prova.c
file in A:
What I see on the screen when I run the "wcl prova.c" command run from
A: with prova.c file in A:is exactly what has been written in the file
output.txt on C: in the test before.
After having seen the content of this last output.txt I've started
thinking that there's something wrong in how data are just written on
the IMG diskette file, in some cases at least. So, I've run the command
"dir > dir.txt" from A: and I got the following:
\80\00
A:\PROVAfile PROVA
name PROVA
\E9E\9FjY
A:\PROVA.C|\88\00\80\E9\96!\00\00CODEDATABSSTLSDGROUP_TEXT\AB\98\00(\00\88\00\80\FEO\A5\96\00CONSTט\00H\00\96\00CONST2\A3\98\00H\00\00
\96\00_DATA\E5\98\00H\00\00
\9A\00\FF\FF\FFR\8C\00__STK\00printf_\00\B5\A0\00\00\00\B8\00\E8\00\00\B8\00\00P\E8\00\00\83\C41\C0÷\9C\00\84V\C4\84
V\AE\90\00\00main_\00\00\00Z\A0
\00\00\00prova\00,\8C\00_cstart_\00_small_code_\00'\88\00\80\9FclibsD\88
\00\80\9Fmath87sÈ\00\80\9Femu87\9B\8A\00\00tbase, Inc. All Rights
Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
a:\PROVA.C: 7 lines
The content is meaningless and not at all the expected output of a "dir"
command.
Here below the command "dir > dir.txt" from C:
Volume in drive C is FREEDOS2022
Volume Serial Number is 1643-19EE
Directory of C:\
APPS <DIR> 11-11-2024 6:08p
DEVEL <DIR> 11-11-2024 6:09p
DOC <DIR> 11-11-2024 6:19p
FREEDOS <DIR> 11-11-2024 6:06p
GAMES <DIR> 11-11-2024 6:07p
NET <DIR> 11-11-2024 6:07p
PGME <DIR> 11-11-2024 6:08p
UTIL <DIR> 11-11-2024 6:08p
COMMAND COM 85,480 07-10-2021 7:28p
DIR TXT 0 11-12-2024 7:11p
FDAUTO BAT 1,940 11-11-2024 6:08p
FDCONFIG SYS 770 11-11-2024 6:08p
KERNEL SYS 46,256 02-20-2022 12:16p
PROVA C 77 11-10-2024 7:58p
PROVA EXE 8,692 11-12-2024 7:02p
PROVA OBJ 344 11-12-2024 7:02p
SCREENC TXT 866 11-12-2024 7:02p
9 file(s) 144,425 bytes
8 dir(s) 1,774,583,808 bytes free
Press any key to continue . . .
Which is exactly what was expected.
So, at this point it looks to me that there's nothing wrong with OW
itself, but there's something wrong with the IMG file (corrupted file
?!) or anyway on how files are read or written on it ...
Regards,
Davide
Il 11/11/24 23:50, Jim Hall via Freedos-user ha scritto:
On Mon, Nov 11, 2024 at 11:47 AM Davide Erbetta <davide.e1...@gmail.com> wrote:
Hi Jim,
let me first say that I'm using FreeDOS in VirtualBox. I've made a fresh
new install of FreeDOS and OW from the FreeDOS distribution CD as suggested.
I had the C file ("prova.c) on A: drive, an IMG file attached as A:
drive. On this IMG file on A: I had no issue in writing, compiling with
i16gcc, etc. I had the doubt that this (C file on "diskette" - IMG file
as A:) could be the source of the error, so I've made the following.
I copied the C file on C: drive as well and I did the tests:
[..]
This is a very weird problem, I cannot replicate it on my end. For
what it's worth, I boot FreeDOS in QEMU on Linux -- but the virtual
machine shouldn't matter here, because you say you can compile fine
using IA-16 GCC.
Here's what I did:
First, I defined a new 720k floppy disk image and booted my QEMU
instance with it (as the "A:" drive). I also formatted it as a 720k
floppy.
And I created a hello.c file on the A: drive:
A:\>dir /b
HELLO.C
A:\>type hello.c
#include <stdio.h>
int main()
{
puts("Hi there!");
return 0;
}
I also copied the hello.c file to the C: drive, at the root: (I used a
slightly different name so it was always clear which program file was
which)
C:\>copy A:\hello.c hello2.c
A:\hello.c =>> hello2.c
Then I reproduced your steps:
1) from C: I've run "wcl prova.c" --> it works!
This also works for me:
C:\>wcl -q hello2.c
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
C:\>hello2
Hi there!
2) from C: I've run "wcl a:\prova.c" --> it works!
That works for me too:
C:\>wcl -q A:\hello.c
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
Note that this creates the hello.obj and hello.exe in the current
directory on the C: drive, so you have to run it there:
C:\>dir /b hello.*
HELLO.EXE
HELLO.OBJ
C:\>hello
Hi there!
3) from A: I've run "wcl prova.c" (what I've done in the last days) -->
ERROR!
I don't get the error. This step works for me:
A:\>wcl -q hello.c
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
A:\>hello
Hi there!
4) from A: I've run "wcl c:\prova.c" --> ERROR!
I still don't get this error. This step works for me. Note that
compiling a file in another drive or directory will create the output
file in the current directory, so I was able to run the output in the
current directory:
A:\>wcl -q C:\hello2.c
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
A:\>hello2
Hi there!
[..]
(while if I run "wcc prova.c" + "wcl prova,obj" it always works, from A:
or C:)
So it looks like if I run "wcl" from A: it has issue. I don't know why,
but I hope it helps.
I assume the comma in your above command is a typo? You wrote "wcl
prova,obj" but that should be "wcl prova.obj"
Yes , it was a type, sorry for that.
I think the only way to figure this out is for you to share your
OWSETUP.BAT file (in case it was edited) and your PATH variable, and
copy/paste the exact messages you see when compiling. See above: When
I show my examples, I'm literally copying & pasting the output of the
commands into this email. I think "ERROR" is not a good enough
description, we need to see the actual output text.
For example, here is my OWSETUP.BAT (I edited it to add an alias to
FED and LS, and turn off output messages with DOS4G .. although I
"un-set" the DOS4G variable before I ran any of these commands)
C:\DEVEL\WATCOMC>type owsetenv.bat
@echo off
if "%WATCOM%" == "" goto SetEnv
if not exist %DOSDIR%\BIN\VFDUTIL.COM goto SetEnv
VFDUTIL /T WFC.EXE /T WFL.EXE
if errorlevel 1 goto SetEnv
goto End
:SetEnv
echo Open Watcom C/C++ Build Environment
SET PATH=C:\DEVEL\WATCOMC\BINW;%PATH%
SET INCLUDE=C:\DEVEL\WATCOMC\H;%INCLUDE%
SET WATCOM=C:\DEVEL\WATCOMC
SET EDPATH=C:\DEVEL\WATCOMC\EDDAT
SET WIPFC=C:\DEVEL\WATCOMC\WIPFC
:End
echo ON
set DOS4G=quiet
alias LS=DIR /O:GNE /W/B/L
alias FED=C:\apps\fed\fed.exe
And here is the PATH variable after I run OWSETUP.BAT:
C:\DEVEL\WATCOMC>path
PATH=C:\DEVEL\WATCOMC\BINW;C:\FreeDOS\BIN
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user