Dual booting Debian Jessie and Windows 8.1 on Dell Vostro 3800

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):
  1. You should be using GPT.
  2. You should be doing native UEFI boot.
  3. Secure boot should be disabled.
  4. 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.
  5. From that boot-menu, if you choose "Debian GNU/Linux", your fresh installation should boot fine without issues.
  6. When you reboot, and choose Windows from the Grub boot-menu, Windows should boot fine without issues.
  7. 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.
  8. 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":
    1. There should be an entry for "Windows Boot Manager"
    2. 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).
  9. Delete the invalid "debian" entry.
  10. Add a valid entry for Debian.
  11. 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'.
  12. If you continue to boot, the computer will boot into Windows.
  13. 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.
  1. Before you installed Debian, "Windows Boot Manager" was the only entry, and the setup-firmware would have shown you that.
  2. 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".
  3. 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).
  4. 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.
  5. 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 :)


Respect the fcking distance

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:
  1. Respect the fcking distance.
  2. "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.
  3. And again, respect the fcking distance.
So, forwarding the same "comfortable finish" goal to the next one.


I cannot digest "model driven engineering". Sorry.

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).


running shoes

"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:
  1. Price
  2. Minimum heel to toe drop
  3. Roomy toe-box
  4. 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.

Its been ~80Km.. the shoe is good :)