Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guides: Add porting hack session #335

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mariasfiraiala
Copy link
Contributor

No description provided.

Signed-off-by: Maria Sfiraiala <[email protected]>
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First round, more incoming.

@@ -0,0 +1,693 @@
---
title: Porting On Unikraft
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: Porting On Unikraft
title: Advanced Porting On Unikraft

---
title: Porting On Unikraft
description: |
We will talk about adapting certain components of Unikraft to your own advantage
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
We will talk about adapting certain components of Unikraft to your own advantage
We talk about adapting certain components of Unikraft to your own advantage.


### Adding New Sections to an ELF

There are situations in which we want to add new sections in the executable file (ELF format - *Executable and Linking Format*) for our application or library.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
There are situations in which we want to add new sections in the executable file (ELF format - *Executable and Linking Format*) for our application or library.
There are situations in which we want to add new sections in the executable file ([ELF format - *Executable and Linking Format*](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format)) for our application or library.


The way we can add such a section in our application/library is the following:

1. Create a file with the `.ld` extension (e.g. extra.ld) with the following content:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Create a file with the `.ld` extension (e.g. extra.ld) with the following content:
1. Create a file with the `.ld` extension (e.g. `extra.ld`) with the following content:


But enough with the chit-chat, let's get our hands dirty.
In the `/demo/01-extrald-app` directory there is an application that defines a new section in the ELF.
Copy this directory to your app's directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Copy this directory to your app's directory.
Setup the application dependencies in the usual layout.

You can start the program using the following command:

```console
$ qemu-guest -k build/02-linked-list-app_kvm-x86_64
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ qemu-guest -k build/02-linked-list-app_kvm-x86_64
qemu-system-x86_64 -kernel workdir/build/02-linked-list-app_qemu-x86_64 -nographic


### Support Files

Session support files are available [in the repository](https://github.com/unikraft/docs).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Session support files are available [in the repository](https://github.com/unikraft/docs).
Session support files are available [in the repository](https://github.com/unikraft-upb/guides-exercises).

Comment on lines +518 to +519
$ ls
demo/ images/ index.md/ sol/ work/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ ls
demo/ images/ index.md/ sol/ work/
$ ls advanced-porting/
demo sol work

Comment on lines +529 to +532
$ cd porting/

$ ls
demo/ images/ index.md/ sol/ work/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$ cd porting/
$ ls
demo/ images/ index.md/ sol/ work/
$ cd advanced-porting/
$ ls
demo/ sol/ work/


In this task we will add a new section in the elf and we will define a series of macros.

Navigate to the `01-extrald` directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Navigate to the `01-extrald` directory.
Navigate to the `work/01-extrald` directory.

@razvand razvand added the enhancement New feature or request label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants