Thursday, August 28, 2008

Finally fixed the driver

The only thing worth going through the painful process of fixing a complicated problem, the kind of problem which keeps you up at night and makes you dream of code and unfathomable journeys through memory space filled with pointers and addresses, is that when you finally solve it you feel that much better.

In "One of those weeks" I told you about a problem that I was facing where a particular memset call was producing access violations, even though the memory was mapped and should have been accessible. I stayed in my office yesterday until 9pm and banged my head against the screen a few times before I figured out the problem. I started the driver and while booting I saw in my debugger window in Visual Studio something that caught my attention. I saw that instead of the driver been loaded at an address which I expected it to, it had been shifted a little (I almost couldn't help say a 'bit'). This shift caused the whole loading process to shift and so our memset address got shifted and ran out of bounds.

I set the expected address to the address where the driver was actually loaded, and lo and behold it worked. This is a problem that I was able to solve but just as well might not have since it was so difficult to identify. This brings me to an important point. Sometimes especially when things do not seem to work and we try every possible solution, just like I had tried--I changed the address, re-mapped the address, checked the buffer size, every test that I made suggested that the driver should work--then the best way to proceed is to throw all of your knowledge, your instincts, your results, and most importantly your assumptions out the window and question your initial assumption which might have shifted your whole problem astray. Sometimes the solution to the problem does not lie within the intricacies of itself, but rather within the context in which we are trying to solve it. In my case, the driver itself was correct just like my tests were showing, and the mapping was done perfectly. To keep investing time in debugging the inner works and magic of the driver would have been to waste it. Instead, taking back a look at how the driver itself is loaded into memory and question whether this process was correct, yielded the right answer.

The other thing I like about solving difficult problems aside from the feeling of confidence it gives balancing the sessions of self esteem bashing, is that it has a humbling factor. Difficult problems serve to show us that no matter how much we think we know, there is always more for us to learn, by researching and from others.

And no, I did not scream I am king of the world.

Thursday, August 21, 2008

One of those weeks

I have been having one of those weeks where nothing you throw at the intellectual world seems to work. You know, those weeks when your neurons seems to say 'see ya fella' and go on vacation. I have been working on this port to WINCE6 and it's been pretty much hell from the beginning. I have never seen so many problems together, all caused by bad memory mapping. The only good thing about the sleepless nights and the self esteem bashing of not being able to solve the problems, is that when you do, you feel like the king of the universe, and like DiCaprio you run to the balcony in your office and climb on the railing and yell "Im king of the world!"

Yeah... I don't do that either.

Well, this past week it's been like the first part of that odyssey of which I spoke. I am having a problem where a simple memset call render an access violation, even though, the address is mapped. I have thrown everything I have at it, and the damn thing just won't work.

I am the kind of person who can't let a problem go. I can't just move on to something else. For the past three nights I have been dreaming of pointers and disarray. I hate memory mapping.

I remember the school days of a year a go and it is only now when I can appreciate the difference between schooling and working. While in university I maintained that you feel more pressure in school because you need to get that degree, after that, work was almost a given. But first you needed to achieve that position. While true, the one difference which I did not realize back then is that in school you seldom have to do 100% of the work. I remember in my operating systems class our FIFO prototypes and memory mapping exercises would only work on certain days of the week, and if Mars aligned with Jupiter, but not with Pluto, which then was a planet. In our networking class, our clients and servers would not communicate past the three way handshake, but we still got B's and you can pass with a B.

In the real world however, much to my surprise the software needs to work everyday of the week no matter where Mars is; madness!

Sunday, August 17, 2008

Software on the 51st floor

Last night was a pretty interesting night. I went to Cirque du Soleil at the Air Canada Centre home of the Toronto Maple Leafs, The Toronto Raptors, and any other event too small to fill the Rogers Centre, or as previously known the Skydome.

The show was stupendous. I can honestly say it was the most professional and electrifying circus act I have seen in my life. The juggler juggled from 7-9 balls and bounced them around his feet at speeds almost too high to see clearly. But the best performance in my opinion goes to a guy who played a joyful boy. The act was a crowd interactive piece with a mixture of sound effects he made with his mouth and mime gestures which brought the better half of the spectators to tears with laughter. He even made a guy get up from the crowd and jump around, and pretend to be in a western duel from the times of the wild west. I would recommend it to anyone with a chance to go see Cirque du Soleil, extremely entertaining.

The show began at 7:30 pm and ended at around 9:00pm. It was a beautiful night for walking in downtown Toronto. It wasn't too cold and the sky was clear and if you squinted long enough you could even see a star. We walked south on Bay street for about two minutes to the parking lot behind the Gardiner Expressway on Bay and Harbour. The mass exodus from the ACC seemed to carry us with them towards the overcrowded parking lot. From behind the elevated highway running over the parking lot the CN Tower rose in its exuberant red and white glow, to its right the TD Waterhouse tower seemed dwarfed and merged into the skyline.

It was early so it meant we had time to meet my fiancee's friend and her boyfriend which had been meaning to get together with us for a while. We drove north on Bay street to Bloor street where we found parking in an underground garage for 12 dollars, plus the 20 we had previously paid meant we had already spent 32 dollars on parking space. If that doesn't make you want to ride the subway, I don't know what will! We parked in the Yorkville area which is filled with extravagant bars and expensive clothing stores. In every corner it seemed there was a patio filled with people dressed in suites and women in night dresses all drinking wine and eating oysters. We walked to the Menu Life Building which houses one of the bars with the best views in the area. Panorama and it's situated in the 51st floor right at the heart of downtown Toronto.

It was my first time going to Panorama, but right from the elevator I knew it was a peculiar type of bar. There were only two buttons, second floor, and 51st floor- pretty specific I would say. I guess since it's a bar you want to give drunk people less options and ways to get confused and wandering lost inside a 51 story building. We pressed the obvious choice and twenty seconds later we were 51 stories high and our ears were popping. The bar looked nice, with dimmed romantic and accented lights at the corners of the walls, mahogany tables and leather couches. My fiancee spotted her friend sitting in the patio, yes that's right a patio in the 51st floor. The patio had couches and reclining chairs, and you could see the whole of Toronto. The CNTower, the TD tower, the CIBC building, Lake Ontario, and the breeze was fresh as could be.

After the courteous introductions I ordered a mojito-which just so you know was amazing and about the best mojito I have had- and almost treacherously and unexpectedly the very dreaded question popped up.

"So what do you do?"

I realized I had been asked a question but gently dodged it and continued to drink my mojito and enjoy the view which by now included a school of seagulls and loonies flying inland.

"Ken, he is asking you what do you do" - That was my fiancee nudging me with her elbow.

Ahh, love, a beautiful thing.

Gina's boyfriend Mark, an entrepreneur, business major, and very proud of his accomplishments asked me what do I do.

About what, was my natural answer after Red Foreman from That 70's Show.

Perhaps to many people including other computer scientists this question is not such a big deal. To me however, it is not a question I want to answer while nursing a very expensive mojito at the edge of the universe. What I do is write and test graphics drivers for embedded systems, this includes safety critical system like aerospace projects (Airbus A380), or other non safety critical systems like GPS gadgets for cars and such. But if I begin to explain that I am in the graphics world of computing I can almost guarantee that I will be asked to photoshop a wedding picture for them.

Then what can I say, I wondered. If I say I am a programmer (though I don't like that because it's over simplifying what computer science is, and what I do) then I'll be asked what areas of programming I like most, just like I am always asked. And then, when I say that I prefer the low level side of programming they look at me with soggy eyes and pouting lips, as though saying awww I'm sure if you try hard enough one day you could do higher level stuff.
One thing I find funny is that people cannot get over the fact that low level and high level have a completely different meaning in the world of computing.

I looked at him straight in the eyes and said.

"I work at PizzaHut"

My fiancee pinched me hard in the ribs and still hurts, and I continued to drink my mojito.

Welcome!

Hello there and welcome to the launch of Software, and a little more. In here I will be talking about the software life cycle and every little aspect I can think of regarding the software development process, which includes donuts and a little secret I'll let you all in on a little later (includes a magic dance) .

As a computer scientist I see the science of computing (I bet you didn't see that coming) as a little more than math and science. To me computer science is an art, and as such this site won't be about the needy greedy, boring, nerd seeking, geek infested bits and bytes composing the software world. Instead, my goal is to speak of the world of software making from a much higher level, which includes dealing with management, dealing with customers-this is always a fun subject if you haven't had the joyous opportunity to have experienced it already-and meeting impossible deadlines.

As the title implies this blog will be about Software, and a little more... In the "a little more..." portion I want to include everyday life anecdotes which might or might not directly relate to the software building process, but who cares, it'll be fun and interesting. After all I'm lots of fun, really, you should all meet me. I will try to write as often as I am able to. But I have promised myself that I will update this blog at least twice a week.

Thank you all, and I hope you enjoy the blog!