which function copies data from user to kernel mode


 
Thread Tools Search this Thread
Top Forums Programming which function copies data from user to kernel mode
# 1  
Old 06-22-2010
which function copies data from user to kernel mode

when transitionaning from user to kernel mode which function copies data from user mode buffer to kernel mode?
# 2  
Old 06-22-2010
user space is visible and writable from kernel mode operations.

example
Code:
rc=read(fd, buf, 32);

read -or the syscall behind it - accesses kernel data and writes it directly into buf. buf is a user space variable.

So - I'm not sure what you are really asking about.
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 06-22-2010
thanks jim for the reply.
when a write request is issued from an application in user mode then while transitioning from user to kernel mode after the software interrupt is generated the buffer data is copied from user to kernel mode
actually I want which function does this copying
# 4  
Old 06-22-2010
The relevant kernel functions are copy_from_user and copy_to_user.
# 5  
Old 06-22-2010
On Solaris 10:
Code:
#define COPY_FROM_USER(target, source, offs, count) \
        if (uiomove((target), count, UIO_WRITE, source)) { \
                cmn_err(CE_WARN, "Bad copyin()!\n"); \
        }

#define COPY_TO_USER(target, offs, source, count) \
        if (uiomove((source), count, UIO_READ, target)) { \
                cmn_err(CE_WARN, "Bad copyout()!\n"); \
        }

# 6  
Old 06-25-2010
solution

coronna is correct
The following link replies my question and clears it all:
Kernel command using Linux system calls

Read the "Reading and writing user memory" in the above link.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Precaution to access user mode buffers from kernel

When accessing a user mode buffers from kernel space drivers what precautions must we take and how those precautions need to be implemented? (0 Replies)
Discussion started by: rupeshkp728
0 Replies

2. UNIX for Dummies Questions & Answers

Kernel Stack vs User Mode Stack

Hi, I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by... (4 Replies)
Discussion started by: saurabhkoar
4 Replies

3. Programming

HELP!!: CPU resource allocation between kernel modules and user mode process

Hi,all: I run my program which consists of one kernel module and one user mode process on a dual core server. The problem here is the kernel module consumes 100% of one core while the user mode process only consumes 10% of the other core, is there any solution that I can assign some computing... (1 Reply)
Discussion started by: neyshule
1 Replies

4. Programming

Execute code in kernel mode.

Hi everyone. I would like to hook a system function (gettimeofday) to modify it. I guess I'll need kernel mode to do that. By the way, how could I do it (c++ or c)? I want to modify that function for one process which I know the PID. So I need to return my own value for that PID and real value... (29 Replies)
Discussion started by: lilezek
29 Replies

5. SCO

PANIC: k_trap - Kernel mode trap type 0x0000000E

Hi, i'm another question: I'm a directory /usr/data on my server sco unix 5.0.5: # du /usr/data 4386948 /usr/data I'm tried to connect to ftp directory /usr/data to this server and: PANIC: k_trap - Kernel mode trap type 0x0000000E Cannot dump 262040 pages to dumpdev hd(1/41):space... (3 Replies)
Discussion started by: sebpes
3 Replies

6. Shell Programming and Scripting

MODE function in awk

Hello, Can someone pls help me with some statistical calculation in awk In excel there is a statistical function called "Mode". How Mode works: MODE returns the most frequently occurring, or repetitive, value in array or range. Eg if we have 5 numbers in 5 different columns... (12 Replies)
Discussion started by: Needhelp2
12 Replies

7. UNIX for Dummies Questions & Answers

Kernel Mode

Hi all i have queastion. Can anybody pease help me what is user mode and kernel mode and the term "De-mountable volumes" means? Thanks Palash (2 Replies)
Discussion started by: palash2k
2 Replies

8. Programming

Aplication user and kernel mode (data access)

Hi all, I am trying to setup a program to use a device driver and am confusing buffer access between User and Kernel mode. I think all applications running in User space have to communicate with the device drivers using io control calls and then have some functions called back from the driver... (1 Reply)
Discussion started by: Brendan Kennedy
1 Replies

9. SCO

unexpected trap in kernel mode

hi, I am trying to install sco openserver 5.0.4 on an old system. However, l was not able to proceed after putting the bootstr l have this panic message of PANIC: K_trap - kernel mode trap tupe 0x00000006 will someone kindly help to decode this error kayode (1 Reply)
Discussion started by: kayode
1 Replies

10. Filesystems, Disks and Memory

k_trap - kernel mode trap type 0x0000000E

HELP is urgently required, I run on SCO Unix 3 and this is the panic message that I get every time that I reboot 10U k_trap - kernel mode trap type 0x0000000E I have checked the swap already having the following results: #swap -l path dev swaplo blocks free... (3 Replies)
Discussion started by: alex_slb
3 Replies
Login or Register to Ask a Question