comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeff Creem" <jeff@thecreems.com>
Subject: Re: Ada and Hardware
Date: Mon, 14 May 2001 00:18:31 GMT
Date: 2001-05-14T00:18:31+00:00	[thread overview]
Message-ID: <rvFL6.25159$9j1.5826626@typhoon.ne.mediaone.net> (raw)
In-Reply-To: ABBL6.3405$tU6.554354@news2-win.server.ntlworld.com

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
>
>





      reply	other threads:[~2001-05-14  0:18 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
replies disabled

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