Loongson CPU and MIPS Assembly?

976 views Asked by At

I have a Gdium Liberty 1000 laptop (Loongson 2F processor) on it's way to me. I will use it mainly to explore the MIPS assembly language. The inner architecture of the Loongson is supposed to be different from the MIPS CPUs. Does it in fact run MIPS assembly (MIPS64?) with no modification or are there any particular quirks to the Loongson 2F architecture? I realize that I can run SPIM (or MARS) as MIPS simulators on my Intel/AMD x86 processors, it just seemed like fun to try to run it natively.

Does it run MIPS assembly (MIPS64?) with no modification?

What tools are available on the Gdium (it runs a version of Mandriva Linux) for learning MIPS assembly?

2

There are 2 answers

0
MannyNS On BEST ANSWER

Loongson 2F is MIPS III-compatible, so this means that you will be able to write MIPS III compatible assembly, compile it and run it. If available, native toolchain should be a better choice than any cross toolchain.

I would suggest reading a UserGuide which will tell you what instructions you have available. Note that the instruction set for this chip has been extended with number of different integer/fp/media instructions.

0
Viktor Latypov On

From wikipedia on Loongson:

The current Loongson instruction set is a MIPS64,
but the internal microarchitecture is independently developed by ICT.
Early implementations of the family lacked four instructions
patented by MIPS Technologies to avoid legal issues.

Yes, it is certainly fun to run MIPS assembly on the real hardware (actually, for similar reasons I've bought myself an old PowerPC Mac as this was a great option to get a decent PowerPC processor).

Regarding the problem with development, I would recommend:

  1. Setup the remote access (run 'sshd' there) to this technical wonder
  2. Download some precompiled gcc toolchain for MIPS
  3. Compile binaries locally, deploy them using 'ssh' to the netbook.
  4. Setup 'gdbserver' there (on the netbook) if you want remote debugging or stick to extensive logging