Commit graph

330 commits

Author SHA1 Message Date
Anas Nashif 3b9199d5d4 Kbuild: optionally build minimal c library
Change-Id: Ib949ec199ba0dec3c5a1a1a6c9fbf355efcc8104
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif 369cf08e29 Kbuild: Support toolchain auxiliary libraries per variant
This allows a toolchain to define the auxiliary libraries in
scripts/Makefile.toolchain.{variant} with more flexibility.

Change-Id: Iaae9c7613ddcbcc8376b7e756aa4b675db680737
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz 0c47e4fbe7 Kbuild: LDLIBS_TOOLCHAIN adds toolchain static libraries.
This commit adds the variable LDLIBS_TOOLCHAIN that, by default,
add the gcc static library to the link command.
This variable can be overriden as an environmental variable or as a make
parameter to allow the use of different toolchains different from gcc.

Change-Id: Id9d6c8621a7dc8feebdf377c115564701fb7652b
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif aca245d96f Kbuild: Add support for multiple toolchains
To use this, export the following:

export VXMICRO_GCC_VARIANT=yocto # for yocto
export VXMICRO_GCC_VARIANT=xtools # for crosstool-ng

export YOCTO_SDK_INSTALL_DIR=/opt/poky-tm/1.8
or
export XTOOLS_TOOLCHAIN_PATH=/opt/crosstool-ng

Change-Id: I9cd6062ecc32047d1582aad46209f4232e0e31f6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz de1cec29d6 Kbuild: Build minimal libc as a static library.
This commit changes the way libc is built.
Instead of building a hierarchy of objects linked into the
microkernel, libc minimal is built as a static library and
linked against the microkernel binary.
The location of the libc is configurable with the variable
KLIBC_DIR. This gives the flexibility to build against a
different libc other than minimal.

Change-Id: I9c0b6a684a9f3b407861aa387727c45eceb269c4
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz 638fb2c181 Kbuild: Bluetooth driver support.
This commit adds the Makefile and Kconfig files
to support the bluetooth driver in the Kbuild system.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I1f72b13aca8fb098eece04c4f0e1b680639b520f
2016-02-05 20:14:08 -05:00
Anas Nashif 848c5c83a3 Kbuild: Support qemu pid
Change-Id: I9824d2971f4eaa8798f444432ff033548ec71e04

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:08 -05:00
Juan Manuel Cruz 52836ec3a8 Kbuild: GenIdt auto build.
This commit includes the genIdt tool as part of the kconfig
basic tools. Now the genIdt tool is built automatically as
part of the whole kernel project.

Change-Id: I45110a7c564c59d7a6684d868ccc377cbd6ef1c4
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 5c8ff0fe26 Kbuild: support sources in different directory
In some cases you might want to compile sources in a
customer location, for example share code for samples
that runs in nano and micro kernels.

Set SOURCE_DIR  in the project Makefile to achieve this.

Change-Id: Iaa4d0fe701b30499b903b64ddf816a678074a176
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:07 -05:00
Anas Nashif 3a4073dc96 LDFLAGS: be compatible with legacy build system
Change-Id: I447afbe63a9a2e5210768ece5ef8ef750956e66a

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif 42f0970b0a remove linux firmware targets
Change-Id: I2bc4ab7220e7b6b200801e440a2490822c2481c6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif de26d969f8 remove linux firmware target documentation
Change-Id: I145cdbe0ba24b95887c4eaa08b3dbad36d0db861
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Anas Nashif b7255f7fd1 remove linux firmware hooks
Change-Id: I847a0aea915b960b2ec9e993267cc9a4c64e5f4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz 068ebc0529 Kbuild: Root Makefile issue.
KBUILD_CFLAGS line was broken because a breakline was missing.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I47a36f89d7cd589c71ce0bfb9a6d346a12202f43
2016-02-05 20:14:06 -05:00
Juan Manuel Cruz fbc5956ade Kbuild: ISA_FLAG Fix
This commit fixes the issue that ISA_FLAG was not being
added during the build process.

Change-Id: I780c8dbae8912ee8e159827cb24a5700432898d2
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz f8fedaa134 Kbuild: Eliminate CFLAGs that are not needed.
This commit removes several CFLAGS inherited from Linux Kconfig
that are not used in the current build system.

 - The option fno-delete-null-pointer-checks is not used.
 - O2 is not a default option and the symbol
   CONFIG_CC_OPTIMIZE_FOR_SIZE is not supported.
 - The option allow-store-data-races=0 is not used.
 - The fno-stack-protector was being added twice and is not
   a default parameter.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I3791d995638dea50796f041e558a39d5aa7e88f6
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 4d8c725ebd Kbuild: External CFLAGS.
This commit add the following changes to the internal CFLAGS:

 - DEFAULTFLAGS is adjusted to only hold the Os option by default.
 - CONFIG_COMPILER_OPT is a Kbuild symbols that is included
   in the CFLAGS.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ie78fe00c8d9b05f5d0361357267f08d978006427
2016-02-05 20:14:05 -05:00
Anas Nashif 39cb1ae28c Run qemu with right kernel
We use the microkernel/nanokernel naming convention,
so run qemu with the right file.

Change-Id: I6cedf34f85693d6026c450904e1ce72c435baa06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz e7de0f65b4 Kbuild: QEMU target.
This commit adds support for the qemu target.
This target will generate the kernel binary and will
launch a qemu instance running the binary.
Currently, only the x86 generic pc and the arm tilm3s6965
BSPs are supported with emulation.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I9e71d3ce2fba98572830475a2e15e3fceb0216b4
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 1c8f5a75e7 Kbuild: Standard output file names.
This commit changes the name of the output files.
The output names tinymountain.* have been changed to
microkernel.* and nanokernel.*.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia73daa35bb8e44972065af3a217bf87335169dac
2016-02-05 20:14:05 -05:00
Anas Nashif 1e8dc5ad88 no need for old_version!
Change-Id: I2fdc4281a5663e1f48fd3b45f5226a2cedf66878
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:05 -05:00
Anas Nashif 6afc4851bf empty CHECKFLAGS
Change-Id: I97787e176fda9f3e118eec4a110408789570f8b1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:05 -05:00
Anas Nashif 67fc206887 Remove ia64 references
Change-Id: I9ae4e32f8f85aa261943acb0c00c7bd0c4d3217a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 7ac851afef Kbuild. Remove linux name references.
This commit substitutes references to the linux string in variable
names.

It changes the LINUX prefix and uses the TIMO prefix (short for
tiny mountain)

It changes the vmlinux prefix for tinymountain prefix.

It preserves linux references found in licenses, comments giving
credits and from scripts that are not supported by the current build
system yet, like rpm generation.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Id17d8d12161f00e2a2ff38f218cdb6c5afd169c0
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 0d01f5bedc Adding Kbuild linking process.
This commit is adding the linking process.
  -Creates linker command files.
  -Creates IDT tables.
  -Creates final ELF file.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I3ce92868b00957fdc24a361cc419e3548f475cc3
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz a0b5466540 Adding Kbuild CFLAGS.
This commit adds all Kbuild CFLAGS to build the kernel binary.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ia4ca1b71b4e68c4515c428147a8814ca983bb541
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz ce3533a476 Kbuild fix for clean and mrproper targets.
This commit fixes the target clean functionality.
Originally, the clean and mrproper targets search for the
Documentation and samples directories and their respective
Makefiles.

Our current directory structure is not including Documentation
directory yet. Also, there is not support for a global Makefiles
at samples directory.

This commit deletes references to Documentation directories for
clean and mrproper targets as well.

Also, This commit deletes the reference to sample directory for
clean target.

Finally, this commit temporary fixes the references to assembly
files .s extensions. This has been marked as a BUG until all .s
files can be renamed to .S files.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I4c95c2eed4b5756843ecb9021d03401289522586
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz ba741fedd7 Root Makefile adaptation.
This commit organizes the different directories listed in the
root Makefile. Each directory hold a root Makefile describing
libraries and object bundles that will be linked together as
the kernel binary.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: I4af16114598ad985dfb4faac68e82dc73b1b6cc5
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz 6de34008ab Creation of version.h header file.
This commit adapts the root Makefile to generate the version.h
header with the format expected by embedded os.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ib394ad6b3fab4f02f6953d83d04f13404df87832
2016-02-05 20:14:05 -05:00
Juan Manuel Cruz a9b1c74ee3 Adding Kbuild root Makefile.
Adding the root Makefile from linux 3.19-rc7 Kbuild as is.

This Makefile will be modified and adapted to the current build
system in following commits.

This is done with the intention to help the revision of changes
that were done to the original Kbuild Makefile.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Ib897553d4d073dc3e3dab702b87b92a6f82cd804
2016-02-05 20:14:04 -05:00