Archive for June, 2009

Soc-coordination Creating a N32 MIPS port for Debian,report, Week 4

June 21, 2009

Hi everyone,
Sorry for not showing up at weekend meeting. I hope you all enjoyed that:-). First let me summerize what I’ve been busy with in the last two weeks and the status of the project.
1. Make a self-build minimal linux system running on fuloong2f box.
2. Building binutils, gmp, mpfr under mipsel on fuloong2f. However, it turns out I use some wrong flags and option when building them
3. Learn zhangle’s(r0bertz) loongson overlay; Learn bash and vim. Learn stuff about automake, autoconf and libtool.
4. Play a little with Gdium Liberty 1000.
5. Applying visa: Make appointment with Spain Consulate on next Tuesday and asking Anto for invitation letter(still not received).

1. Last night is the most exiting time since I’ve been accepted in this year’s GSoC. I’ve finally built a N32 mipsel system and run it on my fuloong2f box! Last week, I’ve talked with zhangle(r0bertz) on how to create such a system. I could either directly build packages on debian-mips on fuloong(because I’ve installed multilib tool-chain on it) or build packages on a x86 maching using the clfs method. Later, I found this[0] which use the second method. This’s a very detailed guide and due to the fact that building packages on fuloong2f is relatively slow compared with my laptop, I choose the second method. The only drawback is this n32 system is not Debian and thus has no Debian specific features!

2. When I tried to build binutils on fuloong, an error "invalid asm constraint" happened. Fai point out several links to this problem and r0bertz gives me the patch in his loongson overlay. This overlay is, from my point of view, a collection of patches and scripts r0bertz has created when building gentoo on loongson. But I have little knowledge with gentoo and the patches in it have few instruction on when or why to use them, so I guess I’ll bother him a lot in future. 🙂

3.I’ve received a Gdium Liberty 1000 netbook[1] a week ago. It has a system based on mandriva running in it. I play aroud it a little until I failed to install the pppoe which I use to connect to my ISP. I plan to install debian on it when I have more time to kill. If you guys are interest in getting a developer’s version of this netbook you can visit[2].

4.The visa stuff is really A BIG HEADACHE for me. The Consulate finally agree to give me a interview on next Tuesday but Anto still haven’t emailed me the invitation letter. If I still haven’t received the letter by tommorrow, I’ll definetly impossible go to debconf9.

Plans next few weeks:
1. Make the N32 system "more debian".
2. Upload it to ??
3. Building more packages like X
4. Start writing documentation and prepare for mid-term evaluation


[tag GSoC,loongson,mips,n32]


Learning Vim(2)

June 10, 2009

I can’t help myself learning Vim today. I found much fun and more magic hidden in it!
1. Enable mouse
:set mouse=a
2. tab pages
Yeah, vim have tab navigation! You can open a tab by :tabedit to open a empty file in a new tab or :tab split to open the current page in a new tab. If you have mouse enabled(see above), you can navigate among tabs with mouse just like under windows. double-click on the empty space will open a new tab and clicking the "X" on the right-most corner will close the current tab. With keyboard, :gt and :gT will go tab previous and next. Use :tabpage for more
3. Completion
In command-line, use the <Tab> key and <Ctrl-D> to complete commands. In insert mode, you can use <Ctrl-P> and <Ctrl-N> to complete your input. More in usr_24.txt. You can type :help and search the text "usr_24.txt" to get in.(But is there better way to go there in command-line?).
4. manage your window
:split and :vsplit will split your current window in two horizonally and vertically. You can move your cursor among these windows with <Ctrl-W> hjkl to move left, down, up and right.
And if you feel boring with so many windows, use <Ctrl-W><Ctrl-W> to move your cursor in the window you want to keep and press <Ctrl-W> O to close all other windows!
5. fold
I’m not quite familiar with this magic but it’s kind of very useful. In visual mode, selecting several lines and type :zf to fold these lines and :zd to delete the fold(Note: not the text). You can also just :zo to open it and after viewing :zc to close it.

To be continued…

Sha Liu

Learning Vim (1)

June 9, 2009

Due to the inconvenience I came across when I play around with config files, patch files, scripts etc, I decide to manage at least one main-stream editor proficiently. And I choose Vim because to the learning process with vimtutor is really a fun to me!
Some How-tos I found useful:
1. How to display with/without color?
Type ":syntax on" or ":syntax off". To change the color theme, type ":colorscheme" and <TAB> to complete your choice
2. How to copy/paste from vim to other application?
There are 2 registers in vim to hold the selection "* and "+. The first is for current selection(which e.g. you select in visual mode) and the second is for real clipboard. Both can be used to exchange info. For the current selection, e.g,
"*yy to yank a line and then "*p to paste it in vim or press the middle button of your mouse in other application. Of course you can just select in visual mode and vice versa
For the real clipboard, e.g,
*yy to yank a line and then "*p to paste it in vim or CTRL-v in other application. It’s just the normal clipboard like in windows.
3.How to move quickly to a word in one line?
Use the "f/F" and "t/T" and repeat it with ";" and ",". This is much faster than pressing "l" and "h".
4.How to get help?
Type":help [keyword]". You can use "CTRL-O" and "CTRL-]" to jump back and forth with hyperlinks or any word. Vim’s help system is very smart and friendly if you can spend a little time learning it. If you have questions, always try to figure it out by turning to help. You’ll find eventually you can solve all the problems on your own

To be continued…

Binutils Build Report

June 8, 2009

I spent my whole day building the binutils, luckily for me I finally succeeded in the evening. I think I’d better write it down for remembering.
Purpose : Since I need to create a N32 port for Debian, all that I need to do is to building every package(hopefully) in Debian repo from source, with the specific CFLAGS="-march=mips3(or loongson2f) -mabi=n32". And before that, I should have this set of cross-compile tool-chain. And Binutils is the very first package to be built.
Goal : build Binutils-2.19 using the multilib version of gcc-4.4 with parameter "-march=mips3 -mabi=n32".
What I have done:
1. Download Binutils-2.19.51 from cvs with this patch since it’ll later be used with building the kernel with the option"-Wa(??),-mfix-ls2f-kernel". One thing to note is there’s a hunk can’t be patched automatically since the context around it in my gas/config/tc-mips.c file is a little bit different from when r0bertz create the patch. However it’s very easy to manually patch it.
2. Install Bison, Flex and texinfo on my debian-mipsel. To be exactly, I’m not sure if they’re *all* neccessary. But without them, the make process will report error "[] error" and "yyparse undeclared indetifier". I google it a little and install these three packages at one time:-)
3. Configure. I use CFLAGS="-O2 -march=mips3 -mabi=n32 -pipe" as Fai told me and "–disable-nls –enable-shared". Of cource the CC="/usr/bin/gcc-4.4".
4. make configure-host && make && make install. The whole process took me 25min on my fuloong2f box.
Things still need to be figured out:
1. There is bin/ diretory in {PREFIX} and another bin/ in mips64el-unknown-linux-gnu. The last one is what i need but what’s the first one for?
2. I’m not sure what "make configure-host" is for.
3. I’m still confused the term "multilib". How many meanings does it have? We can say a multilib system and a mutilib gcc but what’s the relationship between them?
What’s next:
gcc, glibc and kernel.
This is probably the easiest package to be built in the tool-chain and it cost me one hard day to learn and try. Though I build it successfully today, many potential errors may come out later when building other packages. However, I still think it as a good start330