2014-12-28

This post is about a peculiar problem with the UEFI firmware that ships with the Dell Vostro 3800 (or maybe just some of its variants). This problem shows up when you try to dual boot GNU/Linux along side a Windows 8.1 (maybe even 8.0). If you are never gonna dual-boot into Windows, this post is not for you. This post assumes that you understand UEFI to some extent and are familiar with the tools. This is NOT a step-by-step instruction set. If you screw up, its your own problem.

Symptoms and constraints (all of these must hold true):

You should be using GPT.

You should be doing native UEFI boot.

Secure boot should be disabled.

After installing Debian GNU/Linux (Debian Jessie, in my case) along side the pre-installed Windows, on the FIRST boot, you should get the Grub boot-menu.

From that boot-menu, if you choose "Debian GNU/Linux", your fresh installation should boot fine without issues.

When you reboot, and choose Windows from the Grub boot-menu, Windows should boot fine without issues.

When you reboot from Windows, you do not get the Grub boot-menu anymore. The computer boots into Windows by default. Basically, the first time you boot into Windows after installing GNU/Linux, your Grub is gone.

At this point, boot into rescue mode using the Debian installer CD/USB/*. Choose your root partition, etc, and get to a shell. At the shell, do "efibootmgr --verbose":

There should be an entry for "Windows Boot Manager"

There
should be an entry for "debian". But this entry will not have a "HD
path" after the "Vendor" part (compare with the "Windows Boot Manager"
entry).

Delete the invalid "debian" entry.

Add a valid entry for Debian.

Reboot, hold F2 and get into the "firmware setup" (AKA BIOS setup). Go to the "Boot" options. The setup screen will not list any operating systems on your 'hard-drive'.

If you continue to boot, the computer will boot into Windows.

If you reboot into Debian installer's rescue mode and check the NVRAM using "efibootmgr --verbose", you see that problem in (8) has returned.

Now the explanation : The UEFI firmware on the mother-board is buggy. When there is more than one boot entry in the NVRAM, it gets confused.

Before you installed Debian, "Windows Boot Manager" was the only entry, and the setup-firmware would have shown you that.

Then when you installed Debian, 'grub-install' would have removed all NVRAM entries, and configured itself as the ONLY boot-manager because it knows how to load everyone else. So, the setup-firmware would have shown you "debian".

When you boot-up Windows for the first time from Grub, Window's boot-manager got annoyed to see that it was not there in the NVRAM and adds itself there. It also sets itself as the default. Now, at this point both "Windows Boot Manager" and "debian" are listed in the NVRAM. But the "debian"entry got munged somehow (Not sure whose fault it is, the firmware or Windows).

When you setup a valid entry for "debian" the UEFI-firmware did not understand it and therefore resorted to booting the default boot-manager in "\EFI\Boot\boot64.efi", which in turn loads the "Windows boot manager" in "EFI\Microsoft\Boot\". And, in the process the "debian" entry got munged again.

In [1], there is a suggestion to install rEFInd for a similar problem. However, that will not work either. Coz, when windows loads up, if there is no "Windows boot manager" entry in the NVRAM, it'll install it. So, at any point there has to be two valid boot entries in the NVRAM. And, the UEFI firmware is having a problem with that.

The fix: Tell windows that Grub's boot-manager is its boot-manager. You can do this using:

bcdedit /set {bootmgr} path \EFI\debian\grubx64.efi

Once you do that, "Windows Boot Manager" (which gets chain-loaded from Grub) will ensure that the Grub's UEFI file is listed as the boot-manager in the NVRAM. So, you'll get the Grub boot-menu always :)

2014-12-07

Last year, I was euphoric when I crossed that finish line at "The Wipro Chennai Marathon 2013". I had no expectations when I started. The whole 'full marathon' subscription itself being a mistake, I was just glad that I could crawl to the other side in one piece. I also made a conscious note that I'll be in better shape next year.

This year (at TWCM14), the goal was to finish fairly comfortably. To be able to walk normally after crossing the finish line. I did not have any timing expectations. However, in the end, I felt completely defeated and broken. Inspite of all the buildup up to the run, the cramps returned with a vengeance, like clockwork, at 32k. The last 10k was an ordeal of getting my legs to listen to the brain. Yes, I was hydrated. Yes, I was well-fed on the right stuff. Did the icing, the spraying, the stretching. Nothing helped. The take-away is:

Respect the fcking distance.

"If you could do 30k comfortably, you could do 42k" is utter bullshit. If you want to do 42k comfortably, you should be able to do 50k comfortably on a training run.

2014-04-30

Lately, I am being told that "Model driven engineering" is the future in Automotive (and also various other Industrial automation fields). That, it is the standard (apparently) to which most of the industry has already moved. Basically means, "goodbye y'all embedded programmers".

While I clearly see the potential theoretical benefits, I cannot oversee the fundamental flaws in the approach. Every single tool vendor out there, who provides an end-to-end solution, ensures that you are locked in firmly and deeply. This lock-in starts from software and goes all the way to the hardware. Simply put: You cannot model with one tool, generate code with another, and use commodity hardware to verify/test the model with the actual hardware. Heck, you cannot even version control any of this with a tool of your choice. You'll have to go back to folders named "version-1", "version-2", etc.

None of these tools come cheap BTW (~50 Lakh INR to get the whole chain to work, apparently). That creates a huge entry barrier in terms of sheer capital investment. That automatically puts the target industries out of reach for most start-ups. The main driving force (as I understand) seems to be "testability". The industry does have many fancy terms to call the different facets of this (verifiability, traceability, ..), however. Its all the same old story anyways.

While the rest of the software industry has dealt with this quite well (we even got JavaScript testable, duh!), these particular domains are looming in darkness (or so it seems). Maybe I am wrong. Maybe my sources of information are wrong. But this does bring me to an important decision point. If this is how it has to be.. then I have choices to make. The knowledge that I can walk away (like its not my fight to fight), does feel gratifying. But I am not going to ignore that the problem does exist.

The need of the hour, IMHO, is a community that can break this market up so that there is fair participation and true innovation from all ends. I am talking ~10 man-years of development work. Sorry, its not my fight. My bread and butter is a work-in-progress (literally).

2014-03-01

"Running shoes" are not the easiest to pick. You got to look through the options, do the research, find the right one, flirt with it to see how it responds, then take it out on the roads, until it finally blends in and it becomes "THE" shoe. It is like getting married. The random idiot who flicked my last pair, obviously wont see all that love that had gone into it. With the shoe gone, I was forced into the searching-flirting-dating-marrying cycle once more.

The ordeal of dealing with "over enthusiastic" salesmen should not be under-estimated. From "stability" to "bounce" to "support", the salesman will throw "vendor taught jargon" all over you. You know it well, that no matter what the price, what the jargon, what the technology, the shoe will eventually fall apart after 1000Km. If this is the 5th pair of shoes you are picking, you obviously have learnt it the hard way that, it does not fcking matter. Your opinion could vary depending on the type of snob you are. For me, the only things that matter are:

Price

Minimum heel to toe drop

Roomy toe-box

Durability

(4) is THE most important. Because, I really dont have the patience to go through another round of the searching-flirting-dating-marrying cycle.

Armed with a decent bit of research on the models that fit my criteria, I hit every showroom of every vendor in Madras. Realisation dawned pretty quickly: "Big vendor shoes aint cheap. The base price is ~4K INR. At that base price, you get something that feels straight out of a plastic compression molding machine". And none of them fit my requirements (2) and (3). So, in spite of coughing up a lot of money, I should still compromise.

I am not in terms with the idea of buying clothing/apparel/shoes online. Given the situation, I decided to give it a shot anyway. Saw a well reviewed shoe on a discount sale on Flipkart. Before I could think twice, made the jump. At ~2.8K INR, the "Merrell Mix Master 2" fit my requirements (1), (2) and (3) perfectly. (4) should be figured over time.

2013-09-19

Early on, I figured I need a watch that "Just Works (TM)". The search took me to my first "Timex Ironman Triathlon" digital watch. And, work it did. A beautiful piece of art, it is. It bore the rain, the sweat and the shower. It bore the drops and crashes. It bore it all. Until one day, three years later, the battery drained out and I had to change it at a service center. The next day, the watch died after a dip in the bay of bengal.

The service man had not fit the back cover properly after replacing the battery.

After the swearing, yelling and crying, I went over and got myself another "Timex Ironman Triathlon". Which ended with the same fate two years later. So, I went for it again the third time. This time it lasted 5 years and died because of the same reason.

Yes, my next watch is also going to be the same "Timex Ironman Trialthlon". But this time, I am gonna buy the necessary tools to fix the battery myself. I am fed of unskilled idiots ruining my happiness.

2013-08-17

2013-08-10

Lately, Mr. Rahul Gandhi, the heir apparent, (apparently) stated: "Poverty is just a state of mind. It does not mean the scarcity of food,
money or material things. If one possesses self-confidence, then one can
overcome poverty". And, the whole of India (online/offline/in-the-restroom) blew up into a state of anger calling it a "mockery of the poor". But no one really thought about it twice. No one really did.

Yes, I am looking at this from my shoes. And, I think it fits the argument. If you take a casual stroll through the streets of Madras, you are bound to bump into atleast 10 beggars (taking an optimistic count). You can easily classify them into:

Old people

Differently abled people

Children

Homeless able bodied young people

The distribution of the "under poverty line" people in the above categorisation is (honestly) unknown. For the sake of argument, lets assume there is an equal distribution. That means, 25% of the "under poverty line" people are "homeless able bodied young people". Now, what do these people want/desire/expect in their lives? A car? A fridge? A house of their own? A fancy gadget? A fancy lifestyle? Top of the line fashion clothing? NO. They want three meals a day, clothing enough to clothe, a shelter enough to shelter.

A day of "construction labour" fetches 350 INR a day. And, Madras has enough construction happening, that you have a job for the next 10 years. Walk into the closest "Amma's mess" (government subsidised food joint) and you get three meals for less than 30 INR a day. Throw another 50 INR on public transport travel and such. And, another 20 INR for sundry expenses. You still save 250 INR a day. For 5 days a week, and 4 weeks a month, you get to 5000 INR a month as savings. Figure the rest.

Yes there are exceptions to the rule. But, how many are the exceptions? The exceptions are hardly 5% of that 25%. If that 25% were productive, imagine where the rest would be? YES, "poverty is a state of mind". One can sit there on their asses hoping for the world to save them, or move it and save their own. Its their choice. Its their state of mind. So please, for hells sake stop your dramatic emotionalism and move on. Period.

Edit 1: The "construction labour" is just one of the many examples. There are so many other such.