[haiku-development] Re: Ticket #1115 Booting in Live CD mode is slow

  • From: Michael Crawford <mdcrawford@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Tue, 2 Mar 2010 08:20:49 -0800

The main source of slowosity when reading a CD-ROM is moving the
optical head back and forth.  It is really quite slow, because the
tracks on a CD are very fine, so the optical head has to be moved with
great precision.

One way you could speed the boot dramatically would be to place the
server binaries on the physical sectors of the CD in the exact same
order as they are launched by the boot script.

That might not be as difficult to implement as one might think.
Possibly when an ISO is created by an authoring tool such as mkisofs,
the files are placed into the physical CD blocks in the same order as
they are read from the filesystem.

The typical way of mastering a CD is to create a directory tree
containing the entire CD contents, and then to create the ISO by just
adding the top-level directory to the ISO, with the files and
directories within being added recursively.

The slowosity might be eliminated if one would instead create an
explicit list of every file and directory that is to go onto the CD,
then rearrange the order of the items in the list so that they are
laid down in the proper order.

You need not set an explicit order for every single file in Haiku!
Just for the ones that have to be read during boot.

Maybe there is some straightforward way of instrumenting the kernel or
libbe.so so that all opens and execs of files could be written to a
log, possibly via a serial port or network connection.

strace on Linux will do that.  Does Haiku have an equivalent?

If one could make such a log, then you would only explicitly order the
files that got opened or execed starting from boot until the Tracker
was ready for user input.

Of course, one would have to take care to prepare the ordering list so
that parent directories are created before their children are.

Mike
-- 
Michael David Crawford
mdcrawford at gmail dot com

   GoingWare's Bag of Programming Tricks
      http://www.goingware.com/tips/

Other related posts: