Developing FirstRUN for Puppy CD's initial boot

Under development: PCMCIA, wireless, etc.
Message
Author
PANZERKOPF
Posts: 282
Joined: Wed 16 Dec 2009, 21:38
Location: Earth

#46 Post by PANZERKOPF »

nooby wrote: Does that mean that instead of usung aufs? and Squash? it
only uses vmlinuz and initrd and as you say the root is imbedded.
Aufs is mostly used when we want to create a writable layer (tmpfs or other) upon read only filesystem (squashfs or other). Initramfs used in Microsaurus is already writable so aufs is unneeded here.
nooby wrote: I know almost nothing. My vague grasp is that vmlinuz is the kernel
and that initrd is a kind of script that read what grub menu.lst has to
offer as puppy code like pfix=ram and other such codes.
Then the init read scripts take care of a lot of things as an overlay
to the kernel.
Initrd is archive contains tools and scripts. Kernel unpacks it to the ramfs and
runs init script. After initialisation we can continue working in that rootfs (Microsaurus and Tinycore way) or delete it and jump to the other root filesystem (Puppy way).
nooby wrote: I guess that is what Tiny Core do too or similar?
Yes, with one difference: Tinycore uses separate file (initrd.gz) whereas Microsaurus has embedded it into kernel image. Recent kernels (since 2.6.??
have forgotten.....) let us integrate an archive (was mentioned above) to the body.
So we have one file with complete OS inside. :)
SUUM CUIQUE.

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

#47 Post by technosaurus »

I put together a gtk1 version with goingnut's multicall binary of ROX-Filer, Xdialog, dillo, mtpaint and minimum profit (text editor) ... it also has aumix but sound/internet still isn't supported.

The environment variables for rox are set in the init binary (APP_DIR and CHOICESPATH)

Resource usage is hovering around 6-7mb , but that is without the Rox Pinboard (desktop icons) ... I still need to figure out the old format and where it goes.
Attachments
microsaurusgtk.jpg
to run the pinboard as pictured use:
ROX-Filer -p default
(10.09 KiB) Downloaded 1280 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:

#48 Post by goingnuts »

pinbord entries in /root/Choices/ROX-Filer PuppyPin.
Loaded via /sbin/pup_event_frontend_d which needs patch for grid, yafsplash, busybox difff a.o. to work with BB only.
Run "/sbin/clean_desk_icons" and "/sbin/pup_event_frontend_d" via /root/.xinitrc before running:

#ROX-pin
if [ $(which rox) ]; then
#relocates right-side icons to actual right-side of screen...
/usr/sbin/fixPuppyPin /root/Choices/ROX-Filer/PuppyPin
rox -p /root/Choices/ROX-Filer/PuppyPin
fi

(also from /root/.xinitrc)

Note: PinboardAdd supported but not PinboardRemove
Last edited by goingnuts on Sun 25 Dec 2011, 14:15, edited 3 times in total.

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

#49 Post by technosaurus »

goingnuts wrote:pinbord entries in /root/Choices/ROX-Filer PuppyPin.
Loaded via /sbin/pup_event_frontend_d which needs patch for grid, yafsplash, busybox difff a.o. to work with BB only.
Run "/sbin/clean_desk_icons" and "/sbin/pup_event_frontend_d" via /root/.xinitrc before running:

#ROX-pin
if [ $(which rox) ]; then
#relocates right-side icons to actual right-side of screen...
/usr/sbin/fixPuppyPin /root/Choices/ROX-Filer/PuppyPin
rox -p /root/Choices/ROX-Filer/PuppyPin
fi

(also from /root/.xinitrc)

Note: PinboardAdd supported but not PinboardRemove
I kinda figured it out. I am exporting APP_DIR as /usr/share/ROX-Filer (with the pixmaps directory symlinked to ../pixmaps) and CHOICESPATH as just /usr/share - putting the MIME-* directories in a more standardized place with other mime stuff (and reachable in a multi-user setup by exporting new paths)... I don't want to use any legacy Puppy-isms where it can be improved upon.
All in all it is getting a decent feel to it - I will probably set the default resolution in the gtk1 version to {1024x768,800x600}x16 though (will use some extra resources, but not as cramped)
I do miss gtkdialog a bit, but gtkserver could be a replacement since it does have a gtk1 backend... only not as many examples.

something this (untested) would support multiple possible locations depending on user/mode/etc...:

Code: Select all

for x in ${CHOICESPATH//:/ }/ROX-Filer/PuppyPin; do
[ -x "$x" ] && fixPuppyPin "$x" && break
done
for using in standard Puppy's / Puplets the startupcommand (init within X) could use meminfo to determine whether to keep the gtk versions or bump up to gtk2/3 on the main filesystem as well as which daemons to run by default

One thing that no package manager really does, is track the typical resource usage. If I continue to develop this, it will be an integral part of package management. This way we could list all of the packages that provide for instance "defaultbrowser" by resource usage, with any that exceed the systems resource limit by itself grayed out and/or italicized if it could cause problems in typical usage. This could even be based on MIME-types such that the default handler for each MIME-Type defaults to opening the package manager to those "provides". ... but that would be too simple, right?
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].

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

#50 Post by Aitch »

Great stuff, techno
I really like the sound of the final paragraph....can't believe it hasn't been included before

Might a Puppy4.4 evolve out of this, or is it abandoned?
There seemed to have been plenty of .pet tests....but no OS??
...or did I miss it because it was so fast? :wink:
Maybe add-on SFS's is the way to go, on a barebone/microsaurus base?

Interesting xorg development - dynamic loading video

http://www.phoronix.com/scan.php?page=n ... px=MTAzMjM



Aitch :)

User avatar
TheAsterisk!
Posts: 406
Joined: Tue 10 Feb 2009, 08:52

#51 Post by TheAsterisk! »

Just came across Microsaurus this morning. My goodness. I had to resist the urge to mumble, "Don't sneeze," when I copied the bzImage over to its new boot directory.

Great stuff, technosaurus.

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#52 Post by starhawk »

Came across this mentioned in the Akita thread... very interesting indeed. One important question: what is missing in order to create Internet capability? Just a browser, or something more important like support for connections of various sorts?

I have to say, this has me excited... no offense to goingnuts at all, but PupNGo was never an everyday-practical puplet, lacking some significant things. If this puplet could be not only tiny, but also /useful/ (containing web and word-processing software at least) then that would be *amazing*.

One thing that may or may not help here... about to try out a browser (on my windoze box :oops: ) called QtWeb. It's pretty dern tiny... about 6mb. Of course, one will want flash and javascript and all that other crunk, so that will balloon the size a little, but perhaps not too much.

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

#53 Post by technosaurus »

As this was mostly a proof of concept I disabled _everything_ and only enabled what was absolutely necessary. I do have an initramfs tree that can be included in any kernel compile from vanilla sources or pretty much any distro's patched kernel (just add the initramfs location in the .config and then make bzImage). The only difference is that if you use your distro's initrd, it will likely overwrite my init that boots straight to desktop. (you may be able to fix this by simply moving the init in the initrd.gz to /bin/startupcommands - jwm will run it when it starts up)
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].

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#54 Post by starhawk »

Pardon a fair bit of cranial density here... but...

OK, I un-tarballed the bzImage, plopped it on a USB stick, and... it didn't work. Does it need a bootloader, or am I missing something else...?

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

#55 Post by technosaurus »

Yes, but any working x86 bootloader should do, just edit the configs for its location ... You won't need the initrd entry since it is built-in.
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].

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#56 Post by jpeps »

Interesting that my USB mouse works....albeit wildly. Pendrive worked. Reminds me of the early days of TC.

starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#57 Post by starhawk »

Interesting little doohickey...

On my netbook, Processes is broken (pops up and crashes instantly), and every command I've ever used (with the exception of cd) doesn't work in rxvt -- examples = ls init [and a lot of paths] . Heck, half the time I can't even cd somewhere. Seems like the sr0 path is broken, too -- opens an rxvt window instead.

Also... where's the shutdown thingy? All I can do is a hard shutdown (power button)... weird.

BTW, my netbook uses a 16:9 screen (usually 1024x600) so the windows were a little stretched... guessing here, but it looks like you're forcing 640x480 resolution...

BTW, the only way I could get the thing to boot with ****ing Grub Legacy (installed from Wary 513; Grub4DOS didn't see a dern thing) was to press c at the boot menu and then manually type in:

Code: Select all

 kernel /bzImage
boot bzImage
For some reason, it wouldn't do that from menu.lst (odd, since it's the exact same text...). Very strange... will test with syslinux later.

Of note, booting from a PNY 4gb usb stick -- one of the ones Wal*Mart had for a while (little clearish dark plastic swing thing covering the port, not a slidey stick). Handy little bugger, that.

Two other questions...
(1) could this run on a 486 w/o FPU?
(2) ...with only 4mb RAM?

I'm guessing the answers are "no" and "no", in that order, but I'm not sure, so I thought I'd ask...

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#58 Post by jpeps »

starhawk wrote:
For some reason, it wouldn't do that from menu.lst (odd, since it's the exact same text...). Very strange... will test with syslinux later.
You can just change the name to vmlinuz

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#59 Post by 01micko »

Pretty cool. Be nice if we could save stuff then we could build on it ourselves :) . My touchpad actually worked better than lupu, luki and slacko ootb on my IBM r51.
Reminded me a bit of BL2, a jwm thing on 2 floppies.
Puppy Linux Blog - contact me for access

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#60 Post by jpeps »

01micko wrote:Pretty cool. Be nice if we could save stuff then we could build on it ourselves :) . My touchpad actually worked better than lupu, luki and slacko ootb on my IBM r51.
Reminded me a bit of BL2, a jwm thing on 2 floppies.
Maybe a mini-core with puppy as user; I'm sure there would be a lot of support from the community. I can hardly wait to see this posted on DistroWatch. :)

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

#61 Post by technosaurus »

Oops, we kinda got off topic due to old title. I will start a new thread soon (after I post a tutorial on glade1, since I am bringing gtk1 back from the ashes.)
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].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#62 Post by s243a »

technosaurus wrote:Ok here it is, Puppy in <1mb in a single bzImage

Resource usage in X with jwm running and an rxvt terminal open:
MEMUSAGEKB=5020 (with background) 2892kb without background image

Resource usage at the console:
MEMUSAGEKB=2288

I wanted to see how far I could go so I ended up disabling even proc and sys, (which breaks top and ps) so I needed a way to get memory usage. I also replaced busybox with dash and mount from embutils (sh is used by rxvt which also needs /dev/pts so needed to mount a devpts) and just for grins i wrote my own init in C . I could get the resource usage down under 2Mb if jwm were compiled with only X11 with maybe xpm support and used st instead of rxvt

here is the code I wrote for memused

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);
}
here is my init code

Code: Select all

#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>

//these could be functions but gcc complains less this way 
#define EGGSACKWEIGHT(a) ({int s,p;if((p=fork())==0){execvp(a[0],a);}else{while(wait(&s)!= p);}})
#define SHIFTN(i,a) ({ int j=0;while(a[j] != NULL){a[j]=a[j+i];j++;}})
#define EGGSACK(a)	({if((fork())==0) execvp(a[0],a);})
int main(int argc, char** argv) {
//export PATH="/bin" HOME="/root" TERM="xterm /bin/sh" SHELL="/bin/sh" PS1="# " USER=root LOGNAME=$USER HISTSIZE=1000 HISTFILE="$HOME/.history" INPUTRC=/etc/inputrc
//setenv("PATH","/bin",1);
putenv("PATH=/bin");
putenv("HOME=/root");
putenv("TERM=xterm");
putenv("SHELL=/bin/sh");
putenv("PS1=#");
putenv("USER=root");
putenv("LOGNAME=root");
putenv("HISTSIZE=1000");
putenv("HISTFILE=/root/.history");
putenv("INPUTRC=/etc/inputrc");

char* X[99];
//mount devpts /dev/pts -t devpts
	X[0]="mount";
	X[1]="devpts";
	X[2]="/dev/pts";
	X[3]="-t";
	X[4]="devpts";
	X[5]=NULL;
	EGGSACK(X);

//Xvesa -screen 640x480x16 -nolisten tcp -tst -I &
	X[0]="Xvesa";
	X[1]="-screen";
	X[2]="640x480x16";
	X[3]="-nolisten";
	X[4]="tcp";
	X[5]="-tst";	
	X[6]=NULL;
	EGGSACK(X);

//script? ... try getenv("XINITRC") and getenv("HOME") + /.xinitrc

putenv("SHELL=/bin/sh");
putenv("DISPLAY=:0");

X[0]="jwm";
X[1]="-display";
X[2]=":0";
X[3]=NULL;
EGGSACKWEIGHT(X);

X[0]="killall";
if (argc>1) {
	X[1]="Xvesa"; //see above... maybe change to X
}else{
	X[1]="Xorg";
}

X[2]=NULL;
EGGSACK(X);

X[0]="sh";
X[1]=NULL;
EGGSACKWEIGHT(X);
}
I also commented this line in the kernel source (init/do_mounts.c) - the wait isn't needed here

Code: Select all

	//wait_for_device_probe();
http://murga-linux.com/puppy/viewtopic. ... 031#990031


That would fit on a floppy disk from 1987!

Have you considered adding this project to a github repo?

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

#63 Post by technosaurus »

s243a wrote:That would fit on a floppy disk from 1987!

Have you considered adding this project to a github repo?
Actually the 5.25" HD floppies from 1982 would probably work.

I started doing a rewrite as PLiNG but I am busy working on other projects at the moment. Fortunately I documented things first as I thought of them so I don't just write them down in code and then forget what the code was supposed to do.
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].

Post Reply