Programming :: Wrote A Driver That Scans On Startup Dynamically For Available EEPROM's On A Certain IC Bus?
Jul 28, 2011
I wrote a driver that scans on startup dynamically for available EEPROM's on a certain IC bus. For each EEPROM a new character device is created in /dev like:
/dev/bus0eepromA0
/dev/bus0eepromA1
/dev/bus0eepromA2 ...
[code]....
View 1 Replies
ADVERTISEMENT
Apr 19, 2010
I'm looking for any snippet to manage MAC address via C code in Linux. I tried to write some code to change eth0 mac address writing it in smc911xx eeprom. What I did is the following..
#... some includes...
...
int skfd;
struct ifreq ifr;
[code]....
View 1 Replies
View Related
Jul 8, 2010
anybody found or wrote driver for Konica 7130 best 64bit
View 2 Replies
View Related
Aug 27, 2010
I wrote a test app that scans for plugins in a directory, calls their getWidget() method (implemented in my interface), and adds that widget to a layout.
The problem is that when I added a QTimer to my plugin class, it didn't work! Why?
And will it be easier to write the thing in Python and not use QPlugin? I just want to define a QWidget and have it added to the app.
View 8 Replies
View Related
Apr 15, 2010
I'm a starter here in linux, I have written a driver code and in that, I register my character devices by passing 0 for the major number.
To set up I used to use mknod command from terminal to create node,
Is there any method to create node dynamically from driver code during initialization and delete them at cleanup time?
View 1 Replies
View Related
Sep 3, 2010
I suspect this will be beyond my abilities but thought I'd give it a try. A few months ago I wrote code for an application called nagios which would send me tweets when a system within my network ran into a problem (code below):
Code:
define command {
command_name notify-host-twitter
[code]....
View 7 Replies
View Related
Oct 22, 2010
This post isn't really asking for a tutorial, but rather asking for some ideas. I've come up with a few ideas, but they seem cumbersome and unnecessary, so I was wondering if someone with more experience than me could out. Also, my explanations suck, but I'll try to do my best. So say I have an executable called X. At some point during its execution, X loads and uses (using dlopen and dlsym) a library called Y. In Y, there a bunch of functions that call the function called, for example, void *special_malloc (size_t). These functions come from another linked library (linked during compilation) called Z. Problem is, special_malloc contains some static variables within its scope, and when those variables are reset midway through a program, an invalid free occurs (special_malloc uses garbage collection). Now, what I want to happen is that whenever lib Z calls special_malloc, it instead calls the special_malloc defined in the executable X, so that these static variables are retained. Keep in mind that I have control of the Z library, meaning I can edit the source to fit my needs.
View 2 Replies
View Related
Sep 24, 2010
Code:
test=(1 2 3 4 5)
for car in ${test[@]}
do
echo "Element : $car"
[code]....
if variable $car equals 1, new element is added "6" to an array. But i don't know why when i am printing all elements of this array (echo "Element : $car") this element ("6") is not mentioned, but if i make a command which check an amount of contained elements by array it will be 6 elements.
View 14 Replies
View Related
Jul 20, 2011
I have a script which takes an array as an input to the file.ex: test.ksh -l <array_value>
Every time I dont get the same array name.EX: test.ksh -l x ; where x="a b"test.ksh -l y ; where y="c d"
I store the value I get in l in varaible myLvalue.Now indise my Script I want to run a for loop for thevalue I get in -l.If I write the for loop as below. I'm getting value x.However I'm expecting the loop to run for a and b.
View 5 Replies
View Related
May 15, 2010
I'm new to Java.
I'm trying to use some dynamically loaded classes in my application.
The application doesn't know those classes , Just it try to load a class by name that its name came from input.
It doesn't know class (So I can't use casting) but just needs to call some methods of that class (every class should have that methods).
I thought about interfaces but I don't know how.
How can I call those methods?
View 1 Replies
View Related
Jul 6, 2011
I would like to make gcc to link one lib (pthread in the example) statically, and the rest dynamically.
(See the example .c file at the end of this post.)
compiles fine, but every lib is linked dynamically.
Now every lib is linked statically
Not a dynamic executable
I would like to link the libpthread statically and the rest dynamically. Is it possible?
[url]says if I give the full path to the .a lib then it will be linked statically:
So for me it does not work.
On other sites I found that I should use -Wl,-Bstatic -lpthread -Wl,-Bdynamic, but it also doesn't work:
So, how can I do that?
Machine: Linux 2.6.16.60-0.27-bigsmp #1 SMP Mon Jul 28 13:06:32 UTC 2008 i686 i686 i386 GNU/Linux SLED 10
As an example I used a little demo program from [url]
Here is the code:
View 4 Replies
View Related
Mar 5, 2010
I am trying to write an irc bot to run interactive fiction games in a channel. I am connecting to the channel using nc. I'm having a hell of a time trying to supply input stdin for nc after the connection is established. Here's what's going on. I've got lines of plain text in a file with the irc commands required to identify the bot's ID and join the channel. I can connect easily using any of the following commands
cat inputfile | nc irc.servername.org 6667 -i 1
nc irc.servername.org 6667 -i 1 < inputfile
Named_Pipe | nc irc.servername.org 6667 -i 1
cat inputfile > Named_Pipe
With the first two commands nc connects, reads the file with some time between each line allowing the irc server to respond, bringing me into the channel. It then begins to receive stdin from the command line allowing me to do things like "privmsg #channelname :Hello World!!!" sending messages to the room. This is not the desired behavior. I require nc to take additional stdin from the inputfile if I cat additional text to the end of it.
The last set of commands using the named pipe seem like it does the same, but it doesn't actually send anything to the room, which indicates to me that perhaps nc is continuing to take stdin from the named pipe (this is the desired behavior) rather than dropping to the console for stdin. If I try to cat more plain text data to the end of the named pipe, however, either with something like "echo 'privmsg #channelname :Hello World!!!' > Named_Pipe" (or >> instead of >) or with a filename in place of the "echo" command the whole command simply seems to hang until I press ctrl-C.
I don't understand what I'm doing wrong. With anonymous and named pipes, and with redirection, the problem seems to be the same. nc seems to take it's stdin from the file until it hits the end of file, at which point I can no longer introduce new lines of plain text as stdin for the running nc process.
View 4 Replies
View Related
Oct 19, 2009
I (my friend) have a fortran program with the code along the following lines:
Code:
SUBROUTINE NY
REAL, DIMENSION(4000,4000) :: a, b, c
...
RETURN
END SUBROUTINE PARAMETERS
The problem is that the huge matrices are retained in memory even after the subroutine ends. Is there an easy way to declare the arrays in a sort of dynamic way, like they were in the following C example?
Code:
void ny(void) {
double a[4000,4000];
...
}
I mean in the C example the memory is released as soon ny() exits.
View 5 Replies
View Related
Apr 28, 2010
I'd like to get path of one library to link it dynamically in my program. Probobly the best way would be to add macro to my configure.ac file.
View 2 Replies
View Related
Jul 9, 2011
how to dynamically create a list within a dictionary using Python.
Code:
dates = defaultdict(int)
array = []
...
dates[m.group(3)] = array.append(date)
dates[m.group(3)] = [array.append(date)]
dates[m.group(3)].append(date)
None of the above works and I've tried everything I can think of.
View 3 Replies
View Related
Jan 6, 2011
I haven't programmed in C for a while, so I am trying to remember certain aspects of syntax. I have a program that will fork and exec other programs. Those programs will be specified on the command line as follows:
./main "prog1 arg arg ..." "prog2 arg arg ..."
Here is the main snippet:
int countChar(char* s, char c)
{ int cnt = 0;
int len = strlen(s);
for(int i = 0; i < len; i++)
[code]....
The highlighted line is the problem. I get this error:
dualstarter.cpp:58: error: initializer fails to determine size of 'params'.
Right now I am thinking of creating an array with the specified size and simply copying the required string into it, but it just seems like there is an easier way.
View 9 Replies
View Related
Apr 26, 2011
I am looking for an easy way to convert any given maze.txt of any size to a internal array of strings(dynamically allocated). Important is that dimensions of the maze (row, col) shouldn't be written by the user instead they have to be somehow read from the file. This is not my homework assignment! It is a small part of a project that i never dealt with. I never read files to C string.... I made it for specific maze dimensions, but want it to work with any given .txt file.
View 9 Replies
View Related
Aug 25, 2010
Our application uses a dynamically loaded shared object library (codec library) to compress and decompress audio streams.
There happens to be several static and global variables in this shared object library. Hence it is not possible to process two interleaved unrelated media streams using this shared object codec library because each stream corrupts/changes the contents of these static/global variables.
Is there a way through which a context save (save contents of data segment of shared object) and a context load (load previously saved contents of data segment of shared object)operation can be performed on the shared object library. This way the context for each media stream can be saved and loaded before and after processing the "other" media stream respectively.
View 3 Replies
View Related
Jul 27, 2011
I am learning jquery and I think for the most part I have the basics down. One of the things that I am attempting to do is to create cookies using the jquery cookie plugin. The idea is that I want to replace as much of the javascript in my code as possible with jquery to see the difficulties in doing it one way or the other.
As easy as it seems to be able to create a cookie using the plugin I have not been able to do some successfully and the only thing that I can think of is the way that I am submitting my parameters is not correct. So with that, here is is my code:
[Code]...
View 5 Replies
View Related
May 10, 2010
I have an ethernet card that used to work with Linux, but it had its firmware corrutped. (not as a result of the kernel its a different model) I think it had something to do with the thunderstorm I was using the computer in. Anyway, it is an Intel 82562EZ 10/100 Ethernet Controller (rev 01). The device manager in windows xp calls it an Intel PRO/100 VE card, which I think is the same thing. The card works in windows but not in linux. Upon firing up the intel proset software, and running hardware diagnostics the test says the eeprom test failed. Is there any way I can flash the eeprom so I can have a working card?
EDIT: Card fixed after leaving unplugged. It is important to also unplug the power supply connectors from the motherboard as well as capacitors may not discharge otherwise. Also be sure to remove the cmos battery. Oh, yeah don't try to use that intel utility on integrated networking devices. "IBAUTIL is not intended as a utility for LAN-On-Motherboard (LOM) [integrated] implementations."
View 1 Replies
View Related
Dec 27, 2010
I'm trying to learn about reflashing bios and eventually play with coreboot on some old machines I have lying around.Every machine I try to run flashrom on I get Quote:flashrom v0.9.2-r1001 on Linux 2.6.35-gentoo-r12 (i686), built with libpci 3.1.4, GCC 4.4.4flashrom is free software, get the source code at http://www.flashrom.org
No coreboot table found.
Found chipset "VIA VT82C686A/B", enabling flash write... OK.
This chipset supports the following protocols: Non-SPI.
[code]....
View 2 Replies
View Related
Mar 9, 2009
Someone just erased my HWADDR line from /etc/sysconfig/network-scripts/ifcfg-eth0. How can I obtain my original MAC address?
Code:
ifconfig eth0 does not work (it shows the wrong MAC address) since the HWADDR line from the file I mentioned above was erased. Also there is no ifcfg-eth0.bak backup configuration file.
View 2 Replies
View Related
Nov 11, 2010
I replaced the old WIFI card (Intel PRO 3945ABG) in my Dell D620 with the new Intel Ultimate-N 6300.
According to intel's website the driver is integrated in the current kernel (mine is 2.6.34.7 61.fc13.i686.PAE) and I have the latest firmware installed as well (iwl6000-firmware-9.221.4.1 1.fc13.noarch) however it does not work.
I tested the card with Windows XP and it works perfect.
The output from "dmesg" is:
Code:
Code:
But with my previous card "lspic -v" will show the driver in use but the new card does not:
Code:
So it detect the card for some reason does not assign it a driver!
And i googled this "Unsupported (too old) EEPROM" and found some results related to Ubuntu but were not useful.
So am I missing something? what does that message mean "Unsupported (too old) EEPROM"?
View 2 Replies
View Related
Jul 24, 2011
I am new here and I have tried checking similar threads as well as other sources in the net but could not get my card working. I use Debian squeeze on a P4 2.4MHz machine with 2 GB ram. lspci can detect all 8 chips but could not load the proper module since it could not identify the vendor. I have tried unloading the SAA7134 module and reloading repeatedly all possible cards from 1 to 174 by "modprobe -i SAA7134 card=#,#,#,#,#,#,#,# #-numbers 1 to 174 one a a time.
View 3 Replies
View Related
Mar 26, 2010
Lets say i have an empty DVD (4,7G)
I write on it data 2G with k3b.
Is it possible later to add some more files in this DVD with k3b ?
View 3 Replies
View Related
Jun 25, 2010
I want to create diskless comupters for a lan party using an nfs root. My problem is that this root filesystem should be usable on different hardware (AMD / nVidia graphic cards) and I need the best performance.
My question is : Is there a way to activate automatically proprietary driver on startup without modifying root filesystem ?
View 1 Replies
View Related
Jul 17, 2010
I own Fedora Core 12 and an HP scanner. I want to make digital copies of all the pictures I took a few years ago. I have a lot so I tried scanning five at a time thinking I could cut and paste into smaller images like with MS Paint on Windows. HPLIP 3.9.12 wouldn't let me modify the scans so I tried GIMP 2.6.10. GIMP 2.6.10 is a nightmare! When I opened my scan of five pictures I had trouble opening a new image. Then I had to specify the size of the new image. The when I cut and pasted I couldn't rotate. Then when I figured out how to rotate my image was too small.
Then I tried scanning just one picture but HPLIP left a lot of blank space. I tried cropping out the blank space with GIMP but the image size was the same with the blank space. I don't want to post photos to Flickr that are mostly empty space.I wish I could show you examples but the forum won't let me post them.Any ideas or suggestions for a program for Fedora Core 12 that's got the functions and features of MS Paint?
View 9 Replies
View Related
Nov 18, 2010
can some one explain why opensuse 11.2 try to scan the default gw via snmp? And why it generates wrong packages with other mac-addresses? we have 3 scan tries with the same IP (from the fresh install) but with 3 different mac addresses. Can some one point me to the code which does this strange things?
View 2 Replies
View Related
Jul 26, 2010
i just installed ubuntu 10.04 on my computer, and tried to airodump, but noticed that its stuck on 11th channel, when i specified only channel 6 during scan, it gave me hosts from channel 6 and 11, but then i ran aireplay-ng and it runs on 11th channel as well, even when i put my card into monitor mode with a specific channel option. btw my chipset is AR9285 with ath9k driver. everything worked in backtrack. i also tried to reinstall aircrack which did not work.
View 1 Replies
View Related
Jan 1, 2011
Is there a software in linux ubuntu that can count scans???
View 1 Replies
View Related