LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 09-28-2007, 07:57 AM   #1
sedition
LQ Newbie
 
Registered: May 2007
Distribution: Various
Posts: 6

Rep: Reputation: 0
Physical RAM Usage Indicator


Hi all,

I've built a device that will indicate through 10 LEDS the amount of RAM remaining on a system via the USB port(think, an external desktop applet). They illuminate corresponding to a number that is a percentage from a shell script that loops cat /proc/meminfo, does the math, and spits it out via > /dev/ttyUSB0. The problem that I've run into is, when testing, I open tons of apps to eat away the RAM and change the indicators, but there are severe delays or even complete pauses until the system finishes opening the programs before changing the indicators. Is there a better or more efficient way to send the data to USB? The batch file is just being run via terminal in Gnome right now and I had planned on running it in the background on login, but until I get the delays worked out, I don't see much use.
 
Old 09-28-2007, 08:59 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,129

Rep: Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986
Kernel module would probably be the best bet, else you're just going to have to wait until it's your turn. Why not start it in the init scripts (rc.local or similar) ???.
 
Old 09-28-2007, 09:55 AM   #3
sedition
LQ Newbie
 
Registered: May 2007
Distribution: Various
Posts: 6

Original Poster
Rep: Reputation: 0
I've been running it in the terminal just for testing. Can running it via init script cause it to run at different priority/more smoothly? Also, though I can easily Google, do you have any recommendations for learning to write kernel module programs? Thanks for the response, it's greatly appreciated. I was afraid that this may be a bit too esoteric for the forums.
 
Old 09-28-2007, 10:15 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,129

Rep: Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986Reputation: 986
"The Linux Kernel Module Programming Guide" at tldp.org is very good; recently updated too.
Also Linux Device Drivers (vol 3) - by the guy that runs lwn.net and a couple of mates. Heard Jonathan Corbet talk at a conference on the sysfs implementation - very good. I have the book in hardcopy, but the authors have it for free download as well - see here.

As for my init script suggestion, that was just to ensure it was running early (prior to X) - will still be subject to pre-emption. A limitation of running as a script.
 
Old 09-28-2007, 10:38 AM   #5
sedition
LQ Newbie
 
Registered: May 2007
Distribution: Various
Posts: 6

Original Poster
Rep: Reputation: 0
Outstanding. Thanks for the info, looks like I'll have a project this weekend!
 
  


Reply

Tags
electronics, interface, led, ram, usb


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Determine Physical RAM size skistner Linux - Hardware 18 02-22-2010 12:57 PM
Too Much of RAM Usage !! asneed_jas Linux - Newbie 4 05-12-2007 05:28 AM
Size of physical RAM bkankur Linux - General 3 07-21-2006 05:27 AM
RAM usage Serena Linux - General 1 08-12-2003 10:50 PM
Physical memory usage piglingz Linux - Hardware 3 04-06-2003 09:07 PM


All times are GMT -5. The time now is 12:18 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration