mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: Linking with kernel code (Makefile)
@ 2000-12-11 23:31 Jean Fekry Rizk
  0 siblings, 0 replies; 3+ messages in thread
From: Jean Fekry Rizk @ 2000-12-11 23:31 UTC (permalink / raw)
  To: David Feuer; +Cc: linux-kernel

Thanks for your advice,

I already know one way to accomodate shared memory between a user process
and the kernel.
This is done by making a character device which allocates memory in the
kernel, then from the user appl, using the mmap function of the driver.

I was only wondering why I could not link my code with the kernel, though
they are compiled together, this means I should be able to use any
function in the kernel files as long as I succeed to define it right

So in my question X would be any application, Y would be linking my code
with the kernel and Z would be to get more control over structures

--- David Feuer <David_Feuer@brown.edu> wrote:
> At 03:12 PM 12/10/2000 -0800, you wrote:
> >Hi Kernel World,
> >I'm new to linux-kernel developement, so I would appreciate any help.
> >
> >What I want to do:
> >     create a shared memory segment between user space and kernel space
> 
> Generally, you can get the most useful help from linux-kernel if as well
> as 
> saying what you do you also say _why_.  So if you say you are developing
> an 
> application to do X, and you want to interact with the kernel in a
> certain 
> way Y because Z, then if Y is the correct way to accomplish X, people
> will 
> tell you how.  If, however, there is a better way, they will tell you
> this 
> instead.  Sorry, I don't know anything about the particular question you
> 
> posted, but if you want my own uneducated guess, I will guess that it's
> not 
> possible.
> 
> --
> This message has been brought to you by the letter alpha and the number
> pi.
> Open Source: Think locally; act globally.
> David Feuer
> David_Feuer@brown.edu
> 


__________________________________________________
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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linking with kernel code (Makefile)
@ 2000-12-12  0:34 Jean Fekry Rizk
  0 siblings, 0 replies; 3+ messages in thread
From: Jean Fekry Rizk @ 2000-12-12  0:34 UTC (permalink / raw)
  To: Albert D. Cahalan; +Cc: linux-kernel

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.


--- "Albert D. Cahalan" <acahalan@cs.uml.edu> wrote:
> > 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.
> 
> >     I can't link with the array or the function, this also happens
> with
> > all functions that are not defined in 'ksyms'
> >     Even though I declared 'newseg' and 'shm_segs' as 'extern' in my
> file
> ...
> > But while making bzImage, it gives the error unresolved external
> 'newseg'
> > 
> > So my question is how can I link to the kernel source code, or am I
> not
> > allowed to?
> 
> 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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Linking with kernel code (Makefile)
@ 2000-12-10 23:12 Jean Fekry Rizk
  0 siblings, 0 replies; 3+ messages in thread
From: Jean Fekry Rizk @ 2000-12-10 23:12 UTC (permalink / raw)
  To: linux-kernel

Hi Kernel World,
I'm new to linux-kernel developement, so I would appreciate any help.

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

How am I trying to do it from kernel:
    use the 'newseg' function from 'ipc/shm.c', or even the array shm_segs
directly.

The problem:
    I can't link with the array or the function, this also happens with
all functions that are not defined in 'ksyms'
    Even though I declared 'newseg' and 'shm_segs' as 'extern' in my file

I think my problem is in the Makefile.
I'm using linux-2.2.14
Here is the Makefile from the ipc folder
    O_TARGET:=ipc.o
    O_OBJS  :=util.o msg.o sem.o shm.o
    include  $(TOPDIR)/Rules.make
To compile my file 'mycode.c'- which uses newseg - I just added 'mycode.o'
to the O_OBJS line.
But while making bzImage, it gives the error unresolved external 'newseg'

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

__________________________________________________
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 majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-12  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-11 23:31 Linking with kernel code (Makefile) Jean Fekry Rizk
  -- strict thread matches above, loose matches on Subject: below --
2000-12-12  0:34 Jean Fekry Rizk
2000-12-10 23:12 Jean Fekry Rizk

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

all inboxes | Powered by JetHome®