11-03-2010
They reside outside the kernel still, they don't have to be inside the kernel's fixed length. The kernel allocates memory pages outside itself to hold them, and marks them executable so it can run instructions inside them, and keeps pointers so it knows where they are. There's a lot of alignment and fiddly things to consider in order to make sure you're loading the right data into the right memory the right way, but at base that's all it has to do -- put the data in some other memory.
9 More Discussions You Might Find Interesting
1. Solaris
I have Apache 2 webserver as delivered with the Solaris 10 installation.
How to verify if Apache is configured with loadable module support?
Or if needs to be recompiled with loadable module support. (2 Replies)
Discussion started by: kavera
2 Replies
2. SuSE
Hi All,
Is there a max number of slabs that can be used per kernel module? I'm having a tough time finding out that kind of information, but the array 'node_zonelists' (mmzone.h) has a size of 5. I just want to avoid buffer overruns and other bad stuff.
Cheers,
Brendan (4 Replies)
Discussion started by: Brendan Kennedy
4 Replies
3. Linux
Hi all,
I am working on USB data monitoring on Fedora Core 9. Kernel 2.6.25 has a built-in module (the one that isn't loadable, but compiles and links statically with the kernel during compilation) to snoop USB data. It is in <kernel_source_code>/drivers/usb/mon/.
I need to know if I can... (0 Replies)
Discussion started by: anitemp
0 Replies
4. Shell Programming and Scripting
I am trying to use the GD module on a on Unix Solaris environment machine by including gd.pm from a temporary location
but I am receiving the following error:
perl -w polyline.pl > imageoutput.png
Can't locate loadable object for module GD in @INC (@INC contains:... (1 Reply)
Discussion started by: wadhwa.pooja
1 Replies
5. Linux
supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" message comes.
I tried giving acpi=off to the kernel command line but same problem.It shows everything ok and no problem with memory and processors and power supplies.Wt could be the reason?
It has... (1 Reply)
Discussion started by: pankajd
1 Replies
6. Solaris
Hi gurus
Could anybody tell me which file is read by kernel to set its default system kernal parameters values in solaris. Here I am not taking about /etc/system file which is used to load kernal modules or to change any default system kernal parameter value
Is it /dev/kmem file or something... (1 Reply)
Discussion started by: girish.batra
1 Replies
7. SuSE
I just implemented the MD5 Loadable Password Algorithm on my AIX 5.3
TL 11 systems. I run NIS and authentication is working fine between
AIX boxes. I have one OpenSuse Linux box in NIS and I get a PAM
authentication error when I try to login. If you have an idea on
getting the Linux box... (2 Replies)
Discussion started by: prichard
2 Replies
8. Linux
Hi everyone,
I am trying to prevent the ehci_hcd kernel module to load at boot time.
Here's what I've tried so far:
1) Add the following line to /etc/modprobe.d/blacklist.conf (as suggested here):
2) Blacklisted the module by adding the following string to
3) Tried to blacklist the module... (0 Replies)
Discussion started by: gacanepa
0 Replies
9. Shell Programming and Scripting
I am getting this error:
Can't locate loadable object for module IO::Tty in @INC (@INC contains: /production/79p/perl5/lib/site_perl/5.28.0/x86_64-linux /production/79p/perl5/lib/site_perl/5.28.0 /production/79p/perl5/lib/5.28.0/x86_64-linux /production/79p/perl5/lib/5.28.0... (2 Replies)
Discussion started by: mrn6430
2 Replies
LEARN ABOUT SUNOS
kmem_free
kmem_alloc(9F) Kernel Functions for Drivers kmem_alloc(9F)
NAME
kmem_alloc, kmem_zalloc, kmem_free - allocate kernel memory
SYNOPSIS
#include <sys/types.h>
#include <sys/kmem.h>
void *kmem_alloc(size_t size, int flag);
void *kmem_zalloc(size_t size, int flag);
void kmem_free(void*buf, size_t size);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
size Number of bytes to allocate.
flag Determines whether caller can sleep for memory. Possible flags are KM_SLEEP to allow sleeping until memory is available,
or KM_NOSLEEP to return NULL immediately if memory is not available.
buf Pointer to allocated memory.
DESCRIPTION
kmem_alloc() allocates size bytes of kernel memory and returns a pointer to the allocated memory. The allocated memory is at least double-
word aligned, so it can hold any C data structure. No greater alignment can be assumed. flag determines whether the caller can sleep for
memory. KM_SLEEP allocations may sleep but are guaranteed to succeed. KM_NOSLEEP allocations are guaranteed not to sleep but may fail
(return NULL) if no memory is currently available. The initial contents of memory allocated using kmem_alloc() are random garbage.
kmem_zalloc() is like kmem_alloc() but returns zero-filled memory.
kmem_free() frees previously allocated kernel memory. The buffer address and size must exactly match the original allocation. Memory can-
not be returned piecemeal.
RETURN VALUES
If successful, kmem_alloc() and kmem_zalloc() return a pointer to the allocated memory. If KM_NOSLEEP is set and memory cannot be allo-
cated without sleeping, kmem_alloc() and kmem_zalloc() return NULL.
CONTEXT
kmem_alloc() and kmem_zalloc() can be called from interrupt context only if the KM_NOSLEEP flag is set. They can be called from user con-
text with any valid flag. kmem_free() can be called from user or interrupt context.
SEE ALSO
copyout(9F), freerbuf(9F), getrbuf(9F)
Writing Device Drivers
WARNINGS
Memory allocated using kmem_alloc() is not paged. Available memory is therefore limited by the total physical memory on the system. It is
also limited by the available kernel virtual address space, which is often the more restrictive constraint on large-memory configurations.
Excessive use of kernel memory is likely to affect overall system performance. Overcommitment of kernel memory will cause the system to
hang or panic.
Misuse of the kernel memory allocator, such as writing past the end of a buffer, using a buffer after freeing it, freeing a buffer twice,
or freeing a null or invalid pointer, will corrupt the kernel heap and may cause the system to corrupt data or panic.
The initial contents of memory allocated using kmem_alloc() are random garbage. This random garbage may include secure kernel data. There-
fore, uninitialized kernel memory should be handled carefully. For example, never copyout(9F) a potentially uninitialized buffer.
NOTES
kmem_alloc(0, flag) always returns NULL. kmem_free(NULL, 0) is legal.
SunOS 5.10 24 Mar 2003 kmem_alloc(9F)