postmarketOS/Alpine edge image for the Pinebook Pro
#58
yeah, I can see your issue. Let's roll this up from the back:

U-Boot essentially is a firmware and boot loader. One can think of it as Grub+BIOS. It initializes the hardware and loads the kernel into memory.
ARM platforms look for the 64th block and start executing code from there. That's the reason why one has to seek the 64th block, when dd'ing
the firmware onto eMMC or SD.

U-Boot itself consists of 2 parts, a stage1 loader and the actual u-boot image.

The Boot ROM is pretty much a set of instructions that is often stored inside the CPU and gets loaded directly into the cpu at powerup to
initialize the absolute bare minimum hardware required, to enable the possibility to run any externally stored code.

This includes looking into the 64th block (exactly that one) of your boot drive after it's job is done. That's where the first stage of U-Boot
can be found, the stage1 loader. This loader is responsible for actually loading the U-Boot Binary into RAM. Essentially, this is the reason why
we need to 'seek=64' when we want to flash the first part of U-Boot onto SD or eMMC.

Since the Boot ROM does not initialize anything except the bare minimum, stage1's data needs to be stored in a FAT scheme, so we are very limited
in available storage space for stage1, which we have to use economically to set up everything required to load the U-Boot binary into RAM and
start running it. U-Boot is quite a bit larger than stage1 and that's the primary reason we have stage1. It's a small piece of executable
binary responsible for getting the system ready to run and load a larger piece of executable binary. That's why the boot process is often
described as pulling oneself out of a swamp at one's hairs. Again, we basically place the U-Boot binary in a specific location (2nd dd seek)
as a convention, so that stage1 loads the appropriate data into RAM. Keep in mind, that Stage1 is basically a dump fuck, it loads, whatever is
at that location and doesn't care, if it makes sense or not.

Inside the U-Boot binary is, where the magic is actually happening. This is, where device drivers are initially loaded and you can extend it in
any way you want. PXE Boot? Implement it here. USB boot? Initialize your USB controller, loading USB Drivers, initializing your NVMe ...here is
where it's done. Once you initialized your Hardware, U-Boot loads the kernel image into RAM and hands of controll to the kernel and your
specific init system (systemd, initd, whatever you're using). This is, why there are so many different versions of U-Boot. We got tailormade
versions of U-Boot per device since drivers and initialization varies according to the specific controllers and hardware in your system.

To summarize, the boot process looks like this:

Boot ROM ==> Stage1 ==> Stage2(actual u-boot) ==> kernel => init


For your standard PC, this would look like this:
Boot ROM ==> Firmware (BIOS/UEFI/libreboot/...) ==> bootloader ==> kernel ==> init

in comparison, UEFI or BIOS would do comparably more than Stage1 while the bootloader does less.


I hope that clears up a few of your questions.

(06-13-2020, 07:37 AM)randomuser987987 Wrote:
(06-13-2020, 06:49 AM)matosys Wrote: What's your problem exactly? 1. Are you missing a conceptual overview, 2. knowledge about the boot process or 3. what it does?

Maybe all of them?
Things that are unclear to me:

- Which distro uses which uboot? Where is the code? It seems like pmos uses the original uboot with some patches for the LED.

- How do I actually compile it into a flashable image?

- Where can I configure things like boot order, boot target etc. in uboot?

- What is booting what? Why is there some extlinux appearing in the Manjaro distro? Uboot is booting syslinux which boots Linux? What is happening?

Oh and about the configuration thing: yes, you *can* with enough expertise. Just like people forked a u-boot version to add NVMe as a boot option.

If you expect something like a BIOS, I have to disappoint you
  Reply


Messages In This Thread
RE: postmarketOS/Alpine edge image for the Pinebook Pro - by matosys - 06-13-2020, 08:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Debian on Pinebook Pro u974615 8 456 03-22-2024, 03:57 PM
Last Post: u974615
  Pinebook Pro upgrading from the factory image yamsoup 12 1,141 02-22-2024, 04:02 PM
Last Post: tllim
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 1,923 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 1,983 12-11-2023, 03:47 AM
Last Post: calinb
  Gentoo on Pinebook Pro RELEASE jannik2099 54 86,703 12-08-2023, 11:25 PM
Last Post: tllim
  Boot Order in Pinebook Pro food 8 1,014 11-23-2023, 07:37 AM
Last Post: KC9UDX
  PineBook Pro seems to go to deep sleep, but doesn't wake up pogo 11 4,935 08-31-2023, 04:20 PM
Last Post: TRS-80
  Would a Pinebook Pro be good for a Linux newbie? cassado10 6 1,329 08-08-2023, 04:58 AM
Last Post: moobythegoldensock
  Install deepin OS on pinebook pro wangyukunshan 4 1,428 08-07-2023, 01:12 PM
Last Post: myself600
  Kali Linux for Pinebook Pro - stuck on the login screen owaspfap 0 609 07-13-2023, 05:21 PM
Last Post: owaspfap

Forum Jump:


Users browsing this thread: 1 Guest(s)