Minimizing X to load faster

Hello,

I have the following task to accomplish and I want to hear ideas of the people on what can be done (or what else can I read to accomplish what I want):

A company I'm working for is building a device which will run linux with an lcd display and there several requirements:

  1. Device should boot as fast as possible
  2. X should load and operate very fast
  3. The only application without any window managers that will be run will be Borland Kylix3 (Delphi) developed, Qt based.
  4. The graphics chip be a version of Via Savage chip.
  5. Whole system should fit if possible on 1 256Mb bootable USB Key/CF card

What has been accomplished so far and what I want to improve:

  1. A Linux system has been built based on Linux From Scratch 5.0 + some BLFS
  2. X 4.3.0.1 was compiled with support of fontconfig/freetype - however since Qt2.3.0 that Kylix uses doesn't support anti-aliasing I wonder if it will make any difference if I don't include any of this? Will it make X faster if it is run without Freetype/Fontconfig?
  3. Current space taken by X is 128Mb which unacceptable what can be deleted from it? I can't understand how people were able to fit X in less then 5Mb in the past.
  4. X takes 5+ seconds to start - absolutely unacceptable
  5. How to hide the "X" cursor and change the grey grid image to some bitmap or just plain color right from the start/permanently?
  6. Is it possible (and how?) to strip different parts of X like Networking functionality support, multiple display support, etc, etc. X will run only 1 application with 1 window nothing more. If it was possible I would have tried DirectFB as it is a better choice for our platform but because of the Kylix Qt application limitation - it is impossible.

Other then this other questions that I'm researching right now are:

  1. possiblity to statically compile all loaded applications... Will this improve boot/operation speed?
  2. compressing some part of the distribution and loading it into RAM memory at boot (we have plenty (256Mb of RAM)) - I was unable to find any way to do this yet

Any comments, links, book referrals are really appreciated.

Thank you in advance, Sergei

Reply to
Surge
Loading thread data ...

Mmmm, LFS. Only way to go, even with my Athlon 2.4+ ;-D

I think that freetype renders fonts faster but adds to startup time. Doesn't matter if you see below though.

Have a search for kdrive:

formatting link
formatting link

You can get a tiny X server in around 700KB! The source should be included with 4.3.x packages, see the second link for howto.

There are other (GPL) tiny X servers if that one is not suitable.

See above.

C'mon, you should do more research - you're being paid for this! :D

The grey grid is caused by twm (default small but ugly window manager), and the mouse issue is all over the web/usenet.

See point 2.

Yes on both counts. You can also prelink dynamically linked applications resulting in (virtually) the same speed increase. There are plenty prelinking tuts on www and usenet.

As for kdrive, it has all configuration and drivers compiled in. This results in a good speed boost.

initrd can decompress gzip compressed boot images into ram as the kernel boots. This can be the whole root filesystem AFAIK. Other mount points might be more challenging. You know where to find more info about initrd ;) ;).

For a working example of a small Linux distribution have a look at:

formatting link

Its features include: * Full featured graphical web browser with ssl support * File manager * Rdesktop remote client * vncviewer vnc client * ssh client * X scripting system * Text editor * Desktop system * X terminal emulator * Gnome/KDE compliant wm * many other linux utilities... but the best part is, wait for it...: It all fits on 1 floppy disk! That right, its a *one* floppy disk linux dstribution. Now thats what I call "super-amazing-fantastic-glorious", or cool for short.

--
Ben M.

----------------
What are Software Patents for?
To protect the small enterprise from bigger companies.

What do Software Patents do?
In its current form, they protect only companies with
big legal departments as they:
a.) Patent everything no matter how general
b.) Sue everybody. Even if the patent can be argued
	invalid, small companies can ill-afford	the
	typical $500k cost of a law-suit (not to mention
	years of harassment).

Don't let them take away your right to program
whatever you like. Make a stand on Software Patents
before its too late.

Read about the ongoing battle at http://swpat.ffii.org/
----------------
Reply to
Ben Measures

Look at

formatting link
There are links that point to articles on the subject. As pointed by the other fellow, TinyX (aka kdrive) is small, taking no more than 1.5M (AFAIK) with the needed libraries.

Elder.

Reply to
Elder Costa

Thank you for your comments Ben!

Well, I have LFS @ home and here at work :) At home it is cooler :)

I think I read somewhere that KDrive/TinyX are no longer developed by anyone, so that's why I stopped the research and attempts - but I will try today or tomorrow.

What I read so far indicates that I can't get rid of it, other then making it trasparent. However I will need cursor in some occasions... But not visible at startup. I don't like google for its inability to parse forums, so much info is hidden and most forums have super crappy search engines.

:) Actually NO TWM is there. :) The .xinitrc has only one line - the line that starts our application full-screen (think ATM machine). But for a second before it - there a black & white grid. SUSE has it, Mandrake somehow cleaned it and it is just blue background - for us solid grey will be also acceptable.

If you know at least a single readable/good one - can you please post link? Since I seem to find nothing generic.

Yes, I know where to find - but all the HOW-TO, etc don't tell me what exactly and in which secuence happens when initrd is loaded. I know it is possible to go through kernel code, but I would like to avoid this.

Thank you, Sergei

Reply to
Surge

KDrive was written by Keith Packard, who had a 'falling out' with the XFree86 core team over various issues, so yeah, its no longer being developed.

However, it works just fine, and is what I'm using for my small ~7MB with fonts and libraries X install.

xsetroot can set the background color xli can put an image on the background

--
Alex Pavloff - remove BLAH to email
Software Engineer, ESA Technology
Reply to
Alex Pavloff

Looking more closely at the 2-disk Linux/X distribution

formatting link
it seems as if they don't use kdrive. It appears they just use a slimmed down X 4.1 vesa.

Don't ask me how they've done this - I'm not smart enough (yet ;) ). On the upside, you've got me very interested/excited about tiny X distros and its something I'll be reading up on this summer.

Ooops, sorry. It was meant as a joke but my early morning crankiness was showing... :*)

Hiding the X cursor - I'm in deep water here, heh. I know this can be done by applications, not so sure of configs.

Thankfully, 'unclutter' might be all you need here:

formatting link
(It just makes the cursor a small transparent pixel if pointers aren't moved.)

Heh, I stand corrected. It must happen elsewhere in the configs (if you run just run 'X' you don't get any background).

Have a look at Alex Pavloff's post on this subject, he seems to speak the truth.

Gentoo documentation taught me most of what I know :D

formatting link

LOL, I'm not suprised - the 30+ million lines of code is daunting for anyone!

This answer happens to be right on your doorstep: 'man initrd'.

Happy to be of help. It clears some things for me too.

--
Ben M.

----------------
What are Software Patents for?
To protect the small enterprise from bigger companies.

What do Software Patents do?
In its current form, they protect only companies with
big legal departments as they:
a.) Patent everything no matter how general
b.) Sue everybody. Even if the patent can be argued
	invalid, small companies can ill-afford	the
	typical $500k cost of a law-suit (not to mention
	years of harassment).

Don't let them take away your right to program
whatever you like. Make a stand on Software Patents
before its too late.

Read about the ongoing battle at http://swpat.ffii.org/
----------------
Reply to
Ben Measures

Why not strip out X completely by running Qt/Embedded instead of Qt/X11? Can't Kylix do that? Ask Borland.

/RogerL

--
Roger Larsson
Skellefteå
Sweden
Reply to
Roger Larsson

As has been fairly well documented, none of these are particularly significant factors in diminishing memory usage.

It is a _myth_ spread by the ignorant that X is either "bloated" or "slow" because of inclusion of network functionality.

Perhaps you should examine what Jim Gettys did to get X to fit onto Itsy ARM PDAs. It's no longer particularly "recent," but this is exactly the sort of thing that the PDA-based Linux distributions do.

======================================================================= A bit of data: Keith Packard and I recently ported X to the Itsy...

I put the X server (3 fonts built in), xterm, xmh, a bunch of the random little X utilities (xdpyinfo, etc.), Xt, Xlib, various other of the "standard"> shared X libraries, and it was 1.3 megabytes compressed (2-3 times this size uncompressed). The only significant difference from a "standard"> X11R6 server was new frame buffer code Keith has written that cuts the code size of the X server down by about .5 megabytes.

While running, the server was reporting its size was a couple of megabytes. I don't have an Itsy handy this moment to get exact data; this is from memory.

There are certainly some very bloated X toolkits out there; there are also some reasonably small ones.

For most servers, backing store and save unders rapidly dominate memory usage: with 32 bit deep displays, a screen full of memory is 4 megabytes. It doesn't take all that many apps, particularly with some fragmentatation of the memory pool in the server, to cause the virtual address space of an X server to get large. So backing store and save unders dominate memory usage on most displays people use today (and/or any pixmaps the clients save at the server); the X server itself is hardly "bloated", though there is code around I question the need for from time to time...

Note that this is the nature of the beast; some other window system that also implements backing store and save unders would use similar amounts of memory for this purpose.

On itsy, of course, the display size is 320x200x4bits, so even backing store doesn't take much memory (about 1/100'th of the memory that a current 32 bit frame buffer would take).

But this is virtual space; so long as you aren't actively paging, what matters is that the working set be in memory.

If you are memory starved on a system, you might see if your X server supports disabling backing store and/or saveunders; this might save LOTS of memory (some servers these days just always do backing store and save unders).

--Jim Gettys =======================================================================

No, that will mean that each binary contains all of the libraries, which means that the applications will bloat up.

--
let name="cbbrowne" and tld="cbbrowne.com" in name ^ "@" ^ tld;;
http://www3.sympatico.ca/cbbrowne/xbloat.html
"In elementary school, in case of  fire you have to line up quietly in
a single  file line from  smallest to tallest.  What is the  logic? Do
tall people burn slower?" -- Warren Hutcherson
Reply to
Christopher Browne

Another distro to look at is my little Puppy Linux. I used Kdrive, Xfree v 4.3.0. I was able to cut X down to a very small size, and bootup time and general responsiveness is remarkable. From the prompt to the window manager fully loaded happens in the blink of an eye.

The live-CD is 41.6M, and that includes heavy-weight software like Mozilla and Amaya!

Puppy is especially designed to run in a USB card or Zip drive, and has installation scripts for these.

Puppy home page:

formatting link

Regards, Barry Kauler

Reply to
Barry Kauler

Alex Pavloff wrote: I have tried to find out more about kdrive/TinyX. Do you really have to get it from the unpacking of the xc/programs/etc..etc.. etc.. source tarball (12mbs) ?? Does TinyX support 256 color? 16k color 24m color?

Reply to
Mark Shelby

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.