LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-11-2011, 09:17 PM   #1
project168
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Rep: Reputation: 0
Lightbulb Need help on basic Linux C++ programming with simple RTAI functions outputing words


Hello fellow members,

I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.

1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".

2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.

Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");

int init_module(void)
{
printk("Hey there!\n");

return 0;
}

void cleanup_module(void)
{
printk("See you later!\n");

return;
}
 
Old 04-12-2011, 04:17 AM   #2
rocky_siva
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Rep: Reputation: 1
Actually, its pretty simple one... Create pthread and run it periodically. Kindly have a look at the following link

https://cs.uccs.edu/~chow/pub/rtl/do...odic_np.3.html
 
Old 04-12-2011, 11:12 PM   #3
project168
LQ Newbie
 
Registered: Apr 2011
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rocky_siva View Post
Actually, its pretty simple one... Create pthread and run it periodically. Kindly have a look at the following link

https://cs.uccs.edu/~chow/pub/rtl/do...odic_np.3.html
Is that for the 2nd part?
 
Old 04-17-2011, 11:37 PM   #4
rocky_siva
LQ Newbie
 
Registered: Apr 2011
Posts: 13

Rep: Reputation: 1
Yes that is for second part especially...Put delay command such as udelay or mdelay after your first print with specified time, so that it will wait for that amount of time and then execute your thread periodically...ok
 
  


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
newbie to unix programming in C, needed a few simple prgs on these functions! wrapster Programming 7 06-29-2008 01:23 AM
RTAI programming sayooj Programming 0 01-17-2007 10:55 AM
RTAI programming sayoojc Programming 9 11-02-2006 12:36 PM

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

All times are GMT -5. The time now is 08:48 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