Boot time is tracked for every release and any regressions are
flagged. There's still some work going on for optimizing our I/O
patterns during boot on the Atom Chromebooks, but we are somewhat
limited by the hardware (CPU and Disk) as well.
> --
> Chromium OS discuss mailing list: chromium-...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-discuss?hl=en
OK. I can give you the low-down on the basics of the boot process.
At the highest level, boot divides into these three phases:
Phase 1: BIOS startup/kernel load (1.5 seconds)
This phase begins when the CPU powers on and starts fetching. It
ends when control transfers to the decompressed Linux kernel.
For x86 based systems, large parts of this startup are implemented
in proprietary code owned by third parties (not Google). Source
code isn't publicly available.
For ARM based systems, U-boot does a lot of the work. The Chromium
OS U-boot sources are part of the public source tree.
Phase 2: Start the kernel and exec /sbin/init (1.3 seconds)
This phase starts in the kernel, and continues until /sbin/init
(Upstart) kicks off the first Chromium OS specific processing in
a script called /sbin/chromeos_startup.
The bulk of the source code for this phase is in the Chromium OS
kernel source tree. These sources are derived directly from the
Linux kernel.
Phase 3: User process startup (4.6 seconds)
This phase begins roughly at the moment the Chromium logo splash
screen is displayed. The two longest operations in this phase of
startup are starting the X server (2.5 seconds) and starting the
Chrome Browser (1.7 seconds).
The key code responsible for sequencing this phase is a collection
of upstart jobs and scripts in the chromeos-init package. In the
final image, the upstart jobs live in /etc/init.
==
The numbers above are for the R16 (stable channel) builds. The
times above don't include a small but significant amount of time
spent by the hardware between the time you push the power button
and the time when BIOS starts executing. The time summaries also
aren't perfect; some time in the kernel is attributed to the
firmware, and some time in user process startup is attributed to
the kernel.
As for what makes it fast: There's no one single thing. A few
key features:
* The custom Chrome OS firmware is faster than a standard BIOS.
One obvious improvement: A typical BIOS will wait for a few
seconds to allow users to press a key (like F1) in order to
to go to BIOS setup. The Chrome OS BIOS doesn't do this.
* The user process startup leaves out some services commonly
started in a standard Linux distribution. Other services are
simply delayed until after Chrome's login screen is ready.
> --
> Chromium OS discuss mailing list: chromium-...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-discuss?
> hl=en
-- jrb
"Il semble que la perfection soit atteinte non quand il n'y a plus
rien à ajouter, mais quand il n'y a plus rien à retrancher."
(Antoine de Saint-Exupéry, "Terre des hommes")
>
> Thank you for giving me so much help. ChromeOS start on the three
> phases, I feel it is very similar with the standard linux boot. I
> really want to know how to start the process. As you said, what
> services are started, what services are being postponed. So I can
> use it with the traditional linux for a comparison. I think it is
> best that if you could give me a flow chart about the ChromeOS's
> startup progress..
> ------------------
> 周龙
(re-added chromium-...@chromium.org so that all
the interested parties can continue to benefit from
the discussion).
I can't speak directly to either BIOS or kernel startup,
as I don't know them very well. A few key pointers if
these phases interest you:
* As I mentioned, the BIOS contains a fair amount
of proprietary code, so there's not as much to talk
about. If you're interested in ARM, you can dive
into the U-boot sources.
* I believe there's very little startup customization
in the Chromium OS Linux kernel build. If you're
familiar with the Linux kernel, you know how it works.
Regarding user process startup, it's driven by a collection
of upstart jobs custom-written for Chromium OS. There are
two key upstart jobs worth knowing about up front:
boot-services.conf
system-services.conf
Comments in these two files describe their roles in the boot
process. The key observation is this: jobs that depend
on 'boot-services' start early in the boot flow and run
in parallel with the X server and Chromium browswer startup;
jobs that depend on 'system-services' are delayed until after
the browser displays the login screen.
Jobs that start with 'boot-services' are generally critical
to logging in to the system, and include principally these items:
* Access to encrypted user directories (cryptohome.conf).
* Network services (flimflam.conf).
* The X server, including initialization for human-interface
devices (ui.conf).
* Chromium.
X server and Chromium startup are handled by the session
manager. The starting point is an upstart job called 'ui.conf',
which starts a script called session_manager_setup.sh.
One final piece of magic worth knowing about: after the
browser displays the login screen it notifies session_manager,
which then emits an upstart event called 'login-screen-visible';
that event is what eventually triggers the 'system-services'
jobs.
==== Source code references
The core upstart jobs can be found at this path in a standard
source repository:
src/platform/init
You can browse them online here:
http://git.chromium.org/gitweb/?p=chromiumos/platform/init.git;a=tree
The session manager is here:
src/platform/login_manager
http://git.chromium.org/gitweb/?p=chromiumos/platform/login_manager.git;a=tree
==== Additional online references
There's a summary of how to test Chromium OS boot performance here:
http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/measuring-boot-time-performance
The summary mentions the events that mark the boot time critical
path, and roughly where to find them in the source code. There's
also sample data that can give a sense of where the time goes to.
Additionally, if you want to generate a graphical representation
of the boot process, there are instructions about how to generate
a run time graph with 'timechart':
http://www.chromium.org/chromium-os/how-tos-and-troubleshooting/a-brief-perf-how-to
To do this you'll need your own hardware and a custom build of
Chromium OS. The instructions may have molded a bit; let me know
if they don't still work.
Enjoy!
>
>
>
> ------------------ Original ------------------
> From: "Richard Barnette"<jrbar...@chromium.org>;
> Date: Fri, Dec 23, 2011 02:41 AM
> To: "364902036"<3649...@qq.com>;
> Cc: "Chromium OS discuss"<chromium-...@chromium.org>;
> Subject: Re: [cros-discuss] about ChromeOS's startup process