├── start-gdb.sh ├── .gitignore ├── prepare.sh ├── start-qemu-ui.sh ├── start-qemu.sh ├── start-qemu-ui-gdb.sh ├── start-qemu-gdb.sh ├── README.md └── LICENSE /start-gdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./arm-linux-gdb -ix gdbinit 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | gdb* 2 | busybox* 3 | linux* 4 | rootfs 5 | tmpdir 6 | gdbinit 7 | arm-linux-kernel 8 | rootfs.ext3 9 | -------------------------------------------------------------------------------- /prepare.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function prepare() { 4 | apt-get -y install qemu gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libexpat1-dev libncurses5-dev 5 | } 6 | 7 | prepare 8 | -------------------------------------------------------------------------------- /start-qemu-ui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | qemu-system-arm -M vexpress-a9 -m 512M \ 4 | -dtb ./arm-linux-kernel/vexpress-v2p-ca9.dtb \ 5 | -kernel ./arm-linux-kernel/zImage 6 | -append "root=/dev/mmcblk0 rw console=ttyAMA0 init=/bin/sh" \ 7 | -sd rootfs.ext3 8 | 9 | -------------------------------------------------------------------------------- /start-qemu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | qemu-system-arm -M vexpress-a9 -m 512M \ 4 | -dtb ./arm-linux-kernel/vexpress-v2p-ca9.dtb \ 5 | -kernel ./arm-linux-kernel/zImage -nographic \ 6 | -append "root=/dev/mmcblk0 rw console=ttyAMA0 init=/bin/sh" \ 7 | -sd rootfs.ext3 8 | 9 | -------------------------------------------------------------------------------- /start-qemu-ui-gdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | qemu-system-arm -M vexpress-a9 -m 512M \ 4 | -dtb ./arm-linux-kernel/vexpress-v2p-ca9.dtb \ 5 | -kernel ./arm-linux-kernel/zImage 6 | -append "root=/dev/mmcblk0 rw console=ttyAMA0 init=/bin/sh" \ 7 | -sd rootfs.ext3 \ 8 | -s -S 9 | 10 | -------------------------------------------------------------------------------- /start-qemu-gdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | qemu-system-arm -M vexpress-a9 -m 512M \ 4 | -dtb ./arm-linux-kernel/vexpress-v2p-ca9.dtb \ 5 | -kernel ./arm-linux-kernel/zImage -nographic \ 6 | -append "root=/dev/mmcblk0 rw console=ttyAMA0 init=/bin/sh" \ 7 | -sd rootfs.ext3 \ 8 | -s -S 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # qemu-arm-linux 2 | 3 | Run or debug arm linux with qemu 4 | 5 | (Ubuntu 16.04 LTS) 6 | 7 | ## Build 8 | 9 | ``` 10 | sudo ./build.sh 11 | ``` 12 | 13 | ## Start 14 | 15 | Start without graphic ui: 16 | 17 | ``` 18 | ./start-qemu.sh 19 | ``` 20 | 21 | Or 22 | 23 | Start with graphic ui: 24 | 25 | ``` 26 | ./start-qemu-ui.sh 27 | ``` 28 | 29 | ## Debug 30 | 31 | Debug without graphic ui: 32 | 33 | ``` 34 | ./start-qemu-gdb.sh 35 | ``` 36 | 37 | Or 38 | 39 | Debug with graphic ui: 40 | 41 | ``` 42 | ./start-qemu-ui-gdb.sh 43 | ``` 44 | 45 | In other terminal, start gdb 46 | 47 | ``` 48 | ./start-gdb.sh 49 | ``` 50 | 51 | ## Reference 52 | 53 | * http://files.meetup.com/1590495/debugging-with-qemu.pdf 54 | * http://blog.csdn.net/nxcxl88/article/details/53244754 55 | 56 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 jim 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | --------------------------------------------------------------------------------