How to run Linux on a QEMU ARM Versatile machine?

I'm trying to run linux on qemu, especially the versatile version.

I downloaded qemu and linux from github. (qemu : https://github.com/qemu/qemu.git, linux : https://github.com/torvalds/linux.git)

I think these two repositorys are the main project of them.

Anyway, I compiled linux with 2 steps.

  • make ARCH=arm versatile_defconfig
  • make all ARCH=arm CROSS_COMPILE=arm-none-eabi-
  • Also compiled qemu with 3 steps.

  • ./configure
  • make
  • sudo make install
  • And I ran it with this command:

    ../qemu/arm-softmmu/qemu-system-arm -M versatilepb -m 128M -kernel ./arch/arm/boot/zImage
    

    And a window popped up with just a black screen. What should I do after that?


    I downloaded qemu and linux from github. (qemu : https://github.com/qemu/qemu.git, linux : https://github.com/torvalds/linux.git)

    I think these two repositorys are the main project of them.

    Anyway, I compiled linux with 2 steps.

  • make ARCH=arm versatile_defconfig
  • make all ARCH=arm CROSS_COMPILE=arm-none-eabi-
  • Also compiled qemu with 3 steps.

  • ./configure
  • make
  • sudo make install
  • To mount the root filesystem, I downloaded busybox. (I'm not sure, but this busybox is the mostly used filesystem to develper when they want to make simple enviroment)

    I downloaded busybox and i followed some steps.

  • wget http://www.busybox.net/downloads/busybox-1.24.1.tar.bz2
  • tar -xvf busybox-1.24.1.tar.bz2
  • cd busybox-1.24.1/
  • make defconfig
  • make menuconfig (to make binary as static not shared)
  • make -j8
  • make install
  • cd _install
  • find . | cpio -o --format=newc > ../rootfs.img
  • cd ..
  • gzip -c rootfs.img > rootfs.img.gz
  • So, my final command is

    ../qemu/arm-softmmu/qemu-system-arm -M versatilepb -kernel ./arch/arm/boot/zImage -nographic -dtb arch/arm/boot/dts/versatile-pb.dtb -initrd ../rootfs.img.gz -append "root=/dev/ram0 initrd=/bin/sh"
    

    I ran linux on qemu especially versatile version

    here is my current status of file with 'ls' command

    To run the upper command, the linux, qemu and filesystem images should be located like this (except other projects like FreeRTOS it's only for my situation)

    在这里输入图像描述


    Buildroot

    git clone https://github.com/buildroot/buildroot
    cd buildroot
    git checkout 2017.02
    make qemu_arm_versatile_defconfig
    make BR2_JLEVEL="$(($(nproc) - 2))"
    # From: https://github.com/buildroot/buildroot/blob/master/board/qemu/arm-versatile/readme.txt
    qemu-system-arm -M versatilepb -kernel output/images/zImage -append "console=ttyAMA0,115200" -serial stdio -net user -net nic,model=smc91c111
    

    Welcome to automation Nirvana.

    链接地址: http://www.djcxy.com/p/86944.html

    上一篇: 编译器Linux系统安装错误无法找到软件包

    下一篇: 如何在QEMU ARM上运行Linux多功能的机器?