Saturday, December 16, 2006

Mot A1200

Lol, spend a big chunk of a day looking for a Linux based cell in India.. ended up with an Intel Xscale based Motorola A1200... runs a mv 2.4 kernel.. the kernel is posted here: https://opensource.motorola.com/sf/frs/do/viewSummary/projects.a1200/frs
The fun part - i tried joining the sourceforge like project, heh heh, no thanks came the reply :)
Quote "
Your request to join the project, A1200 has been denied.
Comment from admin: Hello,
This project is only for the distribution of our open source software. Project membership does not grant you any privileges beyond what you get simply by being logged into the site (e.g. discussions forums and downloads). Keep watching this site for other projects that are open to community participation.
". I am heart broken.. not even a list to discuss the kernel and hack it up :( - blame it on me being lazy. interesting to read this set of cries: https://opensource.motorola.com/sf/discussion/do/listPosts/projects.a1200/discussion.general_comments.topc1272

I bet Nokia does way better with the maemo... hackers.. next time choose nokia ;)

Wish mot had put up a 2.6 based kernel at least.. :(.. and worst, no tools at to compile, hack arnd with the phone.. :( mebbe i have'nt spend enough time screwing arnd with it.. it plays awesome real player movies, good audio (first time i saw a 5 pin headset :D). Interestingly, i recently saw my friend's Symbian Series 60 based phone which uses ABCD processor.. and boy, it gives worse quality o/p compared to my A1200 (which by the way has an awesome battery life-wish i'd see it's powermanagement code )..

Tuesday, November 07, 2006

new baby

New wakeup :) pretty decent this time :)

Wednesday, October 25, 2006

National rogues' gallery

I got an email from my employer today:

National Skills Registry (NSR) – https://nationalskillsregistry.com/ An initiative by NASSCOM

National Skills Registry (NSR) – An IT & ITeS industry initiative taken-up by NASSCOM

India has emerged as the global hub for IT and ITeS industry and is providing services to customers ranging from corporates, public bodies and even foreign governments. India can remain attractive to such customers only so long as we are able to keep up our service delivery to their satisfaction and demonstrate that we are following best practices in recruitment, information security, etc.
NASSCOM has established a database (called National Skills Registry or NSR) of IT professionals. NSR will register details of IT professionals and will carry out the verification of the information. This will ensure that Indian IT sector employees will be registered on a central database, have a unique identity number and background checked. This will instill confidence about the credentials of the IT professionals to customers and employers.
XYZ has decided along with leading Indian IT Companies to be a part of this initiative taken by NASSCOM. It is expected that over a period of time, all Indian IT professionals will be part of this database and it will become the standard mechanism to establish the credentials. Also Consulates of different countries may look at the database registration with background verification, as preferred criteria / eligibility for visa. The visa issue process can also become easier and faster with this.
We encourage you to partake in this initiative. Watch this space for more information on how to register yourself.

What is the implication of this? iteresting thoughts.. maybe i will post later when i have the time.. right now, getting ready for france onwards to India....:)

Sunday, August 06, 2006

shame on me if u fool me twice

Friday, June 23, 2006

Hamming code: Error Correction Code

Something I spend 2 days re-learning from my MCA days!! Man am i forgetfull.. dont even know if my understanding is correct now..
Generating the Hamming code parity bits
First thing to understand about Hamming code is the following
Step1: Convert data into bits
D0, D1, D2…. Dn-1, Dn where n is divisable by 2
E.g.:
N=8
1 0 0 1 0 1 0 0
Step2: Next thing is called grouping.
Group Bits in sequence of powers of 2 – call them group index
[D0] [D1]…. [Dn] is grouped on power of 0 è[G0_0],[G0_1]…[G0_n]
[D0,D1] [D2, D3].. [Dn-1, Dn] is grouped on Power of 1 è[G1_0],[G1_1]…[G1_n]
[D0,D1, D2, D3].. [Dn-3, Dn-2,Dn-1, Dn] is grouped on Power of 2 è[G2_0],[G2_1]…[G2_n]
Max such groups possible is possible is n/2 è
[D0,.., Dn/2], [Dn/2+1,.., Dn] è[Gn/2_1][Gn/2_2]
E.g:
Groups=
Group index 0: [1], [0], [0], [1], [0], [1], [0], [0]
Group index 1: [1, 0], [0, 1], [0, 1], [0, 0]
Group index 2: [1, 0, 0, 1], [0, 1, 0, 0]

Step 3: Each Group has parity generated for all the data bits of each [Gx_y] using XOR.
[Gx_y] è Dy/x … XOR… D(y/x+1) XOR.. D(y/x+x)
E.g.:
Groups=
Group Parity index 0: [1], [0], [0], [1], [0], [1], [0], [0] è same
Group Parity index 1: [1, 0], [0, 1], [0, 1], [0, 0] è [1], [1], [1], [0]
Group Parity index 2: [1, 0, 0, 1], [0, 1, 0, 0] è[0],[1]

Step 4: Parity Bits Pk and Pk’ are generated based on the following logic:
Where k is 0-n/2 -> same as a group index
Pk is the XOR of all Even parity bits of a group index generated in step 3.
Pk’ is the XOR of all ODD parity bits
So For Group Parity y,
[Gx_0] [Gx_1] [Gx_2] ..[Gx_y],
Pk = [Gx_0] XOR [Gx_2] [Gx_y-1]
Pk = [Gx_1] XOR [Gx_3] [Gx_y]
E.g :
G0 was: [1], [0], [0], [1], [0], [1], [0], [0]
P0: [1], XOR [0], XOR [0], XOR [0] è 1
P0’: [0],XOR, [1], XOR [1], XOR [0] è 0
G1 was : [1, 0], [0, 1], [0, 1], [0, 0] è [1], [1], [1], [0]
P1: [1, 0], XOR [0, 1] è [1], XOR [1]è 0
P1’: [0, 1], XOR [0, 0] è [1], XOR [0] è 1

G2 was: [1, 0, 0, 1], [0, 1, 0, 0] è[1],[1]
P2: [1, 0, 0, 1]è[0]
P2’: [0, 1, 0, 0] è[1]

Fixing a error:
Pold =Say we have old values for which the parity was computed (p0, p0’,p1, p1’ ,p2,p2’)
Pnew =new values generated out of the read values (pn0, pn0’,pn1, pn1’ ,pn2,pn2’)
The Pold XOR Pnew = X
If X==0, there is NO ECC error
If X == num_bits/2, the location of error is pointed by the place the error is. lest 3 bits shows which bit has the problem and rest of the same show where the byte where the problem is.
Else.. Bad data.. dump.. retry.

Friday, June 16, 2006

recipe for a code in schedule

am sleepy waiting for a t-con to happen that never seems to get finalized.. so here it goes.. From what i learnt (relearnt?) in the past couple of months: Why have my modules created least issues?
1. Be clear on what u need to do - fight with requirements teams if required. I love our requirement guys - they are good!
2. Estimate within reason - dont over budget/underbudget. But *spend time* on estimates - always be prepared for unexpected hardware/tools issues-estimate for it!! - I use a 3 point estimate as of now, till i get something better at least.
3. read a lot on the subject - TRMs, functional specs, similar implementation, irc logs, mailing list archives, other OS, validation code, what ever I can lay my hands on - the idea is know how the hardware works - thoroughly before touching s/w.
4. As a driver writer I need to know my users, so i talk to them.. in person, over emails, the final user is the best teacher.. (next to the requirements blokes). meetings.. over all architecture - usually i start along with architecture team.
5. spend time in proper design - much munching required before even touching rational rose/msword for documentation - very important if code is huge. Some of my techniques
a) walk up and down while visualizing what if scenarios - I am pretty restless unless i create a mental picture on what i think the code should behave in total - i love the concept of gears - each turning the other..
b) draw the ideas on a white board and paper.. lots of times, rub re-draw
c) create the final idea on paper with a marker/pen
d) go to s/w tools like rational rose and start depicting what i want - i love sequence diagrams
e) code me in - compile test it at the very least - no platform might be available now.
Pri-Silicon platforms Vs Silicon platforms!
Hmm.. Pri-Silicon platforms are the nearest things to the hardware on which my code will finally work on. Many manifestations exist - FPGA, s/w, previous Si with new boards and what not.. all try to emuate the hardware, but may miss the mark sometimes.. Despite how much ever i curse a Pre-Si platform - there is nothing like it to make my understanding of the hardware better and my code better probable on the actual hardware(when ever it comes)- I usually use Lauterbach on them and after a day or so, I get to know what it does altogether. I have spend months and months on PreSi platforms to bring code up in hours when the real hardware comes in.. but then.. I am a fortunate programmer!! Most blokes dont get that luxury. The *true* programmer is one who reads the data sheet, writes the code and the bloddy code runs the first time on the real hardware.. Now, that *is* awesome and I know a couple of blokes who fit that bill.. Dont blame me for hero worship.. they deserve it!! I am more of a write-test-fix-write-test loop
f) write real real real real mean test cases - always think as if it is ur enemy's code ur testing - u want to kill it and u know its weakness.. I call it Offensive Testing and Defensive Programming (okay I stole it from Defensive Driving over here ;) but then who cares as long as the cliche sticks)!!

6) lets see what else? yeah - coding style
a) I love simple code.. as much as i can make it - my mind works crooked for most part of my lifetime writing obfuscated nested macros that people hate me for.. but elegance is what i strive for.. if u can show me how my code can be better.. i love it..
b) Most importantly, i hate hacks.. if i see a problem, i want and will spend time to fix the root cause. hacks are recipies for more time spend debugging!
c) Always ask for review - for a person who thinks(or tries to think) faster than the speed he codes.. I end up making real basic mistakes.. and knowing that weakness.. I always ask for reviews. I know some breeds of programmers - the fast and sloppy (like me), the slow and thorough and the fast and thorough (RKW). I always like the thorough guys for review.. love them when they kick my butt. e.g. why is OMAP OSS Audio driver capable of handling only one Codec Chip? Dumb me... errr....stutter stutter... Embedded devices have only one codec...Reply -> so and so has two of them.. one for routing music (high sampling rates- 44.1/48khz or even 96khz), and other solely for voice (8/16khz mono) calls. aaaarggh... how dumb of me... it is too late now.. make it an enhancement -> next time i look at the code I will fix it.. Git... some day soon I shall come....
g) tricks:
i) I used to hate gotos... now i use them to improve my code.. yet.. i am careful..
ii) i learnt a new thing.. how to handle multiple checks? OR each check to a variable and test it in one shot - cleaner code that Lindent does not kill- though the optimizer will put the same instructions..
h) Avoid the "i will fix it loop" - many problems have been though over by others and fixed by others.. it never hurts to ask.. my rule of thumb.. if it is logic and i could not fix in 2 days.. i am gonna holler..HELPPPPP...
i) Wish I can overcome this - "I am a super programmer syndrome" - when lesser people start commenting usefully on ur code.. the "I am invincible"(a.k.a 007 GoldenEye) syndrome creeps in.. too bad..

7) Oh yeah - the golden rule (my favorite and one that makes me infamous) - all ways be prepared to re-factor. I use platform changes as opportunity to re-visit code (even that which is written by me) to create a nice rewrite (which basically means do all from step 1 onwards).. and i try never to hack in code on top of what was previously present (i dont deny that i have done it.. but I try as far as possible not to).

8) Love the process and be prepared to bend the rules sometimes.. like writing design documents after code.. but keep the spirit.. never write code without a design.. design need not mean design documents.. they need to be somewhere - simple ones : pictures in mind; complex ones: rational rose/ paper. later on i update those designs and put them in a document when my code is done and ready to go in for review... but usually i end up doing this before testing.. so Some times.. DD is something i visit every 6 months or so.. looking at some of my DD's histories. - Remember the rule - Process is all guidelines - the main thing is absorbing the essense of it.. not necessarily following it verbatim..


I am sure lots of programmers out there have better inputs than I have, but these are what I know of..
Zip Zap Zoom... i am off back home.. crap...

today is my marraige aniversary.. and all i have done is talk to my wife on a noisy connection... but there are more meetings and things to setup before I sleep... or mebbe i got it upside down.. :D.. anyway one thing is for sure.. couple of weeks.. most probably no more blogs..

Disclaimers: No person/things is meant to be true if real people feel bad abt things i wrote here (i am puzzled as to what).. and any copyright violations i might have done.. not done knowingly- i have tried to avoid it.. if it still bugs u.. let me know will s/Copyright/Copyleft/g the same.

Monday, January 30, 2006

omap2430SDP code is out (contains new audio architecture)

http://linux.omap.com/pub/kernel/2430sdp/source/ contains the source now.. :) the 2.6.10 code contains the new audio architecture. it works on SDP2430 and H4 (2420) too..
I guess I need to spend a bit of time to put it together for h3,h2,osk before pushing for it... :( and ofcourse.. lotsa fight coming up for the new dma apis for chaining...

Sunday, January 22, 2006

hwdep

to get hwdep running.
SND_HWDEP does not get enabled in the kernel.. the reason is sound/core/Kconfig does not have a string with the tristate option. for a hack, i put in "hw dep"
that explains why the following happend when i tried to compile btsco
Building modules, stage 2.
MODPOST
*** Warning: "snd_hwdep_new" [/root/kernel-build/btsco-0.41/kernel/snd-bt-sco.ko] undefined!
CC /root/kernel-build/btsco-0.41/kernel/snd-bt-sco.mod.o
LD [M] /root/kernel-build/btsco-0.41/kernel/snd-bt-sco.ko

most of my drivers are modules.. dunnot if it makes sense to load them up as staticly linked drivers???? just musing..i kind of get edgy thinking of installing the kernel again (i lost track of the number of re-compiles i have done so far :D)..

restarting again....

bluetooth trial 1

Ref: http://www.teaparty.net/technotes/blue-gprs.html
I have a Dell Wireless 350 Bluetooth Module
Marvin:~/kernel-build/linux-2.6.15-rc6# lsusb
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 004: ID 413c:8103 Dell Computer Corp.
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
bluez-utils:
added:

deb http://bluez.sourceforge.net/download/debian/ ./
deb-src http://bluez.sourceforge.net/download/debian/ ./

to /etc/apt/source.list, apt-get update
apt-get install bluez-utils
#hciconfig
hci0: Type: USB
BD Address: 00:10:C6:7E:4E:80 ACL MTU: 384:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:522 acl:0 sco:0 events:41 errors:0
TX bytes:1156 acl:0 sco:0 commands:35 errors:0

i put my logitech into scan mode (flashing red and blue after arnd 7 sec of pressing the switch), and then ran hcitool scan
Got:
00:0D:44:01:4B:6E Logitech HS01

now to figure out how to plug into this..


check this out: http://sourceforge.net/projects/bluetooth-alsa/
mainly this: http://ubuntuforums.org/archive/index.php/t-75978.html

more to add - for kde-bluetooth
# KDE-Bluetooth
deb http://fred.hexbox.de/debian ./

I can have the kdebluetooth detecting my headset, but still need to get the bluetoothalsa working!! arrgh..

getting webcam up

http://www.exploits.org/v4l/
i had to recompile the kernel (sigh again) with v4l enabled.
Then i compiled spcaview-20051212(http://mxhaard.free.fr/download.html) since i had a creative webcam live
once that was done a reboot later, i ran camorama and xawtv. both worked like a charm... geee.. this is good..

now i got a couple of issues. gnomemeeting does not seem to be able to open /dev/sound/dsp since kde is already controlling it.. mebbe try to get my bluetooth working??

Monday, January 02, 2006

keyboard and mouse also work now

mouse problem: evdev was compiled as a module(CONFIG_INPUT_EVDEV=m in my .config) .
add:

InputDevice "ALPS Touchpad"
#InputDevice "Configured Mouse"

in ServerLayout
and now either make "CONFIG_INPUT_EVDEV=y" and recompile kernel OR modprobe evdev needs to run before kdm ran, and for this i hacked the /etc/rc5.d/S99kdm and added (lsmodgrep evdev)(modprobe evdev)
This works...

http://rtr.ca/dell_i9300/ has more details on kubuntu setup.
the class is this:
To get the Front-Panel media buttons working, it is necessary to map them to the standard XF86-Audio button symbols on X11 startup. A script to do that is here. To have it run automatically in KDE, place it (or a symlink to it) into your ~/.kde/Autostart/ directory. The volume up, down, and mute buttons are handled internally by kmilo (which you might need to install: apt-get install kmilo). To have xmms use the play, pause, prev, next, and stop buttons, I had to download and install the appropriate package: apt-get install xmms-xf86audio and then enable it in the xmms preferences.
weee... the volume control also works now...

debian partly up

Bloddy well miss semagic!!

One more of the Inspiron 9300 installation stories.. installed windows xp home edition first. then started with debian..

IMPORTANT: http://fluffi.info/inspiron9300/single/ gives a lot of info.. i'd try and fill the missing links..

I got the sarge dvds (both of them ) and installed a basic install -
I just got a shell prompt with *no* audio/video/anyotherthing..
here is the saga so far:

hmm.. anyways.. I have my debian useable level at least..
some interesting things:

apt-get commands and learnings: http://homepage.mac.com/sao1/fink/commands.html

I got the nvidia drivers, the ipw2200 drivers , interestingly these are valid for 2.6 kernel and above.

Debian's Sarge installation is with 2.4.27 kernel!! this is painful. so the thing i did was to download 2.6.15-rc6, applied a patch to it,
here is how to compile the kernel and create a .deb package - pretty nice to do a dpkg -i and apt-get remove package_name and play around..
libata patch: http://www.kernel.org/pub/linux/kernel/people/jgarzik/libata/2.6.15-rc6-libata1.patch.gz
matching kernel: http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.15-rc6.tar.bz2
Here is my .config: http://www.geocities.com/crecmca98/Linux/dot_config_inspiron9300_2.6.15_rc6.txt

Two things here:
read the ipw2200 requirements+ the ata requirements too..+ what ever u'd like to add..
I have also applied the libata patch for 2.6.15-rc6
make menuconfig (with all the required stuff)
make-kpkg clean
fakeroot make-kpkg --revision=custom.1.0 kernel_image
cd ../
dpkg -i kernel-image-2.4.23_custom.1.0_i386.deb


Things are not done now, U need to edit the grub file /boot/grub/menu.lst and ensure that u set it up for hda2/sda.. as required for the root partition. the reason for this is that compared to 2.4 kernel, the 2.6 kernel got itself a nice problem with scsi detecting it for sda and the default grub config gives a dumbo kernel panic.

Now, to get nvidia and ipw2200 to work, u can use module-assistant - this is the easiest way out.

apt-get install module-assistant

module-assistant

and follow the instructions.. hah - just remember that once u select it, u need to build and install it too.. :) wont tell u more than that.. sweat a bit dude...

OR:
apt-get install nvidia-kernel-source
Compile the module to a deb file... lotsa place to search for this - google it..
dpkg -i nvidia-kernel-custom
depmod
modprobe nvidia
apt-get install nvidia-settings nvidia-glx


for working with ipw2200, u better disable the default ieee80211 drivers (as they are already obsolete!!), update from the ipw2200 site - and with lots of .config restrictions.. U get the driver here: http://ipw2200.sourceforge.net/

This is where I had to recompile the kernel (since no one had told me to look here before compiling the kernel first hand...

then u need to update ur lil synaptic touchpad driver - failed bad here.. dunno still why this does not work, but the normal ps2 or compatible mouse still works!!

Once ur install is all ok... bit of hacking into /etc/X11/XF86Config-4 is required.. read http://fluffi.info/inspiron9300/single/ the mousy part failed..

#BACKUP --- OLD SETTINGS --
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "Emulate3Buttons" "true"
Option "ZAxisMapping" "4 5"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen "Panel"
InputDevice "Generic Keyboard"
#InputDevice "ALPS Touchpad"
InputDevice "Configured Mouse"

InputDevice "USB Mouse"
EndSection

Section "DRI"
Mode 0666
EndSection



The ALPS Touchpad never worked for me!!

Then I kicked out xdm and put kdm in place (apt-get install again).

edited /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
iface eth0 inet dhcp

#Wireless Lan
auto eth1
iface eth1 inet dhcp
wireless_mode managed
wireless_channel 1
wireless_essid ARCHANID
wlan_ng_authtype open
wireless_key 2G:EM:70:DE:5F:B3:BD:AA:57:FB:0D:FF:F0

My 802.11 G type Netgear router is set with SSID ARCHANID is set for open WEP 128 Bit and Key Index 1, and the key is stated, I changed the default channel from 11 to 1.

I usually work from my bedroom and would never like the ethernet to start off on its own, hence the "auto eth0" is commented out.

I got gaim working, gaim-1.5.0 - but install libssl before u ./configure and install, since msn and google chat requires this.. now, am connected to google,yahoo and msn from linux.. heh heh..

gmplayer is also working - albiet with lotsa choppy audio/video on it not worth it.. check the mentioned site on dvdcss etc.. but the best part is mpg123 which is my loved mp3 player - it is still up and running..
dvd works out of the box..

one lil thing on kdm: edit /etc/kde3/kdm/backgroundrc to set the background image to what u like..
I love this:Wallpaper=linux_addict.jpg
physical file: /usr/share/wallpapers/linux_addict.jpg

things i love abt debian -
apt-get and kpackage when i feel guish..
better integration in KDE3.3

hate:
kinda not out of the box feeling (well.. thats why i dumped kubuntu and tried it anyways).
bad artsdsp - choppy audio,lousy multimedia (esp video) esperience.

PM needs a big cleanup - windows seems way ahead here..

but compared to 1999 when i last had a linux desktop to play with.. things are a hell lot easier today (mebbe I learnt a bit working on omap kernel which i could use here I guess).. stilll i dont feel the ease of working I do have in windows.. mebbe let me review this a week later...

Adios... weekend... and Appy New Year everyone..