Discussion

NetBSD vs Linux on BPi

11 2160
danboid  
Edited by danboid at Feb 20, 2016 11:31

My original post in this thread read:
I've read that NetBSD 7 (currently in the RC stage) fully supports the BPi.

Has anyone here installed NetBSD on their BPi and done any benchmarking against Linux? I'm mainly interested in the IO throughput of the SATA and NIC ie when using the BPi as a NAS or similar.

I'd imagine Linux will be the better option as it has run on the BPi longer and ext4 is a faster FS than FFS/UFS from what I've heard but maybe thats not the case?

NetBSD doesn't support ZFS and my limited research indicates the BPi NIC doesn't work under FreeBSD yet. I suspect other hardware components don't function under FBSD yet too.

Now that I've actually installed NetBSD 7.0 on my BPi I thought I'd report back and answer my own question.

Getting NetBSD installed just onto SD card was easy enough once I'd got mkubootimage to run under Linux, without it I prob would've had to install NetBSD in a VM just to create the uboot boot.scr file needed to get it to boot.

Transferring the root partition onto my SATA HD proved to be quite tricky as I had never tried NetBSD before and no-one had documented the process so when I finally managed it I updated the install guide to cover this part too:

http://daemonforums.org/showthread.php?t=9652

I had read NetBSD is supposed to support all of the BPi hardware except for hardware graphics acceleration. That seems to be the case but I encountered a few issues, all of which I have reported to the NetBSD project. I was unable to get the IR receiver to work but that could just be because I couldn't find any documentation on how to use IR under NetBSD. Onboard analogue audio mostly works but there is a constant clicking sound every 0.5s or so that ruins it. I didn't try HDMI audio.  The TX LED on the NIC doesn't blink when the ethernet is being used although a blue LED on the other side of the USB ports to the NIC does blink in its place during data transfer and it doesn't seem true poweroff is supported yet so you just have to use the power switch if you want to fully shutdown after halting the OS. HDMI fb console and UART serial console both worked fine and I had a quck go with X and that seemed to be OK.

If none of that has put you off and you still want to try NetBSD, let me advise you that the environment variable command listed on http://pkgsrc.org/ won't work to configure the pkgsrc repos. Use this instead:

  1. export PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/earmv7hf/7.0/All/"
Copy the Code



Here are some benchmarks of NetBSD 7.0 vs Arch when using my old WD Scorpio WD3200BEVT 320 GB SATA drive:

ARCH

  1. Linux bandana 4.4.0-2-ARCH #2 SMP Mon Jan 18 07:42:29 UTC 2016 armv7l GNU/Linux

  2. /dev/sda1 on / type ext4 (rw,noatime,data=ordered)
Copy the Code



Boot time from U-boot to login prompt inc. 2s autoboot prompt delay = 28s

  1. [dan@bandana ~]$ sudo hdparm -Tt /dev/sda

  2. /dev/sda:
  3. Timing cached reads:   820 MB in  2.00 seconds = 409.34 MB/sec
  4. Timing buffered disk reads: 180 MB in  3.02 seconds =  59.62 MB/sec

  5. [dan@bandana ~]$ dd if=/dev/zero of=tempfile bs=1M count=1024 conv=fdatasync,notrunc
  6. 1024+0 records in
  7. 1024+0 records out
  8. 1073741824 bytes (1.1 GB) copied, 29.7105 s, 36.1 MB/s

  9. [root@bandana dan]# echo 3 > /proc/sys/vm/drop_caches
  10. [root@bandana dan]# exit
  11. [dan@bandana ~]$ dd if=tempfile of=/dev/null bs=1M count=1024
  12. 1024+0 records in
  13. 1024+0 records out
  14. 1073741824 bytes (1.1 GB) copied, 16.7307 s, 64.2 MB/s
Copy the Code



Free memory after boot:

  1. [dan@bandana ~]$ free -m
  2.               total        used        free      shared  buff/cache   available
  3. Mem:            996          12         920           1          63         959
  4. Swap:             0           0           0
Copy the Code




NetBSD 7.0

Boot time from U-boot to login prompt inc. 2s autoboot prompt delay = 50s

  1. dd if=/dev/zero of=tempfile bs=1m count=1024 conv=notrunc
  2. 1024+0 records in
  3. 1024+0 records out
  4. 1073741824 bytes transferred in 30.996 secs (34641302 bytes/sec)

  5. dd if=tempfile of=/dev/null bs=1m count=1024
  6. 1024+0 records in
  7. 1024+0 records out
  8. 1073741824 bytes transferred in 23.367 secs (45951205 bytes/sec)
Copy the Code



Free memory after boot:

  1. cat /proc/meminfo
  2.         total:    used:    free:  shared: buffers: cached:
  3. Mem:  1058381824 85344256 973037568        0 29204480 46440448
  4. Swap: 2352873472        0 2352873472
  5. MemTotal:   1033576 kB
  6. MemFree:     950232 kB
  7. MemShared:        0 kB
  8. Buffers:      28520 kB
  9. Cached:       45352 kB
  10. SwapTotal:  2297728 kB
  11. SwapFree:   2297728 kB
Copy the Code


Do not use the NetBSD.

danboid  
Hi Tony

Why do you say not to use NetBSD? Have you tried it?

I know its still RC and so may have bugs atm but they claim all the BPi hardware should work so it sounds like an interesting alternative OS for those who prefer BSD to Linux.

I had wrong expression. I just wanted to express that I did not try BSD. But I knew that some FreeBSD developers have tried it on Banana Pro.

tkaiser  
I haven't done testing with *BSD myself (since it's already too time consuming with Linux) but it shouldn't be that hard when you follow these steps: http://wiki.netbsd.org/ports/evbarm/allwinner/ (BTW: they say use mainline U-Boot and also talk about fex files -- that puzzles me a bit).
When you're testing be prepared that Ethernet throughput might heavily depend on U-Boot (see below). And it also depends on cpufreq settings (no idea whether this is already implemented on NetBSD or at which frequency they clock the CPU cores).

I wanted to test 6 A20 devices 2 weeks ago as an addendum for http://linux-sunxi.org/Sunxi_devices_as_NAS

I used Igor Pečovnik's build system to create 6 images for the different boards just to realize afterwards that something within U-Boot more or less spoiled network performance (way lower than before and on some boards close to unuseable: The A20-Lime2 only achieved 10 Mbits/sec in one direction)

danboid  
Hi tkaiser!

Thanks for your reply - http://linux-sunxi.org/Sunxi_devices_as_NAS is a great resource for BPi users with many good performance and benchmarking tips for A20 chipset devices.

I've heard Illumos (the OpenSolaris fork) is being ported to RPi so there is a chance it could make its way onto the Bpi one day too if the RPi port is successful.

Did you resolve your U-boot issues with NetBSD? Have you managed to get NetBSD network transfer rates comparable to those achieved under Linux?

There's a work in progress FreeBDS image for Banana Pi http://raspbsd.org/

danboid  
Hi pikitsan

I found out about raspbsd recently and I posted a new thread ( http://www.lemaker.org/thread-17367-1-1.html ) about it on here after having wrote to its author before I noticed your reply to this thread.

Thanks anyway!

danboid  
I have recently installed NetBSD 7.0 on my BPi so I have updated the first post in this thread with my findings.

danboid  
I've updated OP to include a working PKG_PATH EV command to configure pkgsrc correctly.

You have to log in before you can reply Login | Sign Up

Points Rules