Kernel way of mind (kmalloc trouble) kernel 2.2.18 mandrake 7.2 x86 arch

Eric Pennamen (Pennamen@nsi.fr)
Wed, 28 Mar 2001 09:24:17 +0200


Explication:
i am a newbie in kernel prog. and i try to write a module for an can-bus
pci card
but the problem begin.
In the module i want to create the /dev/ file with mknod function.
The function was not exported by the kernel, so i found in the _syscall
table adress for
call sys_mknod but the function test if the parameter is on user memory
space or not
and if it is in kernel space the function fail (return -EFAULT)
I try to allocate user-sapce memory whih
void* ptr;
ptr=kmalloc (size,GFP_USER);

but kmalloc return an kernel-space memory adress and mknod don't work (i
think this cause sys_mknod return -EFAULT again).
I try to compare the returned adress by kmalloc with printk and adress i
same with GFP_USER or GFP_KERNEL
(always betwen C0000000 and FFFFFFFF)

Question:
What's wrong with my kmalloc usage ?
Does it exist another way to create the /dev/ file inside my driver ?
Why kernel module can't simply do a mknod ?
Why kmalloc don't give me the specified memory ? (i try kmalloc
(size,GFP_KERNEL) and ptr
is pointing at the same adress than when i used GFP_USER)

Thank to all

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/