pUPnGO - 6Mb ISO - Basic Building Block Puplet

A home for all kinds of Puppy related projects
Message
Author
keniv
Posts: 583
Joined: Tue 06 Oct 2009, 21:00
Location: Scotland

#511 Post by keniv »

Hello All

I have used a number of puppies and I am typing this in 528. I thought I would try pupngo because I was intrigued by it's size. I was not sure which to try and so I went for the one I thought looked the most recent and downloaded V016_090611.iso from Goingnuts site. I burned the iso booted it up and went through the setup procedure. I elected to keep all the drivers. I now have the following files on my hd. GUI_016.sfs, pup_016pupngo.sfs, pup_save.2fs and zdrv_016.sfs. and I am booting from the cd. My problem is wifi setup. My wifi pcmcia card is detected. My router is detected and its id is shown. It detects the wpa security system and asks for the key. When I type in the key and hit OK I get

udhcpc:
SIOCGIFINDEX no such device

I am then asked if I want to cancel or try again. If I try again I get the same result. Can anybody help me get the wifi working. I am using an old Toshiba laptop PIII 800MHZ, 320MB and40GB hd about half full.

Regards,

Ken.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#512 Post by goingnuts »

keniv wrote:..
udhcpc:
SIOCGIFINDEX no such device

I am then asked if I want to cancel or try again. If I try again I get the same result. Can anybody help me get the wifi working. I am using an old Toshiba laptop PIII 800MHZ, 320MB and40GB hd about half full.
Hi ken - thanks for testing pUPnGO!
The wifi-manager is my (obviously not so good) try to get a simple access wizard to wireless. Its buggy I think - sorry for that. I have seen that error before -but its a long time since I messed with the wireless manager so I do not recall how to solve it. It could be a missing/wrong (firmware)-driver.

Still testing the diethotplug as its extremely fast compared to udevd it seems. To watch what the kernel sends to it I have renamed hotplug to hotplug.bin and made the below script (named hotplug). Then the information send from kernel can be evaluated:

Code: Select all

#!/bin/sh
[ ! -f /tmp/hotplug ] && echo -n >/tmp/hotplug
echo "$(date): Arguments ($*)" >> /tmp/hotplug
echo "$(date): Environment $(env)" >> /tmp/hotplug
hotplug.bin $*
exit
Source code for diethotplug show no sign of handling firmware:

Code: Select all

int firmware_handler (void) {return 0;}
but might be modified with some calling of external script that might handle firmware...or maybe some simple c-code additions.
This page might give some good background for hotplug.
Maybe its just reinventing the wheel - but the speed increase is very attractive...

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#513 Post by technosaurus »

I have gotten the full gtk1 version running in the initrd
resource usage is under 32MB (can get <16mb if you use lower res X) with all gui apps running it is still well <48mb

I am a little distressed that the whole init script needs to keep running or you get the "attempted to kill init" message ... the extra shells push me close to 16mb ram usage with only rxvt running top
Rob Landley has oneit.c which can spawn the init script and act as PID 1, but I also remembered my basic xinit that was derived from my waitfordisplay, which gave me this basic idea:

NOTE- this is just a pseudo-code TODO
fork_exec("/sbin/init.sh")
fork()... xvesa_main(argc, argv)
waitfordisplay(void) //change to waitforX since it is builtin
fork()... jwm_main(3,{"jwm","-display",":0"})
wait()
//should kill Xvesa here, but would need the pid from fork above
fork_exec_wait(1,"/bin/sh")


also jwm/src/command.c has this line that spawns unneeded shells
execl(SHELL_NAME, SHELL_NAME, "-c", command, NULL);
could be?
#define EGGSACK(a) ({if((fork())==0) execvp(a[0],a);})
EGGSACK(command);


Note - jwm used to just use system(command) but was changed for security reasons ... perhaps this no longer applies?
Attachments
microsaurus.png
(122.05 KiB) Downloaded 1004 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#514 Post by goingnuts »

I have gotten the full gtk1 version running in the initrd
resource usage is under 32MB (can get <16mb if you use lower res X) with all gui apps running it is still well <48mb
Nice! Let me know if you need sylpheed or aumix as well...
Almost done with the ROX-Filer - working on the hotplug desktop icon update - will propably do a new script just to handle it - to get it out of pup_event_frontend_d.
Found that Dillo download dpi can not use busybox wget (cals wget -O - --load-cookies $HOME/.dillo/cookies.txt) and the --load-cookies makes busybox wget fail. Would also be nice here, to have a message telling that download completed...
If you use some of the dpi´s they stay running after dillo has closed - might be to service other running dillos. But they take up a lot of resources. So I think dillo should be started via a wrapper who looks after that and closes unused dpi´s.

Also found that some scripts fails (if they generate other scripts) with Xdialog. The problem is the rather useless information "locale not supported..." that glib/gtk spawns - as one of its only debug infos.
So modified the code updated build of mcb_gtk attached. No additional files (config, icons etc.) included.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#515 Post by technosaurus »

goingnuts wrote:Also found that some scripts fails (if they generate other scripts) with Xdialog. The problem is the rather useless information "locale not supported..." that glib/gtk spawns - as one of its only debug infos.
So modified the code updated build of mcb_gtk attached. No additional files (config, icons etc.) included.
for gtk1 wjaguar suggested using -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS (several pages back) to save some code size. I also started a project on github called "singularity", but haven't set up the repo yet, b/c I wanted to the latest changes. I tested the aboriginal toolchain and it seems to work quite nicely, but the uclibc / uclibc++ needed some tweaking to get the smallest code size (bonus is that we could use c++ based apps) like eliminating the gnuisms and for uclibc++ disabling support for rtti and exceptions (I know how to patch around that if we need to) I am still working on a wrapper script that uses the objects (*.o files) instead of the static library (*.a archive) because it reduces the code by 10-20% by using -fvisibility=hidden (or we could just use them directly in our build scripts) ... I just wonder how many security exploits are avoided by compiling statically with hidden visibility ... the only ones left that I can think of are stack smashing ... but then we could always use -fstack-protector (or whatever it is)

So, I also tested it with the 2.6.39 kernel and it is working nicely (man I am loving qemu - though it takes ~5seconds to X in qemu vs <2 on my old crap hardware), plus it allows a lot of new things like devtmpfs, lzop/xz compressed kernel, initrd and squashfs, ext4 with support for ext2/3 using its driver. I used the kernels initramfs=(location) to build the entire thing into the kernel (this would allow us to build a "zdrv" as an initrd.xz) ... anyhow I am keeping all the modules out of the main initrd for now so that it can be used with any kernel and even built in to it (great for pxe booting)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#516 Post by PANZERKOPF »

goingnuts wrote: aumix...
I recommend "gamix" instead of "aumix". Aumix lacks some controls on several soundcards whreas gamix has same functions as alsamixer. It is both compatible with gtk1 or gtk2.
SUUM CUIQUE.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#517 Post by technosaurus »

microsaurus is now <1mb using the 2.6.32.50 kernel and resource usage is down to <5mb in Xvesa with jwm running and an rxvt terminal open

I posted a screenie and my DOTconfig here:
http://www.murga-linux.com/puppy/viewto ... 822#590822

also wrote my own init in C, but couldn't get mount(...) to work, so I used the mount from embutils (I replaced busybox with this and dash) at this point I am pretty sure we could get it down to ~4mb of resource usage by eliminating some jwm features and removing xinit and replacing rxvt with st, but why when this could be used in a full desktop environment

I did find out that upx-ing the binaries has a huge negative effect on resource usage (it almost tripled with upx'd binaries)

the other good thing to come of this little experiment

Code: Select all

#include <sys/sysinfo.h>

int main(int argc, char **argv){
	struct sysinfo info;
	sysinfo(&info);
	printf("MEMUSEDKB=%d\n",(info.totalram - info.freeram)*info.mem_unit/1024);
}
this is indirectly related to a previous question on how to prevent starting an app if ram is too low
here is the answer based on above
if (info.freeram > ramneeded) ... ;

Edit: it turns out most of the memory usage is from the jpeg background image, if you use the default background (none) memusage is reduced to <3mb ... apparently the binaries can execute in place??? this would make sense since it is a ramfs but nothing documents it... and would explain why upx caused such a large increase
Attachments
microsaurus.jpg
(9.79 KiB) Downloaded 923 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#518 Post by PANZERKOPF »

technosaurus wrote: I did find out that upx-ing the binaries has a huge negative effect on resource usage (it almost tripled with upx'd binaries)
Maybe it not cleans itself from memory after unpacking a program?
I mean that a part of UPX code stays in memory even program is already unpacked and run.
SUUM CUIQUE.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#519 Post by technosaurus »

@goingnuts
I went to build libtinyX11 on a recent gcc and realized that most of the functions are untyped - also that some of your patches were to add int to the function and patch other places with return 0... was this to support a specific program ? if not I am planning to revert and try to selectively pull from xfree 4.8 and patch tinyX11 to use void typed functions (instead of int, since they don't require a return and sizeof(int) extra space each)
programs that fail to compile by not returning on a void type are typically because it relied on old gcc behaviors that ignored those if the function was void (I forget which version changed this, but it was a while ago, suffice to say most functions can safely be void to slightly reduce size - both compiled and runtime)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#520 Post by goingnuts »

It was just to make gcc happy - but did not do it all the way. I tried to use the 4.8 as basis for tinyX11 but got a regression (?) during compile of Xvesa - so dropped it as the current level of tinyX11 did the job.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#521 Post by technosaurus »

thx, at least I know what is in store for me. I'd also like to make lib and include a bit more sane and clean up the need for various ../../../ garbage... using something like include/mi/mi.h and changing all references to be simply <mi/mi.h> or X11/mi/mi.h depending on where it _should_ be (what a PITA) - its hard to tell on some of them, many were split out from their parent directories into subdirectories to make things easier for someone... and a README in each dir is always useful - will put my findings, TODOs etc... there. My impression is that the xorg versions of kdrives were second class citizens toward the end, but if anyone can point me to a known sane version, I will try and pull from there too... I am kinda interested in their SDL version of kdrive (elephants and all)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#522 Post by goingnuts »

@technosaurus: The ../../../ garbage... is my fault - not originally there. I think you could upgrade to 4.8 for the Xlib things and maybe leave the Xvesa part as is - or for a later round-up. I have added some functions to make gtk work - if needed I will upload my revised tool-chain? Ever thought of putting everything in one dir (source, headers, libs)?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#523 Post by technosaurus »

Not necessarily 1 directory, but possibly 3 (include, libs, programs) I also think it would be a good idea to integrate my basic init with the xvesa,jwm,rxvt mcb because it would speed up booting. I figured out how to mount /dev/pts in c too so we are talking <1s boot times.

The only difference is I would just fork xvesa_main then call jwm_main as a function call without forking it and add this at the beginning in place of using an external mount binary.
#include <sys/mount.h>
mount( "/dev/pts", "/dev/pts", "devpts", MS_MGC_VAL, NULL );

This would allow the boot to X even without busybox ... Jwm needs command.c patched though if no shell is included (i have used fork...execvp)... It also cuts resource usage.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#524 Post by goingnuts »

@technosaurus: Do you have a patch for the jwm exec-thing?

Did some test on the mcb_gtk to evaluate the influence on resources:
The bigger the mcb becomes the more ram is used at execution-time. Using upx does not give a huge difference (maybe +5-10% more ram is used).
So depending on the purpose one might use mcb (nothing beats that for size on disk), standalone (lowest ram usage
/largest size on disk) or the upxed variant of the two possibilities.
I have uploaded standalone version of sylpheed-1.0.6 and roxgtk1-2.2 as they for various reasons seems to be candidates for the standalone approach (sylpheed needs ssl and is big in itself/ROX is the only one using gdk-pixbuf). The ROX is patched to do pinboard-remove so now the puppypin-stuff is working. Also included most of the other needed files (icons/cddetect/diff) and a modified pup_event_frontend_d named roxpin.sh targeted this special version. Get them here

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#525 Post by Aitch »

techno/goingnuts

reading/watching you 2 develop is fascinating....I love the ideas and ways you are exploring - back to basics
I can't do coding at all, but it doesn't stop me from appreciating those who do
many thanks....look forward to a usable final minimalist version, with a brief instruction how to add[/remove?] software to taste

This maybe will suit my old IBM 560/570 that got put away with 214R on.....as being a bit slow......[I got an IBM T21, then T30/current]

thanks, guys :D

Aitch :)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#526 Post by technosaurus »

I don't have the patch with me (still visiting family for the holidays) but basically it was replacing the sh -c at the end of src/command.c with

#define EGGSACK(a) ({if((fork())==0) execvp(a[0],a);})
EGGSACK(command);

Or simply (less secure?)
system(command);

BTW if we could setup a way to only keep one copy of the mcb running (the way rox does) then any newly executed apps could just be forked ... Which only needs to copy the rw data and would cut resource usage considerably... Adding it to my things to research.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#527 Post by goingnuts »

Thanks. It would be a great step forward if that is possible. Do not know if its possible or practical but maybe a shared (but static) mcb library that a tiny launcher link to?

No doubt that this "issue" has to be solved in a way to minimize the resource use of heavier mcbs...

Made a mcb_gtk with the following content where size is reported for standalone builds (updated image as org contained errors in sum):
Attachments
snap0001.png
(59.26 KiB) Downloaded 792 times
Last edited by goingnuts on Wed 28 Dec 2011, 18:16, edited 2 times in total.

nooby
Posts: 10369
Joined: Sun 29 Jun 2008, 19:05
Location: SwedenEurope

#528 Post by nooby »

The following is not criticism and not a demand not even a friendly wish.

It is more like wanting to understand what is involved with the older
kernel. I don't ask you to do anything with pUPnGO but if somebody
else wants to do it. How difficult would it be? Is it like woof or much
more involved and very difficult?

I had promised myself to not bother you anymore.
I am too much of a total absolute Dummie so I know
I am annoying and much more but I love small distros.

Your distro is so cute.

I managed to get TinyCore Linux 4.1 going and it has drivers
that work for my hardware.

Can I borrow those drivers or the program that has them from
TCL and reuse them in your pUPnGO?

or is it easy to port your Puppy420 to say Lucid or something.
To change to another kernel.

No I don't ask you to do it at all. I mean is it easy for any of the other
developers to do it or would they have trouble doing it?
I use Google Search on Puppy Forum
not an ideal solution though

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#529 Post by technosaurus »

Any recommendations as to whether to use pipes, fifo, sockets or something else. I was thinking that when an mcb runs it could check to see if one of the above data streams exist and if not, then start it... Then this data stream could be used as a daemon to fork processes.

I've never really used them so...

Edit:
Did a bit of research and think named pipes (fifo) is the least complex and most versatilemethod. We could even just echo commands to the pipe once the daemon is running. This link had some useful info:
http://developers.sun.com/solaris/artic ... pipes.html
I have it figured out in shell, but need to translate it to C
It goes something like:
If ! -x /tmp/mcbfifo ... mkfifo /tmp/mcbfifo
While read line < /tmp/mcbfifo; do
Case $line in
...
Esac
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#530 Post by goingnuts »

@technosaurus: Would be cool and fast if manageable! dillo seems to do it with its dpis.
@nooby: What kernel do you prefer? Did you try the pUPnGO_V016_090611 with kernel from snowpup [2.6.35.7]?
No big deal to shift kernel in pupngo though - if you have a good reason giving you the energy and drive to do it... :)

Post Reply