> Is it possible for user code to change to kernel mode and back? Or is
> that something that only VMS can do? :)
>
> I want to write a simple device driver that doesn't require IRQs or DMAs,
> and I'd rather not do the dirty part as a kernel module. Certain I/O
> operations need to be atomic to avoid races with other code tweaking the
> same hardware. I understand (possibly incorrectly) that it isn't safe
> (or possible) to disable IRQs in userland...
>
> What's the best approach?
>
> Thanks in advance,
>
> Jeff
Any time the OS is 'called', a trap to kernel mode occurs. For
experimental purposes, just add another function code on top
of the existing ones and write a procedure to do what you want.
If user-space data is involved, use some function like a file read/write
as a template so you can see how to access user-mode data.
I wrote a simple thing to read/write/convert a ADC board using this
technique since it didn't need any ISRs, etc.
VMS CHMKNL uses a pointer to the function to be executed in kernel
mode and returns a longword status. You could certainly emulate this,
but I don't think the complexity is worth it.
Cheers,
Dick Johnson
***** FILE SYSTEM MODIFIED *****
Penguin : Linux version 2.1.101 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu