comp.lang.ada
 help / color / mirror / Atom feed
* GNAT Ada 3.13 + DOS revisted
@ 2001-03-02 13:12 Ashley Collins
  2001-03-02 14:34 ` Cesar Rabak
  2001-03-02 20:16 ` Randy Brukardt
  0 siblings, 2 replies; 16+ messages in thread
From: Ashley Collins @ 2001-03-02 13:12 UTC (permalink / raw)


More problems I'm afraid.  Can anyone help?

I've concluded that it is not possible to run GNAT 3.13 on a DOS-only
machine.  Instead, you have to run GNAT 3.13 on a Windows machine and then
transfer executables across to the DOS machine.  Is this right?

Unfortunately, when I try this I get a 'This program cannot be run in DOS
mode' error.  I have tried using the CWSDPMI dos extender that comes with
DJGPP but it makes no difference.

The source code that I am trying to compile also uses long file names, which
don't work under DOS.  So, my overall question is: does anyone know how I
can compile a load of Ada source code (with long file names) that can run on
a PC than *only* has DOS installed?

It's driving me mad...

Ashley





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-02 13:12 GNAT Ada 3.13 + DOS revisted Ashley Collins
@ 2001-03-02 14:34 ` Cesar Rabak
  2001-03-02 20:16 ` Randy Brukardt
  1 sibling, 0 replies; 16+ messages in thread
From: Cesar Rabak @ 2001-03-02 14:34 UTC (permalink / raw)


Ashley Collins wrote:
> 
> More problems I'm afraid.  Can anyone help?
> 
> I've concluded that it is not possible to run GNAT 3.13 on a DOS-only
> machine.  Instead, you have to run GNAT 3.13 on a Windows machine and then
> transfer executables across to the DOS machine.  Is this right?
> 
> Unfortunately, when I try this I get a 'This program cannot be run in DOS
> mode' error.  I have tried using the CWSDPMI dos extender that comes with
> DJGPP but it makes no difference.

You should be sure the files you're intending to run are in fact DPMI
execs. The msg you're getting is more similar to the stubs PEs have
attached. A DJGPP exec would have something like "no DPMI - Get
csdpmi*b.zip".

> 
> The source code that I am trying to compile also uses long file names, which
> don't work under DOS.  So, my overall question is: does anyone know how I
> can compile a load of Ada source code (with long file names) that can run on
> a PC than *only* has DOS installed?

Have you tried the utility gnatk8 which comes with the gnat
distribution?

HTH

Cesar



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-02 13:12 GNAT Ada 3.13 + DOS revisted Ashley Collins
  2001-03-02 14:34 ` Cesar Rabak
@ 2001-03-02 20:16 ` Randy Brukardt
  2001-03-02 21:06   ` Ted Dennison
  1 sibling, 1 reply; 16+ messages in thread
From: Randy Brukardt @ 2001-03-02 20:16 UTC (permalink / raw)



Ashley Collins wrote in message
<983538732.184184@ernani.logica.co.uk>...
>The source code that I am trying to compile also uses long file names,
which
>don't work under DOS.  So, my overall question is: does anyone know how
I
>can compile a load of Ada source code (with long file names) that can
run on
>a PC than *only* has DOS installed?


Real MS-DOS (as opposed to Windows 95 with the GUI removed) doesn't
support long file names. Period. So that code will never work on MS-DOS,
indeed, it cannot exist in that form on MS-DOS.

OTOH, there is no need for the code to have long file names. Just
copying it to a MS-DOS system will change the names to 8.3 form, and you
can compile them that way. (Not as easy, you have to tell the tolls what
you're doing.)

As far as compiling the Code on bare MS-DOS -- I'll be happy to sell you
a copy of Janus/Ada 83 for MS-DOS (16-bit) or Janus/Ada 95 for MS-DOS
(32-bit with extender). I know of no other MS-DOS solution that is still
supported, and I don't think you can even get any other MS-DOS 16-bit
compiler.

                Randy Brukardt (R.R. Software, Inc.)







^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-02 20:16 ` Randy Brukardt
@ 2001-03-02 21:06   ` Ted Dennison
  2001-03-03  1:28     ` Randy Brukardt
  2001-03-03  3:28     ` Al Christians
  0 siblings, 2 replies; 16+ messages in thread
From: Ted Dennison @ 2001-03-02 21:06 UTC (permalink / raw)


In article <WcTn6.3728$7e6.1473358@homer.alpha.net>, Randy Brukardt says...
>
>As far as compiling the Code on bare MS-DOS -- I'll be happy to sell you
>a copy of Janus/Ada 83 for MS-DOS (16-bit) or Janus/Ada 95 for MS-DOS
>(32-bit with extender). I know of no other MS-DOS solution that is still
>supported, and I don't think you can even get any other MS-DOS 16-bit
>compiler.

I think that Aonix's compiler used to have the ability to target compilations to
DOS, although the compilations themselves had to be performed in Windows. I
don't know if you can still do that though.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-02 21:06   ` Ted Dennison
@ 2001-03-03  1:28     ` Randy Brukardt
  2001-03-03  3:28     ` Al Christians
  1 sibling, 0 replies; 16+ messages in thread
From: Randy Brukardt @ 2001-03-03  1:28 UTC (permalink / raw)


Ted Dennison wrote in message ...
>In article <WcTn6.3728$7e6.1473358@homer.alpha.net>, Randy Brukardt
says...


>I think that Aonix's compiler used to have the ability to target
compilations to
>DOS, although the compilations themselves had to be performed in
Windows. I
>don't know if you can still do that though.


Possibly. I'm certain that there aren't any other 16-bit MS-DOS
compilers around; the only other (validated) one that ever existed was
Meridian's, and that is long gone. But there were a variety of other
32-bit DOS solutions. So far as I know, none of those are supported
anymore. Janus/Ada is the last, and its support for DOS probably will
disappear soon (I think most of the customers have migrated off of it
finally...)

                Randy.






^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-02 21:06   ` Ted Dennison
  2001-03-03  1:28     ` Randy Brukardt
@ 2001-03-03  3:28     ` Al Christians
  2001-03-03  9:17       ` Gautier de Montmollin
  1 sibling, 1 reply; 16+ messages in thread
From: Al Christians @ 2001-03-03  3:28 UTC (permalink / raw)


Whatever was the current version of GNAT around five years ago would
do plain DOS.  I ran it on a machine without Windows. That was 
something in the range of 3.04 to 3.07, I think.  


Al

Ted Dennison wrote:
> 
> In article <WcTn6.3728$7e6.1473358@homer.alpha.net>, Randy Brukardt says...
> >
> >As far as compiling the Code on bare MS-DOS -- I'll be happy to sell you
> >a copy of Janus/Ada 83 for MS-DOS (16-bit) or Janus/Ada 95 for MS-DOS
> >(32-bit with extender). I know of no other MS-DOS solution that is still
> >supported, and I don't think you can even get any other MS-DOS 16-bit
> >compiler.
> 
> I think that Aonix's compiler used to have the ability to target compilations to
> DOS, although the compilations themselves had to be performed in Windows. I
> don't know if you can still do that though.
> 
> ---
> T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
>           home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-03  3:28     ` Al Christians
@ 2001-03-03  9:17       ` Gautier de Montmollin
  2001-03-03 16:23         ` tmoran
  0 siblings, 1 reply; 16+ messages in thread
From: Gautier de Montmollin @ 2001-03-03  9:17 UTC (permalink / raw)


> Whatever was the current version of GNAT around five years ago would
> do plain DOS.  I ran it on a machine without Windows. That was
> something in the range of 3.04 to 3.07, I think.

So does the current "ez2load" (3.10) or the 3.13 version
available: it compiles on DOS and produce DOS .EXEs - of
course 32-bit with DPMI. It runs also on multitasking
environments like Win9x, WinNT, OS/2 or DR-DOS.

__________________________________________
Gautier  --  http://www.diax.ch/users/gdm/



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-03  9:17       ` Gautier de Montmollin
@ 2001-03-03 16:23         ` tmoran
  2001-03-04 22:42           ` Gautier de Montmollin
  0 siblings, 1 reply; 16+ messages in thread
From: tmoran @ 2001-03-03 16:23 UTC (permalink / raw)


> >As far as compiling the Code on bare MS-DOS -- I'll be happy to sell you

> >do plain DOS.  I ran it on a machine without Windows. That was

> it compiles on DOS and produce DOS .EXEs - of course 32-bit with DPMI.

Are we talking here about bare MS-DOS (16 bit) or about DPMI DOS (32 bit)?
They are not at all the same thing.  What did the original questioner want?



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-03 16:23         ` tmoran
@ 2001-03-04 22:42           ` Gautier de Montmollin
  2001-03-04 23:36             ` tmoran
  2001-03-05  1:56             ` Got bitten by GNAT.Table Hervé Bitteur
  0 siblings, 2 replies; 16+ messages in thread
From: Gautier de Montmollin @ 2001-03-04 22:42 UTC (permalink / raw)


tmoran@acm.org:

> Are we talking here about bare MS-DOS (16 bit) or about DPMI DOS (32 bit)?

32-bit DPMI

> They are not at all the same thing.  What did the original questioner want?

Something running on a machine having only DOS. The free server, CWSDPMI,
works on any 386+ machine having DOS 3.0+, so you can run 32-bit DPMI on practically
any PC still in function.

__________________________________________
Gautier  --  http://www.diax.ch/users/gdm/



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-04 22:42           ` Gautier de Montmollin
@ 2001-03-04 23:36             ` tmoran
  2001-03-05  1:45               ` Al Christians
  2001-03-05  1:56             ` Got bitten by GNAT.Table Hervé Bitteur
  1 sibling, 1 reply; 16+ messages in thread
From: tmoran @ 2001-03-04 23:36 UTC (permalink / raw)


>works on any 386+ machine having DOS 3.0+, so you can run 32-bit DPMI on practically
>any PC still in function.
  I have no 386s, but my old Toshiba portable (with the wonderful plasma
screen) has a 286 and still gets used occasionally, especially when I
care about tight timing.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-04 23:36             ` tmoran
@ 2001-03-05  1:45               ` Al Christians
  2001-03-05  3:01                 ` tmoran
  0 siblings, 1 reply; 16+ messages in thread
From: Al Christians @ 2001-03-05  1:45 UTC (permalink / raw)


Does 32-bit DPMI run on a 286???  I thought 286 had only 24-bit 
address space.

Al


tmoran@acm.org wrote:
> 
> >works on any 386+ machine having DOS 3.0+, so you can run 32-bit DPMI on practically
> >any PC still in function.
>   I have no 386s, but my old Toshiba portable (with the wonderful plasma
> screen) has a 286 and still gets used occasionally, especially when I
> care about tight timing.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Got bitten by GNAT.Table
  2001-03-04 22:42           ` Gautier de Montmollin
  2001-03-04 23:36             ` tmoran
@ 2001-03-05  1:56             ` Hervé Bitteur
  2001-03-05 12:41               ` Mario Amado Alves
  2001-03-07 21:33               ` Stephen Leake
  1 sibling, 2 replies; 16+ messages in thread
From: Hervé Bitteur @ 2001-03-05  1:56 UTC (permalink / raw)


GNAT.Table is useful to provide dynamically growing arrays.
However I recently discovered the reason why I occasionally 
had other data overwritten, if not access violation errors.
Here is a simple test program that you can run from the command line,
with just one argument: the upper bound of the loop.

-------------------------------------------------------------------------
with GNAT.Table;
with Ada.Command_Line;
procedure Test_Table
is
   Init : constant Natural := Natural'Value (Ada.Command_Line.Argument
(1));
   package Pkg is new GNAT.Table
     (Table_Component_Type => Character,
      Table_Index_Type     => Natural,
      Table_Low_Bound      => 1,
      Table_Initial        => Init,
      Table_Increment      => 100);
begin
   for I in 1 .. Init + 1 loop          -- To force one reallocation
      Pkg.Table (Pkg.Allocate) := 'a';  -- <<<<<
   end loop;
end Test_Table;
-------------------------------------------------------------------------

On my Windows 98 environment, using GNAT 3.13p, 
I'm getting the following results :

$> test_table 523200
(or less than 523200) is OK, but

$> test_table 523201
(or higher) leads to:
raised PROGRAM_ERROR : EXCEPTION_ACCESS_VIOLATION

Using Integers (4 bytes) instead of Characters (1 byte) also crashes,
the limit is slightly higher (I would have expected a lower limit).

Anyway, if I modify the little program (line marked with -- <<<<<)
so that instead of
      Pkg.Table (Pkg.Allocate) := 'a';
I use
      declare
         Last : Natural := Pkg.Allocate;
      begin
         Pkg.Table (Last) := 'a';
      end;
The program then runs OK. For example test_table 100_000_000 is fine
(1_000_000_000 however raises storage_error, but I can understand this)

How could we explain the result?
If the call to GNAT.Table.Allocate results in an actual reallocation
of the buffer, then at this precise moment, we modify the very value
of Table which is in fact an array reference.
- Allocate increases the current Last value and returns the previous
last value +1
- Table (xxx) is the combination of dereferencement + indexation.
The problem is that when we've reached the end of the allocated array,
the Allocate function reallocates the array, thus changing the array
reference ON-THE-FLY.

I should dig into the generated code but I suspect that the construction 
"Table (Allocate)" is not kept coherent when the array is reallocated, 
so the need to explicitly separate the two operations.

To prevent this, I would suggest to replace the Allocate function, by
a simple procedure. Any one can still retrieve the current last value,
by calling the Table.Last function.

Bye,
-- Herv�

-- 
      /\             Herv� BITTEUR                            
     \\ \            EMEA IT Architect
    \ \\ /           SUN MICROSYSTEMS FRANCE                  
   / \/ / /          13, avenue Morane Saulnier
  / /   \//\         78142 V�lizy cedex France
  \//\   / /         
   / / /\ /          Email  : Herve.Bitteur@France.Sun.COM
    / \\ \           Office : +33 (0)1.30.67.51.12
     \ \\            
      \/             Fax.   : +33 (0)1.30.67.53.06



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: GNAT Ada 3.13 + DOS revisted
  2001-03-05  1:45               ` Al Christians
@ 2001-03-05  3:01                 ` tmoran
  0 siblings, 0 replies; 16+ messages in thread
From: tmoran @ 2001-03-05  3:01 UTC (permalink / raw)


>Does 32-bit DPMI run on a 286???  I thought 286 had only 24-bit
>address space.
  Right.  But:
> works on any 386+  ... practically any PC still in function.
is an incorrect assumption.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Got bitten by GNAT.Table
  2001-03-05  1:56             ` Got bitten by GNAT.Table Hervé Bitteur
@ 2001-03-05 12:41               ` Mario Amado Alves
  2001-03-07 21:33               ` Stephen Leake
  1 sibling, 0 replies; 16+ messages in thread
From: Mario Amado Alves @ 2001-03-05 12:41 UTC (permalink / raw)
  To: comp.lang.ada

> GNAT.Table is useful to provide dynamically growing arrays.
> However I recently discovered the reason why I occasionally 
> had other data overwritten, if not access violation errors.

I am using package Unbounded_Array as an alternative to GNAT.Table in many
problem cases:

  http://lexis.di.fct.unl.pt/ADaLIB/misc.htm

| |,| | | |RuaFranciscoTaborda24RcD 2815-249CharnecaCaparica 351+939354005
|M|A|R|I|O|
|A|M|A|D|O|DepartmentoDeInformaticaFCT/UNL 2825-114 Caparica 351+212958536
|A|L|V|E|S|                                                  fax 212948541
| | | | | |                 maa@di.fct.unl.pt                FCT 212948300





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Got bitten by GNAT.Table
  2001-03-05  1:56             ` Got bitten by GNAT.Table Hervé Bitteur
  2001-03-05 12:41               ` Mario Amado Alves
@ 2001-03-07 21:33               ` Stephen Leake
  2001-03-08  4:07                 ` Hervé Bitteur
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Leake @ 2001-03-07 21:33 UTC (permalink / raw)


Herv� Bitteur <Herve.Bitteur@France.Sun.COM> writes:

> GNAT.Table is useful to provide dynamically growing arrays.
> However I recently discovered the reason why I occasionally 
> had other data overwritten, if not access violation errors.
> Here is a simple test program that you can run from the command line,
> with just one argument: the upper bound of the loop.
> <example snipped>

Hi Herve!

GNAT.Table is not implemented in "pure" Ada, so it has some
restrictions. Be sure to read the spec very carefully. If you believe
you are following the restrictions, report your bug to report@gnat.com

Or, use sal.poly.unbounded_arrays, from
http://users.erols.com/leakstan/Stephe/Ada/sal.html. That's a pure Ada
solution.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: Got bitten by GNAT.Table
  2001-03-07 21:33               ` Stephen Leake
@ 2001-03-08  4:07                 ` Hervé Bitteur
  0 siblings, 0 replies; 16+ messages in thread
From: Hervé Bitteur @ 2001-03-08  4:07 UTC (permalink / raw)
  To: Stephen Leake

Hello Stephe,

I'm using the interface provided by GNAT.Table package. So, yes, I think
it's kind of a bug, even if I more or less understand what is happening
when I resize the array while dereferencing it in the same statement.
I will send it to ACT anyway.

Bye,
-- Herv�

Stephen Leake wrote:
> 
> Herv� Bitteur <Herve.Bitteur@France.Sun.COM> writes:
> 
> > GNAT.Table is useful to provide dynamically growing arrays.
> > However I recently discovered the reason why I occasionally
> > had other data overwritten, if not access violation errors.
> > Here is a simple test program that you can run from the command line,
> > with just one argument: the upper bound of the loop.
> > <example snipped>
> 
> Hi Herve!
> 
> GNAT.Table is not implemented in "pure" Ada, so it has some
> restrictions. Be sure to read the spec very carefully. If you believe
> you are following the restrictions, report your bug to report@gnat.com
> 
> Or, use sal.poly.unbounded_arrays, from
> http://users.erols.com/leakstan/Stephe/Ada/sal.html. That's a pure Ada
> solution.
> 
> --
> -- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2001-03-08  4:07 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-02 13:12 GNAT Ada 3.13 + DOS revisted Ashley Collins
2001-03-02 14:34 ` Cesar Rabak
2001-03-02 20:16 ` Randy Brukardt
2001-03-02 21:06   ` Ted Dennison
2001-03-03  1:28     ` Randy Brukardt
2001-03-03  3:28     ` Al Christians
2001-03-03  9:17       ` Gautier de Montmollin
2001-03-03 16:23         ` tmoran
2001-03-04 22:42           ` Gautier de Montmollin
2001-03-04 23:36             ` tmoran
2001-03-05  1:45               ` Al Christians
2001-03-05  3:01                 ` tmoran
2001-03-05  1:56             ` Got bitten by GNAT.Table Hervé Bitteur
2001-03-05 12:41               ` Mario Amado Alves
2001-03-07 21:33               ` Stephen Leake
2001-03-08  4:07                 ` Hervé Bitteur

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox