Debugging ARM64 booting of FreeBSD/GhostBSD Kernel for Raspberry Pi 4. What tool do you use? any JTAG hardware? Kernel.debug?

Hello, built this image from GhostBSD src code. (which follow closely to FreeBSD src code). for Raspberry Pi 4B. Yes I know NOT FreeBSD. Yet it is the debug methodology and JTAG hardware OpenOCD information sharing I am looking for to help me move further. I have 40 years experience in Electronics and Computers, but I am a little lost here, except to burn another image into a USB flash drive, switch the power on, Look it is broke. Yes, but where? I don't know. Can fill in more details. Spent three days my self researching missing files /boot/entropy /etc/hostid. So no I am not slacking off, just a little lost at next step.
https://www.crowdsupply.com/securinghw/tigard

An open source FT2232H-based, multi-protocol, multi-voltage tool for hardware hacking​



Thanks, Can post more information. Phishfry, Covacat How do you debug today?
 

Attachments

  • photo_2023-09-29_15-02-47.jpg
    photo_2023-09-29_15-02-47.jpg
    253 KB · Views: 62
  • tigard-front-edited_png_md-xl.jpg
    tigard-front-edited_png_md-xl.jpg
    176.7 KB · Views: 58
I do have a USB to UART 3.3V connected to the Raspberry Pi 4B. Thanks for the quick answers, PhishFry.
I did buy a Tigard board that should be here in a couple days. Maybe I can get that hooked to the JTAG pins for arm64 and see "what happened? Where I am? "

What about efibootmgr source code compiled and running for arm64?
https://github.com/freebsd/freebsd-...06fec962a14da3e7b4755c5880cf/stand/efi/loader
https://github.com/freebsd/freebsd-src/tree/de1aa3dab23c06fec962a14da3e7b4755c5880cf

Here is the output from efibootmgr comand:
root@generic:/boot/efi/EFI/BOOT # efibootmgr
BootCurrent: 0000
root@generic:/boot/efi/EFI/BOOT # efibootmgr --verbose
BootCurrent: 0000
root@generic:/boot/efi/EFI/BOOT #

Does not look too verbose, does it? I need to test, but I do no believe that you can add a second boot partition by using efibootmgr command. Do you have a command line that works for you? or does it just error out.

What does your efivar testing show?
Code:
root@generic:/boot/efi/EFI/BOOT # efivar
8be4df61-93ca-11d2-aa0d-00e098032b8c-SecureBoot
8be4df61-93ca-11d2-aa0d-00e098032b8c-SetupMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-AuditMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-DeployedMode
8be4df61-93ca-11d2-aa0d-00e098032b8c-VendorKeys
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLangCodes
8be4df61-93ca-11d2-aa0d-00e098032b8c-PlatformLang
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndicationsSupported
8be4df61-93ca-11d2-aa0d-00e098032b8c-OsIndications
cfee69ad-a0de-47a9-93a8-f63106f8ae99-LoaderPath
cfee69ad-a0de-47a9-93a8-f63106f8ae99-LoaderDev
root@generic:/boot/efi/EFI/BOOT #
Where is the information for boot_order and efivar located at?
 
Last edited by a moderator:
Where is the information for boot_order and efivar located at?
man efibootmgr

You already showed boot info. Your output looks wrong. Try with -v instead of --verbose
efibootmgr -v

If you are asking where are the efivar's stored they are in a storage area of UEFI firmware set aside for environment.

Much like there is a u-boot environment. Stored with firmware in dedicated area.

Tiano EDK2 also uses environment but has a dedicated partition for it in most cases.
 
Look my INTENT is to boot multiple different ARM64 O/S from different partitions on a 1 terrabyte USB sata SSD disk for the Raspberry Pi 4B /8GB computer.
https://blog.manjaro.org/february-2023-in-manjaro-arm/ Manjaro ARM RK3399 fixes to U-BOOT 2021.10 in manjaro repositories. Manjaro.org download area select ARM.
POP!_OS Download area. Select ARM for Raspberry Pi 4.
So I am thinking maybe their ARM64 efibootmgr and efivar programs are better than the 'boot 0000' of FreeBSD efibootmgr program. Maybe one could use their source to work with FreeBSD ARM64 to make a multi-partition boot order selection. Your thoughts.

Second point,) I am at the initial debug capability of write an image to a USB flash drive, plug it in to Raspberry Pi 4B, turn on the power, Is it working? or is it broke? yes broke, what happened what printed on screen. Some how relate that to lines of code somewhere.
What ARM64 supporting tools do you use to debug ARM64 hardware when the code stops running. Visibility? I have ordered the Tigard Board to obtain ARM64 JTAG capability and 3.3V TTL serial port connection. I have 3.3V TTL serial port connection now today with the Black Magic Probe (BMP) device. So, yes, I can see the print messages during boot up. You presently use a FTDI USB to serial TTL device connection at 115200 serial baud.
What techniques do you use for debugging a broken boot or broken kernel boot up?

Third point.) After FreeBSD kernel is booted up and running. You can type command s date , ls, pwd , whoami and others. Do you have any URLs recommend to read up on using DDB for ARM64 kernel debugging. Like for debugging a WIFI device driver code for the 43455 or 43456 wifi chip?

Tigard Board JTAG for ARM64 https://www.crowdsupply.com/search?q=tigard
Bit Magic Basic Logic Analyzer 8 bits https://1bitsquared.com/products/bitmagic-basic Works with Tigard board.
1 BIT SQUARED Black Magic Probe BMP debug for ARM32 bit M0 core https://1bitsquared.com/products/black-magic-probe

Any extra devices you connect to the hardware to help you debug better, with a little more visibility? Glowing leds, logic analyzer, extra serial ports ( I could turn on serial port UART3 on the raspberry pi 4b.)

Fred Finster Ghostbsd-Arm64.blogspot.com my ARM64 debugging posts to help me remember what I did to get here with having FreeBSD 14.0-CURRENT now 15.0-CURRENT running on the Raspberry Pi 4B hardware. Wow, I did watch a number of Raspberry Pi 5 https://youtube.com on this new hardware release from https://raspberrypi.com
FreeBSD subtopic Forums Raspberry Pi FreeBSD install with patching VCHIQ for HDMI TV Sound
 
Great News, GhostBSD-ARM64 is booting up on the Raspberry Pi 4B. Thank you Eric Turgeon, founder of GhostBSD Operating System, for the source code your crafted so finely. It just works! tm. Thank you Vermaden, for those many post & articles that answer my FreeBSD questions. FreeBSD Foundation for making ARM64 a Tier 1 supported CPU. Raspberry Pi Foundation for creating and supporting the Raspberry Pi 4B and now the Raspberry Pi 5 comming out in late October 2023. SleepWalker on PersonalBSD for supporting FreeBSD booting on ARM64 hardware. Phishfry & Covacat for answering questions to a new guy. Notes to self, Cut down the Loader to 3 lines, remove the extra stuff you don't need. Mountroot> ufs:/dev/da0p3 waiting for /var/os-release to update "hit return" waiting for xyz to update "hit return" Now to share FreeBSD/GhostBSD-ARM64 Stability with The Next Billion (TNB) people to connect with the internet and create products and ideas, rather than just mindless consume video on a cellphone. Lets Make something today. Write an Article With ABIword. Create a diagram with DIA. Use LibreCAD to create a DXF drawing to plasma cut a metal shape. Raspberry Pi 3,4,or 5 with a FreeBSD usb flash drive, hdmi output connected to your TV, a keyboard and a mouse, internet connection and you have a creative source at home. GhostBSD-ARM64.blogspot.com https://ghostbsd.org/download Freebsd ARM Mailing List Embedded FreeBSD Forums look here.
 

Attachments

  • GhostBSD_ARM64_First_Boot_Serial_UART0.jpg
    GhostBSD_ARM64_First_Boot_Serial_UART0.jpg
    204.1 KB · Views: 52
  • Telegram_First_BOOT_GhostBSD_ARM64_message.txt
    1.3 KB · Views: 66
  • GhostBSD-ARM64_First_Boot_Raspi4B_8GB.pdf
    170.2 KB · Views: 55
Robonuggie_XFCE_DE_Raspi400.png

https://www.youtube.com/@Robonuggie booting GhostBSD-Arm64 on Raspi 400 Keyboard
http://ghostbsdarm64.hopto.org/packages/ Download Ghost14_selfbuilt_raspi4b_Dec12_3.img.xz and decompress and burn into a USB flash drive. Also Download file GhostBSD.conf and place at /usr/local/etc/pkg/repos/GhostBSD.conf location
pkg install xorg xfce xfce4-goodies lightdm Should be enough to setup a XFCE Desktop Environment.
Wish you well on testing GhostBSD-Arm64 on a Raspberry Pi 4B, 3B, 400 on your SBC.
Ghostbsd-arm64.blogspot.com Many web pages to look at and review about GhostBSD-Arm64 image.
 

Attachments

  • Email_to_Michael_Dexter.txt
    2.6 KB · Views: 40
Back
Top