Discussion:
[Freedos-devel] Incompatibility issue due to FreeCom Dir command's output layout and Dosbox kernel limitations
Denis St-Lau
2017-02-18 20:14:03 UTC
Permalink
Hi all,

There is an incompatibility issue with the "File Selection" dialogs of one of our legacy engineering MS-DOS programs. We don't have the source code of the program but I know it was written in Borland Turbo-Basic a long time ago. For years I thought it was a flaw in the FreeDOS compatibility. In fact I found recently this is because the output of the "dir" command is dumped in a temporary text file and parsed by the program in a fragile way. I discovered three requirements for this program to work. The display of the "dir" command must be formatted in a way that :

1 - The file dates must be printed with a 2 digits year representation
2 - The file times must be printed without the AM/PM flag (24 hours representation)
3 - The thousands delimiter of the file sizes must be a blank space (" ") instead of a comma (",")

The first requirement is easy to handle in autoexec.bat with: SET DIRCMD=/-4.  The second and third requirements need an appropriate fdconfig.sys setting, for example:  !Country = 002, 863, C:\FDOS\BIN\Country.sys

But when installing FreeDOS 1.2 in DosBox, we can't configure the fdconfig.sys. I want to use the program this way in order to operate it automatically with a Python script on the Host machine while sharing files and directories. So now I'm trying to patch and recompile the FreeCom's COMMAND.COM program to meet the above requirements.

I am not proficient in C but all seems to happen in the DisplaySingleDirEntry() function of the DIR.C file. At least I can remove the AM/PM flag with an ugly "p[strlen(p)-1] = 0;" just before the "fputs(p, stdout);" at line of code n°884.

The compilation works well but now I struggle to modify the thousand delimiter. I thought it could be easy with the convert() function of NUM_FMT.C (see temp[30 - c++] = nlsBuf->thousendsSep[0];) but it have no effects and I don't see how to change the country settings.

Does someone have an idea how this could be done?

By the way, I really like the FDIMPLES provided with the new FreeDOS 1.2 !

Regards,
Eric Auer
2017-02-18 21:18:18 UTC
Permalink
Hi Denis,

you write that for getting 2 digit, AM/PM, space 1000s sep
DIR output from freecom, you use SET DIRCMD=/-4 but failed
to find a way to set COUNTRY to 002,863,c:\fdos\bin\country.sys
in the context of DOSBOX. I still think it would be a lot
easier to find out how to change DOSBOX country settings
compared to compiling a special freecom command.com which
has your desired settings hardcoded.

Any DOSBOX fans who could make a recommendation here? :-)

Regards, Eric

PS: As far as I remember, you can also tell DOSBOX to boot
a freedos kernel with freedos config.sys from a disk image,
so if the simulated DOS kernel of DOSBOX lacks country.sys
support at all, then booting freedos would be a workaround.

PPS: Did yahoo mail get renamed to ymail?
Denis St-Lau
2017-02-18 22:22:25 UTC
Permalink
Hi Eric,
Thanks for your answer.
I agree it would be far better using a switch to avoid recompiling the FreeCOM command.com but after my research I concluded DOSBOX do not offer these country settings and is missing any config.sys functionality. I've read they are not very interested in adding this because they focus only on the minimum work required for games compatibility. They don't even support the dir /-4 switch in their own command.com. I will continue to investigate and asking them just in case. But I do not expect much help on their side because my program is not a game.

Also I want to avoid booting the FreeDOS kernel on a disk image, because doing so do not allow access to the host file system. Without the DOSBOX kernel, we don't have the "mount" command and we constantly have to mount/unmount the DOS disk image from the GNU/Linux or Windows host (or use FTP networking) to exchange data. This is tedious and the disk image gets corrupted if simultaneously mounted or written on by the Host and the DOS. I need to use the DOSBOX kernel because I want direct access to the directories without being confined in virtual disk images.
From my point of view an interesting improvement for the next FreeDOS's kernel could be to duplicate the DOSBOX capability to mount external directories...
PS: ymail exists since many years. For me it is not a recent renaming.




Le samedi 18 février 2017 16h19, Eric Auer <***@jpberlin.de> a écrit :



Hi Denis,

you write that for getting 2 digit, AM/PM, space 1000s sep
DIR output from freecom, you use SET DIRCMD=/-4 but failed
to find a way to set COUNTRY to 002,863,c:\fdos\bin\country.sys
in the context of DOSBOX. I still think it would be a lot
easier to find out how to change DOSBOX country settings
compared to compiling a special freecom command.com which
has your desired settings hardcoded.

Any DOSBOX fans who could make a recommendation here? :-)

Regards, Eric

PS: As far as I remember, you can also tell DOSBOX to boot
a freedos kernel with freedos config.sys from a disk image,
so if the simulated DOS kernel of DOSBOX lacks country.sys
support at all, then booting freedos would be a workaround.

PPS: Did yahoo mail get renamed to ymail?
Eric Auer
2017-02-19 01:21:26 UTC
Permalink
Bonsoir Denis,

if the DOSBOX simulated DOS kernel is missing country functionality
and you do not want to boot freedos (because you do not want to use
diskimages) then you could load a TSR which answers COUNTRY requests
by freecom command.com with country preferences of your choice :-)

Dosbox also had some spin-off for people who want to run "work"
software instead of "play" software: Less sound and graphics and
more other features, as far as I remember...

Regarding the mount host filesystem feature of dosbox virtual DOS:
When you use freedos kernel in DOSEMU, you can configure it to use
host (Linux) directories as virtual drives. There are also generic
drivers such as VMSMOUNT which allow a DOS, in particular freedos,
to mount drives offered by the host in vmware :-) I do not know if
DOSBOX offers a general drive access for which a driver can be made
for a real DOS. Maybe the DOSBOX drives only exist for the virtual
DOS simulated by DOSBOX itself. Giving VMWARE and VMSMOUNT a try is
probably worth the experiment :-)

By the way, why does your software use command.com DIR and parses
the output? It would probably be a lot easier to use the DIR call
in the DOS kernel, which is machine readable instead of pure text.

Cheers, Eric
Steve Nickolas
2017-02-19 01:30:04 UTC
Permalink
Post by Eric Auer
Bonsoir Denis,
if the DOSBOX simulated DOS kernel is missing country functionality
and you do not want to boot freedos (because you do not want to use
diskimages) then you could load a TSR which answers COUNTRY requests
by freecom command.com with country preferences of your choice :-)
Dosbox also had some spin-off for people who want to run "work"
software instead of "play" software: Less sound and graphics and
more other features, as far as I remember...
I think it's called VDOS and it uses 4DOS as its default shell.

-uso.
Eric Auer
2017-02-19 01:39:30 UTC
Permalink
For some extra details about the COUNTRY settings idea :-)
Post by Eric Auer
if the DOSBOX simulated DOS kernel is missing country functionality
and you do not want to boot freedos (because you do not want to use
diskimages) then you could load a TSR which answers COUNTRY requests
by freecom command.com with country preferences of your choice :-)
You basically need a very simple "int 21h function AH=38h" TSR tool...

Sub-function AL=0: Fills buffer at DS:DX, passed by the user, with a
Post by Eric Auer
Offset Size Description (Table 01399)
00h WORD date format [0=M-D-Y, 1 D-M-Y, 2 Y-M-D, which is yours?]
02h 5 BYTEs ASCIZ currency symbol string [not relevant for you?]
07h 2 BYTEs ASCIZ thousands separator [you want this to be 20h, 00h]
09h 2 BYTEs ASCIZ decimal separator [not relevant for you?]
0Bh 2 BYTEs ASCIZ date separator [you did not specify your preference]
0Dh 2 BYTEs ASCIZ time separator [you did not specify your preference]
0Fh BYTE currency format [not relevant for you?]
bit 2 = set if currency symbol replaces decimal point
bit 1 = number of spaces between value and currency symbol
bit 0 = 0 if currency symbol precedes value
1 if currency symbol follows value
10h BYTE number of digits after decimal in currency [not relevant?]
11h BYTE time format [you say you want 24h time, so make this 1]
bit 0 = 0 if 12-hour clock
1 if 24-hour clock
12h DWORD address of case map routine [could point to RETF opcode]
(FAR CALL, AL = character to map to upper case [>= 80h])
16h 2 BYTEs ASCIZ data-list separator [not relevant? who uses this?]
18h 10 BYTEs reserved [so not relevant for you by definition...]
You apparently want country code to be 2 (Canadian French). You can
also load DISPLAY and use MODE to load the codepage 863 font if the
required VGA BIOS functionality is supported in DOSEMU - I think yes.

You can use DEVLOAD to load SYS drivers from the shell prompt, as it
seems from your earlier mail that DOSBOX barely does any config sys?

The additional sub-functions 1 to -1 with DX = -1, probably are not
relevant for you. Those are for on the fly country config changes.

In MS DOS 7 (Win95's DOS) mode, there would also be int 21h function
set 70h with various sub-functions, but I doubt that freecom makes
any attempts to query those.

Regards, Eric
Denis St-Lau
2017-02-19 03:30:56 UTC
Permalink
Bonjour Steve and Eric,
Actually I don't already know how to use VDOS, VMSMOUNT, DISPLAY, MODE CON, DEVLOAD and "int 21h function AH=38h" TSR tool. These are good hints that I will explore.

I believe the codepage 863 is not mandatory: the default 437 is probably sufficient. I have DOSEMU at home with an older FreeDOS but I probably cannot have it at work where we have Windows 7 and amd64 processors. 
I see on <help.fdos.org> that we can use DEVLOAD to load Country.sys but it is not clear how to proceed:        When I type on prompt > DEVLOAD C:\FDOS\BIN\COUNTRY.SYS
        I get: "Error: free drive letter not found, increase LASTDRIVE"
        And if I try to increase with> devload lastdrive=G        I get: "Error: can't open file (0003h - Dir not found)"
       No more success with> devload country=002,437,c:\fdos\bin\country.sys       (Had to try a guess because did not found a good example)

I found some doc on internet about the INT 21h TSR tool and it look very scary. Does it imply writing code in Assembler?  If its the case I'm probably out because I know absolutely nothing about this language. I will try a more involved look on all this tomorrow.
I don't know why our old program is so badly designed. My employer bought it 25 years ago without knowing that and the provider have terminated the support a long time ago. They pushed on newer Windows versions but I prefer to compare the results with the original and historical DOS version.

Thanks for your hints!
Denis



Le samedi 18 février 2017 20h40, Eric Auer <***@jpberlin.de> a écrit :



For some extra details about the COUNTRY settings idea :-)
Post by Eric Auer
if the DOSBOX simulated DOS kernel is missing country functionality
and you do not want to boot freedos (because you do not want to use
diskimages) then you could load a TSR which answers COUNTRY requests
by freecom command.com with country preferences of your choice :-)
You basically need a very simple "int 21h function AH=38h" TSR tool...

Sub-function AL=0: Fills buffer at DS:DX, passed by the user, with a
Post by Eric Auer
Offset  Size    Description    (Table 01399)
  00h    WORD    date format [0=M-D-Y, 1 D-M-Y, 2 Y-M-D, which is yours?]
  02h  5 BYTEs  ASCIZ currency symbol string [not relevant for you?]
  07h  2 BYTEs  ASCIZ thousands separator [you want this to be 20h, 00h]
  09h  2 BYTEs  ASCIZ decimal separator [not relevant for you?]
  0Bh  2 BYTEs  ASCIZ date separator [you did not specify your preference]
  0Dh  2 BYTEs  ASCIZ time separator [you did not specify your preference]
  0Fh    BYTE    currency format [not relevant for you?]
                bit 2 = set if currency symbol replaces decimal point
                bit 1 = number of spaces between value and currency symbol
                bit 0 = 0 if currency symbol precedes value
                        1 if currency symbol follows value
  10h    BYTE    number of digits after decimal in currency [not relevant?]
  11h    BYTE    time format [you say you want 24h time, so make this 1]
                bit 0 = 0 if 12-hour clock
                        1 if 24-hour clock
  12h    DWORD  address of case map routine [could point to RETF opcode]
                (FAR CALL, AL = character to map to upper case [>= 80h])
  16h  2 BYTEs  ASCIZ data-list separator [not relevant? who uses this?]
  18h 10 BYTEs  reserved [so not relevant for you by definition...]
You apparently want country code to be 2 (Canadian French). You can
also load DISPLAY and use MODE to load the codepage 863 font if the
required VGA BIOS functionality is supported in DOSEMU - I think yes.

You can use DEVLOAD to load SYS drivers from the shell prompt, as it
seems from your earlier mail that DOSBOX barely does any config sys?

The additional sub-functions 1 to -1 with DX = -1, probably are not
relevant for you. Those are for on the fly country config changes.

In MS DOS 7 (Win95's DOS) mode, there would also be int 21h function
set 70h with various sub-functions, but I doubt that freecom makes
any attempts to query those.

Regards, Eric
Eric Auer
2017-02-19 12:12:22 UTC
Permalink
Hi Denis,

country.sys is not a driver, it is a data file. So you can
not load *that* with DEVLOAD. However, you can load other
drivers, if that helps you. Read the manual of our DISPLAY
and MODE: By first loading DISPLAY, then running MODE, you
can switch fonts, in case codepage 437 is not sufficient.

VDOS is simply a variant of DOSBOX for more serious work.

VMSMOUNT is a program to make drives offered by a VMWare
host available to a DOS running inside VMWare.

If you fill in the table of settings in my previous mail, I
can add some detail to the COUNTRY setting TSR method, so
you do not have to tweak the technical mess yourself :-)

Cheers, Eric

PS: What does that 25 year old program do? For which
version and brand of DOS was it originally designed?
Steve Nickolas
2017-02-18 22:19:26 UTC
Permalink
Post by Denis St-Lau
Hi all,
1 - The file dates must be printed with a 2 digits year representation
2 - The file times must be printed without the AM/PM flag (24 hours representation)
3 - The thousands delimiter of the file sizes must be a blank space (" ") instead of a comma (",")
The first requirement is easy to handle in autoexec.bat with: SET DIRCMD=/-4.  The second and third requirements need an appropriate fdconfig.sys setting, for example:  !Country = 002, 863, C:\FDOS\BIN\Country.sys
But when installing FreeDOS 1.2 in DosBox, we can't configure the fdconfig.sys. I want to use the program this way in order to operate it automatically with a Python script on the Host machine while sharing files and directories. So now I'm trying to patch and recompile the FreeCom's COMMAND.COM program to meet the above requirements.
I am not proficient in C but all seems to happen in the DisplaySingleDirEntry() function of the DIR.C file. At least I can remove the AM/PM flag with an ugly "p[strlen(p)-1] = 0;" just before the "fputs(p, stdout);" at line of code n°884.
The compilation works well but now I struggle to modify the thousand delimiter. I thought it could be easy with the convert() function of NUM_FMT.C (see temp[30 - c++] = nlsBuf->thousendsSep[0];) but it have no effects and I don't see how to change the country settings.
Does someone have an idea how this could be done?
By the way, I really like the FDIMPLES provided with the new FreeDOS 1.2 !
Regards,
The logical way in which removing commas from DIR ought to be handled, in
my opinion, is to use the NO_SEP variable, à la PC DOS 6.3 and 7. That
said, your program is probably liable to break on MS-DOS 6.2x as well as
it does on FreeDOS, as 6.2 introduced the comma separators.

I don't know if FreeCOM has a comparable feature.

-uso.
Joe Forster/STA
2017-02-19 12:21:50 UTC
Permalink
Hi guys,
Post by Denis St-Lau
There is an incompatibility issue with the "File Selection" dialogs of
one of our legacy engineering MS-DOS programs. We don't have the source
code of the program but I know it was written in Borland Turbo-Basic a
long time ago. For years I thought it was a flaw in the FreeDOS
compatibility. In fact I found recently this is because the output of
the "dir" command is dumped in a temporary text file and parsed by the
program in a fragile way. I discovered three requirements for this
program to work. The display of the "dir" command must be formatted in
1 - The file dates must be printed with a 2 digits year representation
2 - The file times must be printed without the AM/PM flag (24 hours representation)
3 - The thousands delimiter of the file sizes must be a blank space (" ") instead of a comma (",")
Honestly, I wouldn't bother with trying to disassemble, decompile,
recompile, whatever any of the programs involved because I wouldn't have
the necessary tools and settings to reproduce the same programs, only
with these small changes and nothing else. I would rather hack the
binaries.

In this case, your DOS program could be changed in a few places so that
its fixed but FreeDOS-incompatible requirements become fixed
FreeDOS-compatible ones. Without having seen your program, I would say
that changing requirement:
- #3 is easy;
- #1 is a bit complicated;
- #2 may not be possible.
In the last case, I would hack the FreeDOS command.com also/instead.

These changes would break compatibility between your program and other
DOS'es as well as the compatibility of FreeDOS with other programs so
they would be only for this very specific setup. You should get a
replacement for your program as soon as possible, though. :-)

Joe
--
KOVÁCS Balázs aka Joe Forster/STA; ***@c64.rulez.org; http://sta.c64.org
Don't E-mail spam, HTML or uncompressed files! More contacts on homepage
Ulrich Hansen
2017-02-19 13:39:16 UTC
Permalink
Post by Denis St-Lau
Without the DOSBOX kernel, we don't have the "mount" command and we constantly have to mount/unmount the DOS disk image from the GNU/Linux or Windows host (or use FTP networking) to exchange data. This is tedious and the disk image gets corrupted if simultaneously mounted or written on by the Host and the DOS.
Yes, you are completely right about that.

But please take a look at a new project: „EtherDFS“ by Mateusz Viste.
http://etherdfs.sourceforge.net <http://etherdfs.sourceforge.net/>

If your host is running GNU/Linux, you can start EtherSRV on the host and EtherDFS on your DOS guest.

On the host go to the directory, that EtherSRV is mounting. Share it with Samba to your Windows clients.

That’s it. You have now what everybody wants: A network disk in FreeDOS, shared with everybody in your LAN, and still 618 K conventional memory free.

The only downsides, as I see it:
- At the moment EtherSRV will change timestamps of received files to the actual date and time.
- On VirtualBox a guest with EtherDFS can not reach (yet) an EtherSRV running on a machine outside the host.
- EtherSRV is running on GNU/Linux only.
Denis St-Lau
2017-02-19 22:57:47 UTC
Permalink
Hi everyone,
vDOS is very nice. Unfortunately also blocked with Dir-command related issues with my program (file dates in style 2-10-98 intead of 02-10-98). I posted a topic on their site. I also found they not support modification of the global Country setting (locked to 1).

About VMWARE and VMSMOUNT. I think it's nearly equivalent to what we have at work with Microsoft VirtualPC. I didn't try sendkeys automation through this heavier layer but I will give it a try if I cannot use vDOS and DOSBOX.

Eric, I found you are author of MODE.COM !! To set the codepage I added this in my autoexec.bat:
       DISPLAY CON=(ega,863,)
       MODE CON CODEPAGE PREPARE=((863) %dosdir%\cpi\ega9.cpx)
Offset  Size    Description     (Table 01399)
  00h    WORD    date format [2 Y-M-D]
  02h  5 BYTEs   ASCIZ currency symbol string ['$'.. so I imagine it is 24h, 00h ?]
  07h  2 BYTEs   ASCIZ thousands separator [you want this to be 20h, 00h...Yes]
  09h  2 BYTEs   ASCIZ decimal separator ['.' = 2E, 00h ?]
  0Bh  2 BYTEs   ASCIZ date separator ['-' = 2D, 00h ?]
  0Dh  2 BYTEs   ASCIZ time separator [':' = 3A, 00h ?]
  0Fh    BYTE    currency format [not relevant for you? probably not, answers bellow]
                 bit 2 = set if currency symbol replaces decimal point
                          [I would say No, do not replaces decimal point]
                 bit 1 = number of spaces between value and currency symbol
                          [I would guess 1 space]
                 bit 0 = 0 if currency symbol precedes value
                         1 if currency symbol follows value
                          [Not sure but I would guess bit 0 =1]
  10h    BYTE    number of digits after decimal in currency
                  [not relevant? maybe not but I would say 2 digits]
  11h    BYTE    time format [you say you want 24h time, so make this 1--Yes]
                 bit 0 = 0 if 12-hour clock
                         1 if 24-hour clock
  12h    DWORD   address of case map routine [could point to RETF opcode]
                 (FAR CALL, AL = character to map to upper case [>= 80h])
  16h  2 BYTEs   ASCIZ data-list separator [not relevant? who uses this?]
  18h 10 BYTEs   reserved [so not relevant for you by definition...]
To answer your question about our old MS-DOS program: We have used it in MS-DOS and winXP-win32 console only. It is described at <http://www.dynatest.com/elmod>. There is not so many users since it is addressed to a very specialized domain. Only the newer Windows version is supported by the maker.

Thanks, Denis


Le Dimanche 19 février 2017 8h39, Ulrich Hansen <***@mailbox.org> a écrit :




Am 18.02.2017 um 23:22 schrieb Denis St-Lau <***@ymail.com>:
Without the DOSBOX kernel, we don't have the "mount" command and we constantly have to mount/unmount the DOS disk image from the GNU/Linux or Windows host (or use FTP networking) to exchange data. This is tedious and the disk image gets corrupted if simultaneously mounted or written on by the Host and the DOS.

Yes, you are completely right about that. 
But please take a look at a new project: „EtherDFS“ by Mateusz Viste.http://etherdfs.sourceforge.net
If your host is running GNU/Linux, you can start EtherSRV on the host and EtherDFS on your DOS guest.
On the host go to the directory, that EtherSRV is mounting. Share it with Samba to your Windows clients.
That’s it. You have now what everybody wants: A network disk in FreeDOS, shared with everybody in your LAN, and still 618 K conventional memory free.
The only downsides, as I see it:- At the moment EtherSRV will change timestamps of received files to the actual date and time.- On VirtualBox a guest with EtherDFS can not reach (yet) an EtherSRV running on a machine outside the host.- EtherSRV is running on GNU/Linux only.
Eric Auer
2017-02-20 00:41:09 UTC
Permalink
Hi everybody, see yet another FreeCOM feature request below... ;-)

Thanks for filling in the table, Denis! A proof of concept tool for
your task, for compilation with "NASM -O CANADA.COM CANADA.ASM" is
start: jmp short setup ; 100h
db 0eah ; jmp far fixed offset
dw 0,0 ; 103h: old INT 21 vector stored here
mapc: retf ; 107h: dummy case mapping routine
new21: pushf ; 108h: new INT 21 handler
cmp ax,3800h ; get country info?
jz canada
popf
jmp short chain
canada: popf ; DS:DX is pointer to user buffer
mov bx,dx
mov word [bx+0],2 ; date format Year Month Day
mov word [bx+2],24h ; dollar sign, null char (currency)
mov word [bx+7],20h ; space char, null char (1000s sep)
mov word [bx+9],2eh ; ".", null char (decimal separator)
mov word [bx+11],2dh ; "-", null char (date separator)
mov word [bx+13],3ah ; colon, null char (time separator)
mov byte [bx+15],3 ; currency format flags
mov byte [bx+16],2 ; decimals for amounts of money
mov byte [bx+17],1 ; use 24 hour time
mov word [bx+18],107h ; case map routine (dummy)
mov [bx+20],cs ; case map routine segment
mov word [bx+22],20h ; space char, null, data list sep
; at offset 24: ten bytes of reserved data, ignored here
mov bx,2 ; country code for French Canadian
clc
retf +2
setup: ; offset must be at most 160h (16+6 para)
mov ax,3521h ; get INT 21 vector
int 21h ; return ES:BX
mov [103h],bx ; offset
mov [105h],es ; segment
mov ax,2521h ; set new INT 21 vector
mov dx,108h ; new21 offset, expect DS=CS
int 21h
mov ax,3100h ; stay TSR, errorlevel 0
mov dx,16+6 ; resident paragraphs incl. PSP
int 21h
However, it turns out that the long number display code of
freecom command.com does NOT support country settings AT ALL
YET! It just uses comma as thousands separator all the time.

See the "convert" function in the "num_fmt" source code file.

I am not sure about the date format: Freecom sources say it
should work, but I think it does not change for me? Do not
forget to load a new instance of freecom (by running the
command.com binary, simple) after running the CANADA tool.

At least the tool does switch to 24 hour time correctly :-p

The clock display in EDIT also follows the CANADA settings.

Cheers, Eric
Denis St-Lau
2017-02-20 02:41:56 UTC
Permalink
Thanks a lot Eric for this program.
I have the space delimiter for thousands with the FreeDOS kernel on my VirtualBox. (But not in the DOSBOX with it's own kernel of course). And yesterday when I replaced the thousand delimiter in convert() of NUM_FMT.C with:        temp[30 - c++] = ' ';instead of:
        temp[30 - c++] = nlsBuf->thousendsSep[0];
This had no visible effect on the behavior of my new Command.com


I have a mysterious problem to compile as you say:        when I do:  NASM -O CANADA.COM CANADA.ASM        I get: "nasm: fatal: unknown optimization option -OC"
And if I rename to test.asm I get:        "nasm: fatal: unknown optimization option -Ot"
Looks like it doesn't see the space character between the -O switch and the file name. Even if I put multiple spaces between them. Have you ever see this?(Can't read the help with <nasm -h> because I don't know how to scroll one page at a time.)

Regards, Denis


Le Dimanche 19 février 2017 19h41, Eric Auer <***@jpberlin.de> a écrit :


Hi everybody, see yet another FreeCOM feature request below... ;-)

Thanks for filling in the table, Denis! A proof of concept tool for
your task, for compilation with "NASM -O CANADA.COM CANADA.ASM" is
start:    jmp short setup    ; 100h
    db 0eah        ; jmp far fixed offset
    dw 0,0        ; 103h: old INT 21 vector stored here
mapc:    retf        ; 107h: dummy case mapping routine
new21:    pushf        ; 108h: new INT 21 handler
    cmp ax,3800h    ; get country info?
    jz canada
    popf
    jmp short chain
canada:    popf        ; DS:DX is pointer to user buffer
    mov bx,dx
    mov word [bx+0],2    ; date format Year Month Day
    mov word [bx+2],24h    ; dollar sign, null char (currency)
    mov word [bx+7],20h    ; space char, null char (1000s sep)
    mov word [bx+9],2eh    ; ".", null char (decimal separator)
    mov word [bx+11],2dh    ; "-", null char (date separator)
    mov word [bx+13],3ah    ; colon, null char (time separator)
    mov byte [bx+15],3    ; currency format flags
    mov byte [bx+16],2    ; decimals for amounts of money
    mov byte [bx+17],1    ; use 24 hour time
    mov word [bx+18],107h    ; case map routine (dummy)
    mov [bx+20],cs        ; case map routine segment
    mov word [bx+22],20h    ; space char, null, data list sep
    ; at offset 24: ten bytes of reserved data, ignored here
    mov bx,2    ; country code for French Canadian
    clc
    retf +2
setup:            ; offset must be at most 160h (16+6 para)
    mov ax,3521h    ; get INT 21 vector
    int 21h        ; return ES:BX
    mov [103h],bx    ; offset
    mov [105h],es    ; segment
    mov ax,2521h    ; set new INT 21 vector
    mov dx,108h    ; new21 offset, expect DS=CS
    int 21h
    mov ax,3100h    ; stay TSR, errorlevel 0
    mov dx,16+6    ; resident paragraphs incl. PSP
    int 21h
However, it turns out that the long number display code of
freecom command.com does NOT support country settings AT ALL
YET! It just uses comma as thousands separator all the time.

See the "convert" function in the "num_fmt" source code file.

I am not sure about the date format: Freecom sources say it
should work, but I think it does not change for me? Do not
forget to load a new instance of freecom (by running the
command.com binary, simple) after running the CANADA tool.

At least the tool does switch to 24 hour time correctly :-p

The clock display in EDIT also follows the CANADA settings.

Cheers, Eric
Mateusz Viste
2017-02-20 07:01:29 UTC
Permalink
Instead of filling out a binary country.sys by hand, you might want to
use localcfg.exe - much more reliable. It will produce a country.sys file
with all the parameters you wish.

http://localcfg.sourceforge.net

Of course, all this is pointless if your program won't listen to country
preferences anyway.

Mateusz
Post by Denis St-Lau
Hi everyone,
vDOS is very nice. Unfortunately also blocked with Dir-command related
issues with my program (file dates in style 2-10-98 intead of 02-10-98).
I posted a topic on their site. I also found they not support
modification of the global Country setting (locked to 1).
About VMWARE and VMSMOUNT. I think it's nearly equivalent to what we
have at work with Microsoft VirtualPC. I didn't try sendkeys automation
through this heavier layer but I will give it a try if I cannot use vDOS
and DOSBOX.
Eric, I found you are author of MODE.COM !! To set the codepage I added
       DISPLAY CON=(ega,863,)
       MODE CON CODEPAGE PREPARE=((863) %dosdir%\cpi\ega9.cpx)
I don't know how far I can follow you in the TSR trail to get country
informations but I'm interested to learn at least up to the next
obstacle :-) I filled the table you showed to me, if it's not taking too
Offset  Size    Description     (Table 01399)
  00h    WORD    date format [2 Y-M-D]
  02h  5 BYTEs   ASCIZ currency symbol string ['$'.. so I imagine it is
  24h, 00h ?] 07h  2 BYTEs   ASCIZ thousands separator [you want this
  to be 20h, 00h...Yes]
  09h  2 BYTEs   ASCIZ decimal separator ['.' = 2E, 00h ?]
  0Bh  2 BYTEs   ASCIZ date separator ['-' = 2D, 00h ?]
  0Dh  2 BYTEs   ASCIZ time separator [':' = 3A, 00h ?]
  0Fh    BYTE    currency format [not relevant for you? probably not,
  answers bellow]
                 bit 2 = set if currency symbol replaces
                 decimal point
                          [I would say No, do
                          not replaces decimal
                          point]
                 bit 1 = number of spaces between value
                 and currency symbol
                          [I would guess 1
                          space]
                 bit 0 = 0 if currency symbol precedes
                 value
                         1 if currency symbol
                         follows value
                          [Not sure but I would
                          guess bit 0 =1]
  10h    BYTE    number of digits after decimal in currency
                  [not relevant? maybe not but I would
                  say 2 digits]
  11h    BYTE    time format [you say you want 24h time, so make this
  1--Yes]
                 bit 0 = 0 if 12-hour clock
                         1 if 24-hour clock
  12h    DWORD   address of case map routine [could point to RETF
  opcode]
                 (FAR CALL, AL = character to map to
                 upper case [>= 80h])
  16h  2 BYTEs   ASCIZ data-list separator [not relevant? who uses
  this?]
  18h 10 BYTEs   reserved [so not relevant for you by definition...]
To answer your question about our old MS-DOS program: We have used it in
MS-DOS and winXP-win32 console only. It is described at
<http://www.dynatest.com/elmod>. There is not so many users since it is
addressed to a very specialized domain. Only the newer Windows version
is supported by the maker.
Thanks, Denis
Le Dimanche 19 février 2017 8h39, Ulrich Hansen
Without the DOSBOX kernel, we don't have the "mount" command and we
constantly have to mount/unmount the DOS disk image from the GNU/Linux
or Windows host (or use FTP networking) to exchange data. This is
tedious and the disk image gets corrupted if simultaneously mounted or
written on by the Host and the DOS.
Yes, you are completely right about that.
But please take a look at a new project: „EtherDFS“ by Mateusz
Viste.http://etherdfs.sourceforge.net If your host is running GNU/Linux,
you can start EtherSRV on the host and EtherDFS on your DOS guest.
On the host go to the directory, that EtherSRV is mounting. Share it
with Samba to your Windows clients.
That’s it. You have now what everybody wants: A network disk in FreeDOS,
shared with everybody in your LAN, and still 618 K conventional memory
free.
The only downsides, as I see it:- At the moment EtherSRV will change
timestamps of received files to the actual date and time.- On VirtualBox
a guest with EtherDFS can not reach (yet) an EtherSRV running on a
machine outside the host.- EtherSRV is running on GNU/Linux only.
Denis St-Lau
2017-02-21 04:07:19 UTC
Permalink
Good news!

My old program can run now on vDOS and DOSBOX. (In addition to pure FreeDOS indeed)

Jos Schaars from the vDOS project gave me an interesting trick: edit manualy the temporary dumpfile generated by the program, and making it read-only. I discovered being wrong about the relevance of the date style (2-10-98 intead of 02-10-98 was in fact not detrimental). Instead it was about the position of the filename extension. The extension of filenames was moved left by the vDOS's (or 4DOS's) DIR command when the filename are less than 8 characters long, and the program expect them to be written at fixed column positions (cols number 10-11-12). Knowing this we just have to set alias dir=*dir /j in the autoexec.txt of vDOS and the problem is solved. The full discussion can be found here:

   <https://sourceforge.net/p/vdos/discussion/general/thread/be084506/>


DOSBOX has a different fatal issue : a comma ',' as thousand separator for files size.

It may looks a little bit heavy-metal but quite fine for my actual needs to modify and recompile the FreeCom's COMMAND.COM. There is just one line to modify in the convert() function of the NUM_FMT.C files:

    Just replace the line:
        temp[30 - c++] = nlsBuf->thousendsSep[0];
    By:
        temp[30 - c++] = ' ';

    The following may probably also works because vDOS works with no separator:
        temp[30 - c++] = '';

    And then recompile (ex: build -r xms-swap)

    In a previous post I wrote this changed nothing to the behavior. I was wrong... this is because I forgot having a duplicate COMMAND.COM file on the system (there is C:\FDOS\BIN\COMMAND.COM in addition to C:\COMMAND.COM, and I was not replacing the good one)

After solving the comma issue, I discovered:
  * AM/PM flags not being really detrimental. Sorry for the mislead.
  * The 4 digits year cause a fault requiring a keypress but not a fatal crash (better behavior with SET DIRCMD=/-4)


The localcfg program pointed out by Matheuz is nice but it creates a file.sys which still need a config.sys country directive in order to be loaded. So I think it does not solves the thousendSep or other country issues potentially encountered by FreeCOM in the DOSBOX.

I imagine the proof of concept from Eric (CANADA.ASM) has the potential to load country settings without config.sys. I let you guys decide I you want to go forward that way. I can be no more than a user or a tester because I do not have the required developper knowledge.

I did not try EtherDFS but it's good to know it's existence.

Regards, Denis




Le lundi 20 février 2017 2h02, Mateusz Viste <***@nospam.viste.fr> a écrit :


Instead of filling out a binary country.sys by hand, you might want to
use localcfg.exe - much more reliable. It will produce a country.sys file
with all the parameters you wish.

http://localcfg.sourceforge.net

Of course, all this is pointless if your program won't listen to country
preferences anyway.

Mateusz
Post by Denis St-Lau
Hi everyone,
vDOS is very nice. Unfortunately also blocked with Dir-command related
issues with my program (file dates in style 2-10-98 intead of 02-10-98).
I posted a topic on their site. I also found they not support
modification of the global Country setting (locked to 1).
About VMWARE and VMSMOUNT. I think it's nearly equivalent to what we
have at work with Microsoft VirtualPC. I didn't try sendkeys automation
through this heavier layer but I will give it a try if I cannot use vDOS
and DOSBOX.
Eric, I found you are author of MODE.COM !! To set the codepage I added
       DISPLAY CON=(ega,863,)
       MODE CON CODEPAGE PREPARE=((863) %dosdir%\cpi\ega9.cpx)
I don't know how far I can follow you in the TSR trail to get country
informations but I'm interested to learn at least up to the next
obstacle :-) I filled the table you showed to me, if it's not taking too
Offset  Size    Description     (Table 01399)
  00h    WORD    date format [2 Y-M-D]
  02h  5 BYTEs   ASCIZ currency symbol string ['$'.. so I imagine it is
  24h, 00h ?] 07h  2 BYTEs   ASCIZ thousands separator [you want this
  to be 20h, 00h...Yes]
  09h  2 BYTEs   ASCIZ decimal separator ['.' = 2E, 00h ?]
  0Bh  2 BYTEs   ASCIZ date separator ['-' = 2D, 00h ?]
  0Dh  2 BYTEs   ASCIZ time separator [':' = 3A, 00h ?]
  0Fh    BYTE    currency format [not relevant for you? probably not,
  answers bellow]
                 bit 2 = set if currency symbol replaces
                 decimal point
                          [I would say No, do
                          not replaces decimal
                          point]
                 bit 1 = number of spaces between value
                 and currency symbol
                          [I would guess 1
                          space]
                 bit 0 = 0 if currency symbol precedes
                 value
                         1 if currency symbol
                         follows value
                          [Not sure but I would
                          guess bit 0 =1]
  10h    BYTE    number of digits after decimal in currency
                  [not relevant? maybe not but I would
                  say 2 digits]
  11h    BYTE    time format [you say you want 24h time, so make this
  1--Yes]
                 bit 0 = 0 if 12-hour clock
                         1 if 24-hour clock
  12h    DWORD   address of case map routine [could point to RETF
  opcode]
                 (FAR CALL, AL = character to map to
                 upper case [>= 80h])
  16h  2 BYTEs   ASCIZ data-list separator [not relevant? who uses
  this?]
  18h 10 BYTEs   reserved [so not relevant for you by definition...]
To answer your question about our old MS-DOS program: We have used it in
MS-DOS and winXP-win32 console only. It is described at
<http://www.dynatest.com/elmod>. There is not so many users since it is
addressed to a very specialized domain. Only the newer Windows version
is supported by the maker.
Thanks, Denis
 
 
    Le Dimanche 19 février 2017 8h39, Ulrich Hansen
 
 
 
Without the DOSBOX kernel, we don't have the "mount" command and we
constantly have to mount/unmount the DOS disk image from the GNU/Linux
or Windows host (or use FTP networking) to exchange data. This is
tedious and the disk image gets corrupted if simultaneously mounted or
written on by the Host and the DOS.
Yes, you are completely right about that.
But please take a look at a new project: „EtherDFS“ by Mateusz
Viste.http://etherdfs.sourceforge.net If your host is running GNU/Linux,
you can start EtherSRV on the host and EtherDFS on your DOS guest.
On the host go to the directory, that EtherSRV is mounting. Share it
with Samba to your Windows clients.
That’s it. You have now what everybody wants: A network disk in FreeDOS,
shared with everybody in your LAN, and still 618 K conventional memory
free.
The only downsides, as I see it:- At the moment EtherSRV will change
timestamps of received files to the actual date and time.- On VirtualBox
a guest with EtherDFS can not reach (yet) an EtherSRV running on a
machine outside the host.- EtherSRV is running on GNU/Linux only.
Loading...