Page 1 of 1

Why isn't this working?

Posted: Mon Jun 20, 2011 7:41 pm
by mmiller235
I am trying to get your ARM Integrator-CP Bare bones thing up and running.

http://wiki.osdev.org/User:Pinged/ARM_I ... Bare_Bones

The instructions did not work.

My .ld file and source code is identical to that on the webpage, and I am using the following commands.

arm-linux-gnueabi-as -o start.o start.s
arm-linux-gnueabi-gcc-4.5 -Wall -Wextra -Werror -nostdlib -nostartfiles -ffreestanding -std=gnu99 -c main.c
arm-linux-gnueabi-ld -T link.ld -o kernel start.o main.o
qemu-system-arm -m 128 -kernel kernel -serial stdio

When I run this, I am supposed to get a qemu window with "Hello World" written in it, but instead I get an empty qemu window.

Could someone please tell me what more I have to do?

Re: Why isn't this working?

Posted: Mon Jun 20, 2011 7:57 pm
by Owen
Where does it say you'll get a screen with Hello World on it? It doesn't. It sends it to the serial port... and then in the QEMU command redirects the serial port to stdout.

That aside, "arm-linux-gnueabi" is not a valid cross compiler for OS development work

Re: Why isn't this working?

Posted: Mon Jun 20, 2011 7:58 pm
by mmiller235
it isn't?

Well, in that case, do you know of any prepackaged cross compilers for ubuntu?

Re: Why isn't this working?

Posted: Mon Jun 20, 2011 11:55 pm
by Solar
GCC Cross-Compiler. Incidentially, that article is linked in the very first sentence of the tutorial, which should tell you something...

Re: Why isn't this working?

Posted: Tue Jun 21, 2011 3:26 pm
by mmiller235
I saw the article link. I am aware of the GCC cross compiler. I was hoping someone could point me in the direction of a prepackaged build of it. I noticed there were some prebuilt packages mentioned on that page but none of them targeted ARM.

Anyway, I figured out that if I do everything in assembly language from start.s, it works just fine. So I think the problem was the linker I was using. Apparently when it hit the "bl main" instruction, execution just halted. This is fine because I really only wanted a platform to practice ARM assembly language programming. And if I ever feel the need to target ARM from C, I atleast know where the problem is and where to look first.

Thanks for the responses.

Re: Why isn't this working?

Posted: Tue Jun 21, 2011 4:20 pm
by diodesign
mmiller235 wrote:I am aware of the GCC cross compiler. I was hoping someone could point me in the direction of a prepackaged build of it.
I found crosstool-ng to be extremely useful for building a cross compiler in minutes - for x86, x64, ARM etc. It'll download the sources you need and build them after you've spent a couple of minutes configuring it via the menuconfig interface. That should get you going. Also, I recommend using -serial file:filename.log on the QEMU command line if you just want to double check it's really working by spitting out a file with your 'Hello World!' in it.

crosstool-ng url (save you a google search): http://crosstool-ng.org/