Problem in Assembly Language Programming for Openmoko

2 messages Options
Embed this post
Permalink
Waqar Ali

Problem in Assembly Language Programming for Openmoko

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)
We are working on a project that needs use of assembly language, to develop low-level programs for Openmoko. However, I am facing a problem while using assembly.

When I write a very simple program (that just exits the program on arm architecture):

.section .text
.globl _start

_start:
SWI 0x11


and compile it using GNU Assembler, provided with the toolchain for Openmoko. It just compiles fine, and then it is also linked and run fine using the Openmoko Toolchain. As shown below:

[root@dhcppc7 arm]# arm-angstrom-linux-gnueabi-as test.S -o test.obj
[root@dhcppc7 arm]# arm-angstrom-linux-gnueabi-ld test.obj -o test
[root@dhcppc7 arm]# arm-angstrom-linux-gnueabi-run test


It works fine. (I have also tried it to print text on screen it also works fine when using arm-angstrom-linux-gnueabi-run simulator, but never works when sent to Openmoko)

However, when I copy this compiled file test to Openmoko and run it there it gives this error:

root@om-gta02:/usr/src/assembly# ./test
Illegal instruction



The exact statement at which the error occurs is:
SWI 0x11

and the error is same for all numbers given after SWI except for 0x0.

However, I have written and tried programs that does not use any software interrupts and they work just fine.

Please help me how can I use software interrupts, It would be of great help in our project.

Regards,
Waqar Ali
Research Engineer,
Next Generation Intelligent Networks Research Center (NexGin RC)



_______________________________________________
hardware mailing list
[hidden email]
http://lists.openmoko.org/mailman/listinfo/hardware
andrzej zaborowski

Re: Problem in Assembly Language Programming for Openmoko

Reply Threaded More More options
Print post
Permalink
Hi,
please don't cross-post like this.

2009/4/13 Waqar Ali <[hidden email]>:

> We are working on a project that needs use of assembly language, to develop
> low-level programs for Openmoko. However, I am facing a problem while using
> assembly.
>
> When I write a very simple program (that just exits the program on arm
> architecture):
>
> .section .text
> .globl _start
>
> _start:
> SWI 0x11

The code I use for exit(0) is

mov     r0, #0
swi     #0x900001

and I think the other syscalls start at 0x900000 too, in current ABI.

Cheers

_______________________________________________
hardware mailing list
[hidden email]
http://lists.openmoko.org/mailman/listinfo/hardware