© Promwad Innovation Company
Application Notes | December 09, 2013
Use of NetBSD with Marvell Kirkwood Processors
This article provides an overview of NetBSD and highlights its differences from other operating systems of the family. It also briefly discusses the implementation and configuration of device drivers. The author studies an example of using this operating system, as an alternative to Linux, on the IP-Plug.
NetBSD is an operating system which represents the BSD family, along with OpenBSD and FreeBSD. Originally, BSD (an acronym of Berkeley Software Distribution) was a combination of patches and utilities for Bell Labs Unix, which evolved into an independent system. The source code had two licenses - Bell (because the company owned the larger part of the original source code) and BSD proper. After a while, the team of BSD developers broke up and the BSD project later received a new incarnation as 386BSD, an architecture i386 port. Eventually, the BSD family broke into three branches: NetBSD, OpenBSD and FreeBSD.
Each of the three systems is unique in its own way, but they all have a lot in common. The key feature of NetBSD is multi-platform support. The developers’ slogan was: “Of course, you can run NetBSD on this platform”. Developers have applied for registering 53 architectures, and the number of supported machines continues to grow.
Meanwhile, NetBSD remains just as safe and high-performing as its “family members”, OpenBSD and FreeBSD. NetBSD was first officially released in April 1993 and had the version number 0.8. Today’s latest version is 6.0.
We should especially mention the advantages of a BSD license. Unlike Linux GPL, a BSD license helps in every possibly way modify the source code, change file names and distribute the final product provided we mention the author’s name.
NetBSD source codes are accessible through an FTP server as tar archives or iso images. You can also receive any version of the system out of the cvs repository by referring to the release name tag. The source code tree includes a kernel code (sys directory), utilities (bin, usr.bin, sbin, usr, usr.sbin, gnu), a cross-compiler (tools), the build script build.sh, as well as relevant libraries and documentation.
System compilation involves the following stages:
Figure 1. Multi-functional mini-server AK-System IP-Plug
This device is used for measuring computing network parameters, data storage and transmission, as well as routing. It can also be used as a Wi-Fi access point, a file server or a DLNA server. The range of tasks performed by the computer is extended through software modification.
Table 1. IP-Plug key features
The IP-Plug uses the Marvell 88F6282 processor, ARMv5TE Kirkwood architecture series. Its support has been added to the NetBSD distribution since July 2012 and represented by files in the directory sys/arch/evbarm/marvell:
Figure 2. Configuration of the first NetBSD root child.
For example, the implementation of the Ethernet driver is represented by the files if_mvgbe.c, makphy.c and mii.c. Its configuration is shown as a tree in Figure 2:
Figure 3. Configuration of the Ethernet driver in NetBSD
and represented as follows:
--------------------
mvgbec0 at mvsoc0 offset 0x70000 # first interface controller
mvgbec1 at mvsoc0 offset 0x74000 # second interface controller
mvgbe0 at mvgbec0 port 0 irq 11 # PHY0
mvgbe1 at mvgbec1 port 1 irq 15 # PHY1
makphy0 at mii0 phy 0
makphy1 at mii1 phy 1
--------------------
Because each device has a universal interface, tree traversal is performed at kernel startup, while successively calling the functions attach / match to initialize each of them. This results in system configuration (this process is called autoconf).
After editing the configuration file and building the kernel, let us proceed to the next step.
By specifying the parameter distribution for the script build.sh, you can build a full-functional root file system with all system utilities. But if you specify the target release, all programs will be grouped into sets and packed in respective files (base, comp, etc, games, modules, etc.). Unpacking only two sets, base and etc, helps receive a minimal root file system. By placing the archive contents on NFS, you can configure the NetBSD kernel to connect it as rootfs. To do this, it is enough to add to the configuration:
--------------------
options NFS_BOOT_BOOTSTATIC
options NFS_BOOTSTATIC_MYIP=”\”192.168.10.10\””
options NFS_BOOTSTATIC_GWIP=”\”192.168.10.1\””
options NFS_BOOTSTATIC_MASK=”\”255.255.255.0\””
options NFS_BOOTSTATIC_SERVERADDR=”\”192.168.10.3.0\””
options NFS_BOOTSTATIC_SERVER=”\”:/export/rootfs\””
config netbsd root on mvgbe0 type nfs
--------------------
Now, the built kernel will automatically mount the specified resource as a root file system.
By changing the device in the config line you can start a rootfs connection from any of the supported devices. If the file system is not mounted for whatever reason, the kernel will ask you to select a new boot device and a file system type on it in interactive mode.
NetBSD allows for the possibility of mounting both ready-made packets and self-assembled packets. To install binary packets, you just have to run pkg_add specifying the packets name mask. The archives of packets and dependencies will be downloaded from the FTP server and unpacked. To receive information on the installed packets, you can use the pkg_info utility. To remove it, run pkg_delete.
When building packets from source codes, you need to download and unpack the pkgsrc archive that contains the bmake utility and make packet files sorted by the category. The list of all packets with a brief description can be generated by the command make readme.
Conclusion
High portability, sufficient ease of use, as well as the necessary software packet and an open source code packets and open source make NetBSD a very attractive operating system for use in embedded systems. As seen in the example, it takes quite superficial knowledge of the system architecture and minimum change in the code to run NetBSD on the IP-Plug. At the same time, the functionality and performance of the built operating system is not inferior to that of Linux, which is used by default.
-----
Author: Vladimir Trubilov, Programming Engineer at © Promwad Innovation Company
- To build a tool chain for the target architecture, you should call the script build.sh with the parameter tools. The tools include as, binutils, gcc, m4, yacc, etc. You can see all supported architectures in the sys/arch directory.
- Building the kernel is based on the specified configuration.
- To build system utilities and create a root file system, you should call the script build.sh with the parameter distribution.

Microprocessor | 1 GHz Marvell Kirkwood 88F6283, ARM Compliant |
Memory | Up to 1024 MB 16 bit DDR2@800 MHz / Up to 4 GB NAND Flash |
Interfaces | |
Ethernet | 2x Gigabit Ethernet |
USB | 2xUSB 2.0 |
Wi-Fi/BT | Wi-Fi 802.11 b/g/n + BT 2.1 EDR (optional) |
Software | |
Operating system | Linux |
Basic features | |
Power | Input voltage: 100–240 V, 50/60 Hz; / Power consumption: 15 Watt, 5V@3.0A max |
Dimensions | 118 мм (L) x 76 mm (W) x 43 mm (H) |
Package size | 145 mm (L) х 125 mm (W) х 55 mm (H) |
Weight | 250 gram |
- marvell_start.S is low-level kernel initialization: MMU initialization, transfer of boot parameters to the high-level code;
- marvell_machdep.c contains the main initialization code of the ARM kernel, peripherals (including boot console), building a page table and kernel relocation;
- marvellreg.h and marvellvar.h are constant values for addresses and sizes of memory locations, into which the registers of peripherals needed for system boot are mapped.


AI chipmaker Hailo collaborates with Renesas
The collaboration is said to result in a powerful and energy-efficient processing solution enabling advanced driver-assistance (ADAS) functions and automated driving (AD) systems in motor vehicles.
Mediatek to open design center at U.S. university
Fabless chipmaker Mediatek announces commitment to support its first Midwest semiconductor chip design center in West Lafayette, Indiana.
Japan’s next chip challenge: finding engineers
Japan, along with a number of companies, has invested a lot to build up the country’s domestic chip industry. The next challenge is to find a multitude of engineers to run and operate it.
Dexerials and SemsoTec to set up an optical solution center
Dexerials Corporation, a provider of leading-edge technologies, materials, and devices for smartphones, automobiles, and other products, and German automobile design house SemsoTec Group, will jointly establish an Optical Solution Center for leading-edge In-Vehicle HMIs in Cham, Germany.
90,000 square metres – Arrows new Dutch distribution centre
Arrow recently opened its new primary distribution centre (PDC) in Venlo, the Netherlands. The new centre is one of the company’s largest warehouses globally and replaces the existing facilities in the region and also provides increased capacity for future growth.
Sivers Semiconductors completes the integration of MixComm
Swedish Sivers Semiconductors says it has completed the integration of MixComm, creating a challenger in 5G, SATCOM and radar.
Inventronics to acquire ams Osram digital systems business
Inventronics has entered into an agreement to acquire the Digital Systems business in Europe and Asia from ams Osram, a global leader in optical solutions.
Allied Motion Technologies acquires Airex
Allied Motion Technologies, a designer and manufacturer of precision and specialty controlled motion products, has acquired Airex, LLC, a privately-owned company providing high precision electromagnetic components and solutions.
Arrow opens new distribution centre in the Netherlands
Arrow Electronics has opened a new primary distribution centre (PDC) in Venlo, the Netherlands. The PDC will function as a key hub serving all customers of Arrow’s electronics components business in Europe.
Smith adds 30,000 square feet of space in Houston
The distributor of electronic components has officially opened its new global services hub in Houston, Texas. The new location adds 30,000 square feet of space for the company’s services.
Samsung invests in Israeli AI systems & semiconductor company
Samsung Ventures has made an investment in NeuReality, an Israeli AI systems and semiconductor company.
Swedes develop new method for manufacturing semiconductor components
AlixLabs from Lund, Sweden, has developed a new method for manufacturing semiconductor components with a high degree of packing, eliminating several steps in the manufacturing process - Atomic Layer Etch Pitch Splitting (APS).
Kinetic closes asset purchase agreement with Gain Semiconductor
Analog and mixed-signal semiconductor company, Kinetic Technologies, has completed the acquisition of certain assets of Gain Semiconductor Incorporated.
Socionext relocation of its US HQ to Milpitas
Fabless SoC supplier, Socionext America Inc. (SNA), has relocated its US headquarters to a34,000 square foot single floor building in the City of Milpitas.
TF-AMD expands with new manufacturing site in Malaysia
TF-AMD Microelectronics plans to expand its manufacturing facility in Penang with the construction of a second site at Batu Kawan Industrial Park, Penang. A move set to create more than 3,000 new jobs.
Ericsson boosts distribution center in Malaysia
Swedish telecom company, Ericsson, has commissioned a new facility at the Kuala Lumpur International Airport (KLIA) that will expand its regional distribution capacity and role of Malaysia in the company.
Applied Materials acquires of Finland-based Picosun
Applied Materials has acquired Finnish atomic layer deposition (ALD) technology specialist Picosun Oy.
Melexis adds new manufacturing and R&D space in Bulgarian
In an update on LinkedIn the company states that it has officially opened ints new “high-tech” building in Sofia, Bulgaria. Melexis says that this new facility will contribute to Bulgaria's presence in areas such as microelectronic, automotive, and innovation.
Arduino finds backing among giants
Open-source company, Arduino, plans to expand its portfolio of hardware, software, connectivity and developer tools for professionals. To reach its goals the company launched a Series B financing round, raising USD 32 million from the likes of Bosch, Renesas and ARM.
Farnell expands Toshiba portfolio to support design engineers
The global distributor says that it has strengthened its global partnership with Toshiba Electronics Europe GmbH (Toshiba), resulting in a significant product line expansion and increased stock holding.
SK hynix pick Lam solution to enhance DRAM production
SK hynix has selected Lam Research's dry resist fabrication technology as a development tool for two key process steps in the production of advanced DRAM chips.
Altair expands and acquires Concept Engineering
Computational science and artificial intelligence company, Altair, has acquired Concept Engineering, a provider of electronic system visualization software.
Infineon liquidating its entity in Russia
One hundred days after the start of the war, Infineon Technologies reaffirms its solidarity with the people of Ukraine. The company states that it made the decision to liquidate its entity in Russia in March already, which is currently being executed.
Load more news