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 last image that supports NVMe
https://mega.nz/#!hFtjQAyZ!XX6kiUoa5UJb_5uD2-6Gitgh6M0r8oiDH1D-byKKR5g

4 Likes

Very cool, I’ll check that out.

Is it possible to boot from NVMe?

Mainline u-boot does not yet support booting from NVMe.
This is a preliminary test version of the NVMe driver, on my m.2 drive intel is not stable.
SD card and eMMC work fine.

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

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