1. w4linux: build system

2. w4linux: configuration →

Contents
1.1 Overview
1.2 Configuration
1.3 Build options
1.4 Building

1.1 Overview [up]


w4linux looks like usual WrmOS application. It can be divided into 2 parts:

  • WrmOS part
  • Linux part

w4linux has make based building system for WrmOS part of project and Buildroot based building system for Linux part of project.

w4linux application contains the next directories and files:

Makefile Application makefile.
cxx_support.patch Patch for Linux kernel to support C++ sources.
br/ Directory with Buildroot configurations.
w4sparc/ Directory with paravirtualized part of Linux kernel.

During building the following steps are taken:

  1. Starts to build WrmOS project (configuration files, libraries, kernel, applications, bootloader);
  2. While building application linux:
    • downloads Buildroot sources from its git repository;
    • configures original Buildroot;
    • builds original Buildroot (libc, busybox, linux, ...);
    • copes paravirtualized part of Linux to original Linux kernel;
    • rebuilds Buildroot for architecture w4sparc;
  3. Builds bootloader containing RAMFS image with app/linux/linux.elf.

1.2 Configuration [up]


WrmOS part of configuration

w4linux looks like usual WrmOS application. Therefore its configuration is usual configuration of WrmOS project.

Project parameters include:

  • target system parameters (CPU, memory, base system devices, system clock frequency, ...);
  • libraries build parameters (debug flags);
  • kernel build parameters (debug flags, UART, timer, MMU);
  • application build parameters (debug flags);
  • applications list;
  • Alpha run-time configuration.

See WrmOS configuration and w4linux configuration clauses for detail.

Linux part configuration

Configuration of Buildroot and its components/subprojects (busybox, Linux kernel and other) is the same as configuration original components/subprojects.

See the Buildroot documentation for detail.

1.3 Build options [up]


Build options are command line or shell environment variables. Generally build starts by such command:

make build P=cfg/prj/linux-qemu-leon3.prj W=../wrmos B=../build/linux-qemu-leon3 -j V=1

Build system supports the next options:

target mandatory can be build, clean or rebuild (clean & build)
P=project-file-name.prj mandatory specifies project file
B=build-dir-name mandatory specifies build directory, all build files will be here
W=wrmos-dir-name mandatory specifies original WrmOS source directory
V=0|1 optional verbose flag, may be 0 or 1, allows hide detail of building (V=0, by default) or print it (V=1)
-j optional make parameter, allows to do parallel building and make it faster

1.4 Building [up]


w4linux is external WrmOS project. It can be build from both 1) the original WrmOS source directory and 2) the w4linux project directory.

From WrmOS source directory building starts by command:

cd wrmos
make build P=../w4linux/cfg/prj/linux-qemu-leon3.prj B=../build/linux-qemu-leon3 E=../w4linux -j

From w4linux project directory building starts by command:

cd w4linux
make build P=cfg/prj/linux-qemu-leon3.prj W=../wrmos B=../build/linux-qemu-leon3 -j

It is assumed that directories wrmos and w4linux are near.

Intermediate build files (generated headers, objects, ELFs) will be in build directory that was specified. The main building result is bootloader executable file:

../build/linux-qemu-leon3/ldr/bootloader.elf

or bootloader disk image:

../build/linux-qemu-leon3/ldr/bootloader.img

This file may be loaded on target board or run on QEMU virtual machine:

qemu-system-sparc -M leon3_generic -display none -serial stdio \
                  -kernel ../build/linux-qemu-leon3/ldr/bootloader.elf

See additional information in the article Running w4linux.

2. w4linux: configuration →