Friday, February 6, 2009

One down, one to go!

During my recent success in helping to free one device from the dark side ground work was being made to free my current phone, the AT&T Tilt. Feeling up to the challenge I jumped on board with the few adventurous souls. The Kernel was still in a very young stage and as such not many of the drivers/devices were written or working.  

I began looking for something I could tackle with my limited kernel hacking skills. It didn't take long for me to decide where to work, it would be the touch screen driver. After all, I had already poured over the assembly code for the touch driver in Windows when I worked on the TouchFlo!  

The project actually wasn't as rough as I thought it would be to get the device working but it was a lot hard then I thought to fine tune the precision. That is a task that I think will be worked on for quite some time.  A professor that goes by the name "dzo" on the #htc-linux IRC channel was successful in getting Linux on his elf which is a very similar phone to the Tilt.  I was able to take the driver he made for it (which he modified from another driver) and modify it so that it worked for my phone. 

I continued to work with the group for quite some time but eventually I had a falling out with some of the members on the chat channel (a Linux user who had no coding background) and it drove me to washing my hands of the project. Still, I hope to see a fully working Android OS on the tilt someday soon.

Circa May 08

Tuesday, May 13, 2008

Down with the Big Bad Wolf!

Not too long ago, Google announced it will be getting into the cell phone industry with its newly acquired product Android. As I'm not a big fan of Microsoft's (or Apple's for that matter) business practices I was excited to see this come out. Google's design stated that it could run on a variety of devices and that they expected to see the first devices out in late 08. Further research revealed that Android was actually a VDM that ran on top of a Linux kernel and Google has been expanded the Linux kernel to work on the new MSM7X00A architecture. This was great news to me as my current phone (AT&T Tilt) ran the MSM7X00 architecture.

I wanted to be able to free my current phone from Gates's grasp but I had little to no Linux porting experience, and on top of that their was nobody working on port Linux to the Tilt at the time. I knew that I'd have to start from scratch and slowly build up. At my work there was an extra HTC Wizard phone that nobody was using and I found a fairly active Linux development community for it here. This would be my launching point, they had managed to get Linux running on the phone but after recent updates the kernel no longer booted.

With the help of members there I learned how porting works and what needed to be done. I remember at times feeling very frustrated looking over the code. I had never taken a operating systems class at college and I was regretting it now. So much of it was so unfamiliar to me, and not being a Linux guru left me very frustrated.

Finally I decided to start from the top. I found what lines of code the CPU executed first and began following the assembly from there. I had already had experience with ARM assembly from the TouchFlo project so this was more familiar to me.  Once I broke the problem down to the smallest parts I was able to divide and conquer until I found what was causing the Kernel Panic.

Seeing that TUX logo finally come up on a device intended for Windows Mobile is a blessed site!

Circa March 08

Passing the time

Back when I was at the U I'd pick up the local newspaper and bring it with me to my classes. I'd usually glace over the news then turn to the puzzles. My favorite was the cryptograph; it consisted of a phase encrypted using a simple letter substitution. The goal was to decode the phrase without knowing the key.

Now, I find myself stuck in meetings without a newspaper to help keep my sanity. Wanting to bring back that simple time passing fun I wrote the game for my phone. This time I used C# and designed it to work on any device with a touch screen or full keyboard. It pulls from over a hundred phrases and randomly encrypts them so you'll have hours of new puzzles.

I had heard about a site where you could sell your programs and for a fee (40% of retail). Looking back it's not much of a deal but hey, getting a few bucks for something you had laying around always sounds good. Here is the listing for my game on their site, it's not exactly a top seller but I do get a few takers now and then :)






Circa Jan. 08

Friday, May 9, 2008

In the Flo of things

I recently received a new mobile phone the AT&T Tilt. After getting my device I was poking around the XDA Devlopers forum and saw many people who wanted to know if the TouchFlo cube shown below could be put on their phone.
video

I quickly gathered that the app interfaced directly with the touch screen device driver. As you can't just copy a device driver from one phone model the another and expect it to work many people were trying to find a workaround. On man who goes by eFrost developed a TSR that detected finger swipes but didn't know how to interface with the cube app. Kona_Mtbkr had found a way to interface with the app but it was only haphazard working and depended on loading a number of executables in a very precise order.

This is the point where I decided I'd jump in. The project seemed to be waiting for someone to just reverse engineer how the device driver worked. I'd loved working in assembly in my classes during college and missed having that sort of challenge. I started by comparing the touch.dll found on my phone with the one that works with the cube. By doing so I found out how the two interfaced and was able to put all the pieces together using a simple C++ proggy of not more than 50 lines. The cube would then work not only with my phone, but in essence any WM6 Professional phone.

At first Kona_Mtbkr wasn't too happy with my findings as he had been working on getting something to work for quite some time. Once he realized that I didn't really care for the credit and that I was just after a working app, he was much happier and since then has expanded its functionality beyond what HTC originally designed it for.


Circa Nov. 07

Stirke when the time is right...but when's that?

Here's the situation, back with the release of WM5 Microsoft declared GAPI depreciated in favor of their DirectDraw Mobile and DirectX Mobile. Most all games on the Pocket PC up to this point were written using GAPI. Now, with the release on WM6 coming within a month or two will GAPI still be supported? Following Microsoft's track record I thought they might just pull the plug on it. This left me with what I thought was a great opportunity to seize the market. Unfortunately, Microsoft never did away with GAPI and I never stole the market :(

I did however design a great 2D graphics engine for the PocketPC using DirectDraw. It was a fun experiment where I started from the ground up; the whole thing done in C++. The engine doesn't have too many advanced features, but that's mainly because of the limited abilities DirectDraw Mobile has. GAPI by far out powers it in terms of speed and abilities, but like always Microsoft spoke and it was. DirectDraw as it turns out was a technology used on PCs during the late 90's. It was dropped with the release of DirectX 8 back in 2000. Because of this I was able to get a programming book for $2 and use it to base my work off of.

I also started writing a rts game with the engine but it never finished once I found out GAPI was still around. The engine used graphics from the Lost Garden. As a coder and not a graphics designer it's always nice to see some quality work freely available. The rts it self required much work to keep it running at a decent speed on these smaller processors. It quickly became apparent why most games were written using GAPI and not DirectDraw. I avoided using alpha transparency like the plague. It often felt like I was writing code for a PC from the late 80's and in a way that wasn't too far from the truth. After all, these Pocket PCs only have 200MHz processors on most of them and little to no hardware accelerated video. Path finding proved to be a CPU hog, even flocking and A* routines brought FPS down to the single digits.

In the end interest died off and the project was abandoned. Who knows, maybe when WM7 comes out Microsoft will drop GAPI like they have threaten to do for years now. If so this project may find itself rising from the grave...




Circa Sep 07

Geocaching from my phone

Over the summer I discovered Geocaching and started to get excited about it. The only problem was that the GPS unit I had was a BlueTooth device that required a laptop to work. I wasn't about to wander around parks with my laptop out and staring at the screen so I found my own solution. At the time I had a windows based smart phone (Cingular 3125) that supported BlueTooth. What I didn't have was a way to interface with my GPS from it.

Hence, the Geophone. This little gem allowed me to go geocaching with my GPS in my pocket and phone in hand. I wouldn't look as conspicuous wandering around looking for caches. People are always texting as they walk and so was I, or so it would look.

I wrote this one in VB just because I wanted something quick. It interfaced with the GPS via a BlueTooth serial port. The program kept a list of way points in an XML file and plotted them on the radar looking bitmap. The way points could be added by current location, manually, or by downloading them straight from the geocaching website.

Learning to write programs for the smart phone was a joy. Microsoft provided great SDKs to get started with (one of the few things they do right). Dealing with the small processor meant making a lot of graphics coding optimizations but because I had be playing with a 3D graphics engine prior to this optimising this was not a problem.

I haven't passed this out to a lot of people but I have tried it on a number of devices. It runs on ether Smart Phones or Pocket PCs. It also works on devices with GPS built in. If you are interested in having this please email me



Circa July 07

Metal Gear 0.1 (The three bored college student version)

For a final project in Computer Science we had to work as a group to create a program. Having played with the irrlicht engine a lot now and having an interest in making games, I talked my friend Tom into writing a game for our senior project. The only problem was we didn't have much of an idea for the game we wanted to write. Tom, having just played one of the Metal Gear Solid games on his PlayStation wanted to write something similar to that. What we ended up with was something that resembled a early metal gear clone.

The name of our group was Imanok (Konami spelt backwards) and are main character was the main character from metal gear with some slight modifications. In my mind there was a lack of creativity here but that didn't matter. Tom fell in love with the project and did a lot of the work himself.

The plot was to move from room to room with out bringing attention to yourself. There were guards patrolling each level and if they saw you then they'd try and catch you. Tom wrote the code for the AI along with the code for rigging events. I must say that the AI responded just as good if not better then some of the AIs I've seen in modern games.

My role was in the game and menu systems and play/camera control. John, our third member was in charge of audio and most the level design and loading. During this project I ended up making a few modifications to the irrlicht source engine that are now in the main repo. See here and here.

When it came to the end of the year and was time to show off our work we received some high marks. Our game was rated the best game written that year and we each one a "actual" game from EA along with some names and places to work if we were interested in continuing to work on games.



Circa Jan. - May 07