Expanded the basic-porting.mdx file so it includes a tutorial on porting external libraries#552
Draft
StefanAMN wants to merge 1 commit intounikraft:mainfrom
Draft
Conversation
…ing external libraries Signed-off-by: Stefan Stancu <stefanstancu2006@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR expands the existing “basic porting” guide to cover porting external C libraries alongside a simple application example, incorporating lessons from earlier Unikraft sessions.
Changes:
- Updates the guide title/description to include library porting.
- Reflows and extends the existing
echo/pwdporting tutorial text. - Adds a new section describing external library porting concepts plus a kdtree practical exercise.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+213
to
+220
| Examining a Ported Library: libhogweed | ||
|
|
||
| Let's examine core components of an existing port, such as lib-libhogweed. | ||
| Glue Code | ||
|
|
||
| Sometimes, an external library's requirements are not fully present in Unikraft. The solution is to add "glue code" manually to the library's sources. Glue code is also useful when a library includes test modules; you can wrap them into a single function that Unikraft can invoke. | ||
| Configuration: Config.uk | ||
|
|
| `-- unikraft/ | ||
| ``` | ||
|
|
||
| Examining a Ported Library: libhogweed |
Comment on lines
+253
to
+255
| $(call verbose_cmd,CONFIG,libhogweed: $(notdir $@), \ | ||
| cd $(LIBHOGWEED_EXTRACTED) && ./configure --enable-mini-gmp \ | ||
| ) |
|
|
||
| ```makefile | ||
| LIBKDTREE_BASE = $(UK_LIBS)/libkdtree | ||
| LIBKDTREE_EXTRACTED = $(LIBKDTREE_BUILD)/origin |
Comment on lines
+31
to
33
| ```shell | ||
| $ ls workdir/libs/musl | ||
| abort.c Makefile.rules Makefile.uk.musl.errno Makefile.uk.musl.locale ...... |
razvand
requested changes
May 2, 2026
Contributor
razvand
left a comment
There was a problem hiding this comment.
See the linter checks. In particular, use a single sentence on a line.
Do not add the library porting in the basic-porting.mdx guide. Create a new guide called library-porting.mdx. We will end up with three porting guides: basic-porting.mdx, library-porting.mdx and advanced-porting.mdx.
Add a commit body to your commit.
Prefix the commit title with feat(guides):.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added a new part in the basic-porting.mdx file that includes a small guide on importing external libraries, which comes mainly from the hackathons/sessions/contributing-to-unikraft folder in an old commit, couples with some other ideas from some sessions from USoC23. This expands on the basic-porting.mdx file and integrates lessons from USoC23 regarding external C library porting.