GSoC Proposal: Creating a new MIPS N32 ABI port for Debian

Creating a new MIPS N32 ABI port for Debian


This project first focus on creating a new MIPS N32 ABI port for Debian. Different from O32 and N64, N32 is a address model which has most 64-bit capability but using 32-bit data structure to save space and process time a lot. A second focus will be given on making such a “mipsn32el” arch fully optimized for Loongson 2F CPU[6] which gains more and more popularity in subnotebook/netbook.


I’m now pursuing my master degree in Fudan University in Shanghai. I major in Micro Electronics and choose EDA software development as my research interest. I have experience with C/C++ programming in a FPGA EDA software project in my lab, in which I’m in charge of : a verilog parser using flex/bison; a netlist viewer using MFC. I’ve taken part in a Altera held competition with 2 other students in which we design and implement a “wireless multimedia monitoring system” which won us an outstanding reward finally. I have also some experience in porting linux to Xilinx and Altera’s FPGA development board although I just mainly copy other people’s pioneering work.

Besides the technical background, the best reason I give myself as the best person for this project are is I’m extremely fascinated by the open-source software development and joining in GSoC project is a precious opportunity to learn about it, including from mentors, developers and other students like me. Another reason worth to be mentioned is, I’m very proud to port one of the most popular and also my favorite linux distribution to Loongson, which is all designed by my own country. Loognson will not only benefit from the large amount of packages in Debian, but also from its talented developers and its influence in FOSS world.


In this project, there are 2 main tasks. First, create a MIPS N32 ABI port for Debian. As mentioned above, N32 ABI model is the best for current 64-bit MIPS arch. This port will use “-march=mips3 -mabi=n32” to make it more generic. The second goal of this project is to optimize the generic port for Loongson 2F with “-march=loongson”. Make such optimizations needs new feature supported in the latest tool chain, to be exactly, gcc-4.4, glibc2.9 and binutils2.19. It is reported that this optimization will fully utilize Loongson 2F’s 64-bit capability and push its performance to utmost [1]. Of course benchmarks will be provided to give a thorough comparison between O32, N32, N64, not only on loongson’s behalf but also will provide datas as reference for other MIPS systems.

Benefits to Debian:

With the growing popularity of Loongson 2F based computers such as Gdium Liberty 1000 Netbook[3], Lemote Yeeloong 8089 Notebook[4] and Fuloong[5], there is a great need and interest to have Debian running at top performance on these machines, especially to serve the greater cause of promoting free/open-source software and of providing computer-assisted education to those who most need it. This work will also make Debian more “universal” by adding a new arch and more popular through its use in Loongson based computer that it’ll attract more talented people to contribute to Debian.


The first three should be achieved with no excuse while the last two tasks especially the last one are optional. I list them here in case I can assure the quality of the first 3 tasks and there are time left for them.

  1. A minimal basic system of Debian fully optimized with N32 ABI
  2. Make this basic system optimized for Loongson 2F
  3. Providing benchmarks to compare performance among O32, N32 and N64 port. The comparison will not only take care of compilation time but also actual system performance as a whole.
  4. Migrating X windows and basic desktop environment
  5. Migrating application such as Iceweasel and

Project details:

As discussed with in IRC with foka, marga, r0bertz, aurel32 etc,  it is better to build a “generic” N32 ABI port at first and then we can use benchmark to fully study its performance compared with O32, N64 and N32 ABI optimized for Loongson 2F. I list jobs to be done down below:

I will start the porting just like others by following CLFS instructions to build a minimal system with N32 ABI by using “-march=mips3 -mabi=n32”. The “mipsel” port in current Debian repository is multilib version but mostly optimized for O32 which is very old. This “generic” port will push performance of those 64-bit MIPS systems to limit.

As such a minimal system is established, optimization for the Loongson will begin. The optimizing job is mostly done by a series of tools including gcc4.4, glibc2.9, binutils2.19. These version is selected because some features are supported in them. For instance, gcc4.4 is optimized for loongson by supporting its instruction set, pipe-line model and scheduler support etc. and  glibc,binutils support PLT etc.  I, on the other hand, will  focus on finding incompatibles.

Then benchmarks will be provided to give a thorough comparison between O32, N32, N64, not only on loongson’s behalf but also will provide datas as reference for other MIPS systems. There is a convincing report by r0bertz that said “coreutils compilation time reduced from 19 minutes to 12 minutes” and “30% overall speed improvement”. So the benchmarks should test against this report and besides these results, more tests should be run to treat the system performance as a whole instead of just choosing compilation time.

If everything goes smooth,the rest of the time will be devoted to porting X, basic desktop environment and other applications. Porting applications should be a collective job in community rather than a single person’s work. Making this job explicitly public will attract more people and will accelerate the pace of porting Debian to Loongson remarkably.

As above mentioned, r0bertz who likes to co-mentor this project with foka, has already pioneered this work using “-march=loongson2f -mabi=n32 -mplt”[1][2]. His work can be a good starting point for this project since he has already submitted many patches and applications for users to test. I think his opinions will help me a lot in this project.

Project schedule:

These timeline are fairly simple and inaccurate, however I’ll be very glad to change it with advice from mentors and other people caring this project.

  • Preparation Stage, April 20th~May 10th : Get myself started and finish Deliverables(1).
  • Mid-term stage, May 11st~July 5th : Deliverables(2)
  • pre-Final stage, July 6th~Aug 13th : A). Deliveralbes(3). The first 3 systems to compare include : the generic N32 version, the version optimized for Loongson and the “mipsel” multilib version Debian already have.B). Release a ‘testing’ version of Loongson based Debian on the internet to let volunteers in the community to try and test. C) Deliverables(4) and (5) if time allowed.
  • Final stage, Aug14th~Aug 23rd : Fix bugs, send patches, document the project and submit it to Google.

Other summer plans:

None, really. Idling on internet or playing wow if it’s counted.

Exams and other commitments:

No exams anymore. A little work involved with TA though.

If you are a Debian Developer:

Not yet.

If you are not Debian Developer:

Actually I’m the only Debianer in my whole lab(>100 students, lots of sub-labs), amazing huh?! Considering RH is not free, less packages and Ubuntu as a unstable version of Debian, there is no obvious reasons to ignore Debian. As a firm fans of Debian, I feel the need to promote the popularity of it, first in my lab and then on internet. As a relatively young Linuxer, I may not help people to solve their complicated problems but I can do tutorial jobs(like posting HOW-TOs) easily and happily. IMO, getting Debian more popular in China will be a very attractive idea since the user base in China is very large and due to this fact, more potential contributors will be led to FOSS world due to the effort Debian has made.

I was very lucky to find this project almost near the end of application. This project is a very precious chance for me in two reasons. It will provide me a environment in which I can learn a lot of interesting things and cool skills from mentors, developers and other students. I treat this project not as a assignment to finish but as a door leading to the great un-known world. Besides, the project involves Loongson 2F cpu which every Chinese people is proud of. And if i could port Debian, which is the best Linux distribution in my opinion, to Loongson, this summer will definitely be the most unforgettable summer in my life. So I’ll be very very happy contribute to this project in and after this summer.










9 Responses to “GSoC Proposal: Creating a new MIPS N32 ABI port for Debian”

  1. yajin Says:

    Cool. Having a N32 based debian will be a big achievement for loongson based systems, for you can have a totally optimized system to play with.
    Good luck.

    • sandyleo26 Says:

      Thanks for your support! I’ll be very proud if I can do this. Again, any comment on this idea will be highly appreciated.

      Sha Liu

  2. usenix Says:

    So now, one year later: is there any outcome of your efforts? Just curious if I can speed up my Fuloong2f a bit 🙂



    • sandyleo26 Says:

      Actually no. I stopped working on it after gsoc finished. I think I would start it again after I graduate this July. Thanks!

  3. Nurkoonsdaz Says:

    The world was created by a single thought!

  4. Anonymous Says:


  5. cnfavor Says:

    Any result from this GSoC project? I didn’t see any update after this announcement. 😦

    • sandyleo26 Says:

      to be honest, this project failed in final evaluation. I didn’t have a delivery complying to gsoc’s standard. I won’t try to find excuse for my self here but looking back then I feel I was not fully capable to take such a huge project. I was then into linux world only for 6 month and thought the love for it will make me accomplish everything. also lacking help from my mentor or others is another factor. Obviously I was too shy or reluctant asking help from outside world.

      anyway, I feel sorry for those who have faith in me or this project. I hope I could do better but the thing is what it is now. I do really want to make up to this in some form in the future but I feel not appropriate to promise anything that is beyond my reach.

      best regard

  6. Kazuko Says:

    This hybrid approach solves the upload speed is fast.
    The best cleaning cartridge you can use the Flash Recovery Area clean
    by storing only what is necessary and automatically removing obsolete files
    that might would not be eligible. You prefer to store it on NAS
    and keeps track of keypoint to files or even having access to reliable Online Backup Services
    and recovery solution. This has caused a change in pfSense is made a Online
    Backup Services of your Drive C, where Windows is usually installed near the ceiling of the basement near
    the floor joists.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: