您的位置:首页 > 运维架构 > 网站架构

基于arm的fast models的架构仿真和linux kernel 开发

2015-12-02 16:10 531 查看
基于arm的fast models,利用仿真方法快速设计linux kernel软件,和arm架构的硬件设计进行并行开发,是现在较为高效的linux kernel软件开发的方法,有点类似航空航天领域和汽车领域的原型仿真设计方法论。

现在,linaro组织会提供这种设计方法的linux kernel code,免费开源,总是很好的。附上采用armv8 模型和,linaro kernel的镜像,openembedded core编译出的filesystem,启动linux系统的log。

jialin@qinghe-server:~$ telnet 127.0.0.1 5000

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

[ 0.000000] Booting Linux on physical CPU 0x0

[ 0.000000] Linux version 4.1.0-1-linaro-vexpress64 (buildslave@x86-64-07) (gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09) ) #1ubuntu1~ci+150619142903 SMP PREEMPT Fri Jun 19 14:29:48 UTC 20

[ 0.000000] CPU: AArch64 Processor [410fd000] revision 0

[ 0.000000] Detected PIPT I-cache on CPU0

[ 0.000000] efi: Getting EFI parameters from FDT:

[ 0.000000] efi: UEFI not found.

[ 0.000000] cma: Reserved 32 MiB at 0x00000000fe000000

[ 0.000000] PERCPU: Embedded 18 pages/cpu @ffffffc87ff8b000 s32832 r8192 d32704 u73728

[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1034240

[ 0.000000] Kernel command line: console=ttyAMA0 earlyprintk=pl011,0x1c090000 consolelog=9 rw root=/dev/vda2

[ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes)

[ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes)

[ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes)

[ 0.000000] software IO TLB [mem 0xf9fff000-0xfdfff000] (64MB) mapped at [ffffffc079fff000-ffffffc07dffefff]

[ 0.000000] Memory: 4019160K/4194304K available (7765K kernel code, 745K rwdata, 2696K rodata, 644K init, 459K bss, 142376K reserved, 32768K cma-reserved)

[ 0.000000] Virtual kernel memory layout:

[ 0.000000] vmalloc : 0xffffff8000000000 - 0xffffffbdffff0000 ( 247 GB)

[ 0.000000] vmemmap : 0xffffffbe00000000 - 0xffffffbfc0000000 ( 7 GB maximum)

[ 0.000000] 0xffffffbe01c00000 - 0xffffffbe1f800000 ( 476 MB actual)

[ 0.000000] fixed : 0xffffffbffabfd000 - 0xffffffbffac00000 ( 12 KB)

[ 0.000000] PCI I/O : 0xffffffbffae00000 - 0xffffffbffbe00000 ( 16 MB)

[ 0.000000] modules : 0xffffffbffc000000 - 0xffffffc000000000 ( 64 MB)

[ 0.000000] memory : 0xffffffc000000000 - 0xffffffc880000000 ( 34816 MB)

[ 0.000000] .init : 0xffffffc000aba000 - 0xffffffc000b5b000 ( 644 KB)

[ 0.000000] .text : 0xffffffc000080000 - 0xffffffc000ab95e4 ( 10470 KB)

[ 0.000000] .data : 0xffffffc000b5f000 - 0xffffffc000c19600 ( 746 KB)

[ 0.000000] Preemptible hierarchical RCU implementation.

[ 0.000000] Additional per-CPU info printed with stalls.

[ 0.000000] RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=4.

[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=4

[ 0.000000] NR_IRQS:64 nr_irqs:64 0

[ 0.000000] Architected cp15 timer(s) running at 100.00MHz (phys).

[ 0.000000] clocksource arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x171024e7e0, max_idle_ns: 440795205315 ns

[ 0.000026] sched_clock: 56 bits at 100MHz, resolution 10ns, wraps every 4398046511100ns

[ 0.002195] Console: colour dummy device 80x25

[ 0.002273] Calibrating delay loop (skipped), value calculated using timer frequency.. 200.00 BogoMIPS (lpj=1000000)

[ 0.002329] pid_max: default: 32768 minimum: 301

[ 0.002904] Security Framework initialized

[ 0.002979] AppArmor: AppArmor initialized

[ 0.003263] Mount-cache hash table entries: 8192 (order: 4, 65536 bytes)

[ 0.003321] Mountpoint-cache hash table entries: 8192 (order: 4, 65536 bytes)

[ 0.006903] ftrace: allocating 27563 entries in 108 pages

[ 0.293559] hw perfevents: enabled with arm/armv8-pmuv3 PMU driver, 9 counters available

[ 0.293747] EFI services will not be available.

[ 1.355497] CPU1: failed to come online

[ 2.377872] CPU2: failed to come online

[ 3.400247] CPU3: failed to come online

[ 3.400398] Brought up 1 CPUs

[ 3.400432] SMP: Total of 1 processors activated.

[ 3.400465] CPU: All CPU(s) started at EL2

[ 3.402158] devtmpfs: initialized

[ 3.408393] evm: security.selinux

[ 3.408427] evm: security.SMACK64

[ 3.408460] evm: security.capability

[ 3.409395] DMI not present or invalid.

[ 3.411141] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns

[ 3.420838] xor: measuring software checksum speed

[ 3.520595] 8regs : 167.200 MB/sec

[ 3.620838] 8regs_prefetch: 144.000 MB/sec

[ 3.721094] 32regs : 171.600 MB/sec

[ 3.821345] 32regs_prefetch: 144.000 MB/sec

[ 3.821387] xor: using function: 32regs (171.600 MB/sec)

[ 3.826464] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.827372] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.827921] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.828595] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.829156] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.829707] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.830500] ACPI Exception: AE_BAD_PARAMETER, Thread 2073299968 could not acquire Mutex [0x1] (20150410/utmutex-285)

[ 3.835287] NET: Registered protocol family 16

[ 3.902032] cpuidle: using governor ladder

[ 3.961783] cpuidle: using governor menu

[ 3.962668] vdso: 2 pages (1 code @ ffffffc000b65000, 1 data @ ffffffc000b64000)

[ 3.962830] hw-breakpoint: found 16 breakpoint and 16 watchpoint registers.

[ 3.967244] DMA: preallocated 256 KiB pool for atomic allocations

[ 3.967352] Serial: AMBA PL011 UART driver

[ 3.977407] 1c090000.uart: ttyAMA0 at MMIO 0x1c090000 (irq = 11, base_baud = 0) is a PL011 rev2

[ 3.981156] console [ttyAMA0] enabled

[ 3.983432] 1c0a0000.uart: ttyAMA1 at MMIO 0x1c0a0000 (irq = 12, base_baud = 0) is a PL011 rev2

[ 3.986086] 1c0b0000.uart: ttyAMA2 at MMIO 0x1c0b0000 (irq = 13, base_baud = 0) is a PL011 rev2

[ 3.988491] 1c0c0000.uart: ttyAMA3 at MMIO 0x1c0c0000 (irq = 14, base_baud = 0) is a PL011 rev2

[ 4.326735] raid6: int64x1 gen() 55 MB/s

[ 4.496325] raid6: int64x1 xor() 31 MB/s

[ 4.667640] raid6: int64x2 gen() 65 MB/s

[ 4.837638] raid6: int64x2 xor() 36 MB/s

[ 5.007820] raid6: int64x4 gen() 71 MB/s

[ 5.178241] raid6: int64x4 xor() 40 MB/s

[ 5.348949] raid6: int64x8 gen() 58 MB/s

[ 5.519702] raid6: int64x8 xor() 36 MB/s

[ 5.689701] raid6: neonx1 gen() 138 MB/s

[ 5.859802] raid6: neonx2 gen() 170 MB/s

[ 6.030305] raid6: neonx4 gen() 192 MB/s

[ 6.200746] raid6: neonx8 gen() 172 MB/s

[ 6.200803] raid6: using algorithm neonx4 gen() 192 MB/s

[ 6.200861] raid6: using intx1 recovery algorithm

[ 6.201393] ACPI: Interpreter disabled.

[ 6.203217] vgaarb: loaded

[ 6.205143] SCSI subsystem initialized

[ 6.209068] usbcore: registered new interface driver usbfs

[ 6.209487] usbcore: registered new interface driver hub

[ 6.210104] usbcore: registered new device driver usb

[ 6.219354] NetLabel: Initializing

[ 6.219404] NetLabel: domain hash size = 128

[ 6.219455] NetLabel: protocols = UNLABELED CIPSOv4

[ 6.219715] NetLabel: unlabeled traffic allowed by default

[ 6.221047] Switched to clocksource arch_sys_counter

[ 6.416140] AppArmor: AppArmor Filesystem Enabled

[ 6.417113] pnp: PnP ACPI: disabled

[ 6.473288] NET: Registered protocol family 2

[ 6.476739] TCP established hash table entries: 32768 (order: 6, 262144 bytes)

[ 6.480503] TCP bind hash table entries: 32768 (order: 7, 524288 bytes)

[ 6.485242] TCP: Hash tables configured (established 32768 bind 32768)

[ 6.485393] UDP hash table entries: 2048 (order: 4, 65536 bytes)

[ 6.486214] UDP-Lite hash table entries: 2048 (order: 4, 65536 bytes)

[ 6.487608] NET: Registered protocol family 1

[ 6.488668] RPC: Registered named UNIX socket transport module.

[ 6.488729] RPC: Registered udp transport module.

[ 6.488784] RPC: Registered tcp transport module.

[ 6.488842] RPC: Registered tcp NFSv4.1 backchannel transport module.

[ 6.490643] hw perfevents: Failed to parse /pmu/interrupt-affinity[0]

[ 6.491625] kvm [1]: interrupt-controller@2c004000 IRQ5

[ 6.492292] kvm [1]: timer IRQ3

[ 6.492346] kvm [1]: Hyp mode initialized successfully

[ 6.497225] futex hash table entries: 1024 (order: 4, 65536 bytes)

[ 6.497628] audit: initializing netlink subsys (disabled)

[ 6.497738] audit: type=2000 audit(6.360:1): initialized

[ 6.505000] HugeTLB registered 2 MB page size, pre-allocated 0 pages

[ 6.506326] VFS: Disk quotas dquot_6.6.0

[ 6.506630] VFS: Dquot-cache hash table entries: 512 (order 0, 4096 bytes)

[ 6.510479] NFS: Registering the id_resolver key type

[ 6.510588] Key type id_resolver registered

[ 6.510642] Key type id_legacy registered

[ 6.511074] jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.

[ 6.512635] 9p: Installing v9fs 9p2000 file system support

[ 6.517149] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)

[ 6.517254] io scheduler noop registered

[ 6.517347] io scheduler deadline registered

[ 6.517592] io scheduler cfq registered (default)

[ 6.520463] pci_hotplug: PCI Hot Plug PCI Core version: 0.5

[ 6.523602] pciehp: PCI Express Hot Plug Controller Driver version: 0.4

[ 6.880007] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled

[ 6.888795] [drm] Initialized drm 1.1.0 20060810

[ 6.932289] brd: module loaded

[ 6.955090] loop: module loaded

[ 6.958774] vda: vda1 vda2

[ 6.964693] mtdoops: mtd device (mtddev=name/number) must be supplied

[ 6.964999] tun: Universal TUN/TAP device driver, 1.6

[ 6.965057] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>

[ 6.966321] sky2: driver version 1.30

[ 6.967309] smc91x 1a000000.ethernet (unnamed net_device) (uninitialized): smc91x: IOADDR ffffff8000160000 doesn't match configuration (300).

[ 6.967399] smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <nico@fluxnic.net>

[ 6.979062] smc91x 1a000000.ethernet eth0: SMC91C11xFD (rev 1) at ffffff8000160000 IRQ 10

[ 6.979128]

[ 6.979201] smc91x 1a000000.ethernet eth0: Ethernet addr: 00:02:f7:ef:30:ac

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

[ 6.980100] ehci-pci: EHCI PCI platform driver

[ 6.980798] ehci-platform: EHCI generic platform driver

[ 6.982749] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

[ 6.982872] ohci-pci: OHCI PCI platform driver

[ 6.983675] usbcore: registered new interface driver usb-storage

[ 6.985632] mousedev: PS/2 mouse device common for all mice

[ 6.989932] device-mapper: ioctl: 4.31.0-ioctl (2015-3-12) initialised: dm-devel@redhat.com

[ 6.994073] usbcore: registered new interface driver usbhid

[ 6.994128] usbhid: USB HID core driver

[ 6.996656] Initializing XFRM netlink socket

[ 6.996800] NET: Registered protocol family 17

[ 6.996944] NET: Registered protocol family 15

[ 6.997357] 9pnet: Installing 9P2000 support

[ 6.998301] Key type dns_resolver registered

[ 7.006550] Btrfs loaded

[ 7.010000] Key type encrypted registered

[ 7.010093] AppArmor: AppArmor sha1 policy hashing enabled

[ 7.010180] ima: No TPM chip found, activating TPM-bypass!

[ 7.010519] evm: HMAC attrs: 0x1

[ 7.012757] hctosys: unable to open rtc device (rtc0)

[ 7.015432] EXT3-fs (vda2): error: couldn't mount because of unsupported optional features (240)

[ 7.015853] EXT2-fs (vda2): error: couldn't mount because of unsupported optional features (244)

[ 7.052438] EXT4-fs (vda2): recovery complete

[ 7.052697] EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: (null)

[ 7.052805] VFS: Mounted root (ext4 filesystem) on device 254:2.

[ 7.052989] devtmpfs: mounted

[ 7.053878] Freeing unused kernel memory: 644K (ffffffc000aba000 - ffffffc000b5b000)

[ 7.053967] Freeing alternatives memory: 8K (ffffffc000b5b000 - ffffffc000b5d000)

INIT: version 2.88 booting

Mounting local filesystems...

Starting udev

cmp: EOF on /etc/udev/cache.data

udev: Not using udev cache because of changes detected in the following files:

udev: /proc/version /proc/cmdline /proc/devices

udev: lib/udev/rules.d/* etc/udev/rules.d/*

udev: The udev cache will be regenerated. To identify the detected changes,

udev: compare the cached sysconf at /etc/udev/cache.data

udev: against the current sysconf at /dev/shm/udev.cache

[ 7.599151] udevd[1125]: starting version 182

Activating swap

[ 10.680439] EXT4-fs (vda2): re-mounted. Opts: data=ordered

Starting Bootlog daemon: bootlogd.

Initializing random number generator...

[ 10.918325] random: dd urandom read with 11 bits of entropy available

udev-cache: checking for /dev/shm/udev-regen... found.

Populating dev cache

Populating volatile Filesystems.

net.ipv4.conf.default.rp_filter = 1

net.ipv4.conf.all.rp_filter = 1

System time was Thu Jan 1 00:00:12 UTC 1970.

Setting the System Clock using the Hardware Clock as reference...

hwclock: can't open '/dev/misc/rtc': No such file or directory

System Clock set. System local time is now Thu Jan 1 00:00:12 UTC 1970.

Thu Jun 18 11:03:04 UTC 2015

Saving the System Clock time to the Hardware Clock...

hwclock: can't open '/dev/misc/rtc': No such file or directory

Hardware Clock updated to Thu Jun 18 11:03:04 UTC 2015.

INIT: Entering runlevel: 5

Configuring network interfaces... [ 13.802306] smc91x 1a000000.ethernet eth0: link up, 10Mbps, half-duplex, lpa 0x0000

udhcpc (v1.23.2) started

Sending discover...

Sending select for 172.20.51.1...

Lease of 172.20.51.1 obtained, lease time 86400

/etc/udhcpc.d/50default: Adding DNS 172.20.51.254

/etc/udhcpc.d/50default: Adding DNS 172.20.51.252

/etc/udhcpc.d/50default: Adding DNS 172.20.51.251

done.

Starting OpenBSD Secure Shell server: sshd

generating ssh DSA key...

generating ssh ED25519 key...

[ 23.494643] NET: Registered protocol family 10

key_load_public: invalid format

Could not load host key: /etc/ssh/ssh_host_rsa_key

key_load_public: invalid format

Could not load host key: /etc/ssh/ssh_host_ecdsa_key

done.

Starting rpcbind daemon...done.

starting statd: done

System time was Thu Jun 18 11:03:14 UTC 2015.

Setting the System Clock using the Hardware Clock as reference...

hwclock: can't open '/dev/misc/rtc': No such file or directory

System Clock set. System local time is now Thu Jun 18 11:03:14 UTC 2015.

NFS daemon support not enabled in kernel

Starting syslogd/klogd: done

Starting auto-serial-console: done

Stopping Bootlog daemon: bootlogd.

INIT: no more processes left in this runlevel

Last login: Thu Jun 18 11:03:15 UTC 2015 on tty1

root@genericarmv8:~#

root@genericarmv8:~#

root@genericarmv8:~# ls

hello.c hello.cc

root@genericarmv8:~#

总结,这种研究方法总是很好的。除了arm提供这种cpu 的ip核模型外,还有新思科技等提供的ip核模型,例如designware 的usb3.0的ip核。如果这底层能够屏蔽掉ip核模型的硬件设计,在kernel层开发driver,在上层或者android提前开发hal code,将是不错的硬件验证,和软件提前开发,效率较高,还能较早的进行更上层的软件架构设计。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: