BAMBI Binutils

The gnu binutils package provides an assembler, a linker, and some assorted binary utilities. The programs that we are using are:

ece554-unknown-elf-as - assembler
ece554-unknown-elf-ld - linker
ece554-unknown-elf-nm - prints symbol table of object file
ece554-unknown-elf-objdump - disassembler, also dumps other object-file info

To port binutils to the Bambi architecture the following files were added to the standard binutils-2.9.1 directory:

Assembly

Here's an example of some assembly, this is taken from start.s. It is the first piece of code executed when the machine boots up.

.global _start
_start:
	## disable all interrupts
	mtspr mr4, r0
	
	##  load _SDA_BASE_ to r13
	ori r13, r0, _SDA_BASE_@l
	lui r13, r13, _SDA_BASE_@h

	## setup system stack
	ori r1, r0, _stack_@l
	lui r1, r1, _stack_@h

	## jump to OS
	b _thumperos

    

Linking

The linker takes a list of .o files, which have been created by the assembler. Because the Assembler does not know where the code it is assembling will end up in the final output, it has to leave unknown fields blank, to be filled in when the final position is known. That final position is known at link time. The linker does a few main things:
The linker outputs code and data into a process image which are loaded directly into memory. For a layout of a process in memory, please see the ThumperOS section.

configuration

mkdir build.binutils
cd build.binutils
../binutils-2.9.1/configure --target=ece554-unknown-elf --prefix=/usr/home/tesch/ece554
Last modified: Sun Mar 11 00:56:44 CST 2001