comp.lang.ada
 help / color / mirror / Atom feed
* GNAT for DOS
@ 1994-12-14  4:04 Miguel Miranda
  0 siblings, 0 replies; 37+ messages in thread
From: Miguel Miranda @ 1994-12-14  4:04 UTC (permalink / raw)


G'day,

Does or will GNAT for DOS support tasking in the future?


Miguel Miranda
STO
UTS
OZ (Australia)



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

* gnat for DOS
@ 1996-04-21  0:00 Al Christians
  1996-04-21  0:00 ` Michael Feldman
  1996-04-22  0:00 ` Robert Dewar
  0 siblings, 2 replies; 37+ messages in thread
From: Al Christians @ 1996-04-21  0:00 UTC (permalink / raw)


There is a note in the gnat archive with the DOS version that says
that the gnat make is broken under DOS.  Does this mean that gnat is
not currently useful to develop programs that will run under DOS, or
is there any way around this problem?  Are there any ideas about of
when the expected remedy to this difficulty will be available? 

Al




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

* Re: gnat for DOS
  1996-04-21  0:00 gnat " Al Christians
@ 1996-04-21  0:00 ` Michael Feldman
  1996-04-21  0:00   ` Weston T. Pan
  1996-04-22  0:00 ` Robert Dewar
  1 sibling, 1 reply; 37+ messages in thread
From: Michael Feldman @ 1996-04-21  0:00 UTC (permalink / raw)


In article <317A8B31.CFD@easystreet.com>,
Al Christians  <achrist@easystreet.com> wrote:
>There is a note in the gnat archive with the DOS version that says
>that the gnat make is broken under DOS.  Does this mean that gnat is
>not currently useful to develop programs that will run under DOS, or
>is there any way around this problem?  Are there any ideas about of
>when the expected remedy to this difficulty will be available? 

gnatmake is "broken" in the current (3.01) version of GNAT under DOS
because the djgpp version 1 memory extender loads a copy of itself into
conventional RAM for each program spawned, at 130k per copy. This eats
memory pretty fast during the bind/link phases using gnatmake. We
decided not to distribute gnatmake for this reason.

Workaround? Just compile the individual units individually, instead
of using gnatmake. No big deal unless your program has zillions of
units.

That said, I should point out that a 3.03 release, compiled for djgpp
version _2_ (which uses dpmi memory and has no more of the above
problems) is quite near at hand (a week or so). Better still, this
release has a tasking runtime! We've done some pretty extensive
testing and think this will be a very good release. gnatmake works
just peachy keen. So does the tasking stuff.

The DOS build for djgpp v2, and the completion of the tasking runtime, 
was done mostly by Doug Rupp of ACT, to whom all GNAT/DOS fans will owe
thanks. The final packaging and integration with a new AdaCAPS release
is happening at GW. 

Stay tuned; we'll post an anouncement here, of course.

Mike Feldman
------------------------------------------------------------------------
Michael B. Feldman -  chair, SIGAda Education Working Group
Professor, Dept. of Electrical Engineering and Computer Science
The George Washington University -  Washington, DC 20052 USA
202-994-5919 (voice) - 202-994-0227 (fax) 
http://www.seas.gwu.edu/faculty/mfeldman
------------------------------------------------------------------------
       Pork is all that money the government gives the other guys.
------------------------------------------------------------------------
Ada on the WWW: http://lglwww.epfl.ch/Ada/ or http://info.acm.org/sigada/
------------------------------------------------------------------------




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

* Re: gnat for DOS
  1996-04-21  0:00 ` Michael Feldman
@ 1996-04-21  0:00   ` Weston T. Pan
  0 siblings, 0 replies; 37+ messages in thread
From: Weston T. Pan @ 1996-04-21  0:00 UTC (permalink / raw)


mfeldman@seas.gwu.edu (Michael Feldman) writes:

>In article <317A8B31.CFD@easystreet.com>,
>gnatmake is "broken" in the current (3.01) version of GNAT under DOS

Isn't there a newer version? I could have sworn I downloaded some files 
called gnat-3.03-dos* . However, they came with djgpp 1.12 and don't 
support tasking.

>That said, I should point out that a 3.03 release, compiled for djgpp
>version _2_ (which uses dpmi memory and has no more of the above
>problems) is quite near at hand (a week or so). Better still, this
>release has a tasking runtime! We've done some pretty extensive
>testing and think this will be a very good release. gnatmake works
>just peachy keen. So does the tasking stuff.

Wonderful!

>The DOS build for djgpp v2, and the completion of the tasking runtime, 
>was done mostly by Doug Rupp of ACT, to whom all GNAT/DOS fans will owe

If you see this, Thank you Doug!

>thanks. The final packaging and integration with a new AdaCAPS release

I really like this editor. I hope the new one supports color syntax and 
doesn't have that 64k limit.

>is happening at GW. 

>Stay tuned; we'll post an anouncement here, of course.

Any plan for interrupt support?






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

* Re: gnat for DOS
  1996-04-21  0:00 gnat " Al Christians
  1996-04-21  0:00 ` Michael Feldman
@ 1996-04-22  0:00 ` Robert Dewar
  1996-04-24  0:00   ` Scott H. James
  1 sibling, 1 reply; 37+ messages in thread
From: Robert Dewar @ 1996-04-22  0:00 UTC (permalink / raw)


iAl asked

"There is a note in the gnat archive with the DOS version that says
that the gnat make is broken under DOS.  Does this mean that gnat is
not currently useful to develop programs that will run under DOS, or
is there any way around this problem?  Are there any ideas about of
when the expected remedy to this difficulty will be available?"

It is perfectly possible to use GNAT without an automatic make
facility, though it is certainly more convenient to have it available.
The reason that gnatmake does not work with the current DOS version
is that there is not enough low memory space with DJGPP version 1.

Ada Core Technologies will shortly be releasing a new DOS version, which
will also be available in Mike Feldman
's EZLoad packaging that fixes this problem (by using DJGPP 2), and also
fully implements tasking.

P.S. Even with the new version, you are well advised to move to a real
32 bit operating system (OS/2, NT. Solaris 86, Linux, FreeBSD, NetBSD,
Nextstep) to do any serious Ada development on a PC. Of these at least
OS/2, Linux and NT support tasking fully.






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

* Re: gnat for DOS
  1996-04-22  0:00 ` Robert Dewar
@ 1996-04-24  0:00   ` Scott H. James
  1996-04-25  0:00     ` Robert Dewar
  1996-04-25  0:00     ` Tom Griest
  0 siblings, 2 replies; 37+ messages in thread
From: Scott H. James @ 1996-04-24  0:00 UTC (permalink / raw)



begin Dewar

  P.S. Even with the new version, you are well advised to move to a real
  32 bit operating system (OS/2, NT. Solaris 86, Linux, FreeBSD, NetBSD,
  Nextstep) to do any serious Ada development on a PC. Of these at least
  OS/2, Linux and NT support tasking fully.

end Dewar


Sigh.

While your comment is perhaps relevant to GUI and OS-application
programming, with regards to embedded programming your repeated smirks at DOS
smack of either gross ignorance or wishful thinking.  Due to DOS's relatively
low system overhead, straightforward access to hardware, and the
proliferation of ROM DOS chips, rest assured DOS is and will remain with us
as a low-end embedded OS option for many years to come.  To continually bash
DOS does nothing for Ada and perhaps, in the future, should be relegated to
comp.os.advocacy or alt.windows.and.mice.are.really.cool or some
other such group.

Thanks,
Dr. Scott




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

* Re: gnat for DOS
  1996-04-24  0:00   ` Scott H. James
@ 1996-04-25  0:00     ` Robert Dewar
  1996-04-25  0:00     ` Tom Griest
  1 sibling, 0 replies; 37+ messages in thread
From: Robert Dewar @ 1996-04-25  0:00 UTC (permalink / raw)


Scott James said:

"While your comment is perhaps relevant to GUI and OS-application
programming, with regards to embedded programming your repeated smirks at DOS
smack of either gross ignorance or wishful thinking.  Due to DOS's relatively
low system overhead, straightforward access to hardware, and the
proliferation of ROM DOS chips, rest assured DOS is and will remain with us
as a low-end embedded OS option for many years to come.  To continually bash
DOS does nothing for Ada and perhaps, in the future, should be relegated to
comp.os.advocacy or alt.windows.and.mice.are.really.cool or some
other such group."

You miss my point, I am not talking about DOS as a target environment. It
is quite true that since DOS is essentially completely transparent at run
time that if what you really want to do is to run on the bare board without
any OS intervention, DOS is perfectly reasonable.

My comment applies to DOS as a *development* environment, where it is indeed
lacking, since running on a DOS extender under DOS is always problematic
compared to using a proper 32-bit operating system.

Note that GNAT in any case does not run under DOS directly, nor do programs
that it generates. Instead they run in protected mode on a 32-bit DOS
extender. Your comments about embedded programming thus don't apply
directly, since in any case you do NOT have straightforward access to
the hardware, and here is no question of running in the context of
ROM DOS chips. 

It remains good advice for people doing serious development using GNAT
on a PC to choose one of the many 32-bit operating systems that is
supported. It is certainly true that DJGPP 2.0 alleviates some of the
worst characterstics of the DOS environment (notably the exhuastion of
low memory that made the use of gnatmake impossible), but still there
are limitations.

So my recommendations here have nothing whatever to do with operating
system advocacy, and are quite relevant to this group. Although it is
certainly possible to run GNAT under DOS, and even to build large
programs in this environment, you are buying yourself trouble. THis
is more a comment on GNAT and its system requirements than on DOS
per se. FOr example, the 8+3 character limits on file names are merely
a minor nuisance for most uses of DOS, but for writing large programs
using GNAT, this file naming restriction can be very bothersome.

That being said, we are continuing to enhance the DOS version. The next
release incorporates tasking, and also uses DJGPP 2.0 (so gnatmake should
finally be available).





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

* Re: gnat for DOS
  1996-04-24  0:00   ` Scott H. James
  1996-04-25  0:00     ` Robert Dewar
@ 1996-04-25  0:00     ` Tom Griest
  1 sibling, 0 replies; 37+ messages in thread
From: Tom Griest @ 1996-04-25  0:00 UTC (permalink / raw)


sjames@wam.umd.edu (Scott H. James) writes:
>
>begin Dewar
>
>  P.S. Even with the new version, you are well advised to move to a real
>  32 bit operating system (OS/2, NT. Solaris 86, Linux, FreeBSD, NetBSD,
>  Nextstep) to do any serious Ada development on a PC. Of these at least
>  OS/2, Linux and NT support tasking fully.
>
>end Dewar
>
>
>Sigh.
>
>While your comment is perhaps relevant to GUI and OS-application
>programming, with regards to embedded programming your repeated smirks at DOS
>smack of either gross ignorance or wishful thinking.  Due to DOS's relatively
>low system overhead, straightforward access to hardware, and the
>proliferation of ROM DOS chips, rest assured DOS is and will remain with us
>as a low-end embedded OS option for many years to come.  To continually bash
>DOS does nothing for Ada and perhaps, in the future, should be relegated to
>comp.os.advocacy or alt.windows.and.mice.are.really.cool or some
>other such group.

I don't think Robert was "bashing DOS".  His comment was advice based
on the fact that you have to be running 32-bits to run GNAT and that it
makes sense to use a "native" 32-bit OS instead of a 16-bit OS with
a 32-bit extender on it.  NOTE: the word "development" in his quote.
As for target systems....  knock yourself out.  We are developing
on WinNT and targeting a 2"x3" 386EX board (and have targeted PC's
running DOS too).  Of course if you only have one box, and don't
want to reboot often, then DOS host/target is probably the way to go.
You just have to judge for yourself if your time lost by using DOS
as a development system is worth less than then the cost of a
second "embedded DOS box" (probably under $500).

-Tom




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

* GNAT for DOS
@ 2000-10-03  0:00 fabien_bousquet
  2000-10-03  0:00 ` Gautier
  0 siblings, 1 reply; 37+ messages in thread
From: fabien_bousquet @ 2000-10-03  0:00 UTC (permalink / raw)


I am using GNAT for DOS 3.10p.
My program is not compiling with this version because of a GNAT bug.
It is compiling on NT with GNAT 3.13p.
But I need to compile it on an old PC with DOS.
Do you know where I could find a more recent release of GNAT for DOS or
some patches ?

Thanks,
        Fabien Bousquet


Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: GNAT for DOS
  2000-10-03  0:00 GNAT for DOS fabien_bousquet
@ 2000-10-03  0:00 ` Gautier
  2000-10-04  0:00   ` fabien_bousquet
  0 siblings, 1 reply; 37+ messages in thread
From: Gautier @ 2000-10-03  0:00 UTC (permalink / raw)


> Do you know where I could find a more recent release of GNAT for DOS or
> some patches ?

There is GNAT 3.12p on that page:

  http://members.nbci.com/gnatlist/

HTH
______________________________________________________
Gautier  --  http://members.nbci.com/gdemont/gsoft.htm




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

* Re: GNAT for DOS
  2000-10-03  0:00 ` Gautier
@ 2000-10-04  0:00   ` fabien_bousquet
  2000-10-04  0:00     ` Gautier
  0 siblings, 1 reply; 37+ messages in thread
From: fabien_bousquet @ 2000-10-04  0:00 UTC (permalink / raw)


In article <39D9C117.88B0886@maths.unine.ch>,
  Gautier <gautier.demontmollin@maths.unine.ch> wrote:
> > Do you know where I could find a more recent release of GNAT for
DOS or
> > some patches ?
>
> There is GNAT 3.12p on that page:
>
>   http://members.nbci.com/gnatlist/
>
> HTH
> ______________________________________________________
> Gautier  --  http://members.nbci.com/gdemont/gsoft.htm
>
Thanks !!!



Sent via Deja.com http://www.deja.com/
Before you buy.




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

* Re: GNAT for DOS
  2000-10-04  0:00   ` fabien_bousquet
@ 2000-10-04  0:00     ` Gautier
  2000-10-05  2:17       ` Robert Dewar
  2000-10-05  2:18       ` Robert Dewar
  0 siblings, 2 replies; 37+ messages in thread
From: Gautier @ 2000-10-04  0:00 UTC (permalink / raw)


> Thanks !!!

You are welcome. BTW the magician who builds the DOS port
will produce a 3.13 one of these nights... BTW 2: is a
"GNAT 3.135" bugfix version in the works ? There seems
to be fresh bugs - e.g. preventing CLAW to compile.

G.




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

* Re: GNAT for DOS
  2000-10-04  0:00     ` Gautier
@ 2000-10-05  2:17       ` Robert Dewar
  2000-10-05  2:18       ` Robert Dewar
  1 sibling, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2000-10-05  2:17 UTC (permalink / raw)


In article <39DB7777.472843BE@maths.unine.ch>,
  Gautier <gautier.demontmollin@maths.unine.ch> wrote:
> > Thanks !!!
>
> You are welcome. BTW the magician who builds the DOS port
> will produce a 3.13 one of these nights... BTW 2: is a
> "GNAT 3.135" bugfix version in the works ? There seems
> to be fresh bugs - e.g. preventing CLAW to compile.

We are beta testing prereleases of 3.14a at this stage with
several customers. Eventually there will be a 3.14a release
and following that a 3.14p release. We never give advance
schedules for public releases of GNAT.

Robert Dewar
Ada Core Technologies


Sent via Deja.com http://www.deja.com/
Before you buy.



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

* Re: GNAT for DOS
  2000-10-04  0:00     ` Gautier
  2000-10-05  2:17       ` Robert Dewar
@ 2000-10-05  2:18       ` Robert Dewar
  1 sibling, 0 replies; 37+ messages in thread
From: Robert Dewar @ 2000-10-05  2:18 UTC (permalink / raw)


In article <39DB7777.472843BE@maths.unine.ch>,
  Gautier <gautier.demontmollin@maths.unine.ch> wrote:
> > Thanks !!!
>
> You are welcome. BTW the magician who builds the DOS port
> will produce a 3.13 one of these nights... BTW 2: is a
> "GNAT 3.135" bugfix version in the works ? There seems
> to be fresh bugs - e.g. preventing CLAW to compile.


One thing that would be helpful is to clarify how complete
the DOS port is, in particular does it implement full tasking
at this stage?


Sent via Deja.com http://www.deja.com/
Before you buy.



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

* Ada and Hardware
@ 2001-05-10 13:02 chris.danx
  2001-05-10 13:36 ` Ted Dennison
                   ` (4 more replies)
  0 siblings, 5 replies; 37+ messages in thread
From: chris.danx @ 2001-05-10 13:02 UTC (permalink / raw)


Hello folks,
    I'm implementing a program which reads files on a floppy disk which are not
stored via the fat12 file system.  I know this is the most popular format but i
want a simple contigouous fs for the purposes of booting an OS.

I'm implementing basic routines for the management of the fs at the moment but
i've been planning ahead and i've encountered a problem.  It is necessary to
access the disk and write the fs to it.  I was wondering if anyone knew of any
Ada packages or techniques for accessing the disk in such a raw manner?  I need
a way to write and read via blocks, sectors, tracks etc on the floppy.  I'm
developing on windows 98 via GNAT.


Thanks,
Chris Campbell





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

* Re: Ada and Hardware
  2001-05-10 13:02 Ada and Hardware chris.danx
@ 2001-05-10 13:36 ` Ted Dennison
  2001-05-10 14:00   ` chris.danx
  2001-05-10 13:54 ` Tarjei T. Jensen
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 37+ messages in thread
From: Ted Dennison @ 2001-05-10 13:36 UTC (permalink / raw)


In article <BiwK6.3562$po.600977@news6-win.server.ntlworld.com>, chris.danx
says...
>I'm implementing basic routines for the management of the fs at the moment but
>i've been planning ahead and i've encountered a problem.  It is necessary to
>access the disk and write the fs to it.  I was wondering if anyone knew of any
>Ada packages or techniques for accessing the disk in such a raw manner?  I need
>a way to write and read via blocks, sectors, tracks etc on the floppy.  I'm
>developing on windows 98 via GNAT.

This is a system-programming question, not an Ada question. An Ada programmer
won't accomplish this much differently than a C programmer. You'd probably have
better luck asking your question in a Windows programming newsgroup.

Now if you get an answer, but don't know how to translate it to Ada, that's what
we're here for.

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



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

* Re: Ada and Hardware
  2001-05-10 13:02 Ada and Hardware chris.danx
  2001-05-10 13:36 ` Ted Dennison
@ 2001-05-10 13:54 ` Tarjei T. Jensen
  2001-05-10 14:10   ` chris.danx
  2001-05-10 17:24 ` Alfred Hilscher
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 37+ messages in thread
From: Tarjei T. Jensen @ 2001-05-10 13:54 UTC (permalink / raw)



chris.danx wrote in message ...
>Hello folks,
>    I'm implementing a program which reads files on a floppy disk which are
not
>stored via the fat12 file system.  I know this is the most popular format
but i
>want a simple contigouous fs for the purposes of booting an OS.

There is a lot of utilities for reading and writing DOS disks. Why change
something which is so standardized?

Booting from such a floppy should be well understood since there are at
least two such systems used in conjunction with Linux and the various BSD
varieties.


Greetings,







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

* Re: Ada and Hardware
  2001-05-10 13:36 ` Ted Dennison
@ 2001-05-10 14:00   ` chris.danx
  2001-05-10 14:52     ` Ted Dennison
  0 siblings, 1 reply; 37+ messages in thread
From: chris.danx @ 2001-05-10 14:00 UTC (permalink / raw)


> This is a system-programming question, not an Ada question. An Ada programmer
> won't accomplish this much differently than a C programmer. You'd probably
have
> better luck asking your question in a Windows programming newsgroup.
>
> Now if you get an answer, but don't know how to translate it to Ada, that's
what
> we're here for.

I know how to do it in C.  Use the biosdisk function!  Which is incredibly
unsafe but is the only way i know of doing this.  I don't know how to do it in
Ada without binding to C, but i want to avoid this if i can.

I don't see how it isn't an Ada question.  Ada supports systems programming, and
all i want to really is to write/read blocks from a floppy not write a floppy
driver (i don't need to do this yet, but i will soon.  in any event i have
decent info on this and i need a PMode OS first.)

Chris Campbell






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

* Re: Ada and Hardware
  2001-05-10 13:54 ` Tarjei T. Jensen
@ 2001-05-10 14:10   ` chris.danx
  2001-05-10 14:34     ` Tarjei T. Jensen
  0 siblings, 1 reply; 37+ messages in thread
From: chris.danx @ 2001-05-10 14:10 UTC (permalink / raw)


> >Hello folks,
> >    I'm implementing a program which reads files on a floppy disk which are
> not
> >stored via the fat12 file system.  I know this is the most popular format
> but i
> >want a simple contigouous fs for the purposes of booting an OS.
>
> There is a lot of utilities for reading and writing DOS disks. Why change
> something which is so standardized?

I don't understand FAT12 yet, and it complicates the boot sector.  Also the fs
can be messed with if it's a fat12 disk easily.  I don't want this.  Would you
want any person coming along and swapping a driver file for another that's got a
similar signiture but does malicious things behind the scenes?  What's more
anyone can come along and delete a critical file easy.  Two clicks and OS is
gone.


> Booting from such a floppy should be well understood since there are at
> least two such systems used in conjunction with Linux and the various BSD
> varieties.

I know how to boot from a floppy for the file system i'm using.  It's really
easy (just look in 2nd inode to get address of primary kernel file, and
calculate offset).  I just need to get the files from my FAT hard disk to my BFS
floppy.  The current driver implements a disk as a file on a HD, and it's really
easy to work with.  The problem is i need to create a bfs enabled disk, write
files to it, read info from it, via an interactive shell.  I don't know how to
do this in Ada (i can do the shell though).  I do know how in C.


Chris Campbell





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

* Re: Ada and Hardware
  2001-05-10 14:10   ` chris.danx
@ 2001-05-10 14:34     ` Tarjei T. Jensen
  2001-05-10 18:28       ` chris.danx
  0 siblings, 1 reply; 37+ messages in thread
From: Tarjei T. Jensen @ 2001-05-10 14:34 UTC (permalink / raw)



chris.danx wrote :
>I don't understand FAT12 yet, and it complicates the boot sector.  Also the
fs
>can be messed with if it's a fat12 disk easily.  I don't want this.  Would
you
>want any person coming along and swapping a driver file for another that's
got a
>similar signiture but does malicious things behind the scenes?  What's more
>anyone can come along and delete a critical file easy.  Two clicks and OS
is
>gone.

That situation is no worse than anything else that boots from a standard
msdos floppy. If I thought it would be a problem II would  make he file(s)
invisible (system).

>I know how to boot from a floppy for the file system i'm using.  It's
really
>easy (just look in 2nd inode to get address of primary kernel file, and
>calculate offset).  I just need to get the files from my FAT hard disk to
my BFS
>floppy.  The current driver implements a disk as a file on a HD, and it's
really
>easy to work with.  The problem is i need to create a bfs enabled disk,
write
>files to it, read info from it, via an interactive shell.  I don't know how
to
>do this in Ada (i can do the shell though).  I do know how in C.

If you know how to do it in C, you know how to do it in Ada.

greetings,






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

* Re: Ada and Hardware
  2001-05-10 14:00   ` chris.danx
@ 2001-05-10 14:52     ` Ted Dennison
  2001-05-10 18:20       ` chris.danx
  0 siblings, 1 reply; 37+ messages in thread
From: Ted Dennison @ 2001-05-10 14:52 UTC (permalink / raw)


In article <G9xK6.4318$577.867642@news2-win.server.ntlworld.com>, chris.danx
says...
>
>I know how to do it in C.  Use the biosdisk function!  Which is incredibly

Well, then the way to do it in Ada is *also* to use the biosdisk function, or to
write something that does what it does. Ada isn't *that* different from C.

>unsafe but is the only way i know of doing this.  I don't know how to do it in
>Ada without binding to C, but i want to avoid this if i can.

There's nothing particularly wrong with binding to an OS utility just because it
uses the C parameter passing interface. Now *writing* something new in C then
linking to it from Ada might be a bit silly, but that's not what you are talking
about, is it?

>I don't see how it isn't an Ada question. Ada supports systems programming, 
True, but so do lots of other languages. If you wanted to find out how to write
your own PC boot manager, that's a system programming question too. But there's
nothing particularly *Ada* about what you have to do to accomplish this, and
this is not the newsgroup that is full of people who are experts in writing PC
boot managers.

This is akin to calling Honda and asking "How do I do a bootlegger turn with my
Honda Accord?", when in fact you don't know how to perform a bootlegger turn
with *any* car. You may luck out and get someone who knows and can tell you, but
its not the best place to ask, and doesn't really change too much just because
you bought a Honda. 

Now if you called Honda and asked, "I'd like to perform bootlegger turns, but
I'm not sure the best way to it in my Accord becuse it uses a pedal for a foot
brake and the catch is on the shifter, which makes it tough because...", that'd
be a different matter.

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



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

* Re: Ada and Hardware
  2001-05-10 13:02 Ada and Hardware chris.danx
  2001-05-10 13:36 ` Ted Dennison
  2001-05-10 13:54 ` Tarjei T. Jensen
@ 2001-05-10 17:24 ` Alfred Hilscher
  2001-05-10 20:22   ` Ted Dennison
  2001-05-10 20:53   ` chris.danx
  2001-05-11 21:45 ` GNAT for DOS chris.danx
  2001-05-13 19:52 ` Ada and Hardware chris.danx
  4 siblings, 2 replies; 37+ messages in thread
From: Alfred Hilscher @ 2001-05-10 17:24 UTC (permalink / raw)


Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will be
what you are looking for ? Look for this excerpt from   MS-API
dokumentation.

"You can use the CreateFile function to open a disk drive or a partition
on a disk drive. The function returns a handle to the disk device; that
handle can be used with the DeviceIOControl function. The following
requirements must be met in order for such a call to succeed: 
�	The caller must have administrative privileges for the operation to
succeed on a hard disk drive. 
�	The lpFileName string should be of the form \\.\PHYSICALDRIVEx to open
the hard disk x. Hard disk numbers start at zero. For example: 

String	Meaning
\\.\PHYSICALDRIVE2	Obtains a handle to the third physical drive on the
user's computer.
�	The lpFileName string should be \\.\x: to open a floppy drive x or a
partition x on a hard disk. For example: 

String	Meaning
\\.\A:	Obtains a handle to drive A on the user's computer.
\\.\C:	Obtains a handle to drive C on the user's computer."

"chris.danx" wrote:
> 
> Hello folks,
>     I'm implementing a program which reads files on a floppy disk which are not
> stored via the fat12 file system.  I know this is the most popular format but i
> want a simple contigouous fs for the purposes of booting an OS.
> 
> I'm implementing basic routines for the management of the fs at the moment but
> i've been planning ahead and i've encountered a problem.  It is necessary to
> access the disk and write the fs to it.  I was wondering if anyone knew of any
> Ada packages or techniques for accessing the disk in such a raw manner?  I need
> a way to write and read via blocks, sectors, tracks etc on the floppy.  I'm
> developing on windows 98 via GNAT.
> 
> Thanks,
> Chris Campbell



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

* Re: Ada and Hardware
  2001-05-10 14:52     ` Ted Dennison
@ 2001-05-10 18:20       ` chris.danx
  2001-05-10 20:01         ` Jerry van Dijk
  0 siblings, 1 reply; 37+ messages in thread
From: chris.danx @ 2001-05-10 18:20 UTC (permalink / raw)


> >I know how to do it in C.  Use the biosdisk function!  Which is incredibly
>
> Well, then the way to do it in Ada is *also* to use the biosdisk function, or
to
> write something that does what it does. Ada isn't *that* different from C.
>
> >unsafe but is the only way i know of doing this.  I don't know how to do it
in
> >Ada without binding to C, but i want to avoid this if i can.
>
> There's nothing particularly wrong with binding to an OS utility just because
it
> uses the C parameter passing interface.

I just thought how am i going to write the fs to disk, realised that the only
way would be to bind with C and panicked.  I have always had problems binding
with C.  For some reason my attempts at this have always failed.  A while back i
tried to write a binding to Conio (i didn't know about Jerry Van Dijks!  Where's
the new site i lost the link?) and couldn't do it for a whole host of reasons, i
couldn't fathom.  I used the stuff in Lovelace to do somethings but some things
just weren't happening.  A couple of bad interfacing experiences have put me off
binding with C.

> Now *writing* something new in C then
> linking to it from Ada might be a bit silly, but that's not what you are
talking
> about, is it?

No!  Thankfully i have more sense than that.

>
> >I don't see how it isn't an Ada question. Ada supports systems programming,
> True, but so do lots of other languages. If you wanted to find out how to
write
> your own PC boot manager, that's a system programming question too. But
there's
> nothing particularly *Ada* about what you have to do to accomplish this, and
> this is not the newsgroup that is full of people who are experts in writing PC
> boot managers.

All i wanted to know was if an Ada package existed for raw writing to floppy
disks.  One doesn't exist as far as i and others know so i'll write a binding to
C (or i'll try to).

Chris Campbell





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

* Re: Ada and Hardware
  2001-05-10 14:34     ` Tarjei T. Jensen
@ 2001-05-10 18:28       ` chris.danx
  2001-05-14  7:40         ` Kretschmer, Matthias
  0 siblings, 1 reply; 37+ messages in thread
From: chris.danx @ 2001-05-10 18:28 UTC (permalink / raw)



"Tarjei T. Jensen" <tarjei.jensen@kvaerner.com> wrote in message
news:9de8t0$e1s3@news.kvaerner.com...
>
> chris.danx wrote :
> >I don't understand FAT12 yet, and it complicates the boot sector.  Also the
> fs
> >can be messed with if it's a fat12 disk easily.  I don't want this.  Would
> you
> >want any person coming along and swapping a driver file for another that's
> got a
> >similar signiture but does malicious things behind the scenes?  What's more
> >anyone can come along and delete a critical file easy.  Two clicks and OS
> is
> >gone.
>
> That situation is no worse than anything else that boots from a standard
> msdos floppy. If I thought it would be a problem II would  make he file(s)
> invisible (system).
>

This is true, but my main reason for doing it with BFS instead of FAT12 is the
simplicity of working with the files on it.  The Boot sector is simplified
grately and so too is the secondary loader (a 32bit Ada loader with floppy
driver; the OS will have a new module reconfiguration system which is easier to
manage with Ada than ASM).  I want to limit my use of ASM in the system to the
bootsector if possible.  Everything else stands a good chance of being Ada or
maybe a teensy bit of C.

> >I know how to boot from a floppy for the file system i'm using.  It's
> really
> >easy (just look in 2nd inode to get address of primary kernel file, and
> >calculate offset).  I just need to get the files from my FAT hard disk to
> my BFS
> >floppy.  The current driver implements a disk as a file on a HD, and it's
> really
> >easy to work with.  The problem is i need to create a bfs enabled disk,
> write
> >files to it, read info from it, via an interactive shell.  I don't know how
> to
> >do this in Ada (i can do the shell though).  I do know how in C.
>
> If you know how to do it in C, you know how to do it in Ada.

I'll try a binding to C and see how it goes.






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

* Re: Ada and Hardware
  2001-05-10 18:20       ` chris.danx
@ 2001-05-10 20:01         ` Jerry van Dijk
  2001-05-10 20:54           ` chris.danx
  0 siblings, 1 reply; 37+ messages in thread
From: Jerry van Dijk @ 2001-05-10 20:01 UTC (permalink / raw)



"chris.danx" <chris.danx@ntlworld.com> writes:

> tried to write a binding to Conio (i didn't know about Jerry Van Dijks!  Where's
> the new site i lost the link?)

See signature :-)

BTW: I might be a bit dense, but I don't see what your problem is. If you
want to high-level format a floppy to your own filesystem from your
development machine, use the BIOS functions with the DOS compiler or the
DeviceIOControl functions with the windows compiler.

-- 
--  Jerry van Dijk   | email: jvandyk@attglobal.net
--  Leiden, Holland  | web:   home.trouwweb.nl/Jerry



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

* Re: Ada and Hardware
  2001-05-10 17:24 ` Alfred Hilscher
@ 2001-05-10 20:22   ` Ted Dennison
  2001-05-10 23:35     ` Jeff Creem
  2001-05-10 20:53   ` chris.danx
  1 sibling, 1 reply; 37+ messages in thread
From: Ted Dennison @ 2001-05-10 20:22 UTC (permalink / raw)


In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher says...
>
>Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will be
>what you are looking for ? Look for this excerpt from   MS-API
..
>"You can use the CreateFile function to open a disk drive or a partition
..
>\\.\A:	Obtains a handle to drive A on the user's computer.
>\\.\C:	Obtains a handle to drive C on the user's computer."

Interesting. One has to wonder if this would work with the standard Ada IO
operations (eg: Ada.Streams.Stream_IO)...


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



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

* Re: Ada and Hardware
  2001-05-10 17:24 ` Alfred Hilscher
  2001-05-10 20:22   ` Ted Dennison
@ 2001-05-10 20:53   ` chris.danx
  1 sibling, 0 replies; 37+ messages in thread
From: chris.danx @ 2001-05-10 20:53 UTC (permalink / raw)



"Alfred Hilscher" <Alfred.Hilscher@icn.siemens.de> wrote in message
news:3AFACEC7.C2E67357@icn.siemens.de...
> Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will be
> what you are looking for ? Look for this excerpt from   MS-API
> dokumentation.
>

This is what i'm looking for thanks.

Chris Campbell





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

* Re: Ada and Hardware
  2001-05-10 20:01         ` Jerry van Dijk
@ 2001-05-10 20:54           ` chris.danx
  0 siblings, 0 replies; 37+ messages in thread
From: chris.danx @ 2001-05-10 20:54 UTC (permalink / raw)



"Jerry van Dijk" <jvandyk@attglobal.net> wrote in message
news:u8zk5nfck.fsf@attglobal.net...
>
> "chris.danx" <chris.danx@ntlworld.com> writes:
>
> > tried to write a binding to Conio (i didn't know about Jerry Van Dijks!
Where's
> > the new site i lost the link?)
>
> See signature :-)
>
> BTW: I might be a bit dense,
> but I don't see what your problem is. If you
> want to high-level format a floppy to your own filesystem from your
> development machine, use the BIOS functions with the DOS compiler or the
> DeviceIOControl functions with the windows compiler.

I didn't know about the DeviceIOControl functions before but i do now.  I'll
probably try doing it this way.

Thanks for the link to the new site Jerry.  It's been bookmarked!

Chris Campbell





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

* Re: Ada and Hardware
  2001-05-10 20:22   ` Ted Dennison
@ 2001-05-10 23:35     ` Jeff Creem
  2001-05-10 23:58       ` Fraser Wilson
  2001-05-11 19:13       ` Randy Brukardt
  0 siblings, 2 replies; 37+ messages in thread
From: Jeff Creem @ 2001-05-10 23:35 UTC (permalink / raw)



"Ted Dennison" <dennison@telepath.com> wrote in message
news:JLCK6.91$j65.11856@www.newsranger.com...
> In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher says...
> >
> >Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will be
> >what you are looking for ? Look for this excerpt from   MS-API
> ..
> >"You can use the CreateFile function to open a disk drive or a partition
> ..
> >\\.\A: Obtains a handle to drive A on the user's computer.
> >\\.\C: Obtains a handle to drive C on the user's computer."
>
> Interesting. One has to wonder if this would work with the standard Ada IO
> operations (eg: Ada.Streams.Stream_IO)...
>

I just had to know to. It looks like it does not work.

with Ada.Streams.Stream_IO;
with Ada.Streams;

procedure Show_It is

  Buffer : Ada.Streams.Stream_Element_Array (1 .. 2048) := (others => 0);


  File : Ada.Streams.Stream_IO.File_Type;

begin
  Ada.Streams.Stream_IO.Open
    (
    File => File,
    Name => "\\.\A:",
    Mode => Ada.Streams.Stream_IO.Out_File);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Write
    (
    File => File,
    Item => Buffer);

  Ada.Streams.Stream_IO.Close(File);
end Show_It;


Raises a name error on the open.  I tried a few quick variations on it.
(Including create instead
of open).








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

* Re: Ada and Hardware
  2001-05-10 23:35     ` Jeff Creem
@ 2001-05-10 23:58       ` Fraser Wilson
  2001-05-11  1:54         ` Jeff Creem
  2001-05-11 19:13       ` Randy Brukardt
  1 sibling, 1 reply; 37+ messages in thread
From: Fraser Wilson @ 2001-05-10 23:58 UTC (permalink / raw)


"Jeff Creem" <jeff@thecreems.com> writes:

> "Ted Dennison" <dennison@telepath.com> wrote in message
> news:JLCK6.91$j65.11856@www.newsranger.com...
> > In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher says...
> > >
> > >"You can use the CreateFile function to open a disk drive or a partition
> > ..
> > >\\.\A: Obtains a handle to drive A on the user's computer.
> > >\\.\C: Obtains a handle to drive C on the user's computer."
> >
> > Interesting. One has to wonder if this would work with the standard Ada IO
> > operations (eg: Ada.Streams.Stream_IO)...
> >
> 
> I just had to know to. It looks like it does not work.

Is it possible that the documentation assumes that back slashes are
escaped?  Though I can't imagine what "\A" means in that case.

Fraser.



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

* Re: Ada and Hardware
  2001-05-10 23:58       ` Fraser Wilson
@ 2001-05-11  1:54         ` Jeff Creem
  0 siblings, 0 replies; 37+ messages in thread
From: Jeff Creem @ 2001-05-11  1:54 UTC (permalink / raw)


Anything is possible. Again this does not take away from the original
advice on this (which is to use the given path with the win32
bindings)...This is just a fun
little diversion. It appears that it is somehow looking at the characters in
a special
way since the name error does take a while to come back. In addition, if I
swap out
\\Ada95\Shared\aaa

for the \\.\A: string (and use the create v.s. the open version of the call)
it does indeed
create a file on the win32 server named Ada95 on its shared disk called
Shared with
a filename of aaa....So it is indeed close to working but not quite right.

...back to real work..


"Fraser Wilson" <blancolioni@blancolioni.org> wrote in message
news:fy7y9s4eoz8.fsf@blancolioni.org...
> "Jeff Creem" <jeff@thecreems.com> writes:
>
> > "Ted Dennison" <dennison@telepath.com> wrote in message
> > news:JLCK6.91$j65.11856@www.newsranger.com...
> > > In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher says...
> > > >
> > > >"You can use the CreateFile function to open a disk drive or a
partition
> > > ..
> > > >\\.\A: Obtains a handle to drive A on the user's computer.
> > > >\\.\C: Obtains a handle to drive C on the user's computer."
> > >
> > > Interesting. One has to wonder if this would work with the standard
Ada IO
> > > operations (eg: Ada.Streams.Stream_IO)...
> > >
> >
> > I just had to know to. It looks like it does not work.
>
> Is it possible that the documentation assumes that back slashes are
> escaped?  Though I can't imagine what "\A" means in that case.
>
> Fraser.





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

* Re: Ada and Hardware
  2001-05-10 23:35     ` Jeff Creem
  2001-05-10 23:58       ` Fraser Wilson
@ 2001-05-11 19:13       ` Randy Brukardt
  2001-05-14 10:27         ` Alfred Hilscher
  1 sibling, 1 reply; 37+ messages in thread
From: Randy Brukardt @ 2001-05-11 19:13 UTC (permalink / raw)


Jeff Creem wrote in message
<1BFK6.19477$9j1.4714444@typhoon.ne.mediaone.net>...
>
>"Ted Dennison" <dennison@telepath.com> wrote in message
>news:JLCK6.91$j65.11856@www.newsranger.com...
>> In article <3AFACEC7.C2E67357@icn.siemens.de>, Alfred Hilscher
says...
>> >
>> >Maybe the Windows API calls "CreateFile" and "DeviceIOControl" will
be
>> >what you are looking for ? Look for this excerpt from   MS-API
>> ..
>> >"You can use the CreateFile function to open a disk drive or a
partition
>> ..
>> >\\.\A: Obtains a handle to drive A on the user's computer.
>> >\\.\C: Obtains a handle to drive C on the user's computer."
>>
>> Interesting. One has to wonder if this would work with the standard
Ada IO
>> operations (eg: Ada.Streams.Stream_IO)...
>>
>
>I just had to know to. It looks like it does not work.


That format for the disk name only works with Windows NT and Windows
2000. Did you try it on one of those, or on Windows 95/98/ME? (So says
the platform documentation in the MSDN library, January 2001).

(Note that the original poster's problem cannot be solved with this
syntax, because it doesn't work on Windows 98, which he indicated was
his target.)

            Randy.






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

* GNAT for DOS
  2001-05-10 13:02 Ada and Hardware chris.danx
                   ` (2 preceding siblings ...)
  2001-05-10 17:24 ` Alfred Hilscher
@ 2001-05-11 21:45 ` chris.danx
  2001-05-13 19:52 ` Ada and Hardware chris.danx
  4 siblings, 0 replies; 37+ messages in thread
From: chris.danx @ 2001-05-11 21:45 UTC (permalink / raw)


I've downloaded GNAT for DOS but i'm not sure which version of djgpp i need to
run it.  I've got 3.13alpha and i've checked the current verson of djgpp --
2.03.  Has anyone used it and if so which version of DJGPP do i need?  And where
do i get it?


Thanks,
Chris

p.s. i looked in the windows api ref and win9x doesn't support deviceio thingy.
{ Probably due to it's naff security mechanisms -- which are nothing like
t's!  }  Hence the need for the dos compiler!





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

* Re: Ada and Hardware
  2001-05-10 13:02 Ada and Hardware chris.danx
                   ` (3 preceding siblings ...)
  2001-05-11 21:45 ` GNAT for DOS chris.danx
@ 2001-05-13 19:52 ` chris.danx
  2001-05-14  0:18   ` Jeff Creem
  4 siblings, 1 reply; 37+ messages in thread
From: chris.danx @ 2001-05-13 19:52 UTC (permalink / raw)


Hi,
    I've got a binding to the biosdisk function but i do not know how to tell
GNAT which file it's in.  I tried -I but that's wrong.  I looked in the users
guide and reference manual for GNAT but cannot find it.

I'm linking to the libc.a file a part of the djgpp installation.  (this is GNAT
non-dos i'm using i had major problems trying to get the dos one to compile...)
I hope linking non-dos and dos is possible (win98 i'm on).

This is my binding


with interfaces.c;
with interfaces.c.strings;

package biosf is

   package C renames interfaces.c;

   function biosdisk ( cmd    : in c.int;
                       drive  : in c.int;
                       head   : in c.int;
                       track  : in c.int;
                       sector : in c.int;
                       nsects : in c.int;
                       buffer : in c.strings.chars_ptr) return c.int;
   pragma import (C, biosdisk, "biosdisk");
   pragma linker_options ("d:\djgpp\lib\libc.a");
   -- the above line is wrong...
   -- i don't know what the correct option is!

end biosf;



Thanks,
Chris Campbell





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

* Re: Ada and Hardware
  2001-05-13 19:52 ` Ada and Hardware chris.danx
@ 2001-05-14  0:18   ` Jeff Creem
  0 siblings, 0 replies; 37+ messages in thread
From: Jeff Creem @ 2001-05-14  0:18 UTC (permalink / raw)


When this thread first started, I and several others tried to point out that
this was
not the best group since you are not really asking how to do something in
Ada but
are asking how to do something in windows..

Many of us tried to help but since we are not all win32 gurus  we probably
thew you some curve balls...

So lets try this and try to set things straight (mainly for people who
revisit this
thread someday in deja (ok make that google)

1) The first assertion was that the poster knew how to do this in C so could
we
help in Ada. After following the thread a little and reading a little I
assert that the
poster (and I am not trying to flame here at all) did not know how to "do
it" in C.
The poster DID know how to make a particular BIOS call with a particular C
compiler however
that call IS NOT available to a win32 (32 bit) C compiler. It is available
on 16 bit compilers
or for compilers producing 16 bit executables.

2) An early post recommended opening the disk device with a name like \\.\A:
which would be
correct for a win32 system based on NT code (and will not work for win
95,98,ME).

3) One recommeded approach (which should have worked) was to use GNAT for
DOS so
that you would be able to make these BIOS calls..Note that I think this
could still work but it
is not the greatest long term approach..(although with what the answer
actually is perhaps this
would not be bad to revisit)

3) Now, for what I think is approaching the correct answer. I looked at the
archives of
a few win32 related groups for similar questions (where the question should
have started
in the beginning...Again this is not meant to be a flame, sometimes the
specifics of a question
and what the actual question is really is only clear once you begin to
understand the answer).

Take a look at the link:

http://msdn.microsoft.com/library/psdk/win95/devio_2b1v.htm

This describes how to use the VWIN32.VXD service in windows to do low
level IO (specifically floppy disk read/write....Note that apparently if you
wanted something
as simple as direct hard disk access it would be much more difficult (See
Microsoft
Knowledge base Q137176 and Q137813 )



What is really amazing here is the pain it takes under a 32 bit app on win
95/98/ME to do this stuff and
how different it is from NT.  I always find it amazing how Windows snobs
will talk about
the multiple versions of Linux (or Unix) without realizing how different win
95, 95 OSR 2, 98, 98 SE,
ME, NT, 2000, XP, CE are from each other...Granted several of these are
version
updates and so you can cut them some slack but it is not as if a windows
developer can
ignore the older versions (although it appears finally that the original 95
and
even 95 OSR 2 are now no longer supported well)..




"chris.danx" <chris.danx@ntlworld.com> wrote in message
news:ABBL6.3405$tU6.554354@news2-win.server.ntlworld.com...
> Hi,
>     I've got a binding to the biosdisk function but i do not know how to
tell
> GNAT which file it's in.  I tried -I but that's wrong.  I looked in the
users
> guide and reference manual for GNAT but cannot find it.
>
> I'm linking to the libc.a file a part of the djgpp installation.  (this is
GNAT
> non-dos i'm using i had major problems trying to get the dos one to
compile...)
> I hope linking non-dos and dos is possible (win98 i'm on).
>
> This is my binding
>
>
> with interfaces.c;
> with interfaces.c.strings;
>
> package biosf is
>
>    package C renames interfaces.c;
>
>    function biosdisk ( cmd    : in c.int;
>                        drive  : in c.int;
>                        head   : in c.int;
>                        track  : in c.int;
>                        sector : in c.int;
>                        nsects : in c.int;
>                        buffer : in c.strings.chars_ptr) return c.int;
>    pragma import (C, biosdisk, "biosdisk");
>    pragma linker_options ("d:\djgpp\lib\libc.a");
>    -- the above line is wrong...
>    -- i don't know what the correct option is!
>
> end biosf;
>
>
>
> Thanks,
> Chris Campbell
>
>





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

* Re: Ada and Hardware
  2001-05-10 18:28       ` chris.danx
@ 2001-05-14  7:40         ` Kretschmer, Matthias
  0 siblings, 0 replies; 37+ messages in thread
From: Kretschmer, Matthias @ 2001-05-14  7:40 UTC (permalink / raw)


"chris.danx" wrote:
> 
> "Tarjei T. Jensen" <tarjei.jensen@kvaerner.com> wrote in message
> news:9de8t0$e1s3@news.kvaerner.com...
> >
> > chris.danx wrote :
> > >I don't understand FAT12 yet, and it complicates the boot sector.  Also the
> > fs
> > >can be messed with if it's a fat12 disk easily.  I don't want this.  Would
> > you
> > >want any person coming along and swapping a driver file for another that's
> > got a
> > >similar signiture but does malicious things behind the scenes?  What's more
> > >anyone can come along and delete a critical file easy.  Two clicks and OS
> > is
> > >gone.
> >
> > That situation is no worse than anything else that boots from a standard
> > msdos floppy. If I thought it would be a problem II would  make he file(s)
> > invisible (system).
> >
> 
> This is true, but my main reason for doing it with BFS instead of FAT12 is the
> simplicity of working with the files on it.  The Boot sector is simplified
> grately and so too is the secondary loader (a 32bit Ada loader with floppy
> driver; the OS will have a new module reconfiguration system which is easier to
> manage with Ada than ASM).  I want to limit my use of ASM in the system to the
> bootsector if possible.  Everything else stands a good chance of being Ada or
> maybe a teensy bit of C.
> 

If you want to implement real usefull memory-management you need to
develop at least some glue in Assembler (there are things that can't be
really done in C or has anybody yet seen an LGDTR mnenomic in C?).

> > >I know how to boot from a floppy for the file system i'm using.  It's
> > really
> > >easy (just look in 2nd inode to get address of primary kernel file, and
> > >calculate offset).  I just need to get the files from my FAT hard disk to
> > my BFS
> > >floppy.  The current driver implements a disk as a file on a HD, and it's
> > really
> > >easy to work with.  The problem is i need to create a bfs enabled disk,
> > write
> > >files to it, read info from it, via an interactive shell.  I don't know how
> > to
> > >do this in Ada (i can do the shell though).  I do know how in C.
> >
> > If you know how to do it in C, you know how to do it in Ada.
> 
> I'll try a binding to C and see how it goes.

maybe you work with your disk on the hdd and than just put the image on
floppy? - using your driver you put on your floppy running Win98 should
be a problem, because win32 applications shouldn't be allowed to
directly access hardware (but I am no Windows expert and I wouldn't
wonder if M$ made it possible).

mfg M.K.



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

* Re: Ada and Hardware
  2001-05-11 19:13       ` Randy Brukardt
@ 2001-05-14 10:27         ` Alfred Hilscher
  0 siblings, 0 replies; 37+ messages in thread
From: Alfred Hilscher @ 2001-05-14 10:27 UTC (permalink / raw)




Randy Brukardt wrote:
> >> >\\.\A: Obtains a handle to drive A on the user's computer.
> >> >\\.\C: Obtains a handle to drive C on the user's computer."
> >>
> >> Interesting. One has to wonder if this would work with the standard
> Ada IO
> >> operations (eg: Ada.Streams.Stream_IO)...
> >>
> >
> >I just had to know to. It looks like it does not work.
> 
> That format for the disk name only works with Windows NT and Windows
> 2000. Did you try it on one of those, or on Windows 95/98/ME? (So says
> the platform documentation in the MSDN library, January 2001).
> 
> (Note that the original poster's problem cannot be solved with this
> syntax, because it doesn't work on Windows 98, which he indicated was
> his target.)

Correct:
"Windows 95: This technique does not work for opening a logical drive.
In Windows 95, specifying a string in this form causes CreateFile to
return an error."

On Win NT you must have admin rights (I think).



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

end of thread, other threads:[~2001-05-14 10:27 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-10 13:02 Ada and Hardware chris.danx
2001-05-10 13:36 ` Ted Dennison
2001-05-10 14:00   ` chris.danx
2001-05-10 14:52     ` Ted Dennison
2001-05-10 18:20       ` chris.danx
2001-05-10 20:01         ` Jerry van Dijk
2001-05-10 20:54           ` chris.danx
2001-05-10 13:54 ` Tarjei T. Jensen
2001-05-10 14:10   ` chris.danx
2001-05-10 14:34     ` Tarjei T. Jensen
2001-05-10 18:28       ` chris.danx
2001-05-14  7:40         ` Kretschmer, Matthias
2001-05-10 17:24 ` Alfred Hilscher
2001-05-10 20:22   ` Ted Dennison
2001-05-10 23:35     ` Jeff Creem
2001-05-10 23:58       ` Fraser Wilson
2001-05-11  1:54         ` Jeff Creem
2001-05-11 19:13       ` Randy Brukardt
2001-05-14 10:27         ` Alfred Hilscher
2001-05-10 20:53   ` chris.danx
2001-05-11 21:45 ` GNAT for DOS chris.danx
2001-05-13 19:52 ` Ada and Hardware chris.danx
2001-05-14  0:18   ` Jeff Creem
  -- strict thread matches above, loose matches on Subject: below --
2000-10-03  0:00 GNAT for DOS fabien_bousquet
2000-10-03  0:00 ` Gautier
2000-10-04  0:00   ` fabien_bousquet
2000-10-04  0:00     ` Gautier
2000-10-05  2:17       ` Robert Dewar
2000-10-05  2:18       ` Robert Dewar
1996-04-21  0:00 gnat " Al Christians
1996-04-21  0:00 ` Michael Feldman
1996-04-21  0:00   ` Weston T. Pan
1996-04-22  0:00 ` Robert Dewar
1996-04-24  0:00   ` Scott H. James
1996-04-25  0:00     ` Robert Dewar
1996-04-25  0:00     ` Tom Griest
1994-12-14  4:04 GNAT " Miguel Miranda

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