Google Fuchsia OS on Khadas VIM2


#1

Hi, Folks:

As some of you may know that Google’s new operating system Fuchsia has added support for Khadas VIM2, but still under developing. Now I will give some instructions about how to build Fuchsia and get it running on VIM2. Let’s go!

Prepare your build environment (Once per build environment)

Install some essential packages:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install texinfo libglib2.0-dev liblz4-tool autoconf libtool libsdl-dev build-essential golang git curl unzip

Build U-boot for Fuchsia

In order to boot Fuchsia, a special u-boot is need.

$ mkdir ~/project
$ cd ~/project
$ git clone https://github.com/mikevoydanoff/u-boot -b vim
$ cd u-boot
$ make kvim2_defconfig
$ make -j8 CROSS_COMPILE=aarch64-linux-gnu-

After build you wii find fip/u-boot.bin.

Get fuchsia source code

$ cd ~/project
$ curl -s "https://fuchsia.googlesource.com/scripts/+/master/bootstrap?format=TEXT" | base64 --decode | bash -s garnet

This will download all the source code of Fuchsia under ~/project/fuchsia.

Build Fuchsia

$ cd ~/project/fuchsia
$ source scripts/fx-env.sh
$ fx set arm64
$ fx full-build

If successfully will start to build Fuchsia, this will take some time.

Boot Fuchsia

Update u-boot to Fuchsia version

Copy the u-boot for Fuchsia you build above to TF card or U-disk, and insert it to VIM2, power on VIM2 and boot into u-boot command line. And execute the following commands to update u-boot.

  • If your u-boot stored in U-disk
kvim2#usb start
kvim2#fatload usb 0 1080000 u-boot.bin
  • If your u-boot stored in TF card
kvim2#mmc info
kvim2#fatload mmc 0 1080000 u-boot.bin

Update u-boot

kvim2#store rom_write 1080000 0 1000000
kvim2#reset

You will boot the u-boot for Fuchsia.

Flash Fuchsia

Enter u-boot command line again and enter fastboot mode to flash Fuchsia.

kvim2#fastboot 

Switch to your build host and enter your fuchsia folder. And make sure thst your VIM2 and host PC are in the same local area network.

$ cd ~/project/fuchsia
$ sudo ./scripts/fx flash vim2 --pave

After this you will boot into Fuchsia, and you can connect VIM2 to the HDMI screen you will find the shell.

In the end

If you don’t want to build the Fuchsia from scratch you can use the ready to use u-boot and zircon kernel I build.

  • Update u-boot
    Please follow the instructions in Build U-boot for Fuchsia about how to burn u-boot.

  • Flash Zircon

    • Enter fastboot mode by holding down POWER KEY, pressing RESET KEY quickly and keeping pressing POWER KEY for a few seconds.
    • Burn
      sudo fastboot flash boot vim2-boot.img

Reboot the board you will enter zedboot.

See also

Google Fuchsia Docs
Zircon on Khadas VIM2 Board


#2

Good job, can update a instructions on Khadas Docs.


#3

#4

It’s great to know that VIM2 is supported by Google and used internally, this is a recognition.


#5

Sounds vary exciting indeed.
Congratulations for this device that runs almost any OS :sunglasses:
Does Fuchsia, apart from shell, also offer some graphical environment?
Have a nice day


#6

Yes, Google Fuchsia team will provide us more binary/blob later this month, will update new ROM to our folks to taste then :wink:


#8

Whether the Mali GPU vulkan driver is open source?


#9

We were told by Google that it’s not open source, they release as blob or binary.


#10

Could we get them to look at cpu frequency adjustments as part of this as well? Going to try this os to see how it does for mining as well!


#11

Interesting, so it is more like a regular Linux distribution just with lightweight kernel?

What is the main advantage of Fuchsia OS?


#12

see https://en.wikipedia.org/wiki/Google_Fuchsia


#13

#15

Will write a blog article for Fuschia later this month, or would someone else from the forum like to write it? :smiley:


#16

Hi. Does someone tried it?
I hope youtube videos will going better.
Under Ubuntu Mate, they are not lovable.
Vim2 3GB/64


#17

I see what you mean. Yes I ran YouTube on my VIM2 as well, laggy at 1080p, Ubuntu Mate. Maybe the video driver is not optimised.

When I run Youtube.com from Chrome browser on Android, the playback is smooth, however the resolution is reduced.

How is playback on the native YouTube app on Android? Is that smooth, resolution good? (I’m unable to sign in to the Google Play Store at the moment)

Not sure if this is because I’m running my VIM without a fan, just the heat sink and air convection.