ARM has recently launched DS-5 Ultimate Edition which adds support for the latest ARMv8-A Architecture and associated ARM Processors. Included in the package is the ARMv8-A Fixed Virtual Platform (FVP) model, giving you a platform to develop code on in advance of hardware availability. In this blog I will attempt to explain the necessary steps to get a working Linux system running on this platform.
But first, especially if you are new to DS-5, we provide some bare-metal examples within DS-5, which you can use to quickly ensure that everything is working correctly. You should be able to use Import... → General → Existing Projects into Workspace from the File menu to import the fireworks example from the \\DS-5\examples\Bare-metal_examples_ARMv8.zip archive. This contains an already configured debug configuration, allowing you to connect via the Debug Control pane, and run this application on the FVP. As this all works "out-of-the-box", it should be a useful first step for learning the GUI, locating register views etc.
Once you are happy that everything is working, we will now move to install a Linaro Linux distribution to the FVP. The latest ARMv8-A distribution is always available here, and is updated approximately monthly. If you simply wish to boot Linux on the platform, you will be able to use the pre-built files. You will need to retrieve the img.axf kernel binary, and the appropriate file system image. There are two options used below, which should be unzipped on the host.
vexpress64-openembedded_minimal-armv8-gcc-<version_and_date>.img.gz is a minimal file system (~80MB)
vexpress64-openembedded_lamp-armv8-gcc-<version_and_date>.img.gz is a fully featured file system (~430MB)
We can launch the model either stand alone, or within the debugger GUI. The procedure is similar for both. To launch stand alone, I recommend creating a batch file, that runs the following command line. Note that this needs to be edited to point to the kernel binary and the file system image used:
-a <path_to>img.axf \
--parameter motherboard.mmc.p_mmc_file="<path_to>\<unzipped_filesystem_image>.img" \
--parameter motherboard.mmc.card_type=eMMC \
--parameter motherboard.smsc_91c111.enabled=true \
--parameter motherboard.hostbridge.userNetworking=true \
For a description of these options, see the latest FVP documentation. From testing on various machines, it takes about 60-120 seconds to boot the minimal file system image, about 4-7 minutes to boot the full LAMP filesystem.
To launch from the DS-5 debugger, select Debug Configurations... from the Run menu, and click the New launch configuration button in the upper left. Give this configuration a name, and then locate the VE_AEMv8 target. I find it easier to enter this in the Filter window, and the tools will automatically jump to it. Navigate down the tree to Linux Kernel debug, and then Debug ARMAEMv8-A_MP_SMP, to connect to all four CPUs in this model.
You then need to paste the same options above (bar the call to the executable itself) into the Model Parameters window.
Click on the Debugger Pane, and select Connect Only. Click on Debug to connect the debugger, click go, and let the system boot as before. You can now also control execution (start/stop etc) with the debugger.
If you have rebuilt the kernel to include debug information (the pre-built images do not contain debug information), you can stop the target, and now use either the Debug Control pane's Load feature
or from the CLI:
and the debugger will now display the status of all threads running on the target:
Note that all below requires use of the above full featured file system (or an equivalent that you have built yourself).
You can create a Remote System View of the file system, by opening the Remote Systems pane, creating a (right-click) → New Connection → General → Linux, and set the Hostname to LOCALHOST, and give the connection an arbitrary Connection name (FVP Linux in the below). Then click Next, and select ssh.files in the Configuration section. Click Finish. You will then be able to expand the file system view (set username as root if prompted).
From this view, you can also right-click on Ssh Terminals, and launch a terminal window within the DS-5 GUI, thus eliminating the need to jump back and forth to the telnet window.
Finally, for completeness, you can also use DS-5 to debug an application on the target. I built the hello.c that is present in this image (gcc -g hello.c) directly on the target. Then I started a gdbserver session with "gdbserver :5555 a.out" (you will notice this port was specified in the model parameters when launching the model). I can then create an Application Debug Configuration, as below, and debug the image.
Alternatively, if building the application on the host, you could use the "download and debug" option, and the debugger would write the image to the target, via the remote system connection.