Linux kernel 启动gem5 X86 Ubuntu完整系统模拟

Linux kernel 启动gem5 X86 Ubuntu完整系统模拟,linux-kernel,ubuntu-12.04,x86-64,diskimage,gem5,Linux Kernel,Ubuntu 12.04,X86 64,Diskimage,Gem5,我需要在gem5上运行相对较新版本的x86磁盘映像。从一开始,我就在内核v3.2.1中使用Ubuntu12.04磁盘映像,因为这种组合是为其他人设计的 经过一段时间后,模拟器挂起,请分享有关原因和可能的解决方案的任何想法。谢谢大家! 您可以在下面的m5term/telnet上找到输出。之后,是准备磁盘映像和内核以供参考的过程 gem5终端的最后一部分(m5term/telnet): # The full terminal output is here: # https://gist.github

我需要在gem5上运行相对较新版本的x86磁盘映像。从一开始,我就在内核v3.2.1中使用Ubuntu12.04磁盘映像,因为这种组合是为其他人设计的

经过一段时间后,模拟器挂起,请分享有关原因和可能的解决方案的任何想法。谢谢大家!

您可以在下面的m5term/telnet上找到输出。之后,是准备磁盘映像和内核以供参考的过程

gem5终端的最后一部分(m5term/telnet):

# The full terminal output is here:
# https://gist.github.com/agyaglikci/018533c8d2ff2a9e86c9144d5f4a9224#file-ubuntu12-04-kernel3-2-1-gem5-terminal

Freeing unused kernel memory: 348k freed
Mount failed for selinuxfs on /sys/fs/selinux:  No such file or directory
init: ureadahead main process (997) terminated with status 5
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
build/X86/gem5.opt -d AMD64 configs/example/fs.py --disk-image ${M5_PATH}/disks/ubuntu-12.04.img --kernel ${M5_PATH}/binaries/vmlinux-amd64-3.2.1
下面是准备磁盘映像的完整过程:

cd ${M5_PATH}
# Download and mount the disk image 
wget http://cdimage.ubuntu.com/ubuntu-base/releases/12.04/release/ubuntu-base-12.04.4-core-amd64.tar.gz
sudo util/gem5img.py init disks/ubuntu-12.04.img 4096
mkdir mnt
sudo util/gem5img.py mount disks/ubuntu-12.04.img mnt
sudo tar xzvf ubuntu-base-12.04.4-core-amd64.tar.gz -C mnt
sudo cp /etc/resolv.conf mnt/etc/

# Nano is used to paste the contents in http://www.lowepower.com/jason/creating-disk-images-for-gem5.html
sudo nano mnt/etc/init/tty-gem5.conf 
sudo nano mnt/etc/hosts
sudo nano mnt/etc/fstab

# Copy m5 Binary
cd util/m5
make clean
make all -f Makefile.x86
sudo cp m5 ${M5_PATH}/mnt/sbin/

cd ${M5_PATH}
sudo umount mnt
sudo losetup -d /dev/loop0
内核编译的步骤:

# The full terminal output is here:
# https://gist.github.com/agyaglikci/018533c8d2ff2a9e86c9144d5f4a9224#file-ubuntu12-04-kernel3-2-1-gem5-terminal

Freeing unused kernel memory: 348k freed
Mount failed for selinuxfs on /sys/fs/selinux:  No such file or directory
init: ureadahead main process (997) terminated with status 5
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
build/X86/gem5.opt -d AMD64 configs/example/fs.py --disk-image ${M5_PATH}/disks/ubuntu-12.04.img --kernel ${M5_PATH}/binaries/vmlinux-amd64-3.2.1
我下载了v3.2.1,然后将v2.6.28.4的配置文件复制为v3.2.1的.config文件。点击
makevmlinux
后,为每个问题按enter键以获取默认值

cd ~
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout v3.2.1
wget http://www.m5sim.org/dist/current/x86/config-x86.tar.bz2
tar jxvf config-x86.tar.bz2
cp configs/linux-2.6.28.4 .config
make clean
make vmlinux -j 4 
# Here compiler asks a lot of configurations, I just hit enter each time to pass the default values.
cp vmlinux ${M5_PATH}/binaries/vmlinux-amd64-v3.2.1
最后,命令如下:

# The full terminal output is here:
# https://gist.github.com/agyaglikci/018533c8d2ff2a9e86c9144d5f4a9224#file-ubuntu12-04-kernel3-2-1-gem5-terminal

Freeing unused kernel memory: 348k freed
Mount failed for selinuxfs on /sys/fs/selinux:  No such file or directory
init: ureadahead main process (997) terminated with status 5
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
mknod: extra operand '64'
Try 'mknod --help' for more information.
build/X86/gem5.opt -d AMD64 configs/example/fs.py --disk-image ${M5_PATH}/disks/ubuntu-12.04.img --kernel ${M5_PATH}/binaries/vmlinux-amd64-3.2.1

任何关于错误消息或冻结原因/解决方案等的评论都将非常有用。提前谢谢

引导FS模式的最佳解决方案如下,但IMHO Ubuntu不是一个好的选择,因为systemd会大大降低引导阶段的速度:

使用配置文件编译linux内核。内核4.8.13应该可以工作(学分归gem5的一位评审员)


现在您需要的是系统的映像。最好的选择是基于gentoo。

而不是12.04.4,使用12.04.5 tarball可以解决问题。我不知道为什么它这么重要。“相对较新”?Ubuntu 12.04已经有四年历史了。如果它比你以前拥有的要新,那一定是非常古老的。16.04 LTS于上月发布。回复:修复:点释放修复bug是常见的。您的设置可能触发了12.04.4中的一个bug。感谢您的评论@Peter不幸的是,对于X86体系结构,gem5最新支持Linux内核2.6.28.4。我刚刚了解到有人让3.2.1与Ubuntu 12.04配合使用。是的,你是对的,它很旧,但对于gem5的x86体系结构来说,不幸的是它很新:/我已经创建了一个完全自动化的gem5 ARM Buildroot安装程序。tat可能会让你感兴趣:不幸的是,我的x86尝试失败,错误描述如下: