mirror of
https://github.com/drasko/codezero.git
synced 2026-04-17 17:29:04 +02:00
Adding option for customized containers
This commit is contained in:
@@ -2,7 +2,9 @@ symbols
|
|||||||
CONT%(cn)d_TYPE_LINUX 'Linux Container'
|
CONT%(cn)d_TYPE_LINUX 'Linux Container'
|
||||||
CONT%(cn)d_TYPE_BAREMETAL 'Barebones Container'
|
CONT%(cn)d_TYPE_BAREMETAL 'Barebones Container'
|
||||||
CONT%(cn)d_TYPE_POSIX 'POSIX Container'
|
CONT%(cn)d_TYPE_POSIX 'POSIX Container'
|
||||||
|
CONT%(cn)d_TYPE_CUSTOM 'Add New Customized Container'
|
||||||
CONT%(cn)d_OPT_NAME 'Container Name'
|
CONT%(cn)d_OPT_NAME 'Container Name'
|
||||||
|
CONT%(cn)d_SOURCE_PATH 'Container Source Path'
|
||||||
|
|
||||||
CONT%(cn)d_PHYSMEM_REGIONS 'Container %(cn)d Number of Physical Regions'
|
CONT%(cn)d_PHYSMEM_REGIONS 'Container %(cn)d Number of Physical Regions'
|
||||||
CONT%(cn)d_PHYS0_START 'Container %(cn)d Physical Region 0 Start Address'
|
CONT%(cn)d_PHYS0_START 'Container %(cn)d Physical Region 0 Start Address'
|
||||||
@@ -138,12 +140,16 @@ default CONT%(cn)d_VIRT4_END from 0xe0000000
|
|||||||
default CONT%(cn)d_VIRT5_START from 0xe0000000
|
default CONT%(cn)d_VIRT5_START from 0xe0000000
|
||||||
default CONT%(cn)d_VIRT5_END from 0xf0000000
|
default CONT%(cn)d_VIRT5_END from 0xf0000000
|
||||||
|
|
||||||
default CONT%(cn)d_OPT_NAME from (CONT%(cn)d_TYPE_LINUX==y) ? "linux%(cn)d" : ((CONT%(cn)d_TYPE_BAREMETAL==y) ? "baremetal%(cn)d" : "posix%(cn)d")
|
default CONT%(cn)d_OPT_NAME from (CONT%(cn)d_TYPE_LINUX==y) ? "linux%(cn)d" : ((CONT%(cn)d_TYPE_BAREMETAL==y) ? "baremetal%(cn)d" : ((CONT%(cn)d_TYPE_CUSTOM==y) ? "custom%(cn)d" :"posix%(cn)d"))
|
||||||
|
|
||||||
|
default CONT%(cn)d_SOURCE_PATH from "conts/timer"
|
||||||
|
|
||||||
when CONT%(cn)d_TYPE_LINUX==y suppress cont%(cn)d_default_pager_params cont%(cn)d_posix_pager_params
|
when CONT%(cn)d_TYPE_LINUX==y suppress cont%(cn)d_default_pager_params cont%(cn)d_posix_pager_params
|
||||||
when CONT%(cn)d_TYPE_BAREMETAL==y suppress cont%(cn)d_linux_pager_params cont%(cn)d_posix_pager_params
|
when CONT%(cn)d_TYPE_BAREMETAL==y suppress cont%(cn)d_linux_pager_params cont%(cn)d_posix_pager_params
|
||||||
when CONT%(cn)d_TYPE_POSIX==y suppress cont%(cn)d_linux_pager_params
|
when CONT%(cn)d_TYPE_POSIX==y suppress cont%(cn)d_linux_pager_params
|
||||||
|
when CONT%(cn)d_TYPE_CUSTOM==y suppress cont%(cn)d_linux_pager_params cont%(cn)d_posix_pager_params
|
||||||
unless CONT%(cn)d_TYPE_BAREMETAL==y suppress cont%(cn)d_baremetal_params
|
unless CONT%(cn)d_TYPE_BAREMETAL==y suppress cont%(cn)d_baremetal_params
|
||||||
|
unless CONT%(cn)d_TYPE_CUSTOM==y suppress CONT%(cn)d_SOURCE_PATH
|
||||||
|
|
||||||
symbols
|
symbols
|
||||||
cont%(cn)d_menu 'Container %(cn)d Parameters'
|
cont%(cn)d_menu 'Container %(cn)d Parameters'
|
||||||
@@ -637,6 +643,7 @@ menu cont%(cn)d_capability_list
|
|||||||
|
|
||||||
menu container%(cn)d_options
|
menu container%(cn)d_options
|
||||||
CONT%(cn)d_OPT_NAME$
|
CONT%(cn)d_OPT_NAME$
|
||||||
|
CONT%(cn)d_SOURCE_PATH$
|
||||||
cont%(cn)d_baremetal_params
|
cont%(cn)d_baremetal_params
|
||||||
cont%(cn)d_linux_pager_params
|
cont%(cn)d_linux_pager_params
|
||||||
cont%(cn)d_default_pager_params
|
cont%(cn)d_default_pager_params
|
||||||
@@ -648,7 +655,8 @@ menu container%(cn)d_options
|
|||||||
choices container%(cn)d_type
|
choices container%(cn)d_type
|
||||||
CONT%(cn)d_TYPE_BAREMETAL
|
CONT%(cn)d_TYPE_BAREMETAL
|
||||||
CONT%(cn)d_TYPE_POSIX
|
CONT%(cn)d_TYPE_POSIX
|
||||||
CONT%(cn)d_TYPE_LINUX
|
CONT%(cn)d_TYPE_CUSTOM
|
||||||
|
CONT%(cn)d_TYPE_LINUX
|
||||||
default CONT%(cn)d_TYPE_BAREMETAL
|
default CONT%(cn)d_TYPE_BAREMETAL
|
||||||
|
|
||||||
menu cont%(cn)d_menu
|
menu cont%(cn)d_menu
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class Container:
|
|||||||
self.name = None
|
self.name = None
|
||||||
self.type = None
|
self.type = None
|
||||||
self.id = id
|
self.id = id
|
||||||
|
self.src_path = None
|
||||||
self.baremetal_id = 0
|
self.baremetal_id = 0
|
||||||
self.pager_lma = 0
|
self.pager_lma = 0
|
||||||
self.pager_vma = 0
|
self.pager_vma = 0
|
||||||
@@ -131,7 +132,10 @@ class configuration:
|
|||||||
|
|
||||||
# TODO: Carry this over to Container() as static method???
|
# TODO: Carry this over to Container() as static method???
|
||||||
def get_container_parameter(self, id, param, val):
|
def get_container_parameter(self, id, param, val):
|
||||||
if param[:len("PAGER_LMA")] == "PAGER_LMA":
|
if param[:len("SOURCE_PATH")] == "SOURCE_PATH":
|
||||||
|
parts = val.split("\"", 3)
|
||||||
|
self.containers[id].src_path = parts[1]
|
||||||
|
elif param[:len("PAGER_LMA")] == "PAGER_LMA":
|
||||||
self.containers[id].pager_lma = int(val, 0)
|
self.containers[id].pager_lma = int(val, 0)
|
||||||
elif param[:len("PAGER_VMA")] == "PAGER_VMA":
|
elif param[:len("PAGER_VMA")] == "PAGER_VMA":
|
||||||
self.containers[id].pager_vma = int(val, 0)
|
self.containers[id].pager_vma = int(val, 0)
|
||||||
@@ -188,6 +192,8 @@ class configuration:
|
|||||||
self.containers[id].type = "posix"
|
self.containers[id].type = "posix"
|
||||||
elif param2 == "BAREMETAL":
|
elif param2 == "BAREMETAL":
|
||||||
self.containers[id].type = "baremetal"
|
self.containers[id].type = "baremetal"
|
||||||
|
elif param2 == "CUSTOM":
|
||||||
|
self.containers[id].type = "custom"
|
||||||
# Extract parameters for containers
|
# Extract parameters for containers
|
||||||
def get_container_parameters(self, name, val):
|
def get_container_parameters(self, name, val):
|
||||||
matchobj = re.match(r"(CONFIG_CONT){1}([0-9]){1}(\w+)", name)
|
matchobj = re.match(r"(CONFIG_CONT){1}([0-9]){1}(\w+)", name)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ from os.path import join
|
|||||||
from config.projpaths import *
|
from config.projpaths import *
|
||||||
from config.configuration import *
|
from config.configuration import *
|
||||||
from scripts.baremetal.baremetal_generator import *
|
from scripts.baremetal.baremetal_generator import *
|
||||||
|
from scripts.custom.custom_generator import *
|
||||||
from scripts.kernel.generate_kernel_cinfo import *
|
from scripts.kernel.generate_kernel_cinfo import *
|
||||||
from scripts.cml.generate_container_cml import *
|
from scripts.cml.generate_container_cml import *
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
@@ -188,6 +189,10 @@ def configure_system(options, args):
|
|||||||
baremetal_cont_gen = BaremetalContGenerator()
|
baremetal_cont_gen = BaremetalContGenerator()
|
||||||
baremetal_cont_gen.baremetal_container_generate(config)
|
baremetal_cont_gen.baremetal_container_generate(config)
|
||||||
|
|
||||||
|
# Generate custom container files if new ones defined
|
||||||
|
custom_cont_gen = CustomContGenerator()
|
||||||
|
custom_cont_gen.custom_container_generate(config)
|
||||||
|
|
||||||
# Print out the configuration if asked
|
# Print out the configuration if asked
|
||||||
if options.print_config:
|
if options.print_config:
|
||||||
config.config_print()
|
config.config_print()
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ def build_all_containers():
|
|||||||
if container.type == 'linux':
|
if container.type == 'linux':
|
||||||
pass
|
pass
|
||||||
cont_images.append(build_linux_container(config, projpaths, container))
|
cont_images.append(build_linux_container(config, projpaths, container))
|
||||||
elif container.type == 'baremetal':
|
elif container.type == 'baremetal' or container.type == 'custom':
|
||||||
cont_images.append(build_default_container(config, projpaths, container))
|
cont_images.append(build_default_container(config, projpaths, container))
|
||||||
elif container.type == 'posix':
|
elif container.type == 'posix':
|
||||||
cont_images.append(build_posix_container(config, projpaths, container))
|
cont_images.append(build_posix_container(config, projpaths, container))
|
||||||
|
|||||||
0
scripts/custom/__init__.py
Normal file
0
scripts/custom/__init__.py
Normal file
143
scripts/custom/custom_generator.py
Executable file
143
scripts/custom/custom_generator.py
Executable file
@@ -0,0 +1,143 @@
|
|||||||
|
#! /usr/bin/env python2.6
|
||||||
|
# -*- mode: python; coding: utf-8; -*-
|
||||||
|
#
|
||||||
|
# Codezero -- Virtualization microkernel for embedded systems.
|
||||||
|
#
|
||||||
|
# Copyright © 2009 B Labs Ltd
|
||||||
|
#
|
||||||
|
import os, sys, shelve, glob
|
||||||
|
from os.path import join
|
||||||
|
|
||||||
|
PROJRELROOT = '../../'
|
||||||
|
|
||||||
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), PROJRELROOT)))
|
||||||
|
sys.path.append(os.path.abspath("../"))
|
||||||
|
|
||||||
|
SCRIPTROOT = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
from config.projpaths import *
|
||||||
|
from config.configuration import *
|
||||||
|
from config.lib import *
|
||||||
|
|
||||||
|
class CustomContGenerator:
|
||||||
|
def __init__(self):
|
||||||
|
self.CONT_SRC_DIR = '' # Set when container is selected
|
||||||
|
|
||||||
|
self.main_builder_name = 'build.py'
|
||||||
|
self.main_configurator_name = 'configure.py'
|
||||||
|
self.mailing_list_url = 'http://lists.l4dev.org/mailman/listinfo/codezero-devel'
|
||||||
|
|
||||||
|
self.build_script_in = join(SCRIPTROOT, 'files/SConstruct.in')
|
||||||
|
self.build_readme_in = join(SCRIPTROOT, 'files/build.readme.in')
|
||||||
|
self.build_desc_in = join(SCRIPTROOT, 'files/container.desc.in')
|
||||||
|
self.linker_lds_in = join(SCRIPTROOT, 'files/linker.lds.in')
|
||||||
|
self.container_h_in = join(SCRIPTROOT, 'files/container.h.in')
|
||||||
|
|
||||||
|
self.build_script_name = 'SConstruct'
|
||||||
|
self.build_readme_name = 'build.readme'
|
||||||
|
self.build_desc_name = '.container'
|
||||||
|
self.linker_lds_name = 'linker.lds'
|
||||||
|
self.container_h_name = 'container.h'
|
||||||
|
|
||||||
|
self.container_h_out = None
|
||||||
|
self.build_script_out = None
|
||||||
|
self.build_readme_out = None
|
||||||
|
self.build_desc_out = None
|
||||||
|
self.src_main_out = None
|
||||||
|
|
||||||
|
def create_custom_srctree(self, config, cont):
|
||||||
|
# First, create the base project directory and sources
|
||||||
|
shutil.copytree(join(PROJROOT, cont.src_path), self.CONT_SRC_DIR)
|
||||||
|
|
||||||
|
def copy_custom_build_desc(self, config, cont):
|
||||||
|
id_header = '[Container ID]\n'
|
||||||
|
type_header = '\n[Container Type]\n'
|
||||||
|
name_header = '\n[Container Name]\n'
|
||||||
|
pager_lma_header = '\n[Container Pager LMA]\n'
|
||||||
|
pager_vma_header = '\n[Container Pager VMA]\n'
|
||||||
|
pager_virtmem_header = '\n[Container Virtmem Region %s]\n'
|
||||||
|
pager_physmem_header = '\n[Container Physmem Region %s]\n'
|
||||||
|
|
||||||
|
with open(self.build_desc_out, 'w+') as fout:
|
||||||
|
fout.write(id_header)
|
||||||
|
fout.write('\t' + str(cont.id) + '\n')
|
||||||
|
fout.write(type_header)
|
||||||
|
fout.write('\t' + cont.type + '\n')
|
||||||
|
fout.write(name_header)
|
||||||
|
fout.write('\t' + cont.name + '\n')
|
||||||
|
fout.write(pager_lma_header)
|
||||||
|
fout.write('\t' + conv_hex(cont.pager_lma) + '\n')
|
||||||
|
fout.write(pager_vma_header)
|
||||||
|
fout.write('\t' + conv_hex(cont.pager_vma) + '\n')
|
||||||
|
for ireg in range(cont.virt_regions):
|
||||||
|
fout.write(pager_virtmem_header % ireg)
|
||||||
|
fout.write('\t' + cont.virtmem["START"][ireg] + ' - ' + cont.virtmem["END"][ireg] + '\n')
|
||||||
|
for ireg in range(cont.phys_regions):
|
||||||
|
fout.write(pager_physmem_header % ireg)
|
||||||
|
fout.write('\t' + cont.physmem["START"][ireg] + ' - ' + cont.physmem["END"][ireg] + '\n')
|
||||||
|
|
||||||
|
def copy_custom_build_readme(self, config, cont):
|
||||||
|
with open(self.build_readme_in) as fin:
|
||||||
|
str = fin.read()
|
||||||
|
with open(self.build_readme_out, 'w+') as fout:
|
||||||
|
# Make any manipulations here
|
||||||
|
fout.write(str % (self.mailing_list_url, \
|
||||||
|
cont.name, \
|
||||||
|
self.build_desc_name, \
|
||||||
|
self.main_builder_name, \
|
||||||
|
self.main_configurator_name, \
|
||||||
|
self.main_configurator_name))
|
||||||
|
|
||||||
|
def copy_custom_container_h(self, config, cont):
|
||||||
|
with open(self.container_h_in) as fin:
|
||||||
|
str = fin.read()
|
||||||
|
with open(self.container_h_out, 'w+') as fout:
|
||||||
|
# Make any manipulations here
|
||||||
|
fout.write(str % (cont.name, cont.id, cont.id))
|
||||||
|
|
||||||
|
def create_custom_sources(self, config, cont):
|
||||||
|
self.create_custom_srctree(config, cont)
|
||||||
|
self.copy_custom_build_readme(config, cont)
|
||||||
|
self.copy_custom_build_desc(config, cont)
|
||||||
|
self.generate_linker_script(config, cont)
|
||||||
|
self.copy_custom_container_h(config, cont)
|
||||||
|
|
||||||
|
def update_configuration(self, config, cont):
|
||||||
|
self.copy_custom_build_desc(config, cont)
|
||||||
|
self.generate_linker_script(config, cont)
|
||||||
|
self.copy_custom_container_h(config, cont)
|
||||||
|
|
||||||
|
def check_create_custom_sources(self, config):
|
||||||
|
for cont in config.containers:
|
||||||
|
if cont.type == "custom":
|
||||||
|
# Determine container directory name.
|
||||||
|
self.CONT_SRC_DIR = join(join(BUILDDIR, 'cont') + str(cont.id), cont.name)
|
||||||
|
self.build_readme_out = join(self.CONT_SRC_DIR, self.build_readme_name)
|
||||||
|
self.build_desc_out = join(self.CONT_SRC_DIR, self.build_desc_name)
|
||||||
|
self.linker_lds_out = join(join(self.CONT_SRC_DIR, 'include'), \
|
||||||
|
self.linker_lds_name)
|
||||||
|
self.container_h_out = join(join(self.CONT_SRC_DIR, 'include'), \
|
||||||
|
self.container_h_name)
|
||||||
|
|
||||||
|
if not os.path.exists(self.CONT_SRC_DIR):
|
||||||
|
self.create_custom_sources(config, cont)
|
||||||
|
else:
|
||||||
|
# Don't create new sources but update configuration
|
||||||
|
self.update_configuration(config, cont)
|
||||||
|
|
||||||
|
def generate_linker_script(self, config, cont):
|
||||||
|
with open(self.linker_lds_in) as fin:
|
||||||
|
str = fin.read()
|
||||||
|
with open(self.linker_lds_out, 'w+') as fout:
|
||||||
|
fout.write(str % (conv_hex(cont.pager_vma), \
|
||||||
|
conv_hex(cont.pager_lma)))
|
||||||
|
|
||||||
|
def custom_container_generate(self, config):
|
||||||
|
self.check_create_custom_sources(config)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
config = configuration_retrieve()
|
||||||
|
config.config_print()
|
||||||
|
custom_cont = CustomContGenerator()
|
||||||
|
custom_cont.custom_container_generate(config)
|
||||||
|
|
||||||
0
scripts/custom/files/SConstruct.in
Normal file
0
scripts/custom/files/SConstruct.in
Normal file
112
scripts/custom/files/build.readme.in
Normal file
112
scripts/custom/files/build.readme.in
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
Codezero Buildsystem For This Container
|
||||||
|
|
||||||
|
Autogenerated by the Build system
|
||||||
|
|
||||||
|
|
||||||
|
This is an autogenerated file that is meant to walk you through the build
|
||||||
|
process. It is meant to be the most simple to get on with, therefore if
|
||||||
|
you feel any complications, please reach us on our l4dev.org mailing list
|
||||||
|
on %s
|
||||||
|
|
||||||
|
You have created a new container called `%s'.
|
||||||
|
|
||||||
|
The parameters you have supplied are described in the "%s" file
|
||||||
|
placed at the top-level directory. Note, that this is only an informative
|
||||||
|
file for your reference, and it can be optionally removed.
|
||||||
|
|
||||||
|
|
||||||
|
1. Directory Structure:
|
||||||
|
|
||||||
|
1.1) Directory tree:
|
||||||
|
.
|
||||||
|
|-- SConstruct
|
||||||
|
|-- build.readme
|
||||||
|
|-- .container
|
||||||
|
|-- include
|
||||||
|
| `-- linker.lds.example
|
||||||
|
|-- main.c
|
||||||
|
`-- src
|
||||||
|
|-- test.c
|
||||||
|
|
||||||
|
In the above directory tree:
|
||||||
|
|
||||||
|
1.2) |-- SConstruct
|
||||||
|
|
||||||
|
This is the top-level build file, that will build your project in its current
|
||||||
|
state. You may freely reorganize directories, but must reflect changes in this
|
||||||
|
file. For more, please see the SCons build tool at http://www.scons.org/
|
||||||
|
|
||||||
|
The build system will search for this file, and execute it by the:
|
||||||
|
|
||||||
|
`scons'
|
||||||
|
|
||||||
|
command at the root of the directory. You may issue the same command manually
|
||||||
|
for building and testing your build. If you choose to use another build tool
|
||||||
|
such as make, you may freely replace scons, and the build system will search
|
||||||
|
and call your custom build command.
|
||||||
|
|
||||||
|
1.3) |--include
|
||||||
|
`--src
|
||||||
|
|
||||||
|
These are the directories that include your header files and sources. You may
|
||||||
|
freely change and reorganize these, but make sure to have a valid build file
|
||||||
|
that reflects those changes at the top-level directory.
|
||||||
|
|
||||||
|
1.4) |-- include
|
||||||
|
| `-- linker.lds.example
|
||||||
|
|
||||||
|
This is an example linker script for your project. Using this as your default
|
||||||
|
linker script is often useful, since it has been autogenerated to contain all
|
||||||
|
the parameters you need for the memory regions of your application defined at
|
||||||
|
configuration time. You may freely replace it, but make sure to edit the
|
||||||
|
top-level build script accordingly.
|
||||||
|
|
||||||
|
|
||||||
|
2. Build Process
|
||||||
|
|
||||||
|
2.1) Build overview
|
||||||
|
|
||||||
|
The complete Codezero system will be built from a top-level `%s' script by
|
||||||
|
that resides in the top-level directory of Codezero sources.
|
||||||
|
|
||||||
|
The Codezero system build script will build this container at a certain stage
|
||||||
|
during the build, by referring to build script file named such as `SConstruct'
|
||||||
|
or `Makefile' that resides in this container's top-level directory.
|
||||||
|
|
||||||
|
Once the executables are built, it will search for all files with a .elf
|
||||||
|
extension in any of the subdirectories, and recognize those as loadable
|
||||||
|
executables. There may be more than one of these files present after the build.
|
||||||
|
|
||||||
|
In the future this behaviour may change such that the loadable executable files
|
||||||
|
are also specified in the configuration.
|
||||||
|
|
||||||
|
Finally, executables of all containers will be picked up and built into the
|
||||||
|
final.elf file, which is a self-loading elf executable.
|
||||||
|
|
||||||
|
|
||||||
|
3. Reconfiguring this container
|
||||||
|
|
||||||
|
If you want to reconfigure the container with new parameters, you may do so by
|
||||||
|
executing the `%s' script at the top-level Codezero directory by:
|
||||||
|
|
||||||
|
'./%s'
|
||||||
|
|
||||||
|
This will populate only brand new container directories with new files. It will
|
||||||
|
update it's existing internal configuration for existing containers (such as
|
||||||
|
container memory regions) but it won't touch any files that exist under an
|
||||||
|
already-defined container.
|
||||||
|
|
||||||
|
If you want to start from scratch, specify a new directory name, if you want
|
||||||
|
to reconfigure existing container parameters, run this on an existing directory,
|
||||||
|
and it will only update its internal records for this container, but not touch
|
||||||
|
the directory.
|
||||||
|
|
||||||
|
|
||||||
|
4. Example source files
|
||||||
|
|
||||||
|
Example source files populated by the configuration contain valid examples
|
||||||
|
of how the generic libl4 userspace library can be used. Each test contains a
|
||||||
|
valid example from the available API, and may be modified, changed and removed
|
||||||
|
freely.
|
||||||
|
|
||||||
|
|
||||||
8
scripts/custom/files/container.desc.in
Normal file
8
scripts/custom/files/container.desc.in
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[Container Name]
|
||||||
|
|
||||||
|
[Container LMA]
|
||||||
|
|
||||||
|
[Container VMA]
|
||||||
|
|
||||||
|
[Container Type]
|
||||||
|
|
||||||
13
scripts/custom/files/container.h.in
Normal file
13
scripts/custom/files/container.h.in
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/*
|
||||||
|
* Autogenerated definitions for this container.
|
||||||
|
*/
|
||||||
|
#ifndef __CONTAINER_H__
|
||||||
|
#define __CONTAINER_H__
|
||||||
|
|
||||||
|
|
||||||
|
#define __CONTAINER_NAME__ "%s"
|
||||||
|
#define __CONTAINER_ID__ %d
|
||||||
|
#define __CONTAINER__ "cont%d"
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __CONTAINER_H__ */
|
||||||
29
scripts/custom/files/linker.lds.in
Normal file
29
scripts/custom/files/linker.lds.in
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* Example working linker script for this container.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2009 B Labs Ltd.
|
||||||
|
*/
|
||||||
|
|
||||||
|
vma_start = %s;
|
||||||
|
lma_start = %s;
|
||||||
|
offset = vma_start - lma_start;
|
||||||
|
|
||||||
|
ENTRY(_start)
|
||||||
|
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
. = vma_start;
|
||||||
|
.text : AT (ADDR(.text) - offset) { *(.text.head) *(.text) }
|
||||||
|
.rodata : AT (ADDR(.rodata) - offset) { *(.rodata) }
|
||||||
|
.rodata1 : AT (ADDR(.rodata1) - offset) { *(.rodata1) }
|
||||||
|
|
||||||
|
. = ALIGN(4K);
|
||||||
|
.data : AT (ADDR(.data) - offset) { *(.data) }
|
||||||
|
.bss : AT (ADDR(.bss) - offset)
|
||||||
|
{
|
||||||
|
*(.bss)
|
||||||
|
. += 0x1000;
|
||||||
|
. = ALIGN(8);
|
||||||
|
__stack = .;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user