[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-arm-kernel
Subject: arm assembly code starting address and define
From: Mark Yang <markarmlinux () yahoo ! com>
Date: 2002-07-31 16:50:37
[Download RAW message or body]
Hi,
I am writing some boot up code to boot up my own OS
kernal and my own board, can anyone tell me how do I
make my code starting from adress 0 instead of the
default address 0x8000? and also how do i add #define
to the code? sorry this sounds stupid but I did try
the normal way to do it, but it doesn't work.
Below is a piece of my code:
////////////////////////////////////////////
#define IOPDATA 8
.code 32
.align 0
.globl _start
.org 0
.text
.globl _start
_start:
b reset
/*b undefined_instruction
b software_interrupt
b prefetch_abort
b data_abort
b not_used
b irq
b fiq*/
reset:
/* First, mask **ALL** interrupts
ldr r0, INTBASE
mov r1, #00
str r1, [r0, #0x00] /* set interrupt pending register
INTPND to pending status */
/* switch CPU to correct speed
ldr r0, CLKBASE
ldr r1, CPU_SPEED
str r1, [r0, #0]*/
/*init LED*/
bl ledinit
bl led_on
loop:
b loop
/* initialise LED GPIO and turn LED on.
clobbers r0 and r1
*/
ledinit:
ldr r0,IOPBASE
/* IOPMOD initialize, set to output*/
mov r1, #0
str r1, [r0, #8] /* IOPDATA turn LED on */
mov pc, lr
led_on:
ldr r0, IOPBASE
mov r1,#3
str r1,[r0, #IOPDATA] /*IOPDATA*/
mov pc,lr
IOPBASE: .word 0x03FF5000
////////////////////////////////////////////////
I am using arm-elf-as and arm-elf-ld, the code starts
from address 0x8000 and it could not recognize IOPDATA
if I use it instead of putting 8 there.
Thanks so much!
Mark
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com
-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ/Etiquette: http://www.arm.linux.org.uk/armlinux/mailinglists.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic