Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Dec 2015 04:48:55 +0100
From:      Sylvain Garrigues <sylgar@gmail.com>
To:        freebsd-arm@freebsd.org
Subject:   Booting the ELF kernel without ubldr on Raspberry Pi
Message-ID:  <C6819C94-DF61-447F-AC61-FD3E061A6F76@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

I=E2=80=99d like to boot FreeBSD directly with u-boot, without ubldr, =
using an image provided by the u-boot mkimage tool. The reason is =
simple: mkimage can deal with compressed kernels and will therefore =
speed my boot time. And I want to try it anyway, as it seems possible =
reading =
http://bsdcan.org/2008/schedule/attachments/49_2008_uboot_freebsd.pdf =
<http://bsdcan.org/2008/schedule/attachments/49_2008_uboot_freebsd.pdf>; =
and various other=20

Before going there and using an mkimage, I=E2=80=99d like to boot the =
kernel image just with the same bootelf version provided by the =
sysutils/u-boot-rpi2 port. It doesn=E2=80=99t display anything and =
crashes (I think I can see =C2=AB illegal instruction =C2=BB just before =
the board reboots). I don=E2=80=99t understand why, and this is my first =
question.

Then I looked at the mkimage utility, although we can specify and =
freebsd kernel type through the -O flag, the bootm command only =
understands linux and NetBSD. I guess I should use linux there?

Thanks for your help,
Sylvain


PS: FYI, below is:

1/ info about my kernel (I can see the entry point is at 0xc0100100), =
copied into the fat partition

# readelf -h =
/root/crochet/work/obj/arm.armv6/root/crochet/src/sys/RPI2/kernel        =
                 =20
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00=20
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0xc0100100
  Start of program headers:          52 (bytes into file)
  Start of section headers:          6235080 (bytes into file)
  Flags:                             0x5000202, has entry point, =
Version5 EABI, <unknown>
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         38
  Section header string table index: 35
[root@clad /usr/ports/sysutils/u-boot-rpi2]# =20

2/ the interesting part of my include/configs/rpi-common.h from u-boot:

#define CONFIG_EXTRA_ENV_SETTINGS \
        ENV_DEVICE_SETTINGS \
        "loadaddr=3D0x02000000\0" \
        "Fatboot=3D" \
          "env exists loaderdev || env set loaderdev ${fatdev}; " \
          "echo Booting from: ${fatdev} ${bootfile}; " \
          "fatload ${fatdev} ${loadaddr} ${bootfile} && bootelf =
${loadaddr}; " \
        "\0" \
        "preboot=3D" \
          "fdt addr 0x100; " \
          "env set bootfile kernel; " \ =20
          "env set fatdev 'mmc 0'; " \
        "\0"
#undef  CONFIG_BOOTCOMMAND
#define CONFIG_BOOTCOMMAND     "run Fatboot"
#undef  CONFIG_PREBOOT
#define CONFIG_PREBOOT         "run preboot"=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C6819C94-DF61-447F-AC61-FD3E061A6F76>