booting with VERBOSE_SYSINIT

I sent email to Andrew Turner and he told me to enable VERBOSE_SYSINIT to see where such stuck happens during the kernel booting.

boot2

Now the log says kernel stuck at 0xffffff800040120c. Since I don’t have a JTAG debugger, I can only use addr2line. I didn’t use it much at office since I have Trace32… but I have no choice but to use addr2line at home. T.T Anyway old tool is still very useful and it tell me to spot the problem.

[jmin@maui /usr/obj/arm64.arm64/usr/home/jmin/src/arm64/sys/GENERIC]$ aarch64-freebsd-addr2line -e kernel.debug 0xffffff800040120c
/usr/home/jmin/src/arm64/sys/vm/vm_init.c:139

139th line of vm_init.c is vm_set_page_size(). Hmm.. what’s wrong now? Guess memory info from DTB is missing. Need to learn create dtb from dts on freebsd. or can i just use dtb made in linux?

Boot log

bsdboot

Before going to sleep…. build loader and kernel. Boot from usb. Finally saw the boot log. DTB is missing and probably uart driver needed to see more log. Good job Semihalf and Andrew Turner!

Changes for Freebsd arm port

Some changes for freebsd arm port.

1. Cavium will support it. (probably HW and technical support)

2. Semihalf and Andrew Turner started to do it.

3. Freebsd branch is now a part of freebsd git.

I didn’t take a look at for more than two months. New AP project was started and busy for handling it. Now I’m not so busy and inspired by the progress of arm64 port, I cloned git and tried to build… BUT!

Now the toolchain is a part of ports. You can install it by

# pkg install devel/aarch64-binutils

I’m building toolchain again!!

panic!

I thought system crashed after entering initarm() but it seems uart isn’t working properly. So I add some code to check TX holding register before writing char byte to early_putc(). So the early_putc() works and I could see more logs without problem. But soon I saw registers are dumped. kernel panic? kernpanic

do_el1h_sync prints some logs… 25 means data abort. So I checked some pointers and l2 isn’t valid. It has ‘0xffffffcbf8803000’  It seems not valid virtual address at this point. Need to debug more..

l2 = pmap_early_page_idx(l1pt, KERNBASE, &l1_slot, &l2_slot);

initarm entered…

Andrew Turner told me he disabled dosfs for loader.efi since he doesn’t use it now. You can find ‘conf.c’ at sys/boot/arm64/efi and uncomment &dosfs_fsops. I placed loader.efi and kernel image on removable usb and boot. Now loader.efi load kernel and boot….. but it fails at initarm() Time for more debugging!

initarm

I also need to check whether I can use nfs for loading kernnel from loader.efi. building and copying image to usb is very time consuming and tedious too.

EFI boot for ‘loader.efi’

DDed efi image to sd card and boot from it. Then setup tftpboot to loade ‘loader.efi’ binary from freebsd build server.

‘loader.efi’ is an implementation of ‘loader’ which runs as an EFI application. It should load kernel and dtb but I don’t

know yet how to do so…

efi

ps. Thanks for freebsd-arm mailing list and Andrew Turner’s work!

Networking works

Don’t know why but ethernet does not work. ETH0 is the primary network enabled on uboot. Don’t know why but management ethernet is the default and it works well. Maybe applied micro planned to put bmc on the board or integrate it with main SoC. It may be fun to implement bmc server on the small board like raspberry pi.