Monday, August 19, 2013

How to Boot From USB in Laptop

Warning: Do at your own risk

Laptop on which I tested this is:
Manufacturer: Samsung (Series 3)
BIOS Manufacturer: (AMI) American Megatrends, Inc.
BIOS Version: P07AAL
Test Image File for booting: Fedora-Live-Desktop-x86_64-19-1.iso





Note : While Performing these steps your pen drive(flash drive) should be plugged in or it won’t be visible in BIOS. If these settings does not work for you, try again but make sure you have plugged in your usb device in your laptop.
Please also note that NTFS formatted pen drive didn’t work, at least for me. So, I used FAT32 file system.

Prerequisites:
1.      A laptop, with AMI bios
2.      A pen drive made bootable using any good usb boot maker software.

Settings that needs to done
0.      Open BIOS
Press F2 key, when your laptop manufacturer logo appears(before windows start-up)

1.      Set ‘Fast BIOS Mode’ to DISABLED











Go to advanced tab using Left/Right arrow keys and then in advanced tab highlight (select) option Fast BIOS Mode and press Enter and select Disabled.
>>Now save your settings by pressing F10 key, your system will restart, open bios again (see step 4 for ‘how to save’).

2.      Set UEFI Boot Support to Enabled

Go to boot tab and select UEFI Boot Support to Enabled (see snapshot).

3.      Now Set Boot Device Priority

Select Boot Device Priority from Boot tab

Then, select Hard Drive BBS Priorities

After that, move your pen drive to top most (using + key from numpad) (in my case it is SanDisk Cruzer Blade 16GB, FAT32 filesystem)

4.      Save your settings

Press F10 and select Yes, press Enter

If you had done all these settings correctly, then after this point your system should boot from pen drive automatically. If it doesn’t then try these steps
-->Restart your system (with pen-drive plugged in)
Press F10 key immediately, when your laptop manufacturer logo appears (before windows start-up).
Now, you will be provided with a list of devices you can boot from, select your pen-drive from this list.

If your pen-drive is not in the list recheck your settings (make sure your pen-drive is plugged-in to laptop).
Or, If your pen-drive is listed, you select it, but it still fails to boot from usb then try using any other usb boot maker software or any other ISO image for booting.


Monday, October 1, 2012

Tower Of Hanoi Game in C with Code



TOWER OF HANOI GAME IN C


5 Feb 2012, I thought to develop a game, Tower of Hanoi. But I had a problem; I didn’t know much about graphics programming in C. Since I had decided, I was not in a mood to drop this project only because of graphics. There are other ways to make a game, i.e text based game which uses ASCII characters to display game. Actually this isn’t my first text based game (I have a collection like Sokoban, Bollywood Film name GuessGame, MindReader, Tic Tac Toe (GUI,CUI both) and many other programs.) but the first one that I am sharing with you.
 
I hope you know about ‘Tower of Hanoi’ game and its rule. If not, then read it in brief.
In this game you are given with N number of discs and 3 towers; say A, B and C. These N discs are arranged in increasing order of their diameter from top to bottom. If all discs are in Tower A then your goal is to move all the discs in Tower C using auxiliary Tower B. Restrictions to play and win this game are
  1.)    To win this game you must place all the discs in Tower C.
  2.)    You cannot move a disc of larger diameter onto a disc of smaller diameter in any of the towers.

Features of my Tower of Hanoi game:
 
  1.       Supports upto 8 disks (limited to 8 because of limited screen width).
  2.       Allows you to play.
  3.       Move discs in animated way.
  4.       If you fail to solve a game, you can let this game to solve it for you.
  5.       Source code is available for learning purpose.

In this game I have used Stack data structure, which is not strictly implemented. At few places in code I have used stack like an array (i.e. fetched data without using pop function of stack). I have done it just for my convenience.

Screenshot of ‘Tower of Hanoi’ game. (Download zip)

Program when running