Howto | Setup an ARM Linux system for QEMU

本文介绍如何从零开始创建一个ARM架构的根文件系统并交叉编译内核,适用于Debian或Ubuntu系统。首先安装必备软件包,然后创建根文件系统、配置内核并最终启动虚拟机。
I've been playing with QEMU lately and found that it's really awesome. To get started all you need is to create a root filesystem and cross compile a Kernel which is quite easy to set up on a Debian/Ubuntu based system. Here is what I did:


0 prerequisites
sudo apt-get install debootstrap qemu-user-static qemu-system git gcc-arm-linux-gnueabihf


1 create the rootfs
# create the hard disk file
fallocate -l 2GiB ubuntu-armhf.ext3
mkfs.ext3 ubuntu-armhf.ext3

# mount the hard disk file
mkdir mnt
sudo mount -o loop ubuntu-armhf.ext3 mnt

# create an initial rootfs using debootstrap
HOSTNAME=ubuntu-armhf sudo debootstrap --variant=minbase --foreign --arch armhf precise ./mnt

# copy the statically linked QEMU binary into the rootfs
sudo cp /usr/bin/qemu-arm-static mnt/usr/bin/

# chroot into the rootfs and start a shell using qemu-arm-static
LANG=C sudo chroot mnt /usr/bin/qemu-arm-static -cpu cortex-a9 /bin/sh
# run the debootstrap second stage from within the chroot:
/debootstrap/debootstrap --second-stage

# create the sources.list files for apt:
echo "deb  http://ports.ubuntu.com  precise main restricted universe
deb-src  http://ports.ubuntu.com  precise main restricted universe" > /etc/apt/sources.list
echo "deb  http://ddebs.ubuntu.com  precise main restricted universe multiverse" > /etc/apt/sources.list.d/ddebs.list
apt-key adv --keyserver  keyserver.ubuntu.com  --recv-keys 428D7C01

# install some fundamental packages
apt-get update
apt-get install sudo apt-utils dialog less wget

# create configuration for the serial console
cp /etc/init/tty1.conf /etc/init/ttyAMA0.conf
sed -i "s/tty1/ttyAMA0/" /etc/init/ttyAMA0.conf

# add a user
adduser myuser
# add user to the sudo group
usermod -aG sudo myuser

# exit the chroot env
exit

# unmount the rootfs
sudo umount mnt
rmdir mnt


2 cross compile the Kernel
# check out the sources
git clone -depth=1 git:// git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
mkdir linux-build
cd linux
# create a .config based on the versatile express default configuration
make ARCH=arm O=../linux-build vexpress_defconfig
# compile the kernel
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=../linux-build -j`getconf _NPROCESSORS_ONLN` zImage
cd ..


3 boot the image using QEMU
qemu-system-arm \
-M vexpress-a9 -m 1024 \
-serial stdio -no-reboot \
-kernel linux-build/arch/arm/boot/zImage \
-drive file=ubuntu-armhf.ext3,if=sd,cache=writeback \

--append "rw console=ttyAMA0,38400n8 console=tty root=/dev/mmcblk0" -s -S

之后,你就可以用gdb 或者eclipse 调试了

内容概要:本文深入研究了基于最优滑模控制的永磁同步电机(PMSM)调速系统模型,重点利用Simulink工具搭建并仿真了该控制系统的动态响应特性。文章系统阐述了最优滑模控制策略的设计原理,突出其在削弱传统滑模控制固有抖振现象、增强系统鲁棒性方面的显著优势。通过与传统滑模控制方法的对比实验,充分验证了所提出方法在调速精度、抗外部干扰能力以及动态响应速度等方面的优越性能。研究内容涵盖PMSM数学建模、滑模面构造、最优控制律推导、Lyapunov稳定性分析、参数整定及Simulink仿真验证等完整环节,形成了一套严谨的控制算法设计与实现流程。; 适合人群:具备自动控制原理、现代控制理论基础和MATLAB/Simulink仿真操作能力,从事电机驱动控制、电力电子与电力传动、运动控制或自动化等相关领域研究的工程技术人员及高校研究生。; 使用场景及目标:① 深入掌握滑模控制理论及其在高性能电机调速系统中的具体应用方法;② 学习如何设计并实现能够有效抑制抖振的最优滑模控制器,以提升系统整体鲁棒性和控制品质;③ 利用Simulink平台独立完成从理论建模到仿真验证的全过程,服务于科研课题、课程设计或实际工程项目。; 阅读建议:建议读者务必结合MATLAB/Simulink环境动手复现文中模型,重点关注滑模切换面的设计准则、控制律的数学推导过程以及控制器参数的调节规律,并通过施加不同的负载扰动、设定多种转速指令等方式全面测试系统的动态与稳态性能,从而深刻理解最优滑模控制的核心机理与工程应用价值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值