QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: shang79

HelloWorld on Skyeye,新手请进!

[复制链接]
发表于 2005-3-24 16:13:35 | 显示全部楼层
不好意思,没有仔细看,我已经找到了,   谢谢
回复

使用道具 举报

发表于 2005-3-24 16:13:58 | 显示全部楼层
不好意思,没有仔细看,我已经找到了,   谢谢
回复

使用道具 举报

发表于 2005-3-31 23:47:33 | 显示全部楼层
我看了一下上几个楼面的帖子,为什么arm汇编文件里面的注释是用“@”?不是“;”吗?ads里就是这样的阿,和汇编器有关吗?
回复

使用道具 举报

发表于 2005-4-1 15:00:22 | 显示全部楼层
[quote:9791e1ca11="jet"]我看了一下上几个楼面的帖子,为什么arm汇编文件里面的注释是用“@”?不是“;”吗?ads里就是这样的阿,和汇编器有关吗?[/quote]

这里的汇编不是ARM的汇编,而是GNU AS,那里面单行注释就是用“@”的。
我一开始也以为是“;”,后来网上搜了一下才知道不是,呵呵。
回复

使用道具 举报

发表于 2005-5-12 13:44:57 | 显示全部楼层
我下载的hello4skyeye.tgz解压时为什么这样的错?
[root@localhost test]#  tar -zxvf hello4skyeye.tgz;
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

Where download the "HelloForSkyeye.tar"?THX
or mail me [email protected]
回复

使用道具 举报

发表于 2005-5-13 13:22:57 | 显示全部楼层
版主:您好!
我根据<分析与实践>书中的实例
1、安装ARM-elf交叉编译器:
我使用arm-elf-tools-20011219.tar.gz,成功!
2、配置,编译和安装uClinux
1)我使用uClinux-dist-20020927.tar.gz,成功!
2)我用make xconfig,根据书上要求成功配置,并save and exit!
3)make dep, 成功!
4)make, 成功!
5)根据书上(241页)在uClinux-dist目录下建立仿真AT91开发板的SkyEye配置文件skyeye.conf,并保存.
最后根据书上的要求运行:skyeye linu-2.4.x/linux, 这时屏幕显示"command not found".这与书上(242页)不一致.
请版主帮助解决我在运行skyeye时出现的问题,急!
回复

使用道具 举报

发表于 2005-5-18 20:12:33 | 显示全部楼层
楼主有个问题请教一下.
在start.S中
ldr  sp, =irq_stack
....
irq_stack:
     .space 4096
????为什么要把irq_stack的值付给sp.
我觉得不是应该把irq_stack的高地址附给sp.
我在skyeye load的时候看到.data segment: 0x01002000 - 0x01003000
而irq_stack的值为0x01002000。我觉得sp的值是自减,那么不是越界了吗?
是不是应该吧0x01003000的值付给sp.
谢谢.
回复

使用道具 举报

发表于 2005-5-22 21:11:14 | 显示全部楼层
when I download the hello4skyeye.tgz file and excute the command
"tar -zvxf hello4skyeye.tgz" , it appear error just as follow:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

can you tell me why, please.
回复

使用道具 举报

发表于 2005-5-24 21:24:29 | 显示全部楼层
我也遇到了和楼上同样的问题

tar -zvxf hello4skyeye.tgz , it appear error just as follow:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

楼主或者哪位已经down到的大哥能否发一份给我呢?
[email protected]
谢谢
回复

使用道具 举报

发表于 2005-6-2 12:52:33 | 显示全部楼层

Re: HelloWorld on Skyeye,新手请进!

能否把那个压缩包用邮件发过来呀?

不好意思,忘了给邮箱了:

[email protected]

我下了几次都是解压出错

多谢了。


[quote:771c094054="shang79"]<chyyuu>最简单的可以在skyeye上运行的程序!

介绍:    初始学习嵌入式系统编程和使用Skyeye的人往往不知道该如何入手,
我想除了看资料以外,最好还有简单的例子可以用来作为基础练习。一般学习新
的编程和工具,都是从helloworld入手,所以我参考ucos-ii,使得用最少的代码
实现在skyeye上打印helloworld字串的功能。注意这里的Hello4Skyeye程
序与以前介绍的skyeye上的helloworld程序不同:它不需要有操作系统底层支
持,比如uclinux;它不是应用程序;它直接往串口写字符。Hello4Skyeye代
码量很少,没有实际应用意义,只是新手用于练习使用,高手就不必看了,欢迎
检查。

编译运行:    Hello4Skyeye程序是在Skyeye0.8.6,RedHat9.0上编译
通过的。编译之前请确定安装了Skyeye和arm-elf交叉编译器。有关这两者的安
装说明可以在论坛置顶的《Skyeye使用简介》中找到。步骤如下:
1  把Hello4Skyeye.tgz下载到Linux用户目录中用
   tar -zxvf Hello4Skyeye.tgz 解压缩Hello4Skyeye.tgz, 产生
   Hello4Skyeye目录
2 cd Hello4Skyeye
3  用make编译
4  用skyeye hello运行hello,和其它程序一样接着用tar sim; load;run;
就可以看到以下结果:
***************************************************************
**** ****
**** SkyEye Simulator Ver 0.8.6 with GDB 5.3 Interface ****
**** ****
***************************************************************
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This SkyEye was configured as "--host=i686-pc-linux-gnu --
target=arm-elf"...(no debugging symbols found)...
(SkyEye) tar s
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x813dae4
log_info: log is off.
log_info:log file is /tmp/sk1.log, fd is 0x829e0e0
log_info: log start clock 0
log_info: log end clock 200000
SKYEYE: use arm7100 mmu ops
Connected to the simulator.
(SkyEye) load
Loading section .text, size 0x98 vma 0x1000000
Loading section .data, size 0x1000 vma 0x1002000
Start address 0x1000000
Transfer rate: 33984 bits in <1 sec.
(SkyEye) run
Starting program: /home/shang/HelloForSkyeye/hello
helloworldhelloworldhelloworldhelloworldhelloworldhelloworld
helloworldhelloworldhelloworldhelloworldhelloworldhelloworld
helloworldhelloworldhelloworldhelloworld   


组成部分:    在Hello4Skyeye目录中用make clean命令可以删除目标代
码,只留下源代码,可以看到总共只有hello.c hello.lds makefile
skyeye.conf start.S五个文件。下面逐一介绍。

makefile:   该文件做为make工具的输入,描述了该如何编译
HelloForSkyeye项目。有关makefile的编写在make.info中已经详细说明,值
得注意的是有些编译参数比较陌生,象-mapcs,-march,... 这些参数的说明可以
在as.info::Machine Dependence::ARM-Dependent::ARM Options中找到。

start.S:    该文件存放了启动的汇编代码,主要工作就是设置IRQ模式,屏蔽中
断,调用hello函数输出字串,重新循环。这里的汇编指令都是ARM指令,但是伪
指令,还有label,立即数等等都和教科书上写的ARM程序大相径庭。这些都是
GNU AS汇编编译器的统一语法。在as.info中有详细的介绍。

hello.c:    这是一个c语言源文件,其中只有一个hello函数,实现向串口输出
“helloworld" 字串的功能。因为AT91的UART0的基址为0xfffd0000,USART
发送寄存器US_THR的偏移量是0x1c。所以向0xfffd001c地址写入字符,就是
向串口发送字符。Skyeye就会把字符打印到屏幕上。可以看到系统编程必须对硬
件了解。

hello.lds:  这是ld链接器的脚本文件,其中规定了程序入口,各个段的放置位
置。ld script的书写方法可以在ld.info::Scripts::中找到。编译好的目标代码,
还可以用'objdump -x' 查看里面的各段的位置。

skyeye.conf: skyeye运行的配置文件,其中说明了模拟的cpu,arch,还有内存
组配置。论坛置顶的《Skyeye使用简介》中详细说明了该配置文件的写法。[/quote]
回复

使用道具 举报

发表于 2005-6-14 06:47:21 | 显示全部楼层
我用的是gcc3版本,所以不认识-mshort-load-bytes, 修正成
-malignment-traps

对于.lds 还没有研究, 解决不了 -N 的问题, 就不用它了, 把
LDFLAGS= -p -X -Thello.lds
改成
LDFLAGS= -p -X

从hello.n看到, 它的映射地址为 0x8000

修改 skyeye.conf
mem_bank: map=M, type=RW, addr=0x01000000, size=0x00400000

mem_bank: map=M, type=RW, addr=0x00000000, size=0x00400000

然后就能运行hello程序了


$ skyeye
***********************************************************************
****                                                               ****
****   SkyEye  Simulator Ver 0.8.8 with  GDB/Insight 5.3 Interface ****
****                                                               ****
***********************************************************************
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This SkyEye was configured as "--host=i686-pc-cygwin --target=arm-elf".
(SkyEye) tar sim
cpu info: armv3, arm7tdmi, 41007700, fff8ff00, 0
mach info: name at91, mach_init addr 0x4f8f70
log_info: log is off.
log_info:log file is ./sk1.log, fd is 0x10096924
log_info: log start clock 0
log_info: log end clock 200000
SKYEYE: use arm7100 mmu ops
Connected to the simulator.
(SkyEye) load hello
Loading section .text, size 0x50 vma 0x8000
Loading section .rodata, size 0xb vma 0x8050
Loading section .data, size 0x1000 vma 0x8160
Start address 0x8000
Transfer rate: 33496 bits in <1 sec.
(SkyEye) run
Starting program:
warning: No executable file specified.
helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld
helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld
helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld
helloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworldhelloworld
回复

使用道具 举报

发表于 2005-6-14 07:05:00 | 显示全部楼层
修改了 .lds

OUTPUT_ARCH(arm)
ENTRY(begin)
SECTIONS
{
        . = 0x1000000;
        .text :
        {
                *(.text .stub .text.* .gnu.linkonce.t.*)
        }

          .rodata :
        {
                *(.rodata .rodata.* .gnu.linkonce.r.*)
        }

        . = ALIGN( 32 / 8 );

        .data : {*(.data)}

        .bss : {*(.bss)}

}
回复

使用道具 举报

发表于 2005-6-14 12:14:42 | 显示全部楼层
是不是每个自己写的程序都必须要上面5个文件才行的呢
有没有更加简单一点的方法啊
回复

使用道具 举报

发表于 2005-7-5 19:48:34 | 显示全部楼层
when I do the 3rd step, #make, system told me that  "make: nothing to be done for 'all' ".
So what should I do? BTW, I am a freshman in linux.
回复

使用道具 举报

发表于 2005-7-6 16:43:49 | 显示全部楼层
请教各位,我修改了skyeye.conf,让它在启动时加载一个文件到0xd0000000,在helloworld里加了几个语句
  int *temp_point;
   int* paddr=(int*)0xfffd001c;  
   temp_point   = 0xd0000000;
   
   * paddr = *temp_point;
   
   *temp_point = 5;
   * paddr = *temp_point;
按道理是应该先串口输出0xd0000000处的内容,然后修改0xd0000000为5,再串口输出5。但是现在运行结果是什么都没有,连0xd0000000处的初始值1都没串口输出过。
请问,是为什么啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-4-20 19:17 , Processed in 0.057068 second(s), 13 queries .

© 2021 Powered by Discuz! X3.5.

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