Deflagration
Posts: 2
Joined: Tue Jun 12, 2012 9:09 pm

Make help required please

Sun Feb 02, 2014 8:52 am

I'm working with the full solution from Cambridge's Lesson 3.

But when I do a make all I get is:

Code: Select all

MAKE Version 5.2  Copyright (c) 1987, 1998 Inprise Corp.
        ld --no-undefined  -Map kernel.map -o build/output.elf -T kernel.ld
        ld.exe: no input files
        objcopy build/output.elf -O binary kernel.img
        objcopy.exe: 'build/output.elf': No such file
        objdump -d build/output.elf > kernel.list
        objdump.exe: 'build/output.elf': No such file
If I run a make with the -K switch I was expecting the main.o and gpio.o files to be in the build directory.

Please put me out of my misery.

Deflagration
Posts: 2
Joined: Tue Jun 12, 2012 9:09 pm

Re: Make help required please

Sun Feb 02, 2014 5:21 pm

Update:

I've now changed my Path variable and put the right command prefix in my makefile and upped the verbosity

Here's my output now and it's definitely not invoking the arm-none-eabi-as compiler for my source files

Code: Select all

MAKE Version 5.2  Copyright (c) 1987, 1998 Inprise Corp.
        arm-none-eabi-ld --verbose --no-undefined  -Map kernel.map -o build/output.elf -T kernel.ld
GNU ld (GNU Binutils) 2.23.1
  Supported emulations:
   armelf
opened script file kernel.ld
using external linker script:
==================================================
/******************************************************************************
*       kernel.ld
*        by Alex Chadwick
*
*       A linker script for generation of raspberry pi kernel images.
******************************************************************************/

SECTIONS {
        /*
        * First and formost we need the .init section, containing the code to
        * be run first. We allow room for the ATAGs and stack and conform to
        * the bootloader's expectation by putting this code at 0x8000.
        */
        .init 0x8000 : {
                *(.init)
        }

        /*
        * Next we put the rest of the code.
        */
        .text : {
                *(.text)
        }

        /*
        * Next we put the data.
        */
        .data : {
                *(.data)
        }

        /*
        * Finally comes everything else. A fun trick here is to put all other
        * sections into this section, which will be discarded by default.
        */
        /DISCARD/ : {
                *(*)
        }
}

==================================================
I think this is the relevant section if the makefile

Code: Select all

# The toolchain to use. arm-none-eabi works, but there does exist 
# arm-bcm2708-linux-gnueabi.
ARMGNU = arm-none-eabi

# The intermediate directory for compiled object files.
BUILD = build/

# The directory in which source files are stored.
SOURCE = source/

# Rule to make the object files.
$(BUILD)%.o: $(SOURCE)%.s $(BUILD)
	$(ARMGNU)-as -I $(SOURCE) $< -o [email protected]

ejames
Posts: 15
Joined: Thu Feb 02, 2012 1:19 pm

Re: Make help required please

Wed Jul 09, 2014 3:11 pm

Hi,
On ubuntu, the arm tools are called arm-linux-gnueabi-* so you may need to modify the name of the executable if you are using ubuntu.
Cheers,
Emyr

Return to “Bare metal, Assembly language”