Posted: Mon 02 Jan 2012, 01:40
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.)
READ-ONLY Archive
https://oldforum.puppylinux.com/
http://murga-linux.com/puppy/viewtopic. ... 031#990031technosaurus 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 memusedhere is my init codeCode: 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); }
I also commented this line in the kernel source (init/do_mounts.c) - the wait isn't needed hereCode: 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); }
Code: Select all
//wait_for_device_probe();
Actually the 5.25" HD floppies from 1982 would probably work.s243a wrote:That would fit on a floppy disk from 1987!
Have you considered adding this project to a github repo?