f



communicating with user space from the kernel

I'm attempting to write a kernel module that will call a user space
function.  The user space function will return a pointer to a user
space memory location.

I'm thinking that the way to do this is with the BSD socket interface,
but I'm inexperieced with sockets.

Am I on the right track or is there an easier way to do this?
0
jheath1 (4)
10/16/2003 4:21:11 PM
comp.os.linux 3406 articles. 0 followers. Post Follow

0 Replies
263 Views

Similar Articles

[PageSpeed] 1

Reply:

Similar Artilces:

Communicating Data from User Space to Kernel Space
struct rule{ int proto; char source[15]; }instance; I have written this structure into a file in user space ,say rule.txt . Say this file contains 10 records , i. e 10 instances of the above structure.Now I would like to read the same file in kernel space by a kernel module by reading 1 record at a time. How can i do this ? Is there any other way to do this without using files ? My objective is to read the 10 records from kernel space one record at a time and not the individual bytes. amit wrote: > > Is there any other way to do this without...

Synchronizing user space threads with kernel space in linux
I want to synchronize a user space thread to an external event that generates an interrupt. I thought of using the following approach: the ISR that treats the interrupt does a quick processing (such as data capture and buffering) and then sends data to the user space thread through a message queue or signals to the thread waiting on a semaphore and it gets the buffered data from shared memory or some similar mechanism. So far I haven't succeded in finding a way to do it. I've tryed to write a module which uses semaphores (<linux/sem.h>) but aparently there is no way to use SysV I...

Kernel Space to User Space Communication in 2.6
To pass data from kernel space to user space we can use netlink sockets. Is there a better or efficient mechanism than netlink in 2.6?? Please advice. Thanks /R -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ramesh wrote: > To pass data from kernel space to user space we can use netlink > sockets. Is there a better or efficient mechanism than netlink in > 2.6?? Please advice. As far as I'm concerned, the best way to pass data from kernelspace to userspace is through the use of the userspace read(2) syscall. - -- Lew Pitcher Master Codewright & JOAT-in-...

sock_register only available in kernel space or also in user space ? If only kernel space is there something equivalent ?
Hello, is sock_register only available in kernel space or can it be also used in user space to register a new socket ? If only kernel space, is there a equivalent function for doing this ? Or some kind of wrapper, so a user mode application can register a new socket via kernel ? Regards, Martin "Maurer Martin (CN MUC)" wrote: > > Hello, > > is sock_register only available in kernel space or can it be also used in > user space It can be used only in kernel mode. > to register a new socket ? That is not what it does accordin...

Kernel to user space communication
Hi, Is anyone aware of any performance measurements for kernel to user space data access? The techniques i can think of are netlink sockets, mmap to a dev and ioctl. But i could not find any pointers on which one to use. Regards. victor <ramkumar2579@gmail.com> writes: > Is anyone aware of any performance measurements for kernel to user > space data access? The techniques i can think of are netlink > sockets, mmap to a dev and ioctl. But i could not find any pointers > on which one to use. System call arguments and socket options would be two additiona...

linux kernel user space
I am developing a kernel module, and as to prevent a page fault from occuring when accessing data from user space, I need to copy it to kernel space. Or so I thought. Until I was told that the linux kernel is in user space, so doing that is unneeded and all that I need to do is just use access_ok() on the address before using the data to which the pointer points to. Is this correct? If not, how should I handle user space addresses? Also, I have heard that the syscall table can no longer be modified in 2.5? What is the validity of that? -- nethlek Mantorok Redgormor wrote: &g...

sending user defined signals from kernel space to user space
Hi all The linux version we are using is 2.4.We have requirement of running a state machine in kernel space .There are four states in the state machine namely. STATE_1,STATE_2, STATE_3 and STATE_4. We have requirement of sending four asynchronous notifications from kernel space to user space for each state change in the state machine. I am able to send two signals namely SIGUSR1 and SIGUSR2 from kernel space to user space for states STATE_1 and STATE_2 respectively. Can any one help me how can I send two more user defined signals from kernel space to user space for STATE_3 and STA...

sending user defined signals from kernel space to user space
Hi all The linux version we are using is 2.4.We have requirement of running a state machine in kernel space .There are four states in the state machine namely. STATE_1,STATE_2, STATE_3 and STATE_4. We have requirement of sending four asynchronous notifications from kernel space to user space for each state change in the state machine. I am able to send two signals namely SIGUSR1 and SIGUSR2 from kernel space to user space for states STATE_1 and STATE_2 respectively. Can any one help me how can I send two more user defined signals from kernel space to user space for STATE_3 and STA...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the o...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other kernel) will be virtual. This seems rather asinine, so I hardly believe this is how it works. It was also proposed to me that the system only considers how much it - will- give to either user or kernel space. Meaning that at boot up, if a system only uses 2 MBs of Kernel space, only 2 MBs gets mapped from the the total available memory for Kernel space (as there's a cap). Also meaning that those first 2 MBs would be allocated to physical memory. Then as more would be requested more would be allocated for either user or kernel space, straight from physical memory, till it ran out. This sounds like a more solid schema, but at the same time it seems silly to do things on a first come, first serve basis. It seems more reasonable that it would partition each application such that each has some physical memory to work in, and then to use a memory map for anything additional to di...

How does Linux partition logical address space as far as User/Kernel space is concerned, especially when it comes to deciding what gets mapped to virtual versus physical RAM?
The norm for a memory allocation scheme is to use physical memory before dumping the overflow to disk. However with Linux it's unique in that there's a set limit for user and kernel space (aka monolithic kernel). Which leads me to believe that the logical address space is set aside ahead of time. Meaning that if a person has 2GBs of physical RAM and chooses option 3GBs/1GBS of user/kernel space, that either 1GB of kernel space and 1GB of user space will be allocated to physical RAM; OR, 2 GBs of user space will go to physical RAM while the remaining 2 GBs (1 user, the other ker...

Does pthreads in Linux create user or kernel space threads?
Does pthreads in Linux create user or kernel space threads? There seems to be many pthreads implementations. How do I know which is the one installed on my linux box? Thanks Diwa On Oct 14, 5:45=A0am, Diwa <shettydiwa...@gmail.com> wrote: > Does pthreads in Linux create user or kernel space threads? As that term is normally understood, on typical modern UNIX systems, pthreads are kernel threads. That may or may not mean what you think it means. > There seems to be many pthreads implementations. > How do I know which is the one installed on my linux box? You could read the documentation that came with it or ask your vendor. On Linux, you may find getconf(_CS_GNU_LIBPTHREAD_VERSION) to be useful inside a program. From a shell prompt, try "getconf GNU_LIBPTHREAD_VERSION". DS On Oct 14, 8:52=A0am, David Schwartz <dav...@webmaster.com> wrote: > On Oct 14, 5:45=A0am, Diwa <shettydiwa...@gmail.com> wrote: > > > There seems to be many pthreads implementations. > > How do I know which is the one installed on my linux box? > > You could read the documentation that came with it or ask your vendor. > On Linux, you may find getconf(_CS_GNU_LIBPTHREAD_VERSION) to be > useful inside a program. From a shell prompt, try "getconf > GNU_LIBPTHREAD_VERSION". > Thanks David. On my 32 bit box, using getconf in shell gave me NPTL 0.60 On my 64 bit box, I got NPTL 2.4 ...

user space vs Kernel space
when user program is running its in user space when it does system call its in kernel space. so user program in kernel space means kernel is running on behalf of user process. does user space means user mode and kernel space means kernel mode does these spaces have anything to do with virtual address space of process Milind Dumbare wrote: > > when user program is running its in user space when it does system > call its in kernel space. so user program in kernel space means kernel > is running on behalf of user process. > > does user space means user mod...

Writing to kernel space from user space ?
hi all, found a way to write to kernel space by using the call copy_from_user () but need to know the pointer to the kernel space add i need to write to . I need to write to the task_struct , is there someway to get the pointer to the task_struct in user space ? vivekian "vivekian" <viveklinux@gmail.com> writes: > hi all, > > found a way to write to kernel space by using the call copy_from_user > () but need to know the pointer to the kernel space add i need to write copy_from_user and friends are for use in kernel code only. > to . I ne...

Kernel space to User space calling
I have a kernel module and a user space application. My kernel modules wants to notify some event occurrence in kernel space to user space. Is this possible using function pointer, it is called from kernel space with argument and function definition should be in user space application. Is this possible to call a function from kernel to user space? or any other method is available to notify my user space application. Thanks... Pandi <pandiwelcomes@gmail.com> wrote: > I have a kernel module and a user space application. My kernel modules > wants to notify some event occu...

pls DISREGARD previous post -- "communicating with user space from the kernel"
please disregard my previous post. Sorry for cluttering the list. Jeff Heath wrote: > please disregard my previous post. Sorry for cluttering the list. .... dont "disregard" using a new thread, do it in the orig .. -- /// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\ \\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" /// No man is an island, but some of us are long peninsulas. Jeff Heath enlightened us with: > please disregard my previous post. Sorry for cluttering the list. That's why they invented cancelling a post. It doesn't always work, though, so the best thing is to post a reply to your own post (so don't create another thread) and then cancel both posts. Servers that accept the cancel messages won't display your posts at all, and servers that don't accept cancel messages will display your apology ;-) Sybren -- The problem with the world is stupidity. Not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself? ...

reading a file which is in user space from kernel space
HI, Can we read a file which is in user space from kernel space. Idea is : This file is a configuration file which contains info which is needed by the file system. so while mounting i want to read this file and keep it in memory. Regards Gururaja On May 7, 9:31=A0am, guru <guru.nav...@gmail.com> wrote: > HI, > > Can we read a file which is in user space from kernel space. > Idea is : This file is a configuration file which contains info which > is needed by the file system. so while mounting i want to read this > file and keep it in memory. > >...

How the data from user space is passing to kernel space?
Hello guys! Just want to ask, if the data sent to network sockets is sent to TCPIP protocol driver via WriteFile() or there is another undocumented mechanism? I am talking about passing data (here: network packet) between user-mode and kernel-mode boundary: only ReadFile/WriteFile/DeviceIoControl or something else (maybe unofficial)? And more: If I have non-WDM driver. When user app calles ReadFile/WriteFile/DeviceIoControl on it, is it provided, that driver gets according IRPs on the same thread? Actually I am writing a NDIS protocol driver. BTW, Is it a WDM driver? Anyway, ca...

Moving an application from User Space to Kernel Space
Hi, I would like to move an application that is currently running in User Space to Kernel Space. Need your ideas regarding it. Regards, Karthik Balaguru > I would like to move an application that is currently running in User > Space to Kernel Space. > Need your ideas regarding it. > 1) The Kernel API from Kernel space is completely different from that used by user space. So no chance without rewriting the application. 2) Why would somebody want to do this ? What are you trying to accomplish. Kernel space applications ("modules", "drivers&qu...

Sharing 4MB of kernel Space in user space
Hi, I want to share 4MB of kernel space in user space. The 4MB of memory is allocated using vmalloc and will span across minimum of 1024 pages. Which is the best way to do so. Are there examples to share multiple pages in kernel space to user space. Can any one share some example. The entire application will need around 1095 pages to be shared with user space i.e 1095 pages to be locked (non swappable). Will this cause any impact on the system. Regards MK On Tue, 25 Jul 2006 22:01:04 -0700, MK wrote: > I want to share 4MB of kernel space in user space. The 4MB of ...

Sharing memory between kernel space and user space
All, I want a ability to share memory between kernel and user space. What is the mechanism available in the 2.4 kernel? What synchronization mechanism can I use for accessing the memory from user space and kernel space? Shobha Shobha wrote: > All, > > I want a ability to share memory between kernel and user space. What is > the mechanism available in the 2.4 kernel? > > What synchronization mechanism can I use for accessing the memory from > user space and kernel space? > > Shobha A simple (and tipical) way may be by implementing a cha...

program execution in user space and in kernel space.
HI All, I want to know, what do mean by program execution in user space and program execution in kernel space. What I know is, when program invokes calls any system call, it starts executing in kernel space. But what about in user space? What makes these execution differ? Thanks Gururaja BO On Sep 16, 5:30=A0pm, guru <guru.nav...@gmail.com> wrote: > HI All, > > I want to know, what do mean by program execution in user space and > program execution in kernel space. > > What I know is, when program invokes calls any system call, it starts > execut...

Virtual memory
Hi, I m having some questions in Linux memory management. I m considering about 32 bit machine only. If you have a 512 MB of memory, how it is divided between kernel space and user space? What is the link between this division and 3GB userspace and 1 GB kernel space division. Is the 3G/1G division is for virtual memory? Is the total Virtual memory can be 4G only? I mean is it the maximum? Thanks in advance. regards SaranJothy SaranJothy wrote: > Hi, > I m having some questions in Linux memory management. > I m considering about 32 bit machine only. > If you...

How to call user space function from kernel space
Hi, There is call back function in user space. This needs to be called from kernel space. Can we pass the address of these user space function to kernel space driver to call this function? If yes that machanism should be used? If no, what are other options we have? thanks in advance for your help, Karnan ...

Web resources about - communicating with user space from the kernel - comp.os.linux

Communicating sequential processes - Wikipedia, the free encyclopedia
The theory of CSP itself is also still the subject of active research, including work to increase its range of practical applicability (e.g., ...

Tuenti: Another way of communicating on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about Tuenti: Another way of communicating. Download Tuenti: Another ...

Official Xperia™ Ear video at MWC 2016. Discover a new way of communicating from Sony - YouTube
Discover more at www.sonymobile.com/xperia-ear Explore the world of Xperia at http://www.sonymobile.com/xperia Introducing the official preview ...

Julie Bishop's secret sign language: who was the Foreign Minister communicating with ahead of Xi Jinping's ...
It looked like Foreign Minister Julie Bishop had kicked off a game of charades&#160;in the House of Representatives chamber to pass the time ...

Aggrieved Indonesia says Australia not communicating on border protection and asylum seeker issues
Indonesia has again criticised Australia over a lack of communication on border and refugee issues and taken a swipe at the continuation of offshore ...

Smart governments realise they must find new ways of communicating
The government is unable to get its message across and its frustration is growing.

Four ways of communicating that are killing your relationship
While the lines might be well and truly open, it turns out that it&#8217;s not just what you say, but how you say it that matters.

China communicating with India on cross-border river issue: spokeswoman
China communicating with India on cross-border river issue: spokeswoman People's Daily Online BEIJING, Feb. 4 ( People's Daily Online) A Foreign ...

Reuters: Tim Cook and Google’s Larry Page are communicating on patents
Apple CEO Tim Cook and Google CEO Larry Page are reportedly in talks regarding mobile patent disputes between the companies. According to Reuters, ...

Why Are The Lawyers Pestering Us? Communicating About Law And Compliance
Write and speak comprehensibly as a lawyer, and more people will listen to your message.

Resources last updated: 3/8/2016 2:07:49 AM