Tuesday, July 31, 2007

slackware 12.0 - fvwm, siliconmotion

I did not leave slackware. I downloaded the latest version of FVWM sourcecode, built and gave it an install. Now every thing is fine with FVWM.

Then I spent my rest time digging into the xorg configuration. Slackware did not use the latest FVWM but contains the latest xorg and it broken with my siliconmotion LynxEM+. I tried with a basic VGA driver, the ctrl-alt-backspace worked. With siliconmotion driver,

(II) LoadModule: "siliconmotion"
(II) Loading /usr/lib/xorg/modules/drivers//siliconmotion_drv.so
(II) Module siliconmotion: vendor="X.Org Foundation"
compiled for, module version = 1.4.1
Module class: X.Org Video Driver
ABI class: X.Org Video Driver, version 1.1

(II) LoadModule: "vgahw"
(II) Loading /usr/lib/xorg/modules//libvgahw.so
(II) Module vgahw: vendor="X.Org Foundation"
compiled for 1.3.0, module version = 0.1.0
ABI class: X.Org Video Driver, version 1.2
(**) Silicon MotionDepth 16, (--) framebuffer bpp 16
(==) Silicon MotionRGB weight 565
(==) Silicon MotionDefault visual is TrueColor
(**) Silicon MotionOption "NoAccel" "True"
(**) Silicon MotionOption "HWCursor" "False"
(**) Silicon MotionOption "UseBIOS" "False"
(**) Silicon MotionOption: NoAccel - Acceleration disabled
(**) Silicon MotionUsing Software Cursor
(**) Silicon MotionOption: UseBIOS disabled.

As you can see, I disabled accelerator and UseBios options.

And I check packages, here is some difference:

xorg-server 1.0.1 (X11R6 X server)
I think X11R6 is not correct it should be 7.0.0 as I dumped by Xorg.0.log

X Window System Version 7.0.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 7.0
Build Operating System:Linux 2.6.9-22.18.bz155725.ELsmp i686Red Hat, Inc.

Install log (Fc5)
Installing xorg-x11-server-Xorg-1.0.1-8.i386.
nstalling xorg-x11-drv-mouse-1.0.4-1.i386.
Installing xorg-x11-drv-siliconmotion-
Installing libXcursor-
Installing xorg-x11-drivers-7.0-2.i386.

X Window System Version 1.3.0
(II) Loading /usr/lib/xorg/modules/extensions//libdri.so
(II) Module dri: vendor="X.Org Foundation"
compiled for 1.3.0, module version = 1.0.0
ABI class: X.Org Server Extension, version 0.3

Xorg web site

7.0 [ ] xf86-video-siliconmotion-X11R7.0-

7.1 xf86-input-mouse-X11R7.1-1.1.0.tar.gz

7.2 xorg-server-X11R7.2-1.2.0.tar.gz


On my FC5, the version is use 7.0 but it still use the directory /usr/X11R6 not /usr/X11R7.
XCURSOR -> X11/Xcursor/Xcursor.h

I just don't know I can build the old version 7.0 on Slackware.

Monday, July 30, 2007

linux distro - which one I will choose?

I am in the bind of choosing a linux distro -- Ubuntu, Slackware or Fedora. It seems Ubuntu always failed to me, I tried to install Ubuntu to my thinkpad 130 which is of i1171, but I always failed on harddisk problems, I use the latest vesion 7.04, I don't know why grub-install always failed. and I am very dislike the start of X windows process through CD, that is toooo slow. And from the Web I see some people have some issues with this type of thinkpad especially for the current version - 7.04.

I can install Slackware on my thinkpad. The audio device need to re-configure with ALSA utilities, that's not big deal. There is one problem I still can not figure out, that is when I configure the xorg.conf, the ctrl-alt-backspace key will bring me a blank screen, it never return, the only way to get out of it, is hit ctrl-alt-delete to reboot. Should I set the start level at /etc/inittab to 4 instead of 3. I check /var/log/Xorg.0.log, the only problem seems DRI failed. Another issue is the fvwm setup, my workable fvwm2rc will not work in this version Slackware 12, the default fvwm in slackware is version 2.4.20(or 21), so I have to reconfigure my fvwm2rc or update it. Then is the issue that may not be a problem for an experienced linux user, I don't like the pkgtool which does not support dependences, the user will take the responsiblity.

Fedora Core 5 is installed on my working machine, it works fine and I never have a problem with it. And it also works fine on my thinkpad. The main reason to choose FC5 is Yum, which compared to pkgtool on slackware, it checks package dependences. I feel Yum is quite suit to me. With yum, FC5 find the most update package for me, for example, the fvwm downloaded by yum is "2.5.21". There could be network problem with one site, but yum can goes to the other site silently. Another reason is I like some scripts in FC5 - they are "system-config-xxxx", I can use these scripts configure my hard ware easyily.

The current version of Fedora is 7, I did not have a chance to use it.

As a result, the debian Ubuntu is beautiful, but I may not use it currently. Slackware is good for learning linux, but it is not friendly to a user, the user will take care too much things which may add a lot of pain. Fedora core 5, is quite suit to me, if the yum and system-config-xxxx work all the time.

The story is not end. Shake said "To be or not to be, that's a question". Slackware bring me both pains and pleasure. For FVWM, I can download fvwm 2.5.21 which supports "decor", build and install the new fvwm will solve my fvwm2rc problem I think. but it is not very easy to build xorg the x server. Even on FC5, will it be Ok if I am using a thinkpad R61?

Will I use Slackware or FC5? That is a problem of Linux.

Thursday, July 26, 2007

slackware - audio config on thinkpad 130

Yesterday I have successfully made audio working with slackware 12 on my thinkpad. When install, I did not select arts (lib), even I don't install most components of KDE,because I would like my thinkpad running with FVWM2. The important thing is I have to choose to install alsa components to the thinkpad, otherwise the audio would not work. After installation, the audio does not work, so I have to do some extra work:

1 runs "alsaconf" to select snd-intel8x0 which is detected by alsa.
2 check the result with "aplay -l" and "aplay sound_sample.wav"
3 runs "alsactl store" to save.

The following is the dump I got from FC5. The slackware will be the same but using some other things like "/etc/modprobe.d" blah blah.

------- lspci --------
00:00.0 Host bridge: Intel Corporation 82440MX Host Bridge (rev 01)
00:00.1 Multimedia audio controller: Intel Corporation 82440MX AC'97 Audio Controller
00:00.2 Modem: Intel Corporation 82440MX AC'97 Modem Controller
00:02.0 VGA compatible controller: Silicon Motion, Inc. SM712 LynxEM+ (rev a0)
00:03.0 CardBus bridge: O2 Micro, Inc. OZ6812 CardBus Controller (rev 05)
00:06.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08)
00:07.0 ISA bridge: Intel Corporation 82440MX ISA Bridge (rev 01)
00:07.1 IDE interface: Intel Corporation 82440MX EIDE Controller
00:07.2 USB Controller: Intel Corporation 82440MX USB Universal Host Controller
00:07.3 Bridge: Intel Corporation 82440MX Power Management Controller

------- lsmod --------
Module Size Used by
ppdev 8645 0
autofs4 19013 1
hidp 15937 2
rfcomm 34517 0
l2cap 23617 10 hidp,rfcomm
bluetooth 44069 5 hidp,rfcomm,l2cap
sunrpc 136573 1
video 14917 0
button 6609 0
battery 9285 0
ac 4933 0
ipv6 225569 12
lp 12297 0
parport_pc 25445 1
parport 34313 3 ppdev,lp,parport_pc
nvram 8393 0
uhci_hcd 28881 0
snd_intel8x0m 16077 0
snd_intel8x0 30301 1
snd_ac97_codec 83937 2 snd_intel8x0m,snd_intel8x0
snd_ac97_bus 2497 1 snd_ac97_codec
snd_seq_dummy 3781 0
snd_seq_oss 28993 0
snd_seq_midi_event 7105 1 snd_seq_oss
snd_seq 47153 5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_seq_device 8909 3 snd_seq_dummy,snd_seq_oss,snd_seq
snd_pcm_oss 45009 0
snd_mixer_oss 16449 1 snd_pcm_oss
i2c_piix4 8529 0
snd_pcm 76869 4 snd_intel8x0m,snd_intel8x0,snd_ac97_codec,snd_pcm_oss
i2c_core 20673 1 i2c_piix4
snd_timer 22597 2 snd_seq,snd_pcm
snd 50501 12 snd_intel8x0m,snd_intel8x0,snd_ac97_codec,snd_seq_oss,snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
soundcore 9377 1 snd
e100 33093 0
snd_page_alloc 10441 3 snd_intel8x0m,snd_intel8x0,snd_pcm
mii 5313 1 e100
dm_snapshot 16237 0
dm_zero 2241 0
dm_mirror 19985 0
dm_mod 50521 6 dm_snapshot,dm_zero,dm_mirror
ext3 116809 2
jbd 53077 1 ext3
------- /etc/modprobe.conf --------
alias eth0 e100
alias snd-card-0 snd-intel8x0
options snd-card-0 index=0
options snd-intel8x0 index=0
remove snd-intel8x0 { /usr/sbin/alsactl store 0 >/dev/null 2>&1 || : ; }; /sbin/modprobe -r --ignore-remove snd-intel8x0

------- /etc/asound.conf --------

------- aplay -l --------
**** List of PLAYBACK Hardware Devices ****
card 0: I440MX [Intel 440MX], device 0: Intel ICH [Intel 440MX]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Modem [Intel 440MX Modem], device 0: Intel ICH - Modem [Intel 440MX Modem - Modem]
Subdevices: 1/1
Subdevice #0: subdevice #0

Tuesday, July 24, 2007

slackware & ubuntu - a little update

Yesterday, I continue the setup with Slackware, the new thing for me is xorgcfg which generate xorg config file, I can use my xorg config file from FC5, so it is not too hard for me to config X window. The second thing is the audio setup, the artds sends failure every time I restart the sound service, and what is artds? I don't know. I don't know what is wrong with my audio setup. I have to figure out way with FC5. Slackware is good for learnning linux, because there is something broken.

And another thing I have tied yesterday was ubuntu, ubuntu 7.04 only contains one cd that is very good, and Ubuntu is very impressive in the GUI, the desktop is so wonderful, it is as good as Windows. I thought linux is not as good as Windows in the general opinion, it has a lot lot of bugs in its code (I mean system code) compared to Windows, the good thing is the architecture is simple, but it is so simple not as NT which is carefully designed. Linux is not designed while NT is carefully designed.

In the Linux world, what I can believe? gcc, make, emacs, gdb, cscope. There are a lot of tools that were built with UNIX philosophy. And on GUI, there are gnome and KDE, now gnome seems also became stable then before. I believe C, but not C++. Maybe a linux devloper that don't use debug tools, they found bug thorough code review? gdb is not very good I think, especially in C++, cscope is also not good at C++. So I would not use C++ myself in linux world. It is unbelievable to see Qt in the Linux world.

Linux for me is a great place to learn programming. For example I learn python to configure my own FVWM.

Monday, July 23, 2007


Yesterday as Sunday, I spent all my day on the download and install of slackware, all the 6CD need to be download, and I also experience burning failure with my download using bittorrent, is that a bug in my bittorrent or record sonic? -- sometimes it report failure but it actually download completely in the termarilly folder as I checked. The six iso are in the same name (of directory) cause the problem? Maybe I have to set them to different folders manually?

The install process keep the same -- I feel the way did not change too much as I first use Slackware about six or seven years ago. For example, I use fdisk to config swap (82), and the linux disk (83), luckly I know those before, it is totally inconvenient compared with FC5.

The X setup is also a nightmare, and I did not have too much the time to do that yesterday, so I will continue setup X today.

Why I have given SlackWare another chance, should I abandoned it since FC5 was quite fit my need. Because Slckware is my first chioce when I hit to linux world? Because some people they are not abandoned it?

Thursday, July 19, 2007

Amarok -- GNU's itune

Several days ago I watched some video presented by RMS, he suggests don't buy Microsoft's, Apple's blah blah, he even mentioned itunes and ipods. Don't use them, because they are against FREE SOFTWARE's spirit. Actually I owned an iPod, and don't have a plan to buy an iPhone. I can't reject the beautiful things from Microsoft and Apple's, even my life is bind ed to Microsoft a lot -- I am a programmer. On the other hand, I respect RMS, I like GNU software such as using emacs every day. Are free software my future? I don't know, but I liked GNU software, that is the trueth, and I want to participate in GNU area, and I am quite happy currently programming with GNU tools, although my product is a commercial software with license needed. (I think that's a problem for future, I have to take steps to make things happen, I mean to be a FREE SOFTWARE programmer.)

Today, I found Amarok, which is an audio player built with KDElibs, so it can only be used by linux.

Wednesday, July 18, 2007

gdb - c++ on the virtual class

Sometimes I feel I waste a lot of time stuck in one single point. If I have a class IFoo, it is just an abstract interface, so it defines foo function but never implements it. The implementation of foo was in the concreate classes, such as CFooConcreateA and CFooConcreateB. The problem of gdb is, if I use a pointer to IFoo, as "IFoo* pFoo", gdb only reports the type of pFoo is IFoo, I have no way to get the real concreate object by pFoo, so if i do "print *pFoo", gdb will response with "incomplete type". I search the internet, read gdb manual again and again, even read gdbinit macro about QString, still no help (QString contains a 'd' to store the string data which is different than IFoo). Am I something wrong, learning gdb not enough, or there is really no way to figure it out.

The only way right now is leave it:-(

Tuesday, July 17, 2007

gdb - debug plugins with realplay

When I debug helix plugins with realplay, my old way, setting LD_PRELOAD, seemed do not work,mainly because realplay is an X windows application, and I can not go to the main entry point before load the shared "so". My new way to debug helix plugin is, run realplay externel on a shell:

export HELIX_LIBS=/usr/local/RealPlayer
/usr/local/RealPlayer/realplay.bin &
[1] 4175

the number 4175 will be the process id which will be used by gdb.

Then start gdb in emacs, "ESC-x gdb":

attach 4175

will attach the running process with gdb, then, I can set break points for my plugins.

When debugging, the main problem here is, the helix code is not available since I directly pull the builtin files from www.real.com, so the `next' command will complain when there's not valid code to debug. Here is a reference from RMS gdb manual:

The next command will exit any functions we can't debug (like C library functions).

Since `next' will not work if the plugs calls a function from helix, but the other command `until' still works, the only thing is, I may not like to use this command.

Sunday, July 15, 2007

Saturday, July 14, 2007

Thinkpad 130 - install fc5

Yesterday, I made linux installed on my thinkpad 130. That's a wonderful experience, guess what, I have failed a thousand times playing my thinkpad with linux in all these years. I bought it maybe around 2000, that's 7 years and it works fine except the battery and sometimes the fans got noisy. The best is its LCD, compared to my ibook G4 which I bought last year, I have to say Apple's LCD is tooooo bad. I used to install Redhat or Debian on thinkpad but with a problem of the sound card, I just can not figure out the sound card driver, right now FC5 is totally support. Thanks FC5!

You know, my thinkpad is getting old, with CPU Celeron 600, a little bit slow compared to most computers today; only 10G harddisk I have to consider the diskspace because today's software getting bigger and bigger; and CDROM so DVD is not support.

How long will it continue its history while I use it for coding as my interest?

Friday, July 13, 2007

gdb - on shared library

I am experiencing problems when I set pending breakpoints to debug shared library. The good thing is at last I found the way for debugging even the pending breakpoints still don't work. I use the following commands:

set environment LD_PRELOAD /home/build/src/helix/debug/pcmrend.so

to debug pcm rendering, for example.

Monday, July 9, 2007

vmware - add new disk

My vmware virtual harddisk is full, the default installation is 8gb. When I build the qtopia or helix, the disk space will be used a lot for compiling files. I found this site and followed the instruction to add my new virtual disk.

Friday, July 6, 2007

smb4k - browse share folders in the net work

smb4k is a very basic tool to browse share folder in the local network. I just learn to use it. The main problem is the setup, and it could be true that using vmware that make browsing share folders more difficult.

The following command tool help me shoot the problem.

smbclient -U markc -W QSLCGY01 -L //QSLFILE01
mount -t cifs //QSLENG04/Qt -o 'user=markc,pass=mypassword,workgroup=QSLCGY01' /mnt/Qt
smbtree --user=markc%password
/usr/bin/smb4k_mount --suid -t cifs //QSLENG04/Qt /mnt/Qt -o user=markc@QSLCGY01,password=mypassword

One benifit is -- without VMWare share folders (I still did not figure out how to share my folder to FC5), I can locate my XP directory.

There are some problems I met:
- KWallet is disabled in FC5.
- Share folders are not shown in the computer

What works to me: manual mount
Share: //QSLENG13/markc
IP: (note: not
Workgroup: QSLCGY01
And authentication user name markc and password.

Tuesday, July 3, 2007

Au - Debug with gdb

I thought I have got the idea on debugging in linux platform -- mainly using gdb, cscope in emacs. Emacs is an IDE or NOT IDE, doesn't matter, but in emacs, source code browse (open file in c-mode or c++ mode), gdb and cscope can work together to make the magic happen. Here are some tips when running gdb:

- use cscope to find the function you want to trace, then open the souce code in C/C++ mode.
- C-x [space] to set break point. (c-mode and gdb)
- "f" will bring me to where the code runs at. (gdb)
- trace the memory variables (gdb)

x/160xb 0xb7f690c8
| |\ |
| | \ |
| | \ |
| | \ |
N F U Address
Here N: repeat times,
F: display format: x for hex, s for string.
U: unit size: b for bytes, h is two bytes, w for four bytes.

(gdb) x/160xb 0xb7f690c8
0xb7f690c8: 0x8e 0x93 0xa6 0x34 0x18 0x0f 0x0f 0x17
0xb7f690d0: 0x2e 0xac 0x96 0x8e 0x8f 0x9b 0xd6 0x1e
0xb7f690d8: 0x12 0x0f 0x15 0x25 0xb9 0x99 0x8f 0x90
0xb7f690e0: 0x9b 0xca 0x1f 0x13 0x10 0x17 0x2a 0xb1
0xb7f690e8: 0x98 0x90 0x92 0x9f 0x46 0x1c 0x12 0x13
0xb7f690f0: 0x1c 0x47 0xa1 0x94 0x91 0x99 0xbb 0x25
0xb7f690f8: 0x16 0x13 0x19 0x31 0xaa 0x96 0x92 0x98
0xb7f69100: 0xb1 0x29 0x18 0x14 0x1a 0x32 0xaa 0x97
0xb7f69108: 0x93 0x9b 0xbd 0x25 0x17 0x15 0x1e 0x4d
0xb7f69110: 0xa1 0x95 0x96 0xa2 0x45 0x1d 0x16 0x19
0xb7f69118: 0x2b 0xb2 0x9a 0x95 0x9c 0xc4 0x24 0x18
0xb7f69120: 0x18 0x25 0xc3 0x9d 0x96 0x9c 0xba 0x28
0xb7f69128: 0x19 0x19 0x26 0xc3 0x9d 0x98 0x9d 0xc4
0xb7f69130: 0x26 0x1a 0x1b 0x2d 0xb4 0x9c 0x99 0xa4
0xb7f69138: 0x4c 0x1f 0x1a 0x1f 0x4a 0xa6 0x9a 0x9d
0xb7f69140: 0xb9 0x2b 0x1c 0x1d 0x2f 0xb2 0x9d 0x9c
0xb7f69148: 0xac 0x38 0x1e 0x1d 0x2b 0xbe 0x9f 0x9c
0xb7f69150: 0xaa 0x3e 0x20 0x1d 0x2b 0xbf 0xa0 0x9d
0xb7f69158: 0xad 0x3a 0x20 0x1f 0x30 0xb7 0x9f 0x9f
0xb7f69160: 0xb8 0x2f 0x1f 0x23 0x43 0xac 0x9f 0xa7