!xmLtiCaAJxfhURjrXl:matrix.org

NixOS RISC-V

240 Members
NixOS on RISC-V https://wiki.nixos.org/wiki/RISC-V https://pad.lassul.us/NixOS-riscv64-linux 74 Servers

Load older messages


SenderMessageTime
8 Apr 2024
@thefossguy:matrix.orgPratham Patel (you can mention me) cnx: ^^^ 07:53:26
@cnx:loang.netcnxi'm not familiar with u-boot (process), does it not load the kernel but efi?08:24:47
@thefossguy:matrix.orgPratham Patel (you can mention me)You can do both08:25:37
@alex:tunstall.xyzAlex
In reply to @cnx:loang.net
i'm not familiar with u-boot (process), does it not load the kernel but efi?
The boot partition contains the systemd-boot loader, the kernel, and the initrd.
08:25:48
@alex:tunstall.xyzAlexOr was it GRUB?08:26:05
@thefossguy:matrix.orgPratham Patel (you can mention me)but if you want a non-ext for rootfs, it's best to boot into a bootloader (grub/systemd-boto) from uboot and then load kernel08:26:20
@cnx:loang.netcnxthanks!08:27:05
@alex:tunstall.xyzAlex

Anyway, here's the full boot chain typically used on the JH7110-based SBCs:

ZSBL (ROM) -> OpenSBI and u-boot (usually flash) -> GRUB/systemd-boot (boot partition) -> kernel (boot partition) -> initrd, AKA NixOS stage 1 (boot partition) -> root system, AKA NixOS stage 2

08:29:19
@cnx:loang.netcnxhow is opensbi and u-boot loaded?08:30:04
@cnx:loang.netcnxi mean where are they loaded from a storage in case of sdio?08:30:25
@cnx:loang.netcnxthe beginning of the drive?08:30:32
@alex:tunstall.xyzAlexNope, the ZSBL looks for a partition with a specific type in the GPT.08:30:56
@cnx:loang.netcnxi see, so say i can have a partition for them on the emmc and use the rest for boot partition and os?08:31:59
@alex:tunstall.xyzAlexYes, but you can also keep them in flash and have the entire disk for yourself.08:32:21
@cnx:loang.netcnxi'm reluctant to override the stock flash, is it possible to back it up?08:32:58
@alex:tunstall.xyzAlexPresumably, though I don't know how you'd do that.08:33:14
@alex:tunstall.xyzAlexYou probably should be updating it because the vendor has significantly improved it over the past year.08:33:42
@thefossguy:matrix.orgPratham Patel (you can mention me) ZSBL is in SoC's ROM. That has an offset to look for, where OpenSBI is stored. OpenSBI either has a hardcoded offset that it looks for, to load U-Boot, or you can specify one at build-time (IIRC, the later is done for the VF2) and then U-Boot scans storage mediums in the given order and scans for EFI partitions and loads from the first match. 08:34:01
@alex:tunstall.xyzAlexUp to you I guess.08:34:03
@thefossguy:matrix.orgPratham Patel (you can mention me)
In reply to @cnx:loang.net
i'm reluctant to override the stock flash, is it possible to back it up?
even if you f it up
08:34:26
@thefossguy:matrix.orgPratham Patel (you can mention me)it's easy to override it08:34:32
@thefossguy:matrix.orgPratham Patel (you can mention me)using the vendor's recovery tool08:34:40
@alex:tunstall.xyzAlex

That has an offset to look for, where OpenSBI is stored.

I've been playing around with booting custom binaries on the SBC before, and it definitely won't load it if the partition type ID doesn't match.
Now I haven't tried whether or not it supports having that partition at a different location, so you could still be right...

08:35:52
@thefossguy:matrix.orgPratham Patel (you can mention me)best not to try it, and remain sane :)08:36:38
@alex:tunstall.xyzAlex
In reply to @thefossguy:matrix.org
using the vendor's recovery tool
To elaborate: as long as you have access to UART, you can't brick your system because the ZSBL is also capable of loading the next stage directly over UART.
08:37:21
@cnx:loang.netcnxthanks, that's good to know08:37:44
@alex:tunstall.xyzAlex
In reply to @thefossguy:matrix.org
best not to try it, and remain sane :)
Well I've already reverse engineered some of the ZSBL code, so I'm not sure what sanity I have left...
08:38:10
@cnx:loang.netcnx
In reply to @thefossguy:matrix.org
ZSBL is in SoC's ROM. That has an offset to look for, where OpenSBI is stored. OpenSBI either has a hardcoded offset that it looks for, to load U-Boot, or you can specify one at build-time (IIRC, the later is done for the VF2) and then U-Boot scans storage mediums in the given order and scans for EFI partitions and loads from the first match.
if the opensbi offset is fixed does it mean you need to flash the partition table along with it?
08:40:14
@thefossguy:matrix.orgPratham Patel (you can mention me)
In reply to @cnx:loang.net
if the opensbi offset is fixed does it mean you need to flash the partition table along with it?
this is selected at compile-time for the VF2
08:40:44
@cnx:loang.netcnxI meant the offset to find opensbi08:41:04

There are no newer messages yet.


Back to Room ListRoom Version: 10