Results 1 to 6 of 6
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 12-31-2005 #1Just Joined!
- Join Date
- Dec 2005
- Posts
- 6
Random Sentence Generator?
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
is there any idea? Where should i start?
- 01-01-2006 #2
Any particular reason why you'd want to implement this in the kernel?
- 01-01-2006 #3
Is that like the thing in slackware, when you log in it gives you a random quote thingy?
- 01-01-2006 #4
first I'd recoment stop using colored text for all of the post
(pun intended)
I'd start looking in the Documents folder in the linux kernel source tree, and then (unless there's some documentation that says other wise) I'd look for files and folders with names like proc, proc.c, proc.h, etc in the source tree and then look them throuhg and see if they say how to extend the "proc fs" (iirc /proc is a pseudo fs, you might find it along with the other file systems sources), and it might actyally resid inside the sys-fs code (not sure but I'd guess /sys is expected to deprecate /proc at some point, my guess would be in 2.8 or 3.0).
And if that fails I'd check lkml ( lkml.org - linux kernel magazine ) and/or kerneltap ( kerneltap.org ) and naturally google
also I think you can save a lot of coding using code from fortune (I think it's GPL or BSD licensed, but if you plan only to play around and not release the code the license is irrelevant - I'm no lawyer, so don't take my words for law
), just put propper cretid where due, and use the same license and I think it should be alright (yet again, I'm no lawyer and really don't like licenses, but this world we live in require them to keep things open... :/ ).
HTHRegards Scienitca (registered user #335819 - http://counter.li.org )
--
A master is nothing more than a student who knows something of which he can teach to other students.
- 01-02-2006 #5
Once again, I don't see why you'd implement this in kernel space? If you could enlighten me, just for shits and giggles?
- 01-04-2008 #6Just Joined!
- Join Date
- Dec 2005
- Posts
- 6
this was a bad idea. i did but not useful. if any one wants i can send code.


Reply With Quote
