sakuraiiii
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `The Linux Foundation Youtube` # Tutorial: Introduction to the Embedded Boot Loader U-boot 我是看完了這個影片才發覺Youtube上面這個頻道真的是個學習Linux的好地方,另一方面也覺得不做一點summary記錄下來很是可惜。這篇的講者Behan Webster講得很清楚,同時不會像有的講者嗯嗯啊啊的贅詞一堆口音還很難懂,最後又有workshop帶你一步一步實做,算是有照顧到我這種動手派的需求了。 一般開機的順序為:First stage bootloader -> User bootloader -> Linux kernel -> Userspace。第一步的First stage bootloader在BootROM裡面,你改也改不到,進到第二步User bootloader才有第一個使用者可以修改的地方,這裡又可以拆解成U-boot SPL (secondary program loader)和U-boot,有時甚至有U-boot SPL, U-boot TPL (tertiary program loader), 和U-boot。 走到U-boot就有U-boot shell可以停下來,user可以在這裡觀察一些hardware informaion或是下boot argument去帶接下來的Linux kernel,或是可以在這裡修改device tree,另外有一些林林總總的memory access指令,gpio指令,i2c指令等等,總之U-boot的使命就是把接下來的Linux kernel image叫起來,我的理解這裡做出一個shell,可以執行一些比較複雜的for while loop,是一個方便debug的中繼站。 這個演講的youtube連結在[這裡](https://www.youtube.com/watch?v=INWghYZH3hI),投影片在[這裡](https://ossna2020.sched.com/event/c47M/tutorial-introduction-to-the-embedded-boot-loader-u-boot-behan-webster-converse-in-code),大致的章節如下: Basic U-boot commands U-boot memory access commands U-boot environment and scripting commands U-boot shell conditional expressions and loops U-boot data loading commands Booting the kernel Miscellaneous U-boot commands Compiling U-boot from source Labs 我覺得一張一張貼slide上來還不如自己上去抓原本的投影片,強烈建議看一下youtube,很淺顯易懂的! 最後是一個Q&A,我把一些重要的問題記錄下來: 1. How to boot very fast (within 1 second)? 這個問題是說怎麼把Linux boot弄的超級快,他知道有些機器可以快到一秒鐘以下,這是怎麼辦到的?我們都知道這問題沒什麼標準答案,端看你的系統多複雜,不過他還是給出了一些重要的hint,有時候hard coding或者是讓他「看起來好像跑起來了」就可以了,比如在一秒之內先帶一下screen,出一個開機logo就可以了。 "Some hard coding and sometimes "cheating" (some devices may not be full functional), and sometimes "pretened to be running" in 1 second." 2. Are there ways to access encrypted file systems in Uboot? 據他的經驗是沒有碰過這情形,另外他指出一個點,U-boot的GPL license不允許放有版權的東西,我對這東西不大清楚,似乎是在說有patent的encryption不能做。 "I've never done that before and to my knowledge I'm not aware of possible ways to do. Uboot has a strict policy on GPL only code and non-patented things only." 3. Does Uboot supoort USB? "Yes. Some beaglebone boards can use USB boot." 4. What is bootloader linker script? 聽他的解釋這東西聽起來很像之前在ARM改過的scatter file,不過主講者也說了這個一般是不會去改動他的。 "Linker script describes what goes where in memory so things can be loaded appropriately. Users usually don't care and leave as it is." 5. Talk about driver porting and Uboot 再次說明有版權的東西不應該放在U-boot code裡面,所以寫一些device相關的code在裡面會變得很奇怪,因為抓下來的人會需要再去拿掉這些code。 "Uboot is GPLv2 and if you need to put code in, you need to upstream it. If it is upstream it will be dragged along and hopefully there is no porting to be done." 6. Is there difference between Uboot and kernel device trees? "In theory the same, in practice they may change inside Uboot and kernel." 7. Can we have a live process after bootloader during kernel boot? 我猜測他的意圖應該是說,可以在bootz/i/m command帶入kernel image的同時,開一個process去監測系統帶入kernel image的行為嗎?常規上來說應該是不行,真的要做的話應該也是可以,但可能會需要其他的software幫助(其實我不是很懂,但應該是說最好別硬幹的意思吧) "In general no. In practice there are other ways of spliiting cores to run other operating systems. If you were to bring up let's say a hypervisor and starting kernel at the same time, but without other software you cannot."

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully