run helloworld on s3c2410 using skyeye without OS

终于将s3c2410在skyeye上跑起来了,没有操作系统的底层支持,实现的是直接向端口写数据。

hello.c

 

/*

 * hello.c

 * just a function used to output "helloworld" to uart 

 * 

 * author: SU Hang

 * date:   2004-08-28

 */

void hello(void)

{

unsigned long n = 0;

int i;

char * hellostr="helloworld";

long* paddr=(long*)0x50000020;

// for timer delay

while (n++ < 0xffff);

for(i=0;i<10;i++)

{

* paddr=hellostr[i];

}

return;

}

hello.lds
/*
 * hello.lds
 * ld script for helloforSkyeye
 * 
 * author: SU Hang
 * Date:   2004-08-28
 */
OUTPUT_ARCH(arm)
ENTRY(begin)
SECTIONS
{
. = 0x33f00000;
.text : 
{
*(.text) 
*(.rodata)
}
. = ALIGN(8192);
.data : {*(.data)}
.bss : {*(.bss)}
        /* Stabs debugging sections.    */
        .stab 0 : { *(.stab) }
        .stabstr 0 : { *(.stabstr) }
        .stab.excl 0 : { *(.stab.excl) }
        .stab.exclstr 0 : { *(.stab.exclstr) }
        .stab.index 0 : { *(.stab.index) }
        .stab.indexstr 0 : { *(.stab.indexstr) }
        .comment 0 : { *(.comment) }
        .debug_abbrev 0 : { *(.debug_abbrev) }
        .debug_info 0 : { *(.debug_info) }
        .debug_line 0 : { *(.debug_line) }
        .debug_pubnames 0 : { *(.debug_pubnames) }
        .debug_aranges 0 : { *(.debug_aranges) }
}
skyeye.conf
#skyeye config file sample
cpu: arm920t
arch: arm
mach: s3c2410x
mem_bank: map=M, type=RW, addr=0x33f00000, size=0x01000000
mem_bank: map=I, type=RW, addr=0x48000000, size=0x20000000
#log: logon=0, logfile=./sk1.log, start=0, end=200000
# for UART
uart: mod=term
start.S
/*
 *  start.S 
 *  very simple code for ARM 7TDMI 
 *
 *  author: SU Hang 
 *  date:   2004-08-28 
 */
 
.text
.align 4
.global begin
.type begin, function
begin:
@set up irq stack
mov r0, #0xd2                @ make irq mode with all irqs disabled
msr cpsr, r0
ldr sp, =irq_stack           @ set sp_irq = irq_stack
bl hello
b begin
.data
.align  4
irq_stack:
.space 4096
将上面的几个文件放置在同一个文件夹下面,然后依次执行下面的命令:
make clean
make
skyeye -e hello -c skyeye.conf
于是helloworld开始在s3c2410上跑了起来。
xuqiang@ubuntu:~/Desktop/Hello4Skyeye$ skyeye -e hello -c skyeye.conf
SkyEye is an Open Source project under GPL. All rights of different parts or 
modules are reserved by their author. Any modification or redistributions of
SkyEye should note remove or modify the annoucement of SkyEye copyright. 
Get more information about it, please visit the homepage http://www.skyeye.org.
Type "help" to get command list. 
 (skyeye)start
cpu info: armv4, arm920t, 41009200, ff00fff0, 2 
arch: arm
In do_mach_option, mach info: name s3c2410x, mach_init addr 0x17c970
uart_mod:0, desc_in:, desc_out:, converter:
SKYEYE: use arm920t mmu ops
exec file "hello"'s format is elf32-i386.
load section .text: addr = 0x33f00000  size = 0x00000077.
load section .glue_7t: addr = 0x33f00078  size = 0x00000000.
load section .glue_7: addr = 0x33f00078  size = 0x00000000.
load section .data: addr = 0x33f02000  size = 0x00001000.
not load section .bss: addr = 0x33f03000  size = 0x00000000 .
not load section .debug_abbrev: addr = 0x00000000  size = 0x0000004e .
not load section .debug_info: addr = 0x00000000  size = 0x00000172 .
not load section .debug_line: addr = 0x00000000  size = 0x00000087 .
not load section .debug_pubnames: addr = 0x00000000  size = 0x0000001c .
not load section .debug_aranges: addr = 0x00000000  size = 0x00000020 .
In SIM_start, Set PC to the address 0x33f00000
(skyeye)(running)helloworldhelloworldhelloworldhelloworldhelloworldhelloworld
熟悉的helloworld,呵呵。。。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值