minix3代码量比linux小很多
minix3 v3.2.1 支持arm
minix3 arm编译
AT91RM9200_Datasheet 此文档中有启动流程描述
ARM嵌入式Linux系统开发从入门到精通.pdf ,这本书用的s3c2410
本书中讲到的 cpu为smdk2410的开发板配置 中的低级初始化
mini2440开发板 可能资料多一些
mini2440开发板资料 天翼云盘
mini2440开发板资料: 百度网盘链接:https://pan.baidu.com/s/1vhAqbLljsQ2k0czkIFGNGg提取码:vew2
嵌入式硬件设计-JohnCatsoulis
嵌入式系统 Linux 内核开发实战指南(arm平台)-王洪辉
ARM 嵌入式 Linux 系统开发从入门到精通
韦东山嵌入式书
虚拟机中安装32位ubuntuubuntu-16.04.6-desktop-i386.iso,
ubuntu-16.04.6-desktop-i386.iso是ubuntu发行版中最后一个32位,之后的全部都不再有32位 而只有64位
各自解压
apt install libncurses5-dev -y
INIT_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
export PATH=/home/z/embedding/arm-2014.05/bin:$INIT_PATH
echo “source /home/z/embedding/env.sh” >> ~/.bashrc
/home/z/embedding/linux-3.16/Makefile修改
大约从257行开始
ARCH ?= arm
CROSS_COMPILE ?= arm-none-linux-gnueabi-
make vexpress_defconfig
#/home/z/embedding/linux-3.16/arch/arm/configs/vexpress_defconfig
make menuconfig #这一步可以省略
make zImage
#time make -j 4 zImage #记录该命令消耗时长
make dtbs
cd /home/z/embedding/busybox-1.21.1/
#方法1:直接改
#Makefile 第164行 第190行:
ARCH ?= arm
CROSS_COMPILE ?= arm-none-linux-gnueabi-
make defconfig
#生成 .config文件
#或者 方法2: 通过界面改: make menuconfig
make menuconfig
#Busybox Settings --> Build Optiions --> Cross Compiler prefix
#输入arm-none-linux-gnueabi-
#退出, 即生成 .config文件
#查看刚刚的修改:
grep -Hn arm-none-linux-gnueabi- .config
#.config:65:CONFIG_CROSS_COMPILER_PREFIX="arm-none-linux-gnueabi-"
#编译
make
#time make -j 4 #耗时大约30秒
#安装, 生成目录_install
make install
#在_install目录下有
#bin linuxrc sbin usr
#创建其他文件夹
mkdir dev etc mnt proc var tmp sys root
#添加动态链接库文件
cp /home/z/embedding/arm-2014.05/arm-none-linux-gnueabi/libc/lib/* /home/z/embedding/busybox-1.21.1/_install/
cd /home/z/embedding/
#1).创建挂载点
mkdir -p rootfs/{dev,etc/init.d,lib} #这句跟 上文"#创建其他文件夹" 有点部分重复
cp busybox-1.22.1/_install/* -r rootfs/
sudo mknod rootfs/dev/tty1 c 4 1
sudo mknod rootfs/dev/tty2 c 4 2
sudo mknod rootfs/dev/tty3 c 4 3
sudo mknod rootfs/dev/tty4 c 4 4
#2).生成镜像
dd if=/dev/zero of=vexpress_rootfs.ext3 bs=1M count=32
#格式化成ext3文件系统
mkfs.ext3 vexpress_rootfs.ext3
#将文件拷贝到镜像中
sudo mkdir tmpfs
sudo mount -t ext3 vexpress_rootfs.ext3 tmpfs/ -o loop
sudo cp -r rootfs/* tmpfs/
sudo umount tmpfs
qemu-system-arm -M vexpress-a9 -m 512M -kernel /home/z/embedding/linux-3.16/arch/arm/boot/zImage -dtb /home/z/embedding/linux-3.16/arch/arm/boot/dts/vexpress-v2p-ca9.dtb -nographic -append "root=/dev/mmcblk0 console=ttyAMA0" -sd vexpress_rootfs.ext3
#能启动一段路, 最后打印kernel panic停止, 详细打印如下:
"""
WARNING: Image format was not specified for 'vexpress_rootfs.ext3' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpuset
Linux version 3.16.0 (z@xx) (gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29) ) #2 SMP Thu Jun 23 17:19:31 CST 2022
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c53c7d
CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine model: V2P-CA9
Memory policy: Data cache writeback
CPU: All CPU(s) started in SVC mode.
PERCPU: Embedded 7 pages/cpu @9fbcf000 s7552 r8192 d12928 u32768
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048
Kernel command line: root=/dev/mmcblk0 console=ttyAMA0
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 513052K/524288K available (4625K kernel code, 190K rwdata, 1288K rodata, 247K init, 150K bss, 11236K reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
vmalloc : 0xa0800000 - 0xff000000 (1512 MB)
lowmem : 0x80000000 - 0xa0000000 ( 512 MB)
modules : 0x7f000000 - 0x80000000 ( 16 MB)
.text : 0x80008000 - 0x805ce9f8 (5915 kB)
.init : 0x805cf000 - 0x8060cd80 ( 248 kB)
.data : 0x8060e000 - 0x8063da80 ( 191 kB)
.bss : 0x8063da88 - 0x806632a4 ( 151 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
Hierarchical RCU implementation.
RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.
RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4
NR_IRQS:16 nr_irqs:16 16
GIC CPU mask not found - kernel will fail to boot.
GIC CPU mask not found - kernel will fail to boot.
L2C: platform modifies aux control register: 0x02020000 -> 0x02420000
L2C: device tree omits to specify unified cache
L2C: DT/platform modifies aux control register: 0x02020000 -> 0x02420000
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 dynamic clock gating disabled, standby mode disabled
L2C-310 cache controller enabled, 8 ways, 128 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x46420001
sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
Console: colour dummy device 80x30
Calibrating delay loop... 789.70 BogoMIPS (lpj=3948544)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x60465ec8 - 0x60465f20
CPU1: failed to boot: -38
CPU2: failed to boot: -38
CPU3: failed to boot: -38
Brought up 1 CPUs
SMP: Total of 1 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor ladder
cpuidle: using governor menu
of_amba_device_create(): amba_device_add() failed (-19) for /memory-controller@100e0000
of_amba_device_create(): amba_device_add() failed (-19) for /memory-controller@100e1000
of_amba_device_create(): amba_device_add() failed (-19) for /watchdog@100e5000
of_amba_device_create(): amba_device_add() failed (-19) for /smb/motherboard/iofpga@7,00000000/sysctl@01000
of_amba_device_create(): amba_device_add() failed (-19) for /smb/motherboard/iofpga@7,00000000/wdt@0f000
hw-breakpoint: debug architecture 0x4 unsupported.
Serial: AMBA PL011 UART driver
10009000.uart: ttyAMA0 at MMIO 0x10009000 (irq = 37, base_baud = 0) is a PL011 rev1
console [ttyAMA0] enabled
1000a000.uart: ttyAMA1 at MMIO 0x1000a000 (irq = 38, base_baud = 0) is a PL011 rev1
1000b000.uart: ttyAMA2 at MMIO 0x1000b000 (irq = 39, base_baud = 0) is a PL011 rev1
1000c000.uart: ttyAMA3 at MMIO 0x1000c000 (irq = 40, base_baud = 0) is a PL011 rev1
3V3: 3300 mV
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arm,sp804
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with ARMv7 Cortex-A9 PMU driver, 1 counters available
futex hash table entries: 1024 (order: 4, 65536 bytes)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
9p: Installing v9fs 9p2000 file system support
msgmni has been set to 1002
io scheduler noop registered (default)
clcd-pl11x: probe of 10020000.clcd failed with error -22
clcd-pl11x: probe of 1001f000.clcd failed with error -22
VD10: at 1000 mV
VD10_S2: at 1000 mV
VD10_S3: at 1000 mV
VCC1V8: at 1800 mV
DDR2VTT: at 900 mV
VCC3V3: at 3300 mV
VIO: at 3300 mV
40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
40000000.flash: Found 2 x16 devices at 0x0 in 32-bit bank. Manufacturer ID 0x000000 Chip ID 0x000000
Intel/Sharp Extended Query Table at 0x0031
Using buffer write method
Concatenating MTD devices:
(0): "40000000.flash"
(1): "40000000.flash"
into device "40000000.flash"
libphy: smsc911x-mdio: probed
smsc911x 4e000000.ethernet eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=4e000000.etherne:01, irq=-1)
smsc911x 4e000000.ethernet eth0: MAC Address: 52:54:00:12:34:56
nxp-isp1760 4f000000.usb: NXP ISP1760 USB Host Controller
nxp-isp1760 4f000000.usb: new USB bus registered, assigned bus number 1
nxp-isp1760 4f000000.usb: Scratch test failed.
nxp-isp1760 4f000000.usb: can't setup: -19
nxp-isp1760 4f000000.usb: USB bus 1 deregistered
usbcore: registered new interface driver usb-storage
mousedev: PS/2 mouse device common for all mice
rtc-pl031 10017000.rtc: rtc core: registered pl031 as rtc0
mmci-pl18x 10005000.mmci: Got CD GPIO #244.
mmci-pl18x 10005000.mmci: Got WP GPIO #245.
mmci-pl18x 10005000.mmci: No vqmmc regulator found
mmci-pl18x 10005000.mmci: mmc0: PL181 manf 41 rev0 at 0x10005000 irq 41,42 (pio)
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
mmc0: new SD card at address 4567
mmcblk0: mmc0:4567 QEMU! 32.0 MiB
input: AT Raw Set 2 keyboard as /devices/smb/smb:motherboard/smb:motherboard:iofpga@7,00000000/10006000.kmi/serio0/input/input0
mmcblk0: unknown partition table
aaci-pl041 10004000.aaci: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 43
aaci-pl041 10004000.aaci: FIFO 512 entries
oprofile: using arm/armv7-ca9
TCP: cubic registered
NET: Registered protocol family 17
9pnet: Installing 9P2000 support
rtc-pl031 10017000.rtc: setting system clock to 2022-06-23 10:27:21 UTC (1655980041)
ALSA device list:
#0: ARM AC'97 Interface PL041 rev0 at 0x10004000, irq 43
input: ImExPS/2 Generic Explorer Mouse as /devices/smb/smb:motherboard/smb:motherboard:iofpga@7,00000000/10007000.kmi/serio1/input/input2
kjournald starting. Commit interval 5 seconds
EXT3-fs (mmcblk0): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) readonly on device 179:0.
Freeing unused kernel memory: 244K (805cf000 - 8060c000)
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.16.0 #2
[<8001474c>] (unwind_backtrace) from [<80011660>] (show_stack+0x10/0x14)
[<80011660>] (show_stack) from [<804610cc>] (dump_stack+0x84/0x94)
[<804610cc>] (dump_stack) from [<8045e3dc>] (panic+0xa0/0x1f8)
[<8045e3dc>] (panic) from [<8045c9d8>] (cpu_die+0x0/0x80)
[<8045c9d8>] (cpu_die) from [<00000000>] ( (null))
---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
"""
列出qemu支持的开发板
#列出qemu支持的开发板:
qemu-system-arm --machine help
Supported machines are:
# akita Sharp SL-C1000 (Akita) PDA (PXA270)
# ast2500-evb Aspeed AST2500 EVB (ARM1176)
# ast2600-evb Aspeed AST2600 EVB (Cortex-A7)
# borzoi Sharp SL-C3100 (Borzoi) PDA (PXA270)
# canon-a1100 Canon PowerShot A1100 IS (ARM946)
# cheetah Palm Tungsten|E aka. Cheetah PDA (OMAP310)
# collie Sharp SL-5500 (Collie) PDA (SA-1110)
# connex Gumstix Connex (PXA255)
# cubieboard cubietech cubieboard (Cortex-A8)
# emcraft-sf2 SmartFusion2 SOM kit from Emcraft (M2S010)
# fp5280g2-bmc Inspur FP5280G2 BMC (ARM1176)
# fuji-bmc Facebook Fuji BMC (Cortex-A7)
# g220a-bmc Bytedance G220A BMC (ARM1176)
# highbank Calxeda Highbank (ECX-1000)
# imx25-pdk ARM i.MX25 PDK board (ARM926)
# integratorcp ARM Integrator/CP (ARM926EJ-S)
# kudo-bmc Kudo BMC (Cortex-A9)
# kzm ARM KZM Emulation Baseboard (ARM1136)
# lm3s6965evb Stellaris LM3S6965EVB (Cortex-M3)
# lm3s811evb Stellaris LM3S811EVB (Cortex-M3)
# mainstone Mainstone II (PXA27x)
# mcimx6ul-evk Freescale i.MX6UL Evaluation Kit (Cortex-A7)
# mcimx7d-sabre Freescale i.MX7 DUAL SABRE (Cortex-A7)
# microbit BBC micro:bit (Cortex-M0)
# midway Calxeda Midway (ECX-2000)
# mps2-an385 ARM MPS2 with AN385 FPGA image for Cortex-M3
# mps2-an386 ARM MPS2 with AN386 FPGA image for Cortex-M4
# mps2-an500 ARM MPS2 with AN500 FPGA image for Cortex-M7
# mps2-an505 ARM MPS2 with AN505 FPGA image for Cortex-M33
# mps2-an511 ARM MPS2 with AN511 DesignStart FPGA image for Cortex-M3
# mps2-an521 ARM MPS2 with AN521 FPGA image for dual Cortex-M33
# mps3-an524 ARM MPS3 with AN524 FPGA image for dual Cortex-M33
# mps3-an547 ARM MPS3 with AN547 FPGA image for Cortex-M55
# musca-a ARM Musca-A board (dual Cortex-M33)
# musca-b1 ARM Musca-B1 board (dual Cortex-M33)
# musicpal Marvell 88w8618 / MusicPal (ARM926EJ-S)
# n800 Nokia N800 tablet aka. RX-34 (OMAP2420)
# n810 Nokia N810 tablet aka. RX-44 (OMAP2420)
# netduino2 Netduino 2 Machine (Cortex-M3)
# netduinoplus2 Netduino Plus 2 Machine (Cortex-M4)
# none empty machine
# npcm750-evb Nuvoton NPCM750 Evaluation Board (Cortex-A9)
# nuri Samsung NURI board (Exynos4210)
# orangepi-pc Orange Pi PC (Cortex-A7)
# palmetto-bmc OpenPOWER Palmetto BMC (ARM926EJ-S)
# quanta-gbs-bmc Quanta GBS (Cortex-A9)
# quanta-gsj Quanta GSJ (Cortex-A9)
# quanta-q71l-bmc Quanta-Q71l BMC (ARM926EJ-S)
# rainier-bmc IBM Rainier BMC (Cortex-A7)
# raspi0 Raspberry Pi Zero (revision 1.2)
# raspi1ap Raspberry Pi A+ (revision 1.1)
# raspi2b Raspberry Pi 2B (revision 1.1)
# realview-eb ARM RealView Emulation Baseboard (ARM926EJ-S)
# realview-eb-mpcore ARM RealView Emulation Baseboard (ARM11MPCore)
# realview-pb-a8 ARM RealView Platform Baseboard for Cortex-A8
# realview-pbx-a9 ARM RealView Platform Baseboard Explore for Cortex-A9
# romulus-bmc OpenPOWER Romulus BMC (ARM1176)
# sabrelite Freescale i.MX6 Quad SABRE Lite Board (Cortex-A9)
# smdkc210 Samsung SMDKC210 board (Exynos4210)
# sonorapass-bmc OCP SonoraPass BMC (ARM1176)
# spitz Sharp SL-C3000 (Spitz) PDA (PXA270)
# stm32vldiscovery ST STM32VLDISCOVERY (Cortex-M3)
# supermicrox11-bmc Supermicro X11 BMC (ARM926EJ-S)
# swift-bmc OpenPOWER Swift BMC (ARM1176) (deprecated)
# sx1 Siemens SX1 (OMAP310) V2
# sx1-v1 Siemens SX1 (OMAP310) V1
# tacoma-bmc OpenPOWER Tacoma BMC (Cortex-A7)
# terrier Sharp SL-C3200 (Terrier) PDA (PXA270)
# tosa Sharp SL-6000 (Tosa) PDA (PXA255)
# verdex Gumstix Verdex (PXA270)
# versatileab ARM Versatile/AB (ARM926EJ-S)
# versatilepb ARM Versatile/PB (ARM926EJ-S)
# vexpress-a15 ARM Versatile Express for Cortex-A15
# vexpress-a9 ARM Versatile Express for Cortex-A9
# virt-2.10 QEMU 2.10 ARM Virtual Machine
# virt-2.11 QEMU 2.11 ARM Virtual Machine
# virt-2.12 QEMU 2.12 ARM Virtual Machine
# virt-2.6 QEMU 2.6 ARM Virtual Machine
# virt-2.7 QEMU 2.7 ARM Virtual Machine
# virt-2.8 QEMU 2.8 ARM Virtual Machine
# virt-2.9 QEMU 2.9 ARM Virtual Machine
# virt-3.0 QEMU 3.0 ARM Virtual Machine
# virt-3.1 QEMU 3.1 ARM Virtual Machine
# virt-4.0 QEMU 4.0 ARM Virtual Machine
# virt-4.1 QEMU 4.1 ARM Virtual Machine
# virt-4.2 QEMU 4.2 ARM Virtual Machine
# virt-5.0 QEMU 5.0 ARM Virtual Machine
# virt-5.1 QEMU 5.1 ARM Virtual Machine
# virt-5.2 QEMU 5.2 ARM Virtual Machine
# virt-6.0 QEMU 6.0 ARM Virtual Machine
# virt-6.1 QEMU 6.1 ARM Virtual Machine
# virt QEMU 6.2 ARM Virtual Machine (alias of virt-6.2)
# virt-6.2 QEMU 6.2 ARM Virtual Machine
# witherspoon-bmc OpenPOWER Witherspoon BMC (ARM1176)
# xilinx-zynq-a9 Xilinx Zynq Platform Baseboard for Cortex-A9
# z2 Zipit Z2 (PXA27x)
arm-none-linux-gnueabi-linux 是32位程序,
如果在64位Ubuntu上运行, arm-none-linux-gnueabi-linux 则会报错 “arm-none-linux-gnueabi-gcc: No such file or directory”
解决错误: apt-get install ia32-libs
永磁无刷电机及其驱动技术, 现代无刷直流永磁电动机的原理和设计
kicad(代替sprint-layout)+Cut2DPro, 视频
u.com/a/403483476_162758)