LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-20-2004, 04:26 AM   #1
floflette
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Rep: Reputation: 0
Question Keyboard scanning in linux kernel space


Hi!

I'm a little newbie in the linux kernel programming world...

I have to develop a kernel module interacting with the user: to do so, it has to scan from the keyboard...
I know that I can't use the 'fscanf' function, and I saw in 'linux/kernel.h' that I can use 'vsscanf' and 'sscanf' functions... but I don't know how...

Does anybody know about this???

Thanks!
 
Old 07-20-2004, 08:09 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
It's not just that easy to make the kernel read from the keyboard. The kernel doesn't have a "stdin", and it cannot use libc functions, and the kernel does not have a scanf(). The sscanf() and vsscanf() provided in the kernel can only read from strings, just like the libc-implementations of those functions.

Also having a kernel take data from the keyboard would create a security hole. Or is that exactly what you're trying to make?
 
Old 07-20-2004, 09:45 AM   #3
floflette
LQ Newbie
 
Registered: Jul 2004
Posts: 5

Original Poster
Rep: Reputation: 0
Red face

Of course not, my aim is not to create a security hole in my system...................
I just want to develop a test module for a driver module i made... I would like this test module to interact with the user, by the way of a menu in which the user could choose which item to test....

It seems to be much complicated, and, in addition, not secure... So maybe it would be better to use only module parameters, and to make something not very user-friendly....

Thank you anyway.....
 
Old 07-20-2004, 12:43 PM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
if you want, u can do anything, but i'd use module params instead. however, if u must, here is one way to make sys calls in kernel space: http://www.linux.it/kerneldocs/ksys/ksys.html
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
notify user space application from the kernel space lordofring Linux - Software 2 06-22-2009 12:32 PM
VMWare Linux Kernel address space mis-match madiyaan Linux - Newbie 4 06-19-2006 09:03 PM
Kernel not scanning ISA PNP devices Woodsman Slackware 5 11-23-2005 10:18 PM
How much space does the Linux kernel take up? Thaidog Linux - General 3 09-06-2004 01:48 AM
Keyboard scanning in linux kernel space floflette Linux - Newbie 3 07-20-2004 09:38 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration