Skip to contentSkip to conversation

Linking with kernel code (Makefile)

DISCUSSION Jean Fekry Rizk 1 participant 1 message Dec 12, 2000

lore
Share & tools
lore
#0 lore raw

The character device is a good idea!!!
But how would the device's mmap be implemented?
I know how the read and write work, but they copy the data from one space to another, which would be slow if there is much communication. Because this looses the benifits of shared memory

About the kernel linking, I'm not making a module driver, I'm trying to recompile the kernel after adding my file (kshared.c) I guess I should be able to access all structures and functions in the kernel, if I succeed to link correctly with the files containing those functions and structures, but I'm not so good at make files.

Quoted 20 lines · --- "Albert D. Cahalan
Quoted 2 lines

What I want to do:
create a shared memory segment between user space and kernel space

Create a character device.
Have the driver allocate memory.
Let the user mmap() it.

Quoted 1 line

I can't link with the array or the function, this also happens

with

Quoted 2 lines

all functions that are not defined in 'ksyms'
Even though I declared 'newseg' and 'shm_segs' as 'extern' in my

file
...

Quoted 1 line

But while making bzImage, it gives the error unresolved external

'newseg'

Quoted 2 lines

So my question is how can I link to the kernel source code, or am I

not

Quoted 1 line

allowed to?

Quoted 8 lines

You are not allowed to use interfaces that are not exported. This is partly to prevent you from depending on code that is very likely to change, and partly to prevent a Microsoft Linux or similar abuse of the GPL.

If you really need it, make a non-module driver. Maybe after that gets accepted into the main kernel you could convince Linus to export the function you want for module use.

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/