-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add p7zip #80
base: master
Are you sure you want to change the base?
Add p7zip #80
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Netwide Assembler | ||
|
||
This is the netwide assembler and it is meant to be used in the binary compatibility mode of unikraft. | ||
|
||
## Content | ||
- sample_code.s: a sample assembly code file that can be assembled using nasm. | ||
- usr/bin/nasm: the nasm binary | ||
- lib/ & lib64/: the required libraries for nasm | ||
|
||
## Extract dynamic libraries | ||
```../extract.sh usr/bin/nasm``` | ||
|
||
output: | ||
``` | ||
Copying /lib/x86_64-linux-gnu/libc.so.6 ... | ||
Copying /lib64/ld-linux-x86-64.so.2 ... | ||
``` | ||
|
||
## Run on linux | ||
```nasm sample_code.s``` | ||
|
||
## Run on unikraft | ||
```./run.sh -r ../dynamic-apps/nasm/ usr/bin/nasm sample_code.s``` | ||
|
||
This should generate the output file ```sample_code``` which is the assembled machine code generated by nasm. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
BITS 64 | ||
|
||
xor rax, rax | ||
test rdi, rdi | ||
jz end | ||
|
||
loop: | ||
cmp byte [rdi], 0 | ||
jz end | ||
|
||
xor rbx, rbx | ||
mov bl, byte [rdi] | ||
cmp bl, 0x5a | ||
ja loop_end | ||
|
||
push rax | ||
push rdi | ||
mov rdi, rbx | ||
mov rax, 0x403000 | ||
call rax | ||
pop rdi | ||
mov byte [rdi], al | ||
pop rax | ||
inc rax | ||
|
||
loop_end: | ||
inc rdi | ||
jmp loop | ||
|
||
end: | ||
ret |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||
# p7zip | ||||||
|
||||||
This is the p7zip compression utility that can be used with Unikraft bincompat mode. | ||||||
|
||||||
## Content | ||||||
|
||||||
- `lib/` & `lib64/`: required libs for p7zip | ||||||
- `/7z`: the 7z main binary | ||||||
- `7z.so`, `7za`, `7zCon.sfx`, `7zr`: different code modules for p7zip that will be used by 7z binary to perform different operations. | ||||||
|
||||||
## Extracting Dynamic Libraries | ||||||
|
||||||
```console | ||||||
../extract.sh ./7z | ||||||
``` | ||||||
|
||||||
## Running on Linux | ||||||
|
||||||
This will create a new archive called `archive.zip` and add the file `README.md` to it. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```console | ||||||
7z a archive.zip README.md | ||||||
``` | ||||||
|
||||||
This will extract the archive: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```console | ||||||
7z x archive.zip | ||||||
``` | ||||||
|
||||||
## Running on Unikraft | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a line on using the |
||||||
This will create a new archive called `archive.zip` and add the file `README.md` to it. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```console | ||||||
./run.sh -r ../dynamic-apps/p7zip /7z a archive.zip README.md | ||||||
``` | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give an output sample of the command above. |
||||||
This will extract an archive file called `archive.zip`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```console | ||||||
./run.sh -r ../dynamic-apps/p7zip /7z x archive.zip | ||||||
``` | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Give an output sample of the command above. |
||||||
We can use this command to check that everything worked properly: | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```console | ||||||
7z l archive.zip | ||||||
``` |
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.
Add wording here.