FreeBSD for Edge / Edge-V

FreeBSD for Khadas Edge SBCs

Thankful appreciation to the efforts of @hyphop and @SleepWalker, who spent the last few weeks making FreeBSD compatible with the Edge and Edge-V!

DEVICES

REQUIREMENTS

  • Edge / Edge-V with at least 4GB of RAM
  • 8GB of larger micro SD card

INSTALLATION VIDEO


YouTube: https://youtu.be/ml2e6w8msfk

BOOTABLE SD IMAGE

https://dl.khadas.com/Firmware/Edge/FreeBSD/

An example of downloading and writing the image to an SD card.

cd /tmp
wget https://dl.khadas.com/Firmware/Edge/FreeBSD/EDGE-FreeBSD-20191022-2342.img.gz
gzip -dc EDGE-FreeBSD-20191022-2342.img.gz | sudo dd bs=1M of=/dev/YOUR_SD_CARD_DEVICE
sync

NOTE: Erase internal emmc before booting from the SD card!

STATUS

  • FreeBSD 13.0-CURRENT
  • mainline uboot U-Boot TPL 2019.10-rc3
  • bootup from SD
  • eth OK
  • uart OK
  • emmc OK
  • sd OK
  • USB 2.0 OK
  • USB HID OK
  • USB DISK OK

TO DO

  • USB 3.0
  • HDMI
  • DRM
  • NVme m2
  • boot from eMMC
  • ā€¦

ABOUT FREEBSD

FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular open-source BSD operating system, accounting for more than three-quarters of all installed BSD systems.

FreeBSD has similarities with Linux, with two major differences in scope and licensing: FreeBSD maintains a complete system, i.e. the project delivers a kernel, device drivers, userland utilities, and documentation, as opposed to Linux only delivering a kernel and drivers, and relying on third-parties for system software; and FreeBSD source code is generally released under a permissive BSD license, as opposed to the copyleft GPL used by Linux.

The FreeBSD project includes a security team overseeing all software shipped in the base distribution. A wide range of additional third-party applications may be installed using the pkg package management system or FreeBSD Ports, or by compiling source code.

Due to its licensing, much of FreeBSDā€™s codebase has become an integral part of other operating systems, such as Appleā€™s Darwin (the basis for macOS, iOS, watchOS, and tvOS), FreeNAS (an open-source NAS/SAN operating system), and the system software for Sonyā€™s PlayStation 3 and PlayStation 4.

FREEBSD LINKS

6 Likes

The original thread is over here: BSD for Khadas EDGE (RK3399)
Russian version: ŠŸŠ¾Š“Š“ŠµŃ€Š¶ŠŗŠ° руссŠŗŠ¾ŃŠ·Ń‹Ń‡Š½Ń‹Ń… ŠæŠ¾Š»ŃŒŠ·Š¾Š²Š°Ń‚ŠµŠ»ŠµŠ¹

1 Like

Bravo Khadas community!! You are the first RK3399 board running FreeBSD although USB 3.0 and PCIE need to be done in order to do more useful work.
kudos to @SleepWalker 's continues effort to make the freebsd port work. This should be the headline for Freebsd community too and may be list on their coming 12.1 (November 1) release note to celebrate

5 Likes

This is good news @SleepWalker great work and effort.

1 Like

CHANGES: from @SleepWalker

  • usb 3.0 - fixed - OK (usb 3.0 card reader tested - works fine )

LAST IMAGE:

https://dl.khadas.com/Firmware/Edge/FreeBSD/EDGE-FreeBSD-20191026.img.gz

3 Likes

@hyphop thanks for the heads up. The SPI driver should works too, I think the next thing is NVMe driver

but not work yet :wink: may be on next build

1 Like

Any progress on the NVMe support? I have an EDGE-V Basic w/M2X expansion board & NVMe and am willing to help test. Would love to get FreeBSD up and running on this platform. Thank you for all the effort so far, great work.

1 Like

plz ask @SleepWalker! i think he have some news !!!

2 Likes

Hi All.

The latest FreeBSD 13.0-RELEASE install images for many SBCs,
and of course for Khadas-EDGE you can download from my site.

https://personalbsd.org/?page_id=2

Unlike standard FreeBSD images,
they are based on a custom U-boot and allow you to start the system directly from
USB, NVMe or eMMC.

USB keyboard and mouse, HDMI-VIDEO and HDMI-AUDIO are working correctly in the system.

To boot from sd card, you must first clean eMMC, for example,
the dd command on Linux or from U-boot
boot# mmc erase 0 0x1000

If eMMC is empty, you will successfully boot from the SD card.

Please report successful installations or noticed bugs.
I need feedback.

I wish you success.

4 Likes

Very cool, Iā€™ll check that out.

Is it possible to boot from NVMe?

System start possible from CD card, USB, NVMe or eMMC.

The boot order is determined by the value of the U-boot environment variable - boot_targets

The U-boot can be accessed by pressing the spacebar when the FreeBSD logo appears on the display screen.

Oh ok. How do you access the serial terminal? Or should it come up with DHCP? I didnā€™t realize HDMI was still on the TODO list and canā€™t tell if itā€™s booting. :slight_smile: I do see link on the ethernetā€¦

1Gbit Ehternet works fine, dhcp is enabled by default.
Login is possible through the console (root without password).

Via ssh login is possible by
user: admin
with password: admin

Please test the work Ethernet at 100Mbit.

4 Likes

i put this image there

INFO: from @SleepWalker

While trying to find the cause of the unstable operation of USB and PCIE.

A thermal sensor driver has been added to the system and now the processor frequency decreases automatically when the load is high and the temperature rises.

The main players got their PINEBOOK PRO on RK3399 and now the debugging system will move faster. We expect drm driver to write from @manu, I hope a video appears, all my fixes are in the source tree and FreeBSD can be built for khadas just from mainline.

1 Like

Today Iā€™m testing the img provide by @SleepWalker. The NVME drive on PCIE does crash randomly, but the SATA to PCIE card(based on Marvell 9235) working perfectly on 2 disk mirror zfs setup for 2 hour intensive writing test. So I assume the PCIE driver is working, the problem is the NVME part.

Iā€™m going to buy another 2 hard drive to test 4 disks raidz1 zfs setup and report the NVME bug to FreeBSD

Just to check, to use this image, I write it to a microSD card and it will boot? Is there anything else I have to do? Iā€™m not seeing any DHCP requests and donā€™t currently have access to a serial cable (I ordered one though!). I might try taking off the M2X board to see if thatā€™s causing it to not boot or something.

Edit: no difference without the M2X board.

My another 2 Hard drive has arrived today, so I have 4 350G 3.5 inch drive for zfs benchmark. Hereā€™s the results using iozone:

4 Stripe:

2 * 2 Mirrors

4 disk raidz1

The read result is good, but the write throughput in raidz setup hasnā€™t been doubled as it should.

More updates:
with @mmelā€™s RK808 regulatorā€™s driver updates, the heat dissipation of RK3399 is vastly improved, only a passive heatsink required for a touchable temperature.

The NVME drive however has some problem, Iā€™ve submit a Bug report

With a stable NVME drive RK3399 will be a powerful FreeBSD developing platform

1 Like