2

What is the memory address information I should plug into IDA for this BIN file?

GOAL:

To disassemble a BIN file extracted from firmware.sb

This BIN file contains the low level board initialization, SDRAM clocks, power, Interrupt Controller, LCD, duart, and more.

I need the values passed to the LCD, duart and other to know what exact hardware my board uses and to know if firmware for an earlier board will work on a later board.

I will use these values to create linux drivers at a later date. (LCD)

Ref this question.

BACKGROUND INFO:

Board initialization sequence:

Part of the this BIN file is loaded into the on chip RAM (OCRAM) for minimal board init. This code is executed and will init the rest of the board most important for this question the SDRAM. More of this BIN file will load into the SDRAM then execute and init the rest of the board. This BIN will then load and pass control to the OS.

Basically a boot loader.

Here is a simple example of this using my custom u-boot and kernel. Oversimplified and information removed for brevity. Actual BIN file info.

LOAD    addr=0x00001000 len=0x00001ef4
CALL    addr=0x00001000 arg=0x00000000
LOAD    addr=0x40002000 len=0x000368ec
LOAD    addr=0x40600000 len=0x002ed3c8
LOAD    addr=0x40a00000 len=0x00002b1e
CALL    addr=0x40002000 arg=0x00000000

This is part of the memory map for this μP.

OCRAM 0x00000000 - 0x00007FFF 32KB
SDRAM 0x40000000 - 0x5FFFFFFF 512MB
Peripherals 0x80000000 - 0xBFFFFFFF

Example of Peripherals:

CLKCTRL 0x80040000 - 0x80041FFF
DBGUART 0x80070000 - 0x80071FFF

The μP is a Freescale mx23 or imx233.

This board has 16MB SDRAM 0x40000000 - 0x01000000

In the “ARM architecture options” dialog I set:

Base architecture as ARMv5TEJ.

VFP instructions as NONE

Thumb instructions as Thumb


In the “Disassembly memory organization” dialog I am unsure what to set.

Is the RAM section my SDRAM, 0x40000000 - 0x01000000?

Is the ROM section my OCRAM, 0x00000000 - 0x00007FFF?

What about Input file loading address, file offset, loading size?

Would the loading size be the 16MB of my SDRAM?

Where does the peripherals addresses go?

1 Answer 1

1

I'll make this brief:

Is the RAM section my SDRAM, 0x40000000 - 0x01000000?

Yes, this is correct. But AFAIK not too important. IDA will create different segment for different code parts based on this input, but will handle fine which ever values are entered.

Is the ROM section my OCRAM, 0x00000000 - 0x00007FFF?

Yes, this is again correct but again AFAIK it's not too important.

What about Input file loading address, file offset, loading size?

for low-level code executed, and especially for boot loaders, the loading address should be specified in the chip's datasheet.

Would the loading size be the 16MB of my SDRAM?

Yep. IDA will add the RAM address space as an additional segment for you.

Where does the peripherals addresses go?

IDA doesn't explicitly support peripherals, you'll need to include those in your RAM definition or create a different segment manually after the file is loaded. You'll need to manually specify what peripheral is exposed at each address either by adding different segments for different peripherals or by creating and naming variables/structures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.