comp.lang.ada
 help / color / mirror / Atom feed
From: "q.kontinuum" <achsis_of_elvis@yahoo.co.uk>
Subject: Linux kernel module - memory allocation
Date: Mon, 18 May 2015 08:27:45 +0000 (UTC)
Date: 2015-05-18T08:27:45+00:00	[thread overview]
Message-ID: <slrnmlj8k2.9gf.achsis_of_elvis@tmoeller-laptop.ad.here.com> (raw)

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.



             reply	other threads:[~2015-05-18  8:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18  8:27 q.kontinuum [this message]
2015-05-18  8:56 ` Linux kernel module - memory allocation Niklas Holsti
2015-05-18  9:19   ` q.kontinuum
2015-05-18 16:02     ` Niklas Holsti
2015-05-18 17:34       ` Simon Clubley
2015-05-18 19:25         ` jan.de.kruyf
2015-05-19  5:30           ` q.kontinuum
2015-05-19  7:18             ` jan.de.kruyf
2015-05-19  7:56               ` q.kontinuum
2015-05-19  8:06                 ` jan.de.kruyf
2015-05-19 10:20                   ` Mart van de Wege
2015-05-19 11:14                     ` jan.de.kruyf
2015-05-19 11:16                   ` G.B.
2015-05-19  9:52               ` Simon Wright
2015-05-19 11:11                 ` jan.de.kruyf
2015-05-18 19:48         ` q.kontinuum
2015-05-18 20:18           ` rrr.eee.27
2015-05-18 21:09             ` q.kontinuum
2015-05-18 19:35       ` q.kontinuum
2015-05-18 20:19 ` jan.de.kruyf
replies disabled

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