Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to ChromeOS (By: Fahad Mansoor) - ...

Introduction to ChromeOS (By: Fahad Mansoor) - DevFest Lahore 2023

Talk by Fahad Mansoor at DevFest Lahore 2023 by GDG Lahore.

GDG Lahore

December 23, 2023
Tweet

More Decks by GDG Lahore

Other Decks in Programming

Transcript

  1. • The operating system for chromebooks • Open-source foundation built

    on Chromium OS • Linux roots with a user-friendly interface • Sandboxing and verified boot for enhanced security • Seamless integration of web, Android, and Linux apps • Built for speed and efficiency, ideal for cloud-based workflows Introduction: What is ChromeOS
  2. • 2009: Chromium OS: The open-source foundation is laid •

    2011: Chromebooks arrive: Bringing Chrome OS to the mainstream • 2016: Android app support: Expanding the app ecosystem • 2021: Linux app support: Bridging the gap with traditional software via Crostini ChromeOS History
  3. - Uses multi tier architecture. - The Linux kernel is

    the OS kernel - The primary user interface is actually the Chrome browser. (Aura Shell) - There are user space daemons that run in the background (e.g powerd, update_engine, shill/connection management) ChromeOS Architecture
  4. • Sandboxing: Each Chrome tab and extension runs in an

    isolated container, preventing malware from spreading and compromising the system. • Verified Boot: This mechanism ensures only authorized software can boot the device, thwarting unauthorized tampering attempts. • Automatic Updates: ChromeOS receives automatic updates for the operating system and apps, keeping users protected against the latest security vulnerabilities. • Data Encryption: User data is encrypted both at rest and in transit, safeguarding sensitive information from unauthorized access. • Hardware Security Chip: Advanced Chromebooks incorporate a dedicated security chip (TPM) that provides tamper-resistant storage for sensitive data like passwords and encryption keys. Security in ChromeOS
  5. ChromeOS Development • ChromiumOS is open source. • Anyone can

    contribute to the project and look at the source code. • http://source.chromium.org
  6. Repositories • ChromiumOS ◦ ChromiumOS is the repository that contains

    mostly platform specific code ◦ e.g. Writing code for user land services, firmware, some startup code etc • Chromium ◦ Chromium repository is used for the the chromium browser. This include writing the UI specific code for ChromeOS. This would include writing code for the System settings UI, any UI that you see on the chromebook.
  7. Fundamentals - Development Frontend - Most of the frontend code

    is written in the polymer/lit library. - In typescript. - Runs in the renderer process which is sandboxed. Backend - The actual code is written in C++ in the chromium codebase. The frontend and the backend communicate with each other through inter process communication using something called Mojo. See [1] [1] https://chromium.googlesource.com/chromium/src/+/HEAD/docs/mojo_and_services.md
  8. Chrome/ChromeOS Development Lifecycle Overview 1. Find something to change/fix 2.

    Checkout the code 3. Create a change list (CL) 4. Get it reviewed 5. Submit the CL 6. Wait for it to be reverted (hopefully not!) 7. Wait for it be released in the next milestone
  9. Chrome/ChromeOS Development Lifecycle Overview 1. Find something to change/fix 2.

    Checkout the code 3. Create a change list (CL) 4. Get it reviewed 5. Submit the CL 6. Wait for it to be reverted (hopefully not!) 7. Wait for it be released in the next milestone This comes either from the product management team, but as OSS contributor you can always find something on http://crbug.com and it. But please leave a comment on the bug you intend to fix first
  10. 2. Checkout the code (linux) • Install depot tools ◦

    git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git ◦ export PATH="/path/to/depot_tools:$PATH" • Checkout chromium ◦ mkdir ~/chromium && cd ~/chromium ◦ fetch --nohooks chromium ◦ ./build/install-build-deps.sh ( to install build dependencies) ◦ gclient runhooks • When stuck consult the chromium build instructions for your system on the web
  11. 3. Create a change list • After making your changes

    write a nice commit message and create a commit • Run presubmits ◦ git cl presubmit • If the presubmits pass and you have written tests, feel free to upload your change by running ◦ git cl upload
  12. 4. Get it reviewed • Check gerrit ◦ Gerrit is

    the open source internal tool that is used for code review ◦ http://chromium-review.googlesource.com • Run CQ (Commit queue) dry run, which is akin to the CI-CD bots that run tests and verify that your change doesn’t break anything • Add reviewers ◦ Chromium usually has an owners file for each directory. The code can only be submitted once you have an approval (+1/ LGTM) from one of the owners in the owners file. ◦ As an open source contributor you need at least 2 approvals to submit your code in to the tree, with one of them being the owner.
  13. 5. Submit the change • Once you have enough approvals,

    hit the submit button in gerrit. This will usually trigger CQ • Once it is submitted gerrit will change the status to merged and submitted. • Note: The bug will usually have to be verified by someone from eng prod once it is submitted, this is usually done by the team owning the component where you’re doing the bug fix if you’re doing it as an external coordinator.
  14. 6. Wait for it to be reverted • Chromium has

    a concept of a rotating sheriff and a gardener. • These people are responsible for making sure that the commit queue (CQ) build bots stay green. • If your change turns the tree red, it will most likely be reverted and you will have to get approvals for it again. • Possible reasons for breaking the tree ◦ Address/Memory/Thread sanitizers find issues in your patch. These some time to run so they are not the part of the normal commit queue bots ◦ Multiple changes get submitted at the same time changing the same thing. ◦ Flaky tests
  15. 7. Wait for it to be included in the milestone

    • Chromium and ChromeOS has a release schedule of 4 weeks. • You are not supposed to submit new features for a milestone after feature freeze date which happens 2 weeks before a the branch date. • The current release schedule can be seen at https://chromiumdash.appspot.com/schedule
  16. • ChromeOS is a secure and easy to use operating

    system which has many use cases. • Becoming an open source contributor to Chrome and ChromeOS is not as hard as it seems. Conclusion