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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: "q.kontinuum" Newsgroups: comp.lang.ada Subject: Linux kernel module - memory allocation Date: Mon, 18 May 2015 08:27:45 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: Reply-To: nntp@thorzten.de NNTP-Posting-Host: 2Re8NKytgV911fAPUMdAmQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org User-Agent: slrn/1.0.1 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.giganews.com comp.lang.ada:193206 Date: 2015-05-18T08:27:45+00:00 List-Id: I'm new to this group, new to Ada programming, and a bit out of touch with Linux driver development for some time. Since I want to learn Ada and want to get back in touch with Linux I'm trying to implement a driver for my raspberry-pi, to access a DS18B20 temperature sensor via onewire protocol. The steps I already took was to implement a small wrapper in C to link with a first Hello world module in Ada and to access the hr_timer of the Linux kernel (here I again used to wrapper and called it from Ada to avoid cloning the whole hrtimer struct from Linux kernel header files) Where I'm getting stuck now is a function returning a String. I simplified the function to this: function UInt2String(I : Integer) return String is begin return ""; end; As soon as this function is used somewhere, I can't load the module. Here is the kernel log output when I try to load the module: May 18 10:19:39 localhost kernel: [87978.938801] wrapper: Unknown symbol system__secondary_stack__ss_allocate (err 0) May 18 10:19:39 localhost kernel: [87978.938812] wrapper: Unknown symbol system__secondary_stack__ss_release (err 0) May 18 10:19:39 localhost kernel: [87978.938819] wrapper: Unknown symbol system__secondary_stack__ss_mark (err 0) May 18 10:19:39 localhost kernel: wrapper: Unknown symbol system__secondary_stack__ss_allocate (err 0) May 18 10:19:39 localhost kernel: wrapper: Unknown symbol system__secondary_stack__ss_release (err 0) May 18 10:19:39 localhost kernel: wrapper: Unknown symbol system__secondary_stack__ss_mark (err 0) I will need to store a binary tree later on to store the addresses of the devices found on the onewire bus. In C, I'd probably use kmalloc and casts to allocate memory for a node of the tree. How should I do that in Ada? Sorry if this is a stupid question. I'm entirely happy with a RTFM + link to a good M on this topic.