-
Notifications
You must be signed in to change notification settings - Fork 83
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
base: main
Are you sure you want to change the base?
Conversation
c60370a
to
d414c2c
Compare
Signed-off-by: Maria Sfiraiala <[email protected]>
d414c2c
to
0a9f2c0
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
$ ls | ||
demo/ images/ index.md/ sol/ work/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ ls | |
demo/ images/ index.md/ sol/ work/ | |
$ ls advanced-porting/ | |
demo sol work |
$ cd porting/ | ||
|
||
$ ls | ||
demo/ images/ index.md/ sol/ work/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigate to the `01-extrald` directory. | |
Navigate to the `work/01-extrald` directory. |
No description provided.