From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,277ad5c6c4fb9545 X-Google-Attributes: gid103376,public X-Google-Thread: 115aec,e3ee290dec815dec X-Google-Attributes: gid115aec,public X-Google-ArrivalTime: 2001-05-25 21:56:01 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: gerhard.nospam@bigfoot.de (Gerhard =?iso-8859-1?Q?H=E4ring?=) Newsgroups: comp.realtime,comp.lang.ada Subject: Re: Using GNAT in Linux kernel modules, was: Re: Free RTOS with support for Ada ? Date: Sat, 26 May 2001 05:35:00 +0200 Organization: T-Online Message-ID: References: <3B0D7877.4AE1FBCC@gsde.hou.us.ray.com> <1UxP6.158$rn5.2018@www.newsranger.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 990852769 04 23986 UuepSy2VSpaMXB 010526 04:52:49 X-Complaints-To: abuse@t-online.com X-Sender: 320066699498-0001@t-dialin.net User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.realtime:2655 comp.lang.ada:7798 Date: 2001-05-26T05:35:00+02:00 List-Id: >I was also aware (from the Ada Linux Programming book from >www.adapower.com) that you need to use a pragma to disable the Ada runtime >when doing Linux kernel modules. > >However, this book does not cover kernel programming in any detail and the >GNAT reference manual just refers you to the GNORT documentation, which does >not appear to be publically available, so I had dismissed this as an option. > >However, since this option is mentioned above, I wonder if I have missed >something. > >Has anybody successfully implemented a Linux/RTlinux kernel module in Ada >using just the public GNAT and freely available documentation and what problems >did you have ? FWIW, I have once implemented a toy Linux kernel module with the publicly available version of GNAT. I also started to port a relatively simple Linux kernel module to Ada (the driver for the bttv video cards). I can tell you that it's possible. But for me, it was quite frustrating, because I had to "fake" C a lot, I couldn't get rid of C completely because the Linux kernel uses lots of #defines and you have to wrap these at least to Ada functions/procedures. It would be nice if the complete Linux kernel API were available as an Ada binding, but this would be a tremendous effort and would have to be updated for every new kernel version. Not quite realistic. I have only translated the C stuff on a as-needed basis. Wrt to the PRAGMA No_Run_Time, it wasn't available with GNAT 3.12p and I could do without. I still don't quite get the point of it: it still lets you use features that need the Ada runtime. Gerhard PS: You can't allocate stuff on the heap. (Part of) The GNAT runtime would need to be ported to the Linux kernel environment, so that it uses kmalloc instead of the C library's malloc. -- mail: gerhard bigfoot de registered Linux user #64239 web: http://highqualdev.com public key at homepage public key fingerprint: DEC1 1D02 5743 1159 CD20 A4B6 7B22 6575 86AB 43C0 reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))