05-27-2007
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 app.
In this model, I guess the User app passes buffer pointer values to the driver
using the ioctl calls. Is that what happens? For example, I have a session
context struct created by the user app using malloc. Would that data have to
be copied to the driver for it to be used, or could I just pass a pointer to
the struct?
Is using ioctl calls the only way to 'switch to kernel mode'??
Also, am I right in saying the process running on the device driver is
separate from the one running in the application? how does that work in
relation to a threaded application? must a new thread be created with each
function call back?
You can probably tell I am very confused here, so any help is greatly
apreciated!
Regards,
Brendan
10 More Discussions You Might Find Interesting
1. SCO
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
2. HP-UX
Hi,
Please any one can help me to know that how we can restrict a user group to access the kernel at all. (0 Replies)
Discussion started by: harishankar
0 Replies
3. UNIX for Dummies Questions & Answers
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
4. UNIX for Advanced & Expert Users
Can kernel process access user address space ? (2 Replies)
Discussion started by: subhotech
2 Replies
5. UNIX for Dummies Questions & Answers
hi all,
i want to know y kernel is giving access for multiple users to access a file when one user may be the owner is executing that file. Because other user can manipulate that file when the other user is executing that file, it will give the unexpected result to owner . plz help me... (1 Reply)
Discussion started by: jimmyuk
1 Replies
6. Programming
when transitionaning from user to kernel mode which function copies data from user mode buffer to kernel mode? (5 Replies)
Discussion started by: rupeshkp728
5 Replies
7. Programming
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
8. Programming
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
9. UNIX for Dummies Questions & Answers
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
10. UNIX for Advanced & Expert Users
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
XPT(4) BSD Kernel Interfaces Manual XPT(4)
NAME
xpt -- CAM transport layer interface
SYNOPSIS
None.
DESCRIPTION
The xpt driver provides a way for userland applications to issue certain CAM CCBs to the kernel.
Since the xpt driver allows direct access to the CAM subsystem, system administrators should exercise caution when granting access to this
driver. If used improperly, this driver can allow userland applications to crash a machine or cause data loss.
KERNEL CONFIGURATION
There is no kernel configuration required for the xpt driver. It is enabled when SCSI support is enabled in the kernel. There is one
instance of the xpt driver per CAM transport layer instance. Since there is currently only one CAM transport layer, there will only be one
instance of this driver.
IOCTLS
CAMIOCOMMAND This ioctl takes certain kinds of CAM CCBs and passes them through to the CAM transport layer for action. Only the following
CCB types are supported:
XPT_SCAN_BUS
XPT_RESET_BUS
XPT_SCAN_LUN
XPT_ENG_INQ
XPT_ENG_EXEC
XPT_DEBUG
XPT_DEV_MATCH
XPT_PATH_INQ
The above CCBs are the only ones supported since it makes more sense to send them through a generic passthrough device rather
than a passthrough device tied to a particular underlying SCSI device.
CAMGETPASSTHRU This ioctl takes an XPT_GDEVLIST CCB, and returns the passthrough device corresponding to the device in question.
FILES
/dev/xpt0 Character device node for the xpt driver.
DIAGNOSTICS
None.
SEE ALSO
cam(3), cam_cdbparse(3), pass(4), camcontrol(8)
HISTORY
The CAM transport layer driver first appeared in FreeBSD 3.0.
AUTHORS
Kenneth Merry <ken@FreeBSD.org>
BSD
October 10, 1998 BSD