找回密码
 欢迎注册
查看: 20875|回复: 0

[原创] Mathematica 10读取树莓派Linux系统的启动信息

[复制链接]
发表于 2014-7-19 11:17:12 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?欢迎注册

×
1) Linux系统的启动信息可以用dmesg打印出来,而dmesg信息在Linux系统启动的时候是可以通过串口连接读取的
2) Mathematica 10新增了很多关于设备操作的函数
3) 我手头有一个树莓派,树莓派怎么玩串口我就不在这说了,我自己是淘宝上买的TTL转USB的模块,

有图有真相:



Mathematica10 读取树莓派启动信息.png


In[28]:= serial = DeviceOpen["Serial", "COM3"]

Out[28]= DeviceObject[{"Serial", 2}]

In[29]:= data = FromCharacterCode[DeviceReadBuffer[serial, 4000]]

Out[29]= "): Volume was not properly unmounted. Some data may be \
corrupt. Please run fsck.

[   62.639301] reboot: Restarting system

Uncompressing Linux... done, booting the kernel.

[    0.000000] Booting Linux on physical CPU 0x0

[    0.000000] Initializing cgroup subsys cpu

[    0.000000] Initializing cgroup subsys cpuacct

[    0.000000] Linux version 3.12.19+ (dc4@dc4-arm-01) (gcc version \
4.7.2 20120731 (prerelease) (crosstool-NG linaro-1.13.1+bzr2458 - \
Linaro GCC 2012.08) ) #681 PREEMPT Fri May 9 16:36:10 BST 2014

[    0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 \
(ARMv7), cr=00c5387d

[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT \
nonaliasing instruction cache

[    0.000000] Machine: BCM2708

[    0.000000] cma: CMA: reserved 8 MiB at 0f800000

[    0.000000] Memory policy: ECC disabled, Data cache writeback

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

[    0.000000] Kernel command line: dma.dmachans=0x7f35 \
bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708.boardrev=0xe \
bcm2708.serial=0x286eeda3 smsc95xx.macaddr=B8:27:EB:6E:ED:A3 \
sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 \
vc_mem.mem_size=0x20000000  dwc_otg.lpm_enable=0 \
console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 \
root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)

[    0.000000] Dentry cache hash table entries: 32768 (order: 5, \
131072 bytes)

[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 \
bytes)

[    0.000000] Memory: 244792K/262144K available (4372K kernel code, \
238K rwdata, 1340K rodata, 143K init, 701K bss, 17352K reserved)

[    0.000000] Virtual kernel memory layout:

[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)

[    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)

[    0.000000]     vmalloc : 0xd0800000 - 0xff000000   ( 744 MB)

[    0.000000]     lowmem  : 0xc0000000 - 0xd0000000   ( 256 MB)

[    0.000000]     modules : 0xbf000000 - 0xc0000000   (  16 MB)

[    0.000000]       .text : 0xc0008000 - 0xc059c4f8   (5714 kB)

[    0.000000]       .init : 0xc059d000 - 0xc05c0fc4   ( 144 kB)

[    0.000000]       .data : 0xc05c2000 - 0xc05fd8a0   ( 239 kB)

[    0.000000]        .bss : 0xc05fd8ac - 0xc06ad098   ( 702 kB)

[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, \
Nodes=1

[    0.000000] Preemptible hierarchical RCU implementation.

[    0.000000] NR_IRQS:394

[    0.000000] sched_clock: 32 bits at 1000kHz, resolution 1000ns, \
wraps every 4294967ms

[    0.000000] Switching to timer-based delay loop

[    0.000000] Console: colour dummy device 80x30

[    0.000000] console [tty1] enabled

[    0.001282] Calibrating delay loop (skipped), value calculated \
using timer frequency.. 2.00 BogoMIPS (lpj=10000)

[    0.001344] pid_max: default: 32768 minimum: 301

[    0.001835] Mount-cache hash table entries: 512

[    0.002659] Initializing cgroup subsys memory

[    0.002771] Initializing cgroup subsys devices

[    0.002810] Initializing cgroup subsys freezer

[    0.002842] Initializing cgroup subsys blkio

[    0.002986] CPU: Testing write buffer coherency: ok

[    0.003452] Setting up static identity map for 0xc04270d0 - \
0xc042712c

[    0.005333] devtmpfs: initialized

[    0.021460] VFP support v0.3: implementor 41 architecture 1 part \
20 variant b rev 5

[    0.023042] NET: Registered protocol family 16

[    0.028438] DMA: preallocated 4096 KiB pool for atomic coherent \
allocations

[    0.029103] cpuidle: using governor ladder

[    0.029154] cpuidle: using governor menu

[    0.029640] bcm2708.uart_clock = 0

[    0.031592] hw-breakpoint: found 6 breakpoint and 1 watchpoint \
registers.

[    0.031658] hw-breakpoint: maximum watchpoint size is 4 bytes.

[    0.031697] mailbox: Broadcom VideoCore Mailbox driver

[    0.031797] bcm2708_vcio: mailbox at f200b880

[    0.031904] bcm_power: Broadcom pow"
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-11-22 02:10 , Processed in 0.034688 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表