Building Monolith Project

In this tutorial, we build a monolith INTEGRITY project for a Qt example application. You can select any Qt example application that uses the supported Qt modules .

Before you can build a monolith INTEGRITY project, you need to prepare your build environment for the qmake build tool. You can do this by running the script ~/setEnvironment.sh that you created in Creating Script for Running Exports .

Run the following commands in a terminal:

source ~/setEnvironment.sh
<Qt installation path>/qtbase/bin/qmake <Qt example application path>/<projectname>.pro
make
					

The qmake tool must be called under the Qt installation path (<Qt installation path>), where you installed the Qt sources in Getting Qt Source Code .

<Qt example application path>/<projectname>.pro is the installation path of the Qt example application project file that the monolith INTEGRITY project will be built for.

Building Monolith Project

To build a monolith INTEGRITY project, create an empty directory for your project in your home folder. In the steps below, we use the directory name mymonolith .

Defining Project with Project Wizard

Launch MULTI Launcher and select File > Create New Project . Define your monolith project with Project Wizard:

  1. Project name tab, fill in the Directory field with the directory you just created.
  2. 选择 下一 .
  3. 操作系统 tab, select INTEGRITY 操作系统 列表。

    注意: The OS Distribution Directory field must contain your INTEGRITY installation directory (in our example, mymonolith ).

  4. 选择 下一 .
  5. Processor Family tab, select ARM .
  6. 选择 下一 .
  7. Target Board tab, select ARM Cortex-A9 Platform from the target board list.
  8. 选择 Finish .

After selecting Finish in Project Wizard, Project Manager is opened.

Project Manager Settings

With Project Manager you can define the settings for the monolith project:

  1. Select Item to Add dialog page, select Monolith Create New 列表。
  2. 选择 下一 .
  3. Settings for Monolith dialog, define the settings:
    • Source Code Directory is your project directory (in our example, mymonolith ).
    • Project Name is the name of your project. In our example, we use the name myproject .
    • 语言 必须是 C . The Qt projects are C++ projects, but this will be configured later.
    • 选择 下一 .
    • Use Shared Libraries should not be selected.
    • 选择 下一 .
  4. Configure number of Virtual AddressSpaces dialog page, select the checkbox Names of Virtual Address Spaces and type galcore .
  5. 选择 下一 .
  6. Settings for Kernel dialog page, type the name of your kernel.
  7. 选择 调试 , Dynamic Load and ResourceManager Kernel Libraries 列表。
  8. 选择 下一 .
  9. Settings for OS Module Selection dialog page, select File System (User Configured) and GHnet IPv4 Stack (Virtual) OS Module 列表。
  10. 选择 下一 .
  11. Settings for File System (User Configured) dialog page, select a filesystem that your monolith project supports.

    In our example, we have selected MSDOS FAT 列表。

  12. 选择 Finish .
  13. Settings for Add File System Clients dialog page, select Finish .

Adding File System Mount Point

You need to configure the file system to use the first partition of the micro SD card. In the MULTI Project Manager view, you see a tree structure of your monolith project:

  1. Right-click the file mounttable.c to open the context menu.
  2. 选择 Modify Project > Add INTEGRITY File System Mount Point .
  3. Settings for FS MountPoint dialog, define the settings:
    • 类型 / to Mount Directory .
    • 选择 下一 .
    • File System Type is MSDOS FAT .
    • 选择 下一 .
    • Select the Use Physical Device radio button.
    • 类型 SDCardDev1 Device 字段。
    • Slice is a .
    • 选择 Finish .

Galcore VAS Settings

Next, define the virtual address space (VAS) settings for your project.

In the MULTI Project Manager view, you see a tree structure of your monolith project:

  1. Double-click the .int file in your project (1) (in the steps below, myproject.int ).
  2. In the opened window, double-click the galcore virtual address space (VAS) area (2).
  3. VirtualAddressSpace Options dialog is opened.
  4. 属性 tab, select the values defined in Values in Attributes Tab .
  5. 选择 OK .
  6. In the galcore virtual address space area, double-click the Task Initial area (3).
  7. Select the Start Automatically check box.
  8. 选择 OK .

Values in Attributes Tab

Add the following attribute values for the virtual address space:

属性
Maximum Priority 255
Maximum Weight 255
Memory Pool Size 2000P
Heap Size 0X2000000
Heap Extension Reserved Size 0x20000
自变量 Leave blank.
Checkbox
Create Extra Virtual Memory Regions Select the checkbox.

Editing Galcore Project

You need to edit a number of files in the monolith project.

File galcore.c

  1. 选择 galcore.c from the tree structure in the MULTI Project Manager view.
  2. Double-click the file to open it for editing.
  3. Add the following code to galcore.c :
    #include <INTEGRITY.h>
    #include <stdlib.h>
    #include <stdio.h>
    extern Error GalCore_TaskInit(void);
    int main(void) {
        Error E;
        E = GalCore_TaskInit();
        if (E != Success) {
            printf("Failed to start GalCore tasks\n");
        }
        Exit(0);
    }
    							

File galcore.gpj

  1. 选择 galcore.gpj from the tree structure in the MULTI Project Manager view.
  2. Right-click the file to open the context menu.
  3. 选择 Edit .
  4. Add the file libgalcore.a to galcore.gpj .

Contents of galcore.gpj should be as follows:

#!gbuild
#component integrity_virtual_address_space
[Program]
    -lgalcore
tgt/INTEGRITY.ld
galcore.c
					

File kernel.gpj

  1. 选择 kernel.gpj from the tree structure in the MULTI Project Manager view.
  2. Right-click the file to open the context menu.
  3. 选择 Edit .
  4. Add the file libgalcore-iod.a to kernel.gpj .

Contents of kernel.gpj should be as follows:

#!gbuild
#component integrity_kernel_monolith
[Program]
    -kernel
    -ldebug
    -lload
    -lres
    -lgalcore-iod
tgt/default.ld
myproject_kernel.c
global_table.c
					

File monolith.gpj

  1. 选择 monolith.gpj from the tree structure in the MULTI Project Manager view.
  2. Righ-click the file to open the context menu.
  3. 选择 Edit .
  4. Add the additional library directory $(__LIBS_DIR_BASE)/Vivante .

Contents of monolith.gpj should be as follows:

#!gbuild
#component integrity_monolith
[INTEGRITY Application]
    -non_shared
   -I$__OS_DIR/modules/ghs/ghnet2/source/kernel/integrity/ip4server :sourceDir=$__OS_DIR/modules/ghs/ghnet2/source/kernel/integrity/ip4server
   -L$(__LIBS_DIR_BASE)/Vivante
tgt/default.bsp
myproject.int
galcore.gpj [Program]
myproject_kernel.gpj [Program]
my_ivfsserver_module.gpj [Program]
ip4server_module.gpj [Program]
					

.int File

  1. Select the .int file of your project from the tree structure in the MULTI Project Manager view.
  2. Right-click the file to open the context menu.
  3. 选择 Edit .
  4. Add the following lines at the end of the file.

    注意: Replace </path/to/your/app/executable> with a path to your application executable.

    AddressSpace
        Name    myappname
        Filename    /path/to/your/app/executable
        MemoryPoolSize 0x2000000
        Language    C++
        HeapSize    0x6000000
        Task Initial
            StackSize    0x30000
            StartIt    true
        EndTask
        HeapExtensionReservedSize    0x2000000
    EndAddressSpace
    							

Building monolith.gpj

打开 monolith.gpj from the tree structure in the MULTI Project Manager view. To build the project:

  1. Right-click monolith.gpj to open the context menu.
  2. 选择 构建 .

Your monolith project is now ready to be packaged for U-Boot.