[RFC] Introduce MIPS disassembler library for barebox

Smirnov Alexander alllecs at yandex.ru
Fri Jul 31 10:26:15 PDT 2015


Hi Sascha,

24.07.2015, 11:06, "Sascha Hauer" <s.hauer at pengutronix.de>:
>  Hi Alexander,
>
>  On Thu, Jul 23, 2015 at 06:53:08PM +0300, Alexander Smirnov wrote:
>>   This commit imports disassembler for mips from qemu/binutils.
>>
>>   Here is a sample disassembler output:
>>
>>   barebox:/ disasm 0xbfc00018+0x20
>>   bfc00018: 401a6000 mfc0 k0,$12
>>   bfc0001c: 241bfffe li k1,-2
>>   bfc00020: 035bd024 and k0,k0,k1
>>   bfc00024: 409a6000 mtc0 k0,$12
>>   bfc00028: 3c09b400 lui t1,0xb400
>>   bfc0002c: 3c08df00 lui t0,0xdf00
>>   bfc00030: ad280068 sw t0,104(t1)
>>   bfc00034: 3c09bbe0 lui t1,0xbbe0
>>
>>   TODOs:
>>
>>     * -a option (select cpu architecture) does not work properly;
>>     * -s option (select binary file for disassembly) does not work properly .
>>
>>   This commit demonstrate simple way for importing disassembler from qemu/binutils:
>>   disassemblers for other architectures (e.g. ARM) can be easely imported.
>
>  This is nice and somehow cool to be able to just disassemble some code
>  under barebox. However, it's quite a bunch of code imported from another
>  project and we'll need even more code for other architectures. This code
>  needs maintenance to stay useful, so I am not very fond of merging it.
>  What is your usecase for this? Normally I would transfer the area I'd
>  like to disassemble via tftp or whatever to a host and disassemble it
>  there, but that it something that I need very seldomly.
>
I carry out this work for educational purposes.
I study programming for embedded systems.
I run barebox for mips as an exercise.
Work on the disassembler will allow me to get better acquainted with the MIPS instruction set.
I'm on vacation now.
I plan to finish disassembler after the vacation ends.
Options -s and -a are not working in the current version, I plan to fix it.
If you think the disassembler pulls too much code from other projects, I'll keep the finished version in my separate branch on github.

-- 
Smirnov Alexander



More information about the barebox mailing list