comp.lang.ada
 help / color / mirror / Atom feed
From: mike@nospam
Subject: Re: Linux Kernel in Ada. Repost
Date: 1999/04/10
Date: 1999-04-10T00:00:00+00:00	[thread overview]
Message-ID: <7ep9p3$9fm@drn.newsguy.com> (raw)
In-Reply-To: 7ep6uj$o97$1@nnrp1.dejanews.com

In article <7ep6uj$o97$1@nnrp1.dejanews.com>, Robert says...
>
>

>
>In article <7emjk8$rp3@drn.newsguy.com>,
>  bill_@nospam wrote:
>> It is kind'a hard to write Linux or Unix stuff in Ada,
>> becuase the Posix
>> Ada binding do not seem to work well or even documented.
>> The Posix Ada
>> bindings for linux (there is now even an RPM for these
>> for Linux!) do not
>> have an API document to tell one how to use them to write
>> the sort of stuff
>> you are talking about.
>


>
>First, of course there is documentation on how to use
>the Posix interface, this is an IEEE standard, just as
>for Ada you go to the RM, you go to the Posix standard
>for details on the Ada binding to Posix.
>

There is no free Ada/Posix binding document. one must buy it.
Something like $60 or $100 I hear? Do you know of a free one
we can download?

>Second, I see no particular reason to use these bindings.
>Might as well call any services that you want directly. I
>see no point in involving the Posix stuff here.
>
>As for it being "kind'a hard to write .. Unix stuff [in
>Ada]" that makes no sense, it is quite straightforward
>in Ada to call any system services or other functions
>that you need.
>

Some calls are easy, but some that takes in a pointer to 
some complicated C structure, might not be, you need to map
an Ada record to match the C struct correctly.
 
>I am not at all clear that it is desirable to use something
>as thick as the Posix bindings at the OS kernel level
>anyway, that does not make any sense. The more reasonable
>view of the Posix bindings is that they bind to the
>kernel you are writing!
>

But the above poster was responding to someone saying to write
Linux UTILTIES and Linux daemons type of applications in Ada, 
i.e. stuff that runs in user mode, not kernel mode. Inside the 
kernel, one does not make system calls.


>In any case, the existing Posix interface is completely
>irrelevant to this project. You are trying to write a
>kernel in Ada, 

Again, the repsonse was for the claim that writing Linux system type
utilities in Ada was easy. (not to write the kernel itself).

For example, If I want to write a system resource monitoring utility
for Linux. Most of the time, the application will be making C system
service calls to the system, and  making heavy use of Linux defined
C structs that contains such information. 

Just an example, making a stat() call, will require one to pass in such
a struct (define in sys/stat.h )
 
              struct stat
              {
                  dev_t         st_dev;      /* device */
                  ino_t         st_ino;      /* inode */
                  mode_t        st_mode;     /* protection */
                  nlink_t       st_nlink;    /* number of hard links */
                  uid_t         st_uid;      /* user ID of owner */
                  gid_t         st_gid;      /* group ID of owner */
                  dev_t         st_rdev;     /* device type (if inode device) */
                  off_t         st_size;     /* total size, in bytes */
                  unsigned long st_blksize;  /* blocksize for filesystem I/O */
                  unsigned long st_blocks;   /* number of blocks allocated */
                  time_t        st_atime;    /* time of last access */
                  time_t        st_mtime;    /* time of last modification */
                  time_t        st_ctime;    /* time of last change */
              };

Now, an Ada application that needs to call stat(), will have to pass
a pointer to a piece of memory that maps to the above layout. I have
to figure how to make my Ada record to be same size as above, with
correct field sizes.  I have to figure the size of each field, etc..

There are zillion (well, many) other such C structs, and 
many constants defined in those C header files, used. All of these 
need to have Ada equivelent.

This is a waste of time for me having to do this everytime I encounter
a new struct, and having each Ada programmer do the same becuase there
is no common Ada/Posix binding to use that allready did all this 
work for us.
 
>what on earth is the relevance of a binding
>from Ada to the corresponding C kernel??
>

I agree. If one is writing the kernel in Ada, offocurse the Posix
binding is not needed. But the posix binding is helpfull to write
user level Unix applications in Ada. (then one will need a C binding
to the Ada kernel. This sounds so nice!)

Lets face it, it is so much easier to write all of this Unix stuff 
in C than in Ada, unless a fully Ada working Unix binding exist 
to make it easier for programmers to use Ada on Unix/Linux, C will 
remain the prefered language of use on Unix for developing system 
applications.
 
Mike





  reply	other threads:[~1999-04-10  0:00 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-07  0:00 Linux Kernel in Ada. Repost Bruce MacDonald
1999-04-07  0:00 ` Matthew Heaney
1999-04-08  0:00 ` Jeffrey D. Cherry
1999-04-09  0:00   ` Corey Ashford
1999-04-09  0:00     ` Jeffrey D. Cherry
1999-04-09  0:00     ` me
1999-04-09  0:00       ` Larry Kilgallen
1999-04-09  0:00         ` David Starner
1999-04-09  0:00           ` Brian Rogoff
1999-04-11  0:00           ` Robert Dewar
1999-04-12  0:00         ` Hans N. Beck
1999-04-09  0:00       ` Tarjei Tj�stheim Jensen
1999-04-09  0:00         ` bill_
1999-04-10  0:00           ` Tarjei Tj�stheim Jensen
1999-04-10  0:00             ` Mich
1999-04-10  0:00               ` Tarjei Tj�stheim Jensen
1999-04-11  0:00                 ` Robert Dewar
1999-04-12  0:00                 ` OpenToken project announcement dennison
1999-04-11  0:00               ` Linux Kernel in Ada. Repost Robert Dewar
1999-04-10  0:00                 ` Kevin
1999-04-13  0:00                 ` Harry Tanovich
1999-04-13  0:00                   ` Robert Dewar
1999-04-11  0:00             ` Jerry van Dijk
1999-04-11  0:00           ` Jerry van Dijk
1999-04-11  0:00             ` Robert Dewar
1999-04-14  0:00               ` Aidan Skinner
1999-04-11  0:00           ` Robert Dewar
1999-04-10  0:00             ` mike [this message]
1999-04-11  0:00               ` Robert Dewar
1999-04-12  0:00                 ` Samuel Mize
1999-04-13  0:00                   ` Robert Dewar
1999-04-16  0:00                     ` Samuel Mize
1999-04-11  0:00             ` Accessing C macro constants from Ada95 Markus Kuhn
1999-04-11  0:00               ` Jerry van Dijk
1999-04-12  0:00               ` Robert Dewar
1999-04-13  0:00                 ` Markus Kuhn
1999-04-13  0:00                   ` Robert Dewar
1999-04-13  0:00                     ` dennison
1999-04-12  0:00               ` Aidan Skinner
1999-04-13  0:00                 ` Robert Dewar
1999-04-12  0:00               ` Robert Dewar
1999-04-12  0:00               ` Tarjei Tj�stheim Jensen
1999-04-12  0:00               ` Robert Dewar
1999-04-11  0:00   ` Linux Kernel in Ada. Repost Robert Dewar
1999-04-12  0:00     ` Bruce MacDonald
1999-05-03  0:00 ` Buz Cory
1999-05-03  0:00   ` Hans N. Beck
replies disabled

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