首页 / 操作系统Linux / 帖子

Linux系统Miz702N板如何配置开机启动时才能运行自己的应用程序

作者 xiaohuaji45 2017-07-02 14615 次浏览 3 条回复 论坛存档
x
xiaohuaji45
2017-07-02
楼主

想要开机启动a.out,使用交叉编译环境编译OK,尝试使用的方法:

1. 更改rc.local,添加如下语句

/dev/mmcblk0/a.out &

/usr/sbin/a.out &

2.更改rcS,添加如下语句

/dev/mmcblk0/a.out &

/usr/sbin/a.out> /dev/console &

3.模仿《ZYNQ SOC修炼秘籍》SO4_CH07_Hello_Qt在开发板上的运行

仿照配置一个init.sh脚本,放在SD卡根目录,内容如下

#!/bin/sh

echo "hello word"

/mnt/a.out &

/usr/sbin/a.out &

/dev/mmcblk0/a.out &

a.out程序的功能是输出一段打印和创建一个文件。

请各位大神给予参谋建议,谢谢!

x
xiaohuaji45
2017-07-02
#1

附上开机打印信息,SD卡引导,参照《ZYNQ SOC修炼秘籍》S04_CH01_搭建工程移植Linux

Booting Linux on physical CPU 0x0

Linux version 4.6.0-xilinx (root@osrc-virtual-machine) (gcc version 4.9.2 (Sourcery CodeBench Lite 2015.05-17) ) #2 SMP PREEMPT Wed Jun 28 17:41:36 CST 2017

CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d

CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache

Machine model: Zynq Miz702n Development Board

cma: Reserved 16 MiB at 0x1f000000

Memory policy: Data cache writealloc

percpu: Embedded 12 pages/cpu @debcd000 s19776 r8192 d21184 u49152

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048

Kernel command line: console=ttyPS0,115200 console=tty0 consoleblank=0 root=/dev/ram rw earlyprintk

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: 489336K/524288K available (5303K kernel code, 230K rwdata, 1844K rodata, 1024K init, 222K bss, 18568K reserved, 16384K cma-reserved, 0K highmem)

Virtual kernel memory layout:

vector : 0xffff0000 - 0xffff1000 ( 4 kB)

fixmap : 0xffc00000 - 0xfff00000 (3072 kB)

vmalloc : 0xe0800000 - 0xff800000 ( 496 MB)

lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)

pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)

modules : 0xbf000000 - 0xbfe00000 ( 14 MB)

.text : 0xc0008000 - 0xc07fafe4 (8140 kB)

.init : 0xc0800000 - 0xc0900000 (1024 kB)

.data : 0xc0900000 - 0xc0939b60 ( 231 kB)

.bss : 0xc0939b60 - 0xc09714a8 ( 223 kB)

Preemptible hierarchical RCU implementation.

Build-time adjustment of leaf fanout to 32.

RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.

RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2

NR_IRQS:16 nr_irqs:16 16

efuse mapped to e0800000

slcr mapped to e0802000

L2C: platform modifies aux control register: 0x72360000 -> 0x72760000

L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000

L2C-310 erratum 769419 enabled

L2C-310 enabling early BRESP for Cortex-A9

L2C-310 full line of zeros enabled for Cortex-A9

L2C-310 ID prefetch enabled, offset 1 lines

L2C-310 dynamic clock gating enabled, standby mode enabled

L2C-310 cache controller enabled, 8 ways, 512 kB

L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001

zynq_clock_init: clkc starts at e0802100

Zynq clock init

sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns

clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns

Switching to timer-based delay loop, resolution 3ns

clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns

timer #0 at e080a000, irq=17

Console: colour dummy device 80x30

console [tty0] enabled

Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)

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 0x100000 - 0x100058

CPU1: thread -1, cpu 1, socket 0, mpidr 80000001

Brought up 2 CPUs

SMP: Total of 2 processors activated (1333.33 BogoMIPS).

CPU: All CPU(s) started in SVC mode.

devtmpfs: initialized

VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4

clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

pinctrl core: initialized pinctrl subsystem

NET: Registered protocol family 16

DMA: preallocated 256 KiB pool for atomic coherent allocations

cpuidle: using governor menu

hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.

hw-breakpoint: maximum watchpoint size is 4 bytes.

zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0880000

zynq-pinctrl 700.pinctrl: zynq pinctrl initialized

vgaarb: loaded

SCSI subsystem initialized

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

media: Linux media interface: v0.10

Linux video capture interface: v2.00

pps_core: LinuxPPS API ver. 1 registered

pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>

PTP clock support registered

EDAC MC: Ver: 3.0.0

Advanced Linux Sound Architecture Driver Initialized.

clocksource: Switched to clocksource arm_global_timer

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)

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.

Trying to unpack rootfs image as initramfs...

rootfs image is not initramfs (no cpio magic); looks like an initrd

Freeing initrd memory: 5188K (de603000 - deb14000)

hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available

futex hash table entries: 512 (order: 3, 32768 bytes)

workingset: timestamp_bits=28 max_order=17 bucket_order=0

jffs2: version 2.2. (NAND) (SUMMARY) &copy; 2001-2006 Red Hat, Inc.

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330

dma-pl330 f8003000.dmac: DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16

xilinx-vdma 43000000.dma: Xilinx AXI VDMA Engine Driver Probed!!

e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 143, base_baud = 6249999) is a xuartps

console [ttyPS0] enabled

xdevcfg f8007000.devcfg: ioremap 0xf8007000 to e086e000

Initialized drm 1.1.0 20060810

brd: module loaded

loop: module loaded

m25p80 spi0.0: found s25fl256s1, expected n25q128a11

m25p80 spi0.0: s25fl256s1 (32768 Kbytes)

5 ofpart partitions found on MTD device spi0.0

Creating 5 MTD partitions on "spi0.0":

0x000000000000-0x000000100000 : "qspi-fsbl-uboot"

0x000000100000-0x000000600000 : "qspi-linux"

0x000000600000-0x000000620000 : "qspi-device-tree"

0x000000620000-0x000000c00000 : "qspi-rootfs"

0x000000c00000-0x000001000000 : "qspi-bitstream"

CAN device driver interface

gpiod_set_value: invalid GPIO

libphy: MACB_mii_bus: probed

macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 145 (00:0a:35:00:01:22)

Marvell 88E1510 e000b000.etherne:00: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=e000b000.etherne:00, irq=-1)

e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k

e1000e: Copyright(c) 1999 - 2015 Intel Corporation.

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver

ehci-pci: EHCI PCI platform driver

usbcore: registered new interface driver usb-storage

e0002000.usb supply vbus not found, using dummy regulator

ULPI transceiver vendor/product ID 0x0451/0x1507

Found TI TUSB1210 ULPI transceiver.

ULPI integrity check: passed.

ci_hdrc ci_hdrc.0: EHCI Host Controller

ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1

ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 1 port detected

mousedev: PS/2 mouse device common for all mice

i2c /dev entries driver

EDAC MC: ECC not enabled

Xilinx Zynq CpuIdle Driver started

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

sdhci-pltfm: SDHCI platform and OF driver helper

mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using DMA

mmc0: new high speed SD card at address 0002

mmc1: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using DMA

ledtrig-cpu: registered to indicate activity on CPUs

mmcblk0: mmc0:0002 00000 969 MiB

mmcblk0: p1

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

NET: Registered protocol family 10

sit: IPv6 over IPv4 tunneling driver

NET: Registered protocol family 17

can: controller area network core (rev 20120528 abi 9)

NET: Registered protocol family 29

can: raw protocol (rev 20120528)

can: broadcast manager protocol (rev 20120528 t)

can: netlink gateway (rev 20130117) max_hops=1

Registering SWP/SWPB emulation handler

hctosys: unable to open rtc device (rtc0)

ALSA device list:

No soundcards found.

RAMDISK: gzip image found at block 0

mmc1: new high speed MMC card at address 0001

mmcblk1: mmc1:0001 P1XXXX 7.20 GiB

mmcblk1boot0: mmc1:0001 P1XXXX partition 1 2.00 MiB

mmcblk1boot1: mmc1:0001 P1XXXX partition 2 2.00 MiB

mmcblk1rpmb: mmc1:0001 P1XXXX partition 3 128 KiB

EXT4-fs (ram0): couldn't mount as ext3 due to feature incompatibilities

EXT4-fs (ram0): mounted filesystem without journal. Opts: (null)

VFS: Mounted root (ext4 filesystem) on device 1:0.

devtmpfs: mounted

Freeing unused kernel memory: 1024K (c0800000 - c0900000)

FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

random: sshd urandom read with 4 bits of entropy available

x
xiaohuaji45
2017-07-04
#2

可以解决了,更改Arm板的脚本文件,但是更改后脚本文件后重新启动,更改的没有保存,是因为我选择了从SD卡引导的缘故吗?

x
xiaohuaji45
2017-07-07
#3

已解决,init.sh脚本文件配置问题

这是论坛时期的原帖存档,只读。新的讨论请到 提问, 沉淀下来的内容会进 知识库 和 方案库。