On Tue, 2005-04-12 at 10:41 +0200, Christian Magnusson wrote: > Sure... It's an easy way to solve it, but when you are running things > on embedded systems you have to save your ram wherever you can. > Just starting /bin/sh will consume 484Kb on your WRT54G router... and > that's a lot when you only have a few Mb free space. > Adding such a feature to owfs will increase code-size with max 300bytes > I guess and ram-usage will probably just be a couple of Kb even if you > start a new thread which handles it. No additional dynamic library is > loaded since everything is already there from owfs or owserver.
Holy crapoly! Your /bin/sh is [still] 484k? On low-memory devices, I statically link a old v7 /bin/sh with dietlibc and get it: [EMAIL PROTECTED] v7]$ strip sh [EMAIL PROTECTED] v7]$ ls -l sh -rwxrwxr-x 1 geocar geocar 24528 Apr 12 09:56 sh [EMAIL PROTECTED] v7]$ file sh sh: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped [EMAIL PROTECTED] v7]$ ./sh $ ps aux | fgrep ./sh | fgrep -v grep geocar 12986 0.0 0.0 128 44 pts/10 S+ 09:57 0:00 ./sh I'm sure you can do better than 484k if you're serious about embedded. I realize that was almost completely off topic, but "300 bytes" is a bit optimistic: Any software that's interested in the results has a blocking loop, and it is at the top of that loop that is the correct place to do it. To wake up a thread (with a structure quite a bit larger than 300 bytes) periodically and pull a trigger, that may or may not have data read during this cycle, is just wasteful. the sh-code is adequate for something this brain-damaged, but really, nobody needs it: it's a solution for a problem created by another problem which is actually much easier to solve :) > How about people using iButtons as identification cards etc... There > are key-rings to attach the iButton and then it's just to hold up > the button to the reader. This requires a loop searching for new > devices all the time, and then when a device is found, read the > memory or content and eventually accept the user's iButton. I've been suggesting ow* subscription/directed-broadcast-announcements for a while, and I think they're really a good idea. ... one just needs time... > This directory search could also be a low-level function in owserver > where it's searching for new devices as often as possible. > It wouldn't be very a very good user experience when you have to hold > your iButton to the reader for several seconds before it's detected and > accepted. > > Just a few thoughts... :) -- Internet Connection High Quality Web Hosting http://www.internetconnection.net/ ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Owfs-developers mailing list Owfs-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/owfs-developers