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

Open
wants to merge 18 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

@mahyarsamani
Copy link
Contributor

@Harshil2107 Please update the documentation on how to increase the size of the disk-image. I would like to see an example of how each size is calculated--- rather than saying size A has to be at least 1 megabyte more than size B. In my experience when I tried to resize the image for ~20GB, this is what I had to do.

UEFI_size: First partition size defined in http/user-data; I am assume it is the size of the partition allocated for UEFI. This in your case is the magical number 564133888.
root_size: Second partition size defined in http/user-data; This is the size of the root partition (/) in the disk-image, this is what the user defines. In my case, I am using 20909654016.
mystical_size: Size of the unexplained mysterious 1 MB we have to account for. This is 1048576.

Using this information, the disk_size is equal to 564133888 + 20909654016 + 1048576 = 21474836480 (which btw is exactly 20GiB (GibiBytes). Please note that the unit for disk_size in .hcl is not MibiBytes (2^20), it is rather MegaBytes (10^6). Which means you have to divide the final number by 1_000_000 which will give you 21474.833. In my case, I just rounded that to 21600.

@mahyarsamani
Copy link
Contributor

@Harshil2107 Please update the documentation on how to increase the size of the disk-image. I would like to see an example of how each size is calculated--- rather than saying size A has to be at least 1 megabyte more than size B. In my experience when I tried to resize the image for ~20GB, this is what I had to do.

UEFI_size: First partition size defined in http/user-data; I am assume it is the size of the partition allocated for UEFI. This in your case is the magical number 564133888. root_size: Second partition size defined in http/user-data; This is the size of the root partition (/) in the disk-image, this is what the user defines. In my case, I am using 20909654016. mystical_size: Size of the unexplained mysterious 1 MB we have to account for. This is 1048576.

Using this information, the disk_size is equal to 564133888 + 20909654016 + 1048576 = 21474836480 (which btw is exactly 20GiB (GibiBytes). Please note that the unit for disk_size in .hcl is not MibiBytes (2^20), it is rather MegaBytes (10^6). Which means you have to divide the final number by 1_000_000 which will give you 21474.833. In my case, I just rounded that to 21600.

This worked btw!

@Harshil2107
Copy link
Contributor Author

@mahyarsamani I updated the documentation with example #65

@mahyarsamani
Copy link
Contributor

I think the iso link for 24.04 is outdated.

@Harshil2107 Harshil2107 marked this pull request as ready for review January 16, 2025 22:03
@erin-le erin-le self-requested a review January 17, 2025 19:52
@mahyarsamani
Copy link
Contributor

I want to propose holding off on getting this merged. I faced a few challenges when I tried to use the scripts here to get my packages installed and get them to work without effecting other parts of the system setup (e.g. [email protected], gem5_init.sh, ...). I have created a draft pr for it here: #68

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.

4 participants