42

Looking for fun, Feeling groovy…

Tag: linux

fsod status

Its been a while since I blogged about odeviced. In my earlier posts I had mentioned the possibility of integrating odeviced and others (which do not exist at the moment) into a single daemon for avoiding too much fracture. I have pushed some code that does this, converting odeviced into a Device subsystem that is loaded by a master daemon called fsod. This, of course is very similar to the python implementation (frameworkd) which is pretty awesome at what it does and has become a sort of success story for using DBus as the fudgy layer separating toolkits and the underlying systems which in themselves are tightly coupled.

The current code base is written in vala (and C where it is required) which unfortunately lacks certain features of DBus like async callbacks and some method signatures at the moment (I may be horribly wrong. I would be glad if someone points out in that case. The mailing list discussion on async support here). But at the same time, writing GObject code in vala is infinitely easier and lots of fun too :D .

It would be also be pretty awesome if fsod could support loading python plugins, kind of like what gedit does. The GSM code especially could benefit from this since there is not much to gain in terms of performance here.

As for fsod, the sources are available here. In case anyone wants to get hold of a opk of the current code to install on the Freerunner, it is available here. Comments are welcome

Fun @ Shaastra

Four words. Shaastra ’08 was frigging awesome. I was there a couple of days and had fun meeting people (shres, madhusudhan and many others). Also got to speak about FSO framework (slides later) as part of the FOSS sub-conference. Lots of food, some awesome talks and a wonderful atmosphere made the event memorable. Too bad, I had to leave early for the FOSS HackFest on 2nd night.

Only one gripe though, the event was not laptop friendly =(, It would have been awesome if the organizers had provided wifi spots near the talk venues.

Thanks to kstars, vimzard, vikram and other volunteers for organizing the event .

mukt.in 2008, quite a change from mukt v1

After intense negotiations with the college that made me realise that I could be a good business man, I was given OD to attend mukt.in. I was there to talk on DBus (which by the way was EPIC FAIL!). On a brighter side, I had fun showing off my gsoc code to people at qvantel. One of the things that I learned from this “version” of mukt.in was to prepare talks well in advance, otherwise you end up giving a mediocre presentation.

There were a lot of great things about mukt.in this year than the last version. The venue, the speaker list, the topics covered and the people who attended it.

The entire scope of mukt is to introduce people to FOSS. This is quite unlike other “biggies” in India like foss.in which is mainly concerned with the developer folk. In fact, mukt.in was more like fossconf with regards to its intended audience. Last year was more satisfying for me personally because I got a chance to actively help around. This year I didn’t move my butt and was pampered like a elite speaker, which I felt to be weird.

But at the same time, the event as a whole was a great success! The interactions between the speakers was awesome, many of us whom were using the free wifi at krish’s place. His mom made me feel home and all salutes to a nice lady who happens to make the best “chai” ever.

We also visited Charminar, Got stuck at Hussein Sagar in the midnight where there were no local buses, realised that samosas can cost a fortune in some places (;) ). And of course, thanks to Aju bhaiyya for the tee. (you are the best for now :D )

Ok, so here are some of my thoughts on improving mukt.in with which I have become quite attached,

  • I feel the duration of the event to be too long. Two days would be apt and the third day, as mbuf put forth rightly, could be made as a “Picnic day”. Get a mini-van for the speakers and visit the tourist spots or some hang-out. A wonderful way to get together and make mukt more of a friendly cozy foss event that everyone would love to attend.
  • Be a bit strict with the kind of talks that make it to the final lists. Ask the speakers to submit slides and be strict with it.
  • Chinese food, all the three days was a bit sucky. Tokens from the local canteen would have been cool instead.
  • I realised this rather late, but the mukt.in logo could have been a bit more expressive. Like a little image of Charminar or even the Buddha of Hussein Sagar that adds some weight to the logo. You get the picture.

I guess thats about it. Next time, I am ruddy damn sure mukt.in will be bigger and more “mukt”ier.

@mukt.in organizers, take a week off and sleep well. You guys deserve it!

First frigging milestone..

Why Milestone? Nope, I didn’t come up with fancy code or a “beautiful” one for that matter (Came up with a way to unload plugins). Milestone, because today was the first day I was squeezing up my half empty head to work around a teency weency problem. In short, I am happy I was actually thinking today about squishing a segmentation fault which was bringing the whole house down due to dbus and the kinky wifi plugin.

Now a word of warning. The wifi plugin is a circus freak of sorts. Being the lazy bum I am, I found it a drag to manually get into the trouble of coming up with xml introspection data for the “org.freesmartphone.Device.plugins.wifi” interface.

Instead I just came up with a grand plan of letting valac generate wifi.c and wifi.h, which I could modify later. Piece of cake? Sure…

After the wifi plugin is loaded it works pretty well. The keyword being “After”…By the way, check the progress report which I sent to the smartphone-standards list. That should give you an idea of how odeviced works and looks like. In fact, it works pretty satisfactorily discounting the segmentation faults  :D , which is easily reproducible in the following ways,

  • Don’t load the wifi plugin on startup, set enable=0 in odeviced.conf. Instead load it manually after odeviced starts up and begins to idle.
  • If the wifi plugin is already loaded, unload it and then try to load it again.

Part of this problem might be my arrogance of not to use GTypeModules for dynamically typing the plugins. I need to discuss with my mentor, mickeyl about this once he gets back to business after LinuxTag.

The barely bare bones powercontrol plugin loads and unloads without any problems, but it doesn’t do anything as remotely useful as the wifi plugin!! Just contains an init function that has a printf in it (bleh!, thank goodness it didn’t bail out).

Oh and the all important tarball is here. Highly effective than laughing gas!

…Another gdb session beckons

odeviced: progress report :P

So, presenting a preliminary skeleton service for odeviced that loads shared object libraries (or in other words plugins). Nothing to be proud of, but hey, something is better than nothing.

Here’s a screenshot of a very very preliminary odeviced in action..

odeviced

Basically its just a dbus service that can load modules from a predefined location. Here’s how it works currently,

  • Setup all the boring stuff like registering the object path and getting the connection to the DBus system bus. The interface used will be “org.freesmartphone.Device”.
  • The service reads the configuration file at /etc/odeviced.conf whose contents are as follows,
    # General configurations
    [odeviced]
    device_name=FreeRunner

    [powercontrol]
    enable=1
  • So from the above configuration, the device name is set to FreeRunner and odeviced tries to load the powercontrol plugin since “enable” is set to 1. Of course, the dbus service exposes the load method to load plugins manually after the service has started if the need arises.
  • The default directory for plugins is at ‘/usr/share/odeviced/plugins’. Maybe additional directories for other plugins can be set in odeviced.conf. By now odeviced tries to load the plugin libpowercontrol.so under ‘/usr/share/odeviced/plugins’.
  • After successful loading of the plugin, odeviced executes the init function in the plugin which is of the form <plugin_name>_init. In our case it is powercontrol_init. The dbus paths for the plugins are to be set here. So we would have object paths such as “/org/freesmartphone/Device/plugins/powercontrol’. This is yet to be done.
  • As evident in the above screenshot the powercontrol_init contains a single printf statement which merely spits out “In powercontrol”. And yes, the powercontrol plugin is written in good ol’ C.

Notice the gnome-terminal at the right. It is running a simple python helper script for testing odeviced. It simply reads from stdin and calls the `load’ method offered by the dbus service with the input as the argument. As you can see, powercontrol has been loaded successfully but “l” and “this_aint_a_plugin” gives a critical warning that these plugins couldn’t be found.

What needs to be done

  • Make the code “beautiful”. :D . I am constantly on the lookout for vala’ish ways of doing things. Still need to work on my OOP skills :/.
  • Come up with a decent plugin for powercontrol.
  • Put in some example apps or port the existing OM ones to use odeviced.

odeviced: Device daemon for the FreeRunner

Man, its quite difficult to sneak up and write a blog post when semesters are around the corner. So as mentioned in the last post, my project for this summer would be to write a device daemon for the Openmoko platform. We already have neod offering keypad and power management, but its not that elegant. Hence I proposed a DBUS replacement as a SoC project which got through.

So, heres a pdf of the proposed *ahem* architecture. (Boy, I love that word. Sounds enterprisey). it looks a bit sucky since I did it using a touchpad, but hey, something is better than nothing.

I was looking at pulseaudio code for a while and liked it pretty much. So naturally, odeviced will borrow ideas from pulseaudio a bit heavily. My idea of odeviced is as follows,

  • A dbus service with support for loadable plugins.
  • These plugins can be arbitrary, from managing power, gps to controlling the uber secret laser katana in the FreeRunner (oops. I let the secret out)
  • And of course, some user space applications may want to know whats going on under the hood. So expose some sort of api from the dbus service.

Initially for the SoC, I will be working for full odeviced support for the FreeRunner, and maybe later on write plugins for other devices as well. Especially for the ones from Motorola.

For the implementation, here are the things I need to learn over the next month

  • Vala, its a cool language built around GLib.
  • DBUS, My experience with dbus is now limited to the tutorial code
  • Prolly some HAL and udev and touch upon the kernel stuff if need arises
  • …and *cough* to manage my time and write good code…

Heres the abstract of my proposal. Thanks to tuxmaniac, Casanova, techno_freak, tuxplorer, pygi and many more for proofreading my proposal which at the beginning looked like a love letter written by a 5 year old.

FossConf ’08

Totally screwed out for the last 5 days. 3 days of intense FOSS at Fossconf and internal assessments at College after that. What a week. I had Ub3rcool fun at fossconf meeting new people and matching irc nicks with faces, presenting a tutorial on writing python extensions and pygsmd, and of course voluntary work eating food which was provided to us.

I am feeling lazy to give a report on the event, which my fat elder bro has taken time to do so.

The best I can do is give you some links =).

http://flickr.com/search/?q=fossconf 

http://picasaweb.google.co.uk/tshrinivasan/FossConfDayOne

SMSHack…how not to design GUIs

I got to test some code in the neo and found that sms sending using pygsmd works quite well!!..Also I was looking for an opportunity to brush up my 2 hour stint with pyGTK which I had a long long time ago. What better reason than to create a dirty, scrawny, crufty, fugly GUI for sending SMS. Heres a screenshot of the GUI in action taken from the neo itself. It doesnt really follow any GUI guidelines (who would care at 2:30 AM)…When you click SendSMS, it calls pygsmd.sms.send() and sends your message..and when you click Quit button, the obvious thing happens.

screenshot-1.png

Oh there is also this another more better looking tool called SMSTool by alessandro, you might want to check that out as well if you want, it achieves its purpose in a weird sort of interesting way. It communicates with libgsmd-tool in shell mode through python subprocesses.

If anyone is willing to modify the GUI and make it look more humane, be my guest..It ofcourse depends on pygtk and its dependencies

P.S: SVN in projects.openmoko.org seems to be down. So I was not able to commit these example scripts.

Goofup: I did it again..The SMSTool is written by kriss and maintaned by alessandro

pygsmd-shell: Shell mode of libgsmd-tool in python

Got some sms and phonebook code in the svn, but not all. So once I had some bindings finished. I decided to write a sort of example script that uses our pygsmd module. libgsmd-tool have always been a friend of mine in knowing whats up with gsmd. Therefore to pay a tribute to my good “friend”, I came up with a python script that mimics ‘libgsmd-tool -m shell’. Of course since pygsmd itself is yet to be completed, the script is incomplete although functional. Its been a long time since I had written a real python script, so if its not pythonic, please comment..The script is already in the svn, so if you are interested take a look and most importantly test it out and extend it..=D

Heres a more sane version(88) from the svn

http://projects.openmoko.org/plugins/scmsvn/viewcvs.php/*checkout*/python-gsmd/examples/pygsmd_shell.py?content-type=text%2Fplain&rev=88&root=python-openmoko

And the screenshot of pygsmd-shell in action. Notice the AT commands in Phonesim to the right. And the screenshot of the script running in the neo.

pygsmd-shell     pygsmd-shell-neo

For pygsmd svn repository, click here

gnusim8085, kickass “free” 8085 simulator…

A big thanks to sridhar and the gang maintaining the 8085, Its around 12 midnight now and am studying for my microprocessor semester practicals. But my hand writing is next to shit, So bad that even I cannot understand it. To make matters worse I had to study from a record which was written in a hurry. Anyway all my mnemonics, opcodes in my record are messed up, so needed a way to properly sync up the two and learn.

Ah, thats where gnusim8085 is currently saving my arse. My buddies: tuxmaniac, slytherin, srid, I owe you guys big time. You have no idea how gnusim8085 is helping me right now.

Viva la Linux et FOSS!

Oh, got to study now, dang internet is addictive..Leaving you with a couple of screenshots showing a program of 16 bit addition..

snapshot1.png

The opcode listing…

snapshot2.png

Get gnusim8085 here

The packages are there in the repositories of gentoo, debian and ubuntu..so its only a command/click away.

Currently enjoying every moment of it. Man, I am getting goosebumps…

UPDATE: For those of you who wish to know how I did the exams, this should help to explain  scroll down that page..

Follow

Get every new post delivered to your Inbox.