Wed, 19 Apr 2000 Olaf Petzold wrote:
> Could it be, that the amount of memory which I want to copy must be less than
> PAGE_SIZE???? The structure has a size of about 512 kB!
> The shared memory is allocated by mbuff, no problems. The local copy which I
> try to fill with the contents of the shm structure is a static variable, like
> 
> void *thread_code(void *param)
> {
>   shm_slut_t slut;
> 
>   shm_slut->inuse = true;
>    memcpy((void *)slut, (void *)shm_slut, sizeof(shm_slut_t));
>   shm_slut->inuse = false;
> ..
> }}

Unless you do

   static shm_slut_t slut;

you'll get a *local* variable, rather than a static variable. That is, the
kernel crashes already when trying to allocate space for the variable (when
entering thread_code()). It's allocated from the stack...

> kmalloc can only allocate about 131072 Bytes. I have heard about vmalloc()
> inside kernel space - is this the solution to allocate an local memory region?

Probably, but I don't think this is the problem that generates the crasch. If
you try to kmalloc() too big a block, you should get an error return (to be
handled nicely by your code!) rather than a kernel crash.


David Olofson
   Programmer
   Reologica Instruments AB
   Scheelev�gen 30
   S-223 63  LUND
   +46 (0)46 - 12 77 60
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to