Platform Library Development¶
Platforms (e.g., Xen, KVM, Linux user-space, etc.) are also treated as libraries in Unikraft but there are a few differences:
You need to namespace any variables in Makefile.uk with
You need to register the platform and the library with Unikraft using the following commands:
$(eval $(call addplat_s,platname,$(PLAT_PLATNAME))) $(eval $(call addplatlib,platname,libplatnameplat))
You need to provide a linker script and name the file
You need to place all platform files in the Unikraft repo under
A platform have to implement interfaces defined in
include/uk/plat(this is analogue to architectures that have to implement interfaces in
They do not use any external source files, i.e., all source code is within the Unikraft tree.
They must not have dependencies on external libraries, i.e., the Unikraft repo must be able to be built on its own. Remember that for such builds,
libnolibchas to be sufficient
libcreplacement to compile, link, and execute internal libraries. This means that nolibc has to be extended from time to time.
All changes/additions to
include/uk/archhave to be completely independent of any library (internal and external). They do not include any header provided by any library and never conflict with any library. Most of the times this is challenging for defining data types and structs. We use the same style as Linux kernel uses for kernel- internal types: double-underscore in front of the type. You can base your data types and function prototypes on
Please refer to the existing platforms to have a fuller idea of how platform libraries are implemented, and in particular what the syntax of the linker script should be.