just wondering this while driving my car today ...
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
just wondering this while driving my car today ...
Hi. Im new (sorta) 5months or so ) to linux and begining C programming (8 months on/off) and wanna learn bash and python and eventually assembly.
Anyways I was driving today listening to the Deftones (which I burned on linux using mkisofs and cdrecord ) (no front-ends for me) ( <--- none of this has anything to do with my question by the way) and a question came to my mind about programming. > Is it possible to have a program sit on a HDD and
auto-execute after a certain amount of time (say a month or so) or would it have to be running for the clock to do the counting (for the month or whatever) ? I mean without the help of any other programs. I think the answer would be NO. Just wanted to know what any experienced programmers new.
Well cron is an application. It just checks if it has any scheduled events and executes them at the appropriate time. So making it a cron job will be running it with the help of another application.
There has to be something that triggers the execution of an application. Since the kernel doesn't do this it's up to other applications to do this. Most people use cron (or a cron like program) to execute applications at a scheduled time.
ld.conf.so looks good.
Are you sure that /usr/src/linux is the directory with the right version of kernel? The one your module is for?
Module for 2.2.x kernel won't work with 2.4.x kernel....
You're right - the answer is no. Something has to be running, keeping track of time - either the app your want to start percolating, or cron (or something like it). Cron already works, so...
You could have your app run, keeping track of time until some fateful moment, but it's likely it would consume considerably more resources than cron would to do the same thing.
Incidentally, there are a number of calendar programs you can have start at boot that will pop reminders for you, if that's where you're going with this.
Originally posted by Mara ld.conf.so looks good.
Are you sure that /usr/src/linux is the directory with the right version of kernel? The one your module is for?
Module for 2.2.x kernel won't work with 2.4.x kernel....
yeah /usr/src/linux is 2.4.18 (I should know I've built it enough ). The module isn't for any specific kernel. This is what I found in this book thus this is what I've tried :
sh-2.05a$ make
gcc -o first.o first.c -D__KERNEL__ -I/usr/src/linux/include \
-DMODULE -Wall -O2
/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x18): undefined reference to `main'
/tmp/cca6ySeP.o: In function `init_module':
/tmp/cca6ySeP.o(.text+0xf): undefined reference to `printk_R1b7d4074'
/tmp/cca6ySeP.o: In function `cleanup_module':
/tmp/cca6ySeP.o(.text+0x27): undefined reference to `printk_R1b7d4074'
collect2: ld returned 1 exit status
make: *** [first.o] Error 1
Try this:
gcc -Wall -DMODULE -D__KERNEL__ -DLINUX -O2 -I/usr/src/linux/include -c first.c
I compiled it on my machine this way (kernel 2.2.20), but should work also for you.
Ah so! Your patience and help is much appreciated, Mara. It worked. The only difference I see here is that you defined LINUX (-DLINUX). What's that about? Anyways, thanks greatly for your help - hopefully someday I'll make a driver you'll want/need and then you'll be glad you helped me so long back . You rock.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.