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

resources: add scripts to make and extract arm kernel #60

Draft
wants to merge 15 commits into
base: stable
Choose a base branch
from

Conversation

Harshil2107
Copy link
Contributor

No description provided.

@Harshil2107
Copy link
Contributor Author

I am adding gem5-bridge driver based on #48

src/ubuntu-generic-diskimages/scripts/post-installation.sh Outdated Show resolved Hide resolved
src/ubuntu-generic-diskimages/scripts/post-installation.sh Outdated Show resolved Hide resolved
@@ -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
Copy link
Contributor

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.

@erin-le erin-le self-requested a review November 13, 2024 18:00
erin-le
erin-le previously approved these changes Nov 18, 2024
Copy link
Contributor

@erin-le erin-le left a 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

@Harshil2107
Copy link
Contributor Author

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

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
Copy link
Contributor

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/22.04-dockerfile/Dockerfile Outdated Show resolved Hide resolved
@Harshil2107 Harshil2107 requested a review from erin-le November 26, 2024 19:16
@Harshil2107 Harshil2107 requested a review from powerjg November 26, 2024 19:30
@Harshil2107
Copy link
Contributor Author

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.

Copy link
Contributor

@erin-le erin-le left a 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.

@Harshil2107 Harshil2107 requested a review from erin-le December 4, 2024 17:46
rm -rf build

# Use bash as the default shell
CMD ["/bin/bash"]
Copy link
Contributor

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 && \
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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`:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants