Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi everyone;
I am interested in linux kernel programming it is nice but so hard until now.
I wanna implement a Linux kernel module that gives out fortune cookies.
I wanna do something like proc/mycookies to take some cookies from user
and for each run will print a random sentence.
I mean i will write some sentences to a file(fortune file) and i will load my fortune file first
$ cat cookielist.txt > /proc/mycookie...
Then
When user prompt it;it will print out a sentence randomly.
Like:
$ cat /proc/mycookie
Lucky you: Your fortune is meaningless
I know i can write a small shell program that will out a random sentence from a speicif file. I didn't talk bout it. I mean i wanna write a random sentence generator in kernel as a function of kernel. When user prompt it will out a random sentence from a specific file that loaded before.
I know i can write a small shell program that will out a random sentence from a speicif file. I didn't talk bout it. I mean i wanna write a random sentence generator in kernel as a function of kernel. When user prompt it will out a random sentence from a specific file that loaded before.
Understood?
NO!! Why do you want to do this as a kernel function? It seems that you simply need an application that puts out random sentences in response to some kind of user input. You do not need to have the kernel do this.
Er, not to speak for the person requesting assistance, but I get the feeling that this is for learning, not practical use. I can't personally answer your question, gandil, but I think I understand what you're trying to do.
I meant nothing negative or critical--I simply stated that I did not understand what OP was trying to do. Language of course could be an issue.
Watch to see if OP turns out to be a "one question hit and run". I see this a LOT on fora----someone has a question, registers, asks, and then disappears. No way to help them in the long haul.....
My value system says you stick around and try to help someone else---while of course continuing to ask your own questions. It is called "learning together"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.