~Welcome to the world of soft-core CPU with infinite possibilities~

Click here for Mr. Asai's introduction and serial titles

 

If you have any questions, please contact Mr. Asai at the address below.

Introduction

Last time, I explained how to develop software. This time, with the cooperation of Mr. Fukushima of Tokyo Keiki Kogyo Co., Ltd., we will introduce an implementation example of an OS (Operating System) targeting the Nios II development kit Cyclone II edition (equipped with 2C35) provided by Altera.

 

OS

Windows, MAC OS, UNIX-based Linux, etc. are the operating systems that run on personal computers, and many embedded devices are also equipped with operating systems. Until a few years ago, I was mainly developing small devices that didn't need to be equipped with an OS, so I didn't quite understand the need for an OS. However, as the scale of the system grew, the limitations of hand-made software became apparent, and it became inevitable to install an OS in order to meet the demands of connecting to file systems and networks.

Main role of OS

・Task/process scheduling

・Memory management

・Hardware abstraction

etc. I won't go into detail here, but installing an OS allows software designers to focus on application development. General-purpose OS also has the advantage of being able to obtain package software that has a track record elsewhere, such as middleware (file system, network protocol, etc.) that supports it.

Table 1 shows the main embedded OS. Real-time OSs, which require fast interrupt response times, have been used in many embedded devices, but recently, Linux-based OSs have been used for network-equipped devices, and devices that require GUIs for ease of application development. Windows OS is also used.

This time, I will explain the implementation example for Linux OS.

 

Table 1 Main embedded OS

 

OS

real

timing

versatility expandability

scale

cost

Main use

µITRON

small

control, medical equipment, etc.

VxWorks

Big

Aviation, space and defense fields

Linux

During ~

Network equipment, etc.

Windows

During ~

Devices with GUI

What is μClinux?

μClinux was developed by Embedded Linux / MicrocontrollerProject (http://www.uclinux.org/) for PDA "PalmPilot" equipped with Dragon Ball (MC68328) from Motorola (currently Freescale Semiconductor, USA). Thing.

Figure 1 shows the structure of μClinux. Since Linux is based on using virtual memory, it could not be run on processors without an MMU (Memory Management Unit). μClinux changes this virtual memory to physical page management so that it can operate even on processors that do not have an MMU. With this explanation, you may think that μClinux is a dedicated OS without an MMU, but that is not the case. Furthermore, from kernel version 2.6 onwards, it is now possible to set whether or not to use the MMU for CPUs with an MMU.

In other words, μClinux is one of the few Linux-based OSes that can be ported regardless of the presence or absence of an MMU.

 

Figure 1 μClinux structure

μClinux for Nios II

Actually, there are two μClinux distributions that support Nios II.

 

Provided by Microtronix

It is used by plugging into the Nios II IDE provided by Altera, and is easy to handle in a form specialized for Nios II. However, perhaps because it is being developed by a single company, it has been slow to respond to version upgrades, and even now, the supported version is v.7.0 (it was v.5.0 when the OS was implemented). Newlib is used as the standard library.

 

Provided by uClinux.org (http://www.uclinux.org)

Although it cannot be plugged into the Nios II IDE, it is a full source distribution and can be developed in the same way as other Linux. Also, since it is not dedicated to Nios II, it can be expanded to other CPUs. The standard library uses uClibc, which is designed to be compact with embedded use in mind.

 

Each has its own characteristics, but I was thinking of using it on other CPUs, so I used the latter distribution (uClinux-dist-20070130.tar.gz) (hereafter referred to as uClinux-dist). To apply to Nios II, use the Nios II patch (uClinux-dist-20070130-nios2-02.diff.gz) provided by Nios Community Wiki (http://nioswiki.jot.com/WikiHome) should be applied.