Why isn't this working?

Programming, for all ages and all languages.
Post Reply
mmiller235
Posts: 4
Joined: Mon Jun 20, 2011 7:27 pm

Why isn't this working?

Post 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?
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Why isn't this working?

Post 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
mmiller235
Posts: 4
Joined: Mon Jun 20, 2011 7:27 pm

Re: Why isn't this working?

Post by mmiller235 »

it isn't?

Well, in that case, do you know of any prepackaged cross compilers for ubuntu?
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Why isn't this working?

Post by Solar »

GCC Cross-Compiler. Incidentially, that article is linked in the very first sentence of the tutorial, which should tell you something...
Every good solution is obvious once you've found it.
mmiller235
Posts: 4
Joined: Mon Jun 20, 2011 7:27 pm

Re: Why isn't this working?

Post 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.
User avatar
diodesign
Posts: 14
Joined: Sat Sep 11, 2010 10:14 am
Location: England
Contact:

Re: Why isn't this working?

Post 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/
Post Reply