Booting process of chromium os

794 views
Skip to first unread message

Thakur Mahendar Singh

unread,
Oct 29, 2015, 2:47:06 PM10/29/15
to Chromium OS discuss
Hi,

I am new to Chromium, I am very much interested to learn and understand how the boot time is reduced in chromium os when compared to any other os.
I am trying to understand first fro x86 based architecture and then any other architecture. I want to analyse this with respect to the code.
According to the documents i have read it says that for x86, chromium uses coreboot to does the h/w initialization(what all the h/w components) then payload as u-boot.
In chromium os security video it is said like there is no any bootloader required, directly load the kernel. I want to know exactly what happens at the backend and how all other steps been removed from the traditional os for chromium.

If any one has done some kind of analysis for this please do share the information related to this.

In chromium desgin docs i got documents related some architecture stuff. But all i am looking for is related to booting and even i want to know how and were exactly we are customising the linux kernel to just look for network driver.

Regards
Mahendar Singh
 

David Hendricks

unread,
Oct 31, 2015, 2:29:21 PM10/31/15
to coolm...@gmail.com, Chromium OS discuss
Hi Thakur,
Which ChromeOS security video are you referring to?

coreboot initializes hardware and then loads a "payload." The payload can be anything - A diagnostic such as memtest86, a game such as Tint, an OS kernel, or a bootloader such as GRUB. Here is an overview of payloads: http://www.coreboot.org/Payloads

In ChromeOS devices, the payload is a bootloader. Current generation ChromeOS devices use Depthcharge, and previous ones have used U-boot. U-boot has a lot of useful features, but Depthcharge is much smaller and simpler as it was written specifically to handle verified boot on Chromebooks.

A bootloader loads a kernel from storage (SSD, eMMC, USB, etc) or network and then executes it.

There's a lot more info about this stuff here: https://www.chromium.org/chromium-os/2014-firmware-summit


--
--
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

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.

David Hendricks

unread,
Nov 8, 2015, 4:13:24 PM11/8/15
to Thakur Mahendar Singh, Chromium OS discuss
Please keep the discussion on the list as others may be able to offer advice and other resources.

On Sun, Nov 1, 2015 at 10:23 AM, Thakur Mahendar Singh <coolm...@gmail.com> wrote:
Hi David,

Thanks for response.

Well I am referring to the video which got posted on youtube related
to chrome Os security and even the same video link is available on
chromium.org.

I understood that coreboot /Depthcharge initializes the hardware and
then loads the payload. Here i want to understand what all the
hardware we are checking during the booting of chromium OS

That depends on the platform, and whether we're booting into normal mode or developer/recovery mode (which requires additional initialization for things like display and USB).

Coreboot and Depthcharge don't "check" hardware, they initialize it. Generally speaking, the idea is to do the minimum necessary work to get an OS kernel booted. This generally includes CPU/caches, memory, pinmux and GPIOs, some peripheral buses (e.g. for EC and storage).

You'll need to check the silicon vendor's documentation for full details, or read the source code.
 
and how
coreboot/Depthcharge loads the payload.

It reads it from the kernel partition on the storage media (SATA drive, eMMC, etc), passes in necessary kernel arguments, then jumps to the entry point.

For more details, look at depthcharge/src/arch/*/boot.c and boot documentation in the kernel tree:
linux/Documentation/x86/boot.txt
linux/Documentation/arm/Booting
linux/Documentation/arm64/booting
 
I want to analyse and learn
all this things cross checking in the code.

Once the payload is loaded how payload brings the kernel into RAM and
executes the kernel.Here in chromium we have many versions of linux
kernels available, I want to know which version kernel is getting
loaded into RAM.

I have attached a image "Traditional vs chrome". I want to know how
those steps are removed from the booting process from code. I want to
know Linux kernel is customized to boot.

Regards
Mahendar Singh

Thakur Mahendar Singh

unread,
Nov 9, 2015, 1:08:54 PM11/9/15
to David Hendricks, Chromium OS discuss
HI David,
Thanks a lott , the information given by you is very much useful.I have read those files.
In the Depthcharge ( /src/platform/depthcharge/drivers/ ) I have checked the Kconfig, file in which there are few drivers like bus,gpio,spi,ec etc. where are we initializing only this set of drivers.

As I mentioned 
about which kernel version to be used. I have encountered make.conf file in the /src/overlays/overlays-<board>/make.conf, this file contains all the board specific stuff like which all the flags to be used and kernel version as well.

Some where in the design documents i read that the actual Linux kernel
 is not been modified. now I have built the chrome OS for x86-generic and amd-64-generic
 boards. amd64 uses kernel=3.14. When I build the chrome OS, it should build kernel as well. When i cross checked the /src/third-party/kernel/files/v3.14/drivers/<any driver> directory, I should be able to see the .o files for all the respective .c files in that directory, but i couldn't see even single .o file and build got succeeded.

The idea here is I want to add my own device driver code as part of chromium OS any  try it and I even to enable few more drivers so that i can use those as part of chromium OS.

Adding the own board. I tried adding the new board by following the below link

https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/chromiumos-board-porting-guide/private-boards

https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/chromiumos-board-porting-guide/private-boards

I tried building it for ARM architecture. it gets failed during setup_board process only.
I have copied the make.conf from arm-generic board and build it.
do you have another and good way to add the new board and even exploring the kenel as well.

Regards
Mahendar Singh

David Hendricks

unread,
Nov 10, 2015, 2:39:37 PM11/10/15
to coolm...@gmail.com, David Hendricks, Chromium OS discuss
On Mon, Nov 9, 2015 at 10:08 AM, Thakur Mahendar Singh <coolm...@gmail.com> wrote:
HI David,
Thanks a lott , the information given by you is very much useful.I have read those files.
In the Depthcharge ( /src/platform/depthcharge/drivers/ ) I have checked the Kconfig, file in which there are few drivers like bus,gpio,spi,ec etc. where are we initializing only this set of drivers.

As I mentioned 
about which kernel version to be used. I have encountered make.conf file in the /src/overlays/overlays-<board>/make.conf, this file contains all the board specific stuff like which all the flags to be used and kernel version as well.

Some where in the design documents i read that the actual Linux kernel
 is not been modified. now I have built the chrome OS for x86-generic and amd-64-generic
 boards. amd64 uses kernel=3.14. When I build the chrome OS, it should build kernel as well. When i cross checked the /src/third-party/kernel/files/v3.14/drivers/<any driver> directory, I should be able to see the .o files for all the respective .c files in that directory, but i couldn't see even single .o file and build got succeeded.

The kernel is built using Portage (https://wiki.gentoo.org/wiki/Portage). Portage will normally copy the kernel sources to a temporary storage location, compile, install, and then remove the temporary storage location. This keeps the source tree clean and prevents the system from filling up with .o files.

Try this command:
FEATURES=noclean emerge-<your_board> chromeos-kernel-3_14

With "FEATURES=noclean" Portage will not remove the temporary location. The intermediate files generated by the "make" command for your kernel will remain in /build/<your_board>/var/cache/portage/sys-kernel/chromeos-kernel-3_14/

 
The idea here is I want to add my own device driver code as part of chromium OS any  try it and I even to enable few more drivers so that i can use those as part of chromium OS.

Cool. You will also need to update the kernel configuration. Here is a page explaining how to do so: https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/kernel-configuration

Regards
Mahendar Singh
--
--
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

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

Thakur Mahendar Singh

unread,
Nov 11, 2015, 7:17:42 AM11/11/15
to Chromium OS discuss, coolm...@gmail.com, david.h...@gmail.com
Hi David,

Thanks again, that was pretty much useful to me. Now I got to understand that 
chroot/build/<your_board>/var/cache/portage/sys-kernel/chromeos-kernel-3_14/ 
directory will contain the complete built kernel which include all the drivers built and even checked all the .ko and .o files are also available.

I think now, if I add my own driver code directly into my Linux kernel (i.e 3.14) and include to build my driver information in Kconfig and toplevel makefile. Is it enough to make my driver to appear into chromium OS well, because portage will unpack the kernel to above mentioned path and builds the kernel. then it runs
src/third_party/kernel/v3.14/arch/x86/boot/install.sh, this script to create few directories and install the drivers to respective directories and creates a kernel image.
please do correct me if my understanding above went wrong anywhere. Question here is just adding the source code and modifying the Kconfig and Makefile is it enough to appear my own driver code into chromium OS? Or should I need to do some tweaks where in chromium OS will install my driver code to build the image, if so then where I should look in to do that tweak?

I didn't get what that kernel configuration page actually says. It talks something about kernel config file based on the Family,Architecture and flavor. 

As I mentioned in the previous discussion regarding adding a new board(ARM) to overlay and to build it I followed the below links in doing it so

https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/chromiumos-board-porting-guide/private-boards

and when I run ./setup_board, setup got failed with many errors and I could see my board in the chroot/build/ directory. I want to add new overlay(ARM) and build chromium OS and try this on that board. please let me know how to add new overlay and build chromium OS for it in an order.

Regards
Mahendar Singh

Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-discuss+unsub...@chromium.org.

Mike Frysinger

unread,
Nov 12, 2015, 1:05:09 AM11/12/15
to coolm...@gmail.com, Chromium OS discuss, David Hendricks
you should create a branch in the 3.14 kernel, make all your changes there, and commit them.  then do `cros_workon-$BOARD start chromeos-kernel-3_14`.  when you do build_packages next, it should use all the local changes you've made to the kernel tree.
-mike


Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--

Thakur Mahendar Singh

unread,
Nov 12, 2015, 2:21:03 AM11/12/15
to Chromium OS discuss, coolm...@gmail.com, david.h...@gmail.com
Hi Mike,

Thanks. So it means if I want any changes of mine to be seen into chromium OS(locally in my build image), then I should  commit that code and build for the board then only it will be available.

Do you have any idea related to adding the new board (ARM) into overlays-<board>? I have already mentioned about it in my previous posts.

Regards
Mahendar Singh

Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-discuss+unsub...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

Mike Frysinger

unread,
Nov 12, 2015, 2:42:52 AM11/12/15
to Thakur Mahendar Singh, Chromium OS discuss, David Hendricks
really you just need to cros-workon start it.  committing it will make it easier to sync up to the latest tree.

wrt porting, you didn't provide any error messages, so we can't really guess.  you already found the documents that describe the process for creating your own overlay.
-mike


Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--
--
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

Thakur Mahendar Singh

unread,
Nov 12, 2015, 5:10:32 AM11/12/15
to Chromium OS discuss, coolm...@gmail.com, david.h...@gmail.com
Hi Mike,

I just blindly followed the porting document which i mentioned for creating overlay for imx6sabarelite board. As I wanted to build and port chromium on to that board and in overlays I couldn't find that board support.

Just for make.conf file I simply copied the content of make.conf from arm-generic board and pasted it here. 
After following all the steps mentioned now I run the setup_board script and I gave me errors. I am attaching the screenshots of it for reference.


                          

Regards
Mahendar Singh 

Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-discuss+unsub...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--
--
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

Mike Frysinger

unread,
Nov 13, 2015, 1:45:40 AM11/13/15
to Thakur Mahendar Singh, Chromium OS discuss, David Hendricks
in the future, please copy & paste text rather than take pictures of text

the error message seems pretty clear to me:
  .../make.conf: prebuilt.conf: no such file
you created a make.conf file referring to a prebuilt.conf file, but you didn't create that prebuilt.conf file.  most likely you just want to delete that line from the make.conf.

i looked in the guides, but nowhere did they say "include prebuilt.conf", so i'm not sure why you did that.
-mike


Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-dis...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--
--
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

--
--
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

Thakur Mahendar Singh

unread,
Nov 16, 2015, 2:23:15 AM11/16/15
to Chromium OS discuss, coolm...@gmail.com, david.h...@gmail.com
Hi Mike,

Thanks again, after knocking off the prebuilt.conf file from make.conf, I was able to run the setup_board sucessfully.

Yes,It was not even mentioned in the document to add prebuilt.conf in make.conf. There in the document it was said just leave the make.conf file like that later will can check it, but with empty make.conf file when I build I got errors so I just copied the content of make.conf file from arm-generic make.conf file and which has this prebuilt.conf so same was there in my make.conf aslo.

Now I tried building the building the package using build_package script I got the following error.

INFO    : Elapsed time (run_chroot_version_hooks): 0m0s
INFO    : Updating chroot
INFO    : Clearing shadow utils lockfiles under /
INFO    : Updating cross-compilers
INFO    : Updating the SDK
INFO    : Elapsed time (update_chroot): 0m55s
INFO    : Selecting profile: /mnt/host/source/src/overlays/overlay-mx6qsabrelite/profiles/base for /build/mx6qsabrelite
INFO    : Cross toolchain already up to date.  Nothing to do.
INFO    : Clearing shadow utils lockfiles under /build/mx6qsabrelite
INFO    : Checking package dependencies are correct: virtual/target-os virtual/target-os-dev chromeos-base/chromeos-installshim chromeos-base/chromeos-factory chromeos-base/chromeos-hwid chromeos-base/autotest-factory-install virtual/target-os-test chromeos-base/autotest-all
ERROR   : emerge detected broken ebuilds. See error message above.

my make.conf:

CHROMEOS_KERNEL_SPLITCONFIG="chromiumos-arm"

ARM_FPU=neon
MARCH_TUNE="-march=armv7-a -mtune=cortex-a15 -mfpu=${ARM_FPU} -mfloat-abi=hard"

# Include many firmwares as this is a "generic" board and might run on a
# wide variety of platforms with who knows what kind of hardware.
LINUX_FIRMWARE="${LINUX_FIRMWARE} iwlwifi-all"

USE="${USE} hardfp legacy_keyboard legacy_power_button neon"
USE="${USE} -opengl opengles"
USE="${USE} kernel-3_14 device_tree"

# Enable all optional features on generic overlays.
USE="${USE} buffet peerd wifi_bootstrapping"

# PORTAGE_BINHOST is pulled in from prebuilt.conf
#source prebuilt.conf

metdata/layout.conf:

masters = portage-stable chromiumos
profile-formats = portage-2
repo-name = mx6qsabrelite
thin-manifests = true
use-manifests = true

third_party/chromiumos-overlay/eclass/cros-board.eclass

I have updated cross-board.eclass file with my board name.

This are the changes I have done for following the documents, I am facing the above mentioned error and not sure of what error it is.

In order to build and port chromium OS particular ARM board, are this changes are enough or need to modify few more files? 


Regards
Mahendar Singh

Regards
Mahendar Singh
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-discuss+unsub...@chromium.org.



--
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.

--
--
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

--
--
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

Thakur Mahendar Singh

unread,
Nov 17, 2015, 12:36:40 AM11/17/15
to Chromium OS discuss, coolm...@gmail.com, david.h...@gmail.com
Hi Mike,David,

Did anyone got any chance of looking into this?

Regards
Mahendar Singh
Reply all
Reply to author
Forward
0 new messages