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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.246.99 with SMTP id xv3mr33325736obc.16.1432019933263; Tue, 19 May 2015 00:18:53 -0700 (PDT) X-Received: by 10.140.83.165 with SMTP id j34mr350893qgd.23.1432019933223; Tue, 19 May 2015 00:18:53 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!j8no5396245igd.0!news-out.google.com!k20ni36313qgd.0!nntp.google.com!z60no2187778qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 19 May 2015 00:18:53 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=105.237.126.3; posting-account=orbgeAkAAADzWCTlruxuX_Ts4lIq8C5J NNTP-Posting-Host: 105.237.126.3 References: <8759d49e-c30a-4c71-a3e5-fd7a818a30f6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Linux kernel module - memory allocation From: jan.de.kruyf@gmail.com Injection-Date: Tue, 19 May 2015 07:18:53 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:25915 Date: 2015-05-19T00:18:53-07:00 List-Id: On Tuesday, May 19, 2015 at 7:30:37 AM UTC+2, q.kontinuum wrote: > I think I might be a different learning type.=20 Age related I guess. I was forced to take your way with an ethernet driver for an arm board sinc= e no good example was available (at least not for what I wanted) And oh boy= was I bitten in the foot! But it is running now. > > Somewhere in the discussion I saw "no runtime". This is obsolete now. > > you are supposed to have some runtime even if it is empty, I suppose. >=20 > I didn't find anything about this. Do you have some additional informatio= n? >=20 file:///usr/gnat/share/doc/gnat/html/gnat_rm_2.html#SEC6 (on my machine) -------------------- =09 pragma No_Run_Time; This is an obsolete configuration pragma that historically was used to setu= p what is now called the "zero footprint" library. It causes any library un= its outside this basic library to be ignored. The use of this pragma has be= en superseded by the general configurable run-time capability of GNAT where= the compiler takes into account whatever units happen to be accessible in = the library. -------------------- > > It just needs porting back to x86. >=20 > Not, when the target ist my raspberry pi :-) Shows you how bad I am at reading books ;) I should have said "kernelspace"= perhaps.=20 >=20 > Currently I tend to use some static memory instead. kmalloc should be > used scarcely, and I don't need much memory anyway. I just need a=20 > buffer for messages to send and an array to store the addresses of > the onewire devices. (Well, actually I'm not sure I need that. The > search algorithm should work when the driver just gets last found > address + last fork point [point, where an address with bit=3D1 and=20 > another with bit=3D0 exists and decision was taken to search in one=20 > direction] in order to follow the other direction next time.) >=20 > Everything more complex should be done in userspace anyway. >=20 Well, yes. At the moment I am going to set up an ioctl communication channe= l and a page of 'dual port' memory as a buffer that can be read / written o= n both sides, so we have 'zero-copying' communication. I need that for spee= d. And ioctl works nicely also as a debugging tool. It will allow me to ask= specific info from kernelspace at runtime. > As I wrote in another thread, it's a gcc feature.=20 > https://gcc.gnu.org/onlinedocs/gcc-4.5.3/gcc/i386-and-x86_002d64-Options.= html >=20 Yes, i take it you did see my post about the load of other switches the mod= ule building process inserts into the call to gcc. And you just gave me an idea.=20 I think I am going to run gcc with no package System.Memory (thats where gc= c looks when there is a memory request) just to see what happens. Normally = gcc calls for some form of malloc, but perhaps in kernel mode it acts diffe= rently. > > May the peace be with you. > And with you :-) Thank you. j.