1

希望有fs.py,但不一定。

例如,我有一些 x86 BIOS 示例,它在 QEMU 的屏幕上画了一条线,我也想在 gem5 上看到它。

对所有拱门感兴趣。

https://www.mail-archive.com/gem5-users@gem5.org/msg15455.html

4

1 回答 1

2

手臂

我设法在 ARM 的屏幕上获得了图像。

这是一个高度自动化的设置,它执行以下步骤:

  • 从https://gem5.googlesource.com/arm/linux/获取 ARM gem5 Linux kernel v4.15 fork并从那里使用配置文件 arch/arm/configs/gem5_defconfig。

    我相信提交drm: Add component-aware simple encoder https://gem5.googlesource.com/arm/linux/需要 fork ,它添加了 required option CONFIG_DRM_VIRT_ENCODER=y

    另一个必需选项是CONFIG_DRM_HDLCD=y,它启用管理显示器的 HDLCD ARM IP:http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0541c/ CHDBAIDI.html

  • 使用以下命令在 49f96e7b77925837aa5bc84d4c3453ab5f07408e 运行 gem5:

    M5_PATH='/data/git/linux-kernel-module-cheat/out/common/gem5/system' \
    '/data/git/linux-kernel-module-cheat/out/common/gem5/build/ARM/gem5.opt' \
    --debug-file=trace.txt \
    -d '/data/git/linux-kernel-module-cheat/out/arm/gem5/m5out' \
    '/data/git/linux-kernel-module-cheat/gem5/gem5/configs/example/fs.py' \
    --disk-image='/data/git/linux-kernel-module-cheat/out/arm/buildroot/images/rootfs.ext2' \
    --kernel='/data/git/linux-kernel-module-cheat/out/arm/buildroot/build/linux-custom/vmlinux' \
    --mem-size='256MB' \
    --num-cpus='1' \
    --script='/data/git/linux-kernel-module-cheat/data/readfile' \
    --command-line='earlyprintk=pl011,0x1c090000 console=ttyAMA0 lpj=19988480 rw loglevel=8 mem=256MB root=/dev/sda console_msg_format=syslog nokaslr norandmaps printk.devkmsg=on printk.time=y' \
    --dtb-file='/data/git/linux-kernel-module-cheat/out/common/gem5/system/arm/dt/armv7_gem5_v1_1cpu.dtb' \
    --machine-type=VExpress_GEM5_V1 \
    
  • 连接到您喜欢的客户端 gem5 提供的 VNC 服务器。

    在 Ubuntu 18.04 上,我喜欢:

    sudo apt-get install vinagre
    vinagre localhost:5900
    

    该端口显示在 gem5 类型的消息中:

    system.vncserver: Listening for connections on port 5900
    

    它占用从 开始的第一个空闲端口5900

    当前仅支持原始连接。

结果:

  • 几秒钟后,VNC 客户端在屏幕上出现了一只小企鹅!这是因为我们的内核是用:CONFIG_LOGO=y.

  • 最新的帧被转储到system.framebuffer.png,它还包含小企鹅。

  • Linux 内核 dmesg 在telnet 3456终端上显示如下消息:

    [    0.152755] [drm] found ARM HDLCD version r0p0
    [    0.152790] hdlcd 2b000000.hdlcd: bound virt-encoder (ops 0x80935f94)
    [    0.152795] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    0.152799] [drm] No driver support for vblank timestamp query.
    [    0.215179] Console: switching to colour frame buffer device 240x67
    [    0.230389] hdlcd 2b000000.hdlcd: fb0:  frame buffer device
    [    0.230509] [drm] Initialized hdlcd 1.0.0 20151021 for 2b000000.hdlcd on minor 0
    

    这表明 HDLCD 已启用。

  • 当我们连接时,gem5 显示在标准输出上:

    info: VNC client attached
    

TODO:也让 shell 工作。目前我只有一只小企鹅,我的按键没有任何作用。可能需要console=在 init 上调整内核参数或设置一个 tty 控制台?CONFIG_FRAMEBUFFER_CONSOLE=y已设置。也许答案包含在:https ://www.kernel.org/doc/Documentation/fb/fbcon.txt

aarch64

gem5 aarch64defconfig 没有附带所有必需的选项,例如CONFIG_DRM_HDLCD=y.

通过黑客或配置片段添加以下选项使其工作:

CONFIG_DRM=y
CONFIG_DRM_HDLCD=y
CONFIG_DRM_VIRT_ENCODER=y
于 2018-05-16T07:34:09.883 回答