FreeBSD support

I spent some time this week getting FreeBSD to boot on the VisionFive 2.

See here for a script to generate an SD card image and instructions to make it work: GitHub - robn/freebsd-vf2: FreeBSD on StarFive VisionFive 2.

There’s no drivers for anything, so the serial console is your only option right now. Not useful yet, but gotta start somewhere! If you like playing with broken computers, maybe you will like this too :upside_down_face:

I’m hoping to get some rudimentary drivers going in due time. I’ll post here if I get anywhere interesting.

15 Likes

This is cool! Sadly im no coder and cant help but its a good first start. Would love to try FreeBSD for it.

3 Likes

Followed the instructions. Looks beautiful.

FreeBSD/riscv (generic) (rcons)

login: root
Password:
Jan  8 11:35:36 generic login[1352]: ROOT LOGIN (root) ON rcons
FreeBSD 14.0-CURRENT #0 main-n259905-231d75568f16: Sun Jan  1 07:57:08 UTC 2023     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/riscv.riscv64/sys/GENERIC

Welcome to FreeBSD!

4 Likes

is this over UART ?
Are there drivers for Network chip ? Then we could have ssh acces.

1 Like

That said, I’ve been thinking about trying to do something with PPP over the serial line to get a network because round trips moving SD card back and forth, reflashing and waiting for the root to load takes many minutes and makes driver development very tedious.

1 Like

Is it possible to boot images over tftp similar we did for the flashing of the firmware?

Then you w’d only need to exchange the new files in the tftp folder.

1 Like

It should be possible; u-boot has the network set up and is presenting it through EFI to the loader. I haven’t tried it though, and won’t be for a while - I don’t really have my network set up for it right now and its a distraction I don’t have much interest in. If you try it I’ll be interested to know how it goes!

2 Likes

It looks to me like OpenBSD version 7.4 (2023-10, the 55th release of OpenBSD) might be aiming to include initial support for one, or more, JH7110 based boards.

OpenBSD in the past few weeks have started to add initial support for the JH7110 SoC, some of which may be useful for the FreeBSD port:

10 Likes

Got OpenBSD installer running from SD. Installed to NVME, runs, doesn’t support eswin wifi, used an old realtek dongle, worked for install and run time.

2 Likes

I’ve written up some notes on how to get OpenBSD installed (to eMMC): openbsd-vf2.md · GitHub

I’ve also tried @robn’s script with newer snapshots of 14, and it still works.

I’m currently working on porting the OpenBSD drivers linked above to FreeBSD, but we’ll see how long that takes…

5 Likes

@csgordon I do not know if you have already, or not, but might be an idea to bang an email off to the freebsd riscv mailing list just to double check that you are not repeating what someone else might already be working on.
https://lists.freebsd.org/subscription/freebsd-riscv

EDIT: If you plug “site:lists.freebsd.org visionfive”, “site:lists.freebsd.org starfive” or “site:lists.freebsd.org jh7110” into your search engine of choice, you will find a few hits. Just because no code has been merged into a public branch does not mean that no one is working on it.

5 Likes

Ah, I replied to the riscv@freebsd mailing list but I can see everybody is already here :slight_smile:

My friend Lup Yuen Lee is porting NuttX RTOS to JH7110 and documents every discovery on his website… it may be wise to join the forces so both NuttX and BSD benefits :slight_smile:

1 Like
3 Likes

I thought I’d post this link here:
https://www.freshports.org/sysutils/u-boot-starfive-visionfive2/
It looks like some form of VF2 installation process is being worked on (I’m guessing that it will be without any support for the Imagination BXE-4-32 MC1 GPU, at least until some BSD licensed source code becomes available. And I’m guessing a lot more features of the VF2 will not be supported, initially, as well.).

2 Likes