nanogui@linuxhacker.org
Remember: X11 was developed on VAX 11/750's with 2 megabytes of RAM.
Somehow us old farts have a bit more confidence that things don't have
to be bloated as the young turks seem to; but maybe that is because
we lived in the stone-age :-).
> Sender: handhelds-admin@handhelds.org
> From: "Greg Haerr" <greg@censoft.com>
> Date: Mon, 17 Jul 2000 12:28:50 -0600
> To: "Jim Gettys" <jg@pa.dec.com>
> Cc: "Matthew Kirkwood" <weejock@ferret.lmh.ox.ac.uk>,
> "Alan Cox" <alan@lxorguk.ukuu.org.uk>,
> "Roberto Alsina" <ralsina@conectiva.com.ar>,
> <nanogui@linuxhacker.org>,
> <handhelds@handhelds.org>, <viewml-devel@viewml.com>
> Subject: Re: [Handhelds] Re: Small open source web browser introduced
> -----
> : > GTK+/GDK is absolutely huge, so it wasn't considered for very
> : > long for the embedded solution. (~2.5MB RAM usage for widget set)
> :
> : I have estimates that show GTK+/GDK can be alot smaller from people I
> : have good reason to believe are likely correct......
> : The X server is 600Kbytes (down from more than 1.5 megabytes); Keith
> Packard
> : and I can also without much trouble reduce the size of Xlib by at least
> : 600Kbytes. Between just those two we will have saved a good fraction of
> that
> : 2.5MB.
>
> I wasn't saying that X+GTK=2.5MB, I was saying that GTK=2.5MB
>
> Wow, 600k byte reduction of Xlib? What are you taking out?
The particular suggestion I am making is to change the Xlib implementation
to dlopen libraries for the Xlib CMS and I18N impementations only when
an application first calls into them: this would preserve binary
compatibility, save RAM and TLB entries for everyone who is not using
them (almost everyone), and allow people like me on flash constrained
systems to ship configurations in which the storage space for the code
is saved by not shipping these dynamic libraries. This would cost a tiny
amount of code in each of the affected library routines, to see if the
dynamic libraries need to be loaded.
Not elegant, but should get the job done.
So the big ones are:
1) CMS (Color management System: few apps use it). Keith blew it and let
people put this in for a minor return (ability to use other color scheme
names in existing interfaces).
2) Recent TOG I18N stuff (most toolkits, particularly modern ones, don't
use it). I would have fought this one tooth and nail had I been involved
at the time.
Beyond these, I'll be converting a number of macros to procedure calls,
which also saves space (and is probably faster on today's machines; I'll
benchmark before and after to confirm this).
>
>
> : So I expect by using X we can have our cake and eat it too (and not have
> : to build another window system (thank you, one was enough for me...).
> : Putting X on a diet turns out to be alot less work.
>
> I applaud the efforts to make X smaller. The Microwindows window system
> development isn't to try to recreate X. Instead, it's to create a system
> that is fundamentally simpler and smaller, that can run on systems where X
> cannot. BTW, does the 600k include support for fonts, or are other X
> utilities required? What is the total size of the minimal system, one that
> includes
> the X server, as well as all required X11R6/bin/* utilities? It is my
> understanding
> that many of these utilities are required on any installation.
Most of the apps in /usr/X11R6/bin aren't very big. These are from the
ramdisk on handhelds.org to give you an idea. So even with ugly, antique
tookits like Xt, apps aren't all that big typically...
As Keith says, no apps are required (other than the ones you actually want
to use). Just for grins, I threw a bunch on our ramdisk. The one's
actually used for our demo are Xfbdev (the X server itself), bl (controlls
the front light), twm (window manager), xeyes, xcalc, xlogo, xload, xterm
(still has 4010 code that nonone needs), and xscribble (grafitti like input).
(all sizes uncompressed)
[jg@zap jg]$ more /tmp/foo
total 1463
-rwxr-xr-x 1 jg jg 604904 Jun 15 17:52 Xfbdev
-rwxrwxr-x 1 root root 12173 Jun 19 19:31 bl
-rwxr-xr-x 1 jg jg 41288 Jun 14 09:54 ico
-rwxrwxr-x 1 root root 12282 Jun 19 19:31 led
-rwxr-xr-x 1 jg jg 7664 Jun 14 09:54 listres
-rwxr-xr-x 1 jg jg 13608 Jun 14 09:54 oclock
-rwxr-xr-x 1 jg jg 146288 Jun 14 09:54 twm
-rwxr-xr-x 1 jg jg 93172 Jun 14 09:54 x11perf
-rwxr-xr-x 1 jg jg 23308 Jun 14 09:54 xcalc
-rwxr-xr-x 1 jg jg 14664 Jun 14 09:54 xclock
-rwxr-xr-x 1 jg jg 14952 Jun 14 09:54 xdpyinfo
-rwxr-xr-x 1 jg jg 15576 Jun 14 09:54 xev
-rwxr-xr-x 1 jg jg 12544 Jun 14 09:54 xeyes
-rwxr-xr-x 1 jg jg 13828 Jun 14 09:54 xfd
-rwxr-xr-x 1 jg jg 8512 Jun 14 09:54 xhost
-rwxr-xr-x 1 jg jg 9528 Jun 14 09:54 xload
-rwxr-xr-x 1 jg jg 8312 Jun 14 09:54 xlogo
-rwxr-xr-x 1 jg jg 5860 Jun 14 09:54 xlsatoms
-rwxr-xr-x 1 jg jg 24956 Jun 14 09:54 xprop
-rwxr-xr-x 1 jg jg 19424 Jun 14 09:54 xrdb
-rwxr-xr-x 1 jg jg 7264 Jun 14 09:54 xrefresh
-rwxr-xr-x 1 jg jg 50380 Jun 14 09:54 xscribble
-rwxr-xr-x 1 jg jg 22740 Jun 14 09:54 xset
-rwxr-xr-x 1 jg jg 11268 Jun 14 09:54 xsetroot
-rwxr-xr-x 1 jg jg 202552 Jun 14 09:54 xterm
-rwxr-xr-x 1 jg jg 21680 Jun 14 09:54 xwd
-rwxr-xr-x 1 jg jg 23048 Jun 14 09:54 xwininfo
-rwxr-xr-x 1 jg jg 18904 Jun 14 09:54 xwud
Here are the library sizes from this ramdisk:
-rwxr-xr-x 1 root root 792036 Jun 14 09:47 libX11.so.6.1
-rwxr-xr-x 1 root root 350128 Jun 14 09:47 libXaw.so.7.0
-rwxr-xr-x 1 root root 342532 Jun 14 09:47 libXt.so.6.0
-rwxr-xr-x 1 root root 276596 Jun 14 09:47 libdps.so.1.0
-rwxr-xr-x 1 root root 250264 Jun 14 09:47 libPEX5.so.6.0
-rwxr-xr-x 1 root root 244552 Jun 14 09:47 libXaw.so.6.1
-rwxr-xr-x 1 root root 89592 Jun 14 09:47 libXmu.so.6.1
-rwxr-xr-x 1 root root 80852 Jun 14 09:47 libICE.so.6.3
-rwxr-xr-x 1 root root 58800 Jun 14 09:47 libXext.so.6.4
-rwxr-xr-x 1 root root 57960 Jun 14 09:47 libXpm.so.4.11
-rwxr-xr-x 1 root root 46924 Jun 14 09:47 libXIE.so.6.0
-rwxr-xr-x 1 root root 32580 Jun 14 09:47 libSM.so.6.0
-rwxr-xr-x 1 root root 29704 Jun 14 09:47 libXi.so.6.0
-rwxr-xr-x 1 root root 28808 Jun 14 09:47 libXp.so.6.2
-rwxr-xr-x 1 root root 25936 Jun 14 09:47 libdpstk.so.1.0
-rwxr-xr-x 1 root root 19676 Jun 14 09:47 libpsres.so.1.0
-rwxr-xr-x 1 root root 19156 Jun 14 09:47 libXtst.so.6.1
I put most of the libraries on the ramdisk without thinking, as
I was in a hurry.
Also note that there are utilities to go through elf files and get rid
of unneeded trash (makes things harder to debug, but for production code
it isn't an issue.) The stuff above is vanilla elf; I believe
the exe's are stripped.
Note that PEX, and Xie are useless. Not much uses dps (since it was never
ubiquitous. We'd like to get rid of Xt and Xaw by using more modern
toolkits. libX11 can go on a major diet (probably > 600K savings
available). And many of the others probably aren't used by particular
apps/toolkits and might also be left out (though some are).
>
> However, I think there needs to be discussion on widget sets, regardless of
> windowing systems. I'm interested in a discussion of GTK for either
> X or Microwindows. Can it be made more modular?
>
This is the question: we'd like a better toolkit/widget set than Xt/Xaw/Motif.
This is why I beleive we have space for even an unmodified GTK+ (at least
on 32 megabyte machines like an iPAQ), etc, if needed (though they should
be put on a diet as well). So given that we also get network transparency
(so when you drop your handheld on the net you can just use it normally),
and familiarity of programming, this seems like a no brainer to me (but
then again, I'm biased).
- Jim
--
Jim Gettys
Technology and Corporate Development
Compaq Computer Corporation
jg@pa.dec.com