网络安全参考 | UNIX参考 | GPS参考 | 无线参考 | 在线手册 | OSBUG.ORG | SUNNY-NETWORK.COM
天线制作 GPS 地标
网站地图 RSS订阅
高级搜索 收藏本站
Home | 业界动态 | Open source | GNU | Linux | BSD | Solaris | AIX | HP-UX | IRIX | Mac OS X | Minix | Tru64 | SCO UNIX | Network | Security | X-Window | Database | 应用服务 | Programming | 经典著作 | 永远的纪念 | 杂项
 当前位置: Home > Linux > 嵌入式系统 > Boot loader > 文章  
ARM的嵌入式Linux移植体验之BootLoader
文章来源: 天极开发 文章作者: 宋宝华 发布时间: 2006-08-12   字体: [ ]  
 
  此外,vivi还提供了几个汇编情况下通过串口打印字符的函数PrintChar、PrintWord和PrintHexWord:

@ PrintChar : prints the character in R0
@ r0 contains the character
@ r1 contains base of serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintChar:
TXBusy:
ldr r2, [r1, #oUTRSTAT]
and r2, r2, #UTRSTAT_TX_EMPTY
tst r2, #UTRSTAT_TX_EMPTY
beq TXBusy
str r0, [r1, #oUTXHL]
mov pc, lr

@ PrintWord : prints the 4 characters in R0
@ r0 contains the binary word
@ r1 contains the base of the serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintWord:
mov r3, r0
mov r4, lr
bl PrintChar

mov r0, r3, LSR #8 /* shift word right 8 bits */
bl PrintChar

mov r0, r3, LSR #16 /* shift word right 16 bits */
bl PrintChar

mov r0, r3, LSR #24 /* shift word right 24 bits */
bl PrintChar

mov r0, #'\r'
bl PrintChar

mov r0, #'\n'
bl PrintChar

mov pc, r4

@ PrintHexWord : prints the 4 bytes in R0 as 8 hex ascii characters
@ followed by a newline
@ r0 contains the binary word
@ r1 contains the base of the serial port
@ writes ro with XXX, modifies r0,r1,r2
@ TODO : write ro with XXX reg to error handling
PrintHexWord:
mov r4, lr
mov r3, r0
mov r0, r3, LSR #28
bl PrintHexNibble
mov r0, r3, LSR #24
bl PrintHexNibble
mov r0, r3, LSR #20
bl PrintHexNibble
mov r0, r3, LSR #16
bl PrintHexNibble
mov r0, r3, LSR #12
bl PrintHexNibble
mov r0, r3, LSR #8
bl PrintHexNibble
mov r0, r3, LSR #4
bl PrintHexNibble
mov r0, r3
bl PrintHexNibble

mov r0, #'\r'
bl PrintChar

mov r0, #'\n'
bl PrintChar

mov pc, r4

 
推荐文章
·嵌入式系统 Boot Loader 技术内
 
 
↑返回顶部   打印本页   关闭窗口↓  

Google
 
Web oldhand.org unixreference.net meshmea.org
相关分类
热点文章
·U-Boot简介
·U-BOOT的启动流程及移植
·嵌入式系统 Boot Loader
·Bootloader存在的必要性
·U-Boot在S3C2410上的移
·bootloader的加载和运行
相关文章
·ARM的嵌入式Linux移植体
·ARM的嵌入式Linux移植体
·ARM的嵌入式Linux移植体
·ARM的嵌入式Linux移植体
·Linux PDA和手持PC一览
·嵌入式Linux系统中的GUI
·嵌入式Linux操作系统启
·QTE/Qtopia在Liod-270上
更多...
 
 

Copyright(c) 2001-2009 OLDHAND ORGANIZATION, All Rights reserved.
Power by DedeCms 织梦内容管理系统