Discussion:
[gem5-users] How to build a linux image for full system simulation
Yunxia Zhu
2018-08-01 14:56:29 UTC
Permalink
hello all,



I use thesenways to build the disk.

Firstly, I built 14.04.5-i386.img and 4.8.13 kernel by QEMU. I can built
32-bit kernel and 64-bit kernel, but I can’t built 64-bit disk, because the
OS I use now is 32 bit. When I associate the image to one of the kernels,
it shows the problem as last time “‘gem5.opt:
build/x86/arch/x86/tlb.cc:357: fault x86isa::tlb::translate(requestptr,
threadcontext*, basetlb::translation*, basetlb::mode, bool&, bool):
assertion `entry' failed’ attached in image . ”. I also associate
16.04.4-i386.img to 4.8.13-32 kernel, it also shows the same problem.

Secondly, I use ‘dd if= of=’ to build 18.04.1-64.img and associate it to
kernel 4.8.13-64. It shows ‘end Kernel panic-not syncing: VFS: Unable to
mount root fs on unknown-block(3,1)’, which is also posted in the Mailing
list.

Now I use ‘util/gem5img.py’ to build disk. When I make Makefile.x86 it has
error and the reason is that the Linux System OS type is 32-bit.



could guys give any new idea?



With best regards

Yunxia Zhu
Jimmy Situ
2018-08-02 13:46:20 UTC
Permalink
Hi, Yunxia


I have never tried 32bit full system mode, but I think the key idea are the same. You can start with Joson's blog
http://www.lowepower.com/jason/setting-up-gem5-full-system.html


The most tricky part of booting a Ubuntu on gem5 is compile the right kernel (with right module), which means you need to be very careful with the config file of kernel build.
Basically, gem5 not support kernel module loading at boot time, so all kernel module need to build into the kernel (change all =m to =y in the configure file)
You can start with Joson's config file http://www.lowepower.com/jason/files/config (test in 4.8.13)
Or mine https://github.com/jimmysitu/gem5-bench/blob/master/linux_configs/config-X86 ( test in 4.14)
You need to modify it for 32bit kernel
Another key point of making the ubuntu img is the partitaiton
I suggest you try to install ubuntu on qemu with one partition, and without swap or other partition
Do remember format your partition to ext3 or ext4, and your kernel support ext3 or ext4 file system


Hope this will help your gem5 full system boot, and good luck.








------------------
Jimmy Situ





------------------ Ô­ÊŒÓÊŒþ ------------------
·¢ŒþÈË: "Yunxia Zhu"<***@gmail.com>;
·¢ËÍʱŒä: 2018Äê8ÔÂ1ÈÕ(ÐÇÆÚÈý) ÍíÉÏ10:56
ÊÕŒþÈË: "gem5 users mailing l"<gem5-***@gem5.org>;

Ö÷Ìâ: [gem5-users] How to build a linux image for full system simulation


hello all,




I use thesenways to build the disk.

Firstly, I built 14.04.5-i386.img and 4.8.13 kernel by QEMU. I can built 32-bit kernel and 64-bit kernel, but I can¡¯t built 64-bit disk, because the OS I use now is 32 bit. When I associate the image to one of the kernels, it shows the problem as last time ¡°¡®gem5.opt: build/x86/arch/x86/tlb.cc:357: fault x86isa::tlb::translate(requestptr, threadcontext*, basetlb::translation*, basetlb::mode, bool&, bool): assertion `entry' failed¡¯ attached in image . ¡±. I also associate 16.04.4-i386.img to 4.8.13-32 kernel, it also shows the same problem.

Secondly, I use ¡®dd if= of=¡¯ to build 18.04.1-64.img and associate it to kernel 4.8.13-64. It shows ¡®end Kernel panic-not syncing: VFS: Unable to mount root fs on unknown-block(3,1)¡¯, which is also posted in the Mailing list.

Now I use ¡®util/gem5img.py¡¯ to build disk. When I make Makefile.x86 it has error and the reason is that the Linux System OS type is 32-bit.



could guys give any new idea?



With best regards

Yunxia Zhu

Loading...