-
Notifications
You must be signed in to change notification settings - Fork 48
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
resources: add scripts to make and extract arm kernel #60
base: stable
Are you sure you want to change the base?
Conversation
I am adding gem5-bridge driver based on #48 |
@@ -47,21 +61,29 @@ if [ -z "$ISA" ]; then | |||
fi | |||
|
|||
# Just get the files we need | |||
git clone https://github.com/gem5/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=stable | |||
git clone https://github.com/nkrim/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=gem5-bridge |
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.
I assume this is just a placeholder, but don't forget to fix this.
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.
I tested this by building the disk image, then using the disk image and kernel as resources in a script that Harshil provided. It boots, so this LGTM
I think going for the method that I used in the 22.04 image, is better than the one that is used in 24.04 image. The only issue is that you have to give write permissions to the the directory we are mounting to the docker to get the kernel and the modules. does this look good, If so I can update the 24.04 image as well |
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
in the `/workspace/source`, lets get the driver files | ||
|
||
```bash | ||
git clone https://github.com/nkrim/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=gem5-bridge |
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.
get this committed to gem5 and use the gem5 source.
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
I built and tests the gem5 bridge driver with both the 22.04 and 24.04 disk images. I built the base image and then built the npb image using this base image. I was able to run the benchmark without sudo in gem5. The only blocker to his now should be getting the m5 driver code in gem5. |
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.
Looks good overall. There are just a few typos and minor things that could be added in make-kernel-and-gem5-bridge-driver.md
.
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
src/ubuntu-generic-diskimages/make-kernel-and-gem5-bridge-driver.md
Outdated
Show resolved
Hide resolved
rm -rf build | ||
|
||
# Use bash as the default shell | ||
CMD ["/bin/bash"] |
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.
Should be removed so the image won't be used interactively.
make -j 32 && \ | ||
make INSTALL_MOD_PATH=/workspace/output modules_install | ||
|
||
RUN git clone https://github.com/nkrim/gem5.git --depth=1 --filter=blob:none --no-checkout --sparse --single-branch --branch=gem5-bridge && \ |
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.
Must be changed before merging
@@ -64,7 +64,8 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
|
|||
### Add Kernel Modules to the Disk Image | |||
|
|||
- Add a Packer file provisioner to copy the modules to the disk image: | |||
- Add a Packer file provisioner to copy the modules to the disk image. |
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 a Packer file provisioner to copy the modules to the disk image. | |
- Add a Packer file provisioner to copy the modules to the disk image. The Packer script is located at `ubuntu-generic-diskimages/packer-scripts/arm-ubuntu.pkr.hcl`. |
@@ -64,7 +64,8 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
|
|||
### Add Kernel Modules to the Disk Image | |||
|
|||
- Add a Packer file provisioner to copy the modules to the disk image: | |||
- Add a Packer file provisioner to copy the modules to the disk image. | |||
Make sure that this provisioner is added before the shell provisioner as we will used these files in the `post-installation.sh`: |
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.
Make sure that this provisioner is added before the shell provisioner as we will used these files in the `post-installation.sh`: | |
Make sure that this provisioner is added before the shell provisioner, as these files are used when the shell provisioner runs`post-installation.sh`: |
@@ -148,16 +149,18 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
|
|||
### Add Kernel Modules to the Disk Image | |||
|
|||
- Add a Packer file provisioner to copy the modules to the disk image: | |||
- Add a Packer file provisioner to copy the modules to the disk image. |
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 a Packer file provisioner to copy the modules to the disk image. | |
- Add a Packer file provisioner to copy the modules to the disk image. The Packer script is located at `ubuntu-generic-diskimages/packer-scripts/arm-ubuntu.pkr.hcl`. |
@@ -176,3 +179,16 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
### Test with gem5 | |||
|
|||
- Use the disk image and the kernel to run a gem5 filesystem simulation, ensuring the new kernel and modules are correctly set up. | |||
|
|||
- You can use the following code snipped to use the disk image and kernel you made. |
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.
- You can use the following code snipped to use the disk image and kernel you made. | |
- You can use the following code snippet to use the disk image and kernel you made. |
@@ -73,7 +74,8 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
} | |||
``` | |||
|
|||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs: | |||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. |
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.
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. | |
- Add the following code snippet to the post-install script to move the modules into the correct location and regenerate the initramfs. The post-install script is located at `ubuntu-generic-diskimages/scripts/post-installation.sh`. |
@@ -73,7 +74,8 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
} | |||
``` | |||
|
|||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs: | |||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. | |||
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`: |
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.
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`: | |
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`, i.e. add the snippet before the line `echo "Building and installing gem5-bridge (m5) and libm5"`: |
} | ||
``` | ||
|
||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs: | ||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. |
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.
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. | |
- Add the following code snippet to the post-install script to move the modules into the correct location and regenerate the initramfs. The post-install script is located at `ubuntu-generic-diskimages/scripts/post-installation.sh`. |
} | ||
``` | ||
|
||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs: | ||
- Update the post-install script to move the modules into the correct location and regenerate the initramfs. | ||
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`: |
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.
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`: | |
Make sure the modules are moved before using `gem5-bridge` or compiling benchmarks with `gem5-bridge`, i.e. add the snippet before the line `echo "Building and installing gem5-bridge (m5) and libm5"`: |
@@ -176,3 +179,16 @@ This document outlines the steps to build a Linux kernel and its modules with th | |||
### Test with gem5 | |||
|
|||
- Use the disk image and the kernel to run a gem5 filesystem simulation, ensuring the new kernel and modules are correctly set up. |
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.
- Use the disk image and the kernel to run a gem5 filesystem simulation, ensuring the new kernel and modules are correctly set up. | |
- Use the disk image and the kernel to run a gem5 filesystem simulation, ensuring the new kernel and modules are correctly set up. See the bottom of this file for an example. |
No description provided.