Saturday, March 14, 2009

Intro to BIOS Hacking

BIOS Hacking 101
Do you ever get tired of having to go into your BIOS Setup and reset your favorite tweaks every time you have to do a "Clear CMOS"?
If you answered YES, then pay attention. You are going to like this one.If you answered NO, pay attention anyway. One day you might want or need to use this.
Disclaimer:Hacking your BIOS file can result in your mobo not booting if you mess up.And if you do mess up, don't come crying to me or ERT.But if you post a Question in the HARDWARE area, we will see what can be done to get you up and running again.You have been Warned!!Now back to living dangerously.
I guess I should start with the WHY
When setting up and tweaking (aka: overclocking) a motherboard, it sometimes becomes ...ummmm.. necessary to Clear the CMOS, because it didn't like what you did and will not boot up.And while this is not a big problem, it can be a pain if you need to do it a lot. Because each time, you have to go and reset a few settings so your hardware will work right.Things like which kind of video card it looks for first, the drive boot order, and power management on/off.
But the reason I got into this, was because the onboard lan (network interface) on my K7S5A rev.3.1 mobo (mentioned in the BIOS flashing-Overclocking Fun article) kept disappearing.I mean, one minute it was there. And the next, it's GONE. Not even listed in the bios anymore.
After tail-chasing for several hours, I finally figured out that when the nic chip warmed up, it just quit working.Yeeee Haw. Trash can parts can be so much fun. : /Luckily the fix is easy. Just Disable the onboard lan, and put in a PCI nic.Unluckily, I was still tweaking the hardware, and having to Clear the CMOS regularly. Which meant the onboard lan was reenabled in the Default setting, and had to be changed (if I could find it) before I could let the floppy/cd rom/hard drive boot to whatever utility I was wanting to run.That got real old, real fast.
Then one night while searching the K7S5A mobo pages, looking for better info on what some of the bios settings did, I saw a link to the AMI BIOS Editor.Just what the doctor ordered!And being a small download, I wasted no time in getting it tucked safely away on my hard drive.
Before diving in...
...a few things it might be nice to know.
for this project, I am using amibcp75.exe - the AMI editor
different bios's call the default option different things. Another name is "Fail-Safe". The same goes for the best-performance setting. So make sure you know what you are changing. Amibcp75 uses "Fail-Safe" and "Optimal".
This bios editor is a DOS program. And while I only had a problem viewing one bios file running DOS under W98, the rest of the ones I looked at worked without problem..
You might want to stay with the old 8 letter limit for naming the files and folders. DOS doesn't like long file names, and if you need to use a DOS Boot Disk, you can find the files easier. And you need to keep the same 3 letter extension the flash file came with.
It seemed to work fine under W2K Pro SP4.
I have not tried it with XP, or with a hard drive formatted with NTFS. DOS is very stupid when it comes to NTFS. I did see one site that had XP on the OS list.
If you run into trouble, you will probably have to use a "clean" W98 boot disk, and run things from the floppy drive or a Fat32 partition on the hard drive.
Fire it up
After dl'ing it, unzip the program to a folder, and double-click the .EXE file.Since this is a stand alone program (no files are installed to Windows), you can put it on almost any kind of drive, as long as the OS can see it.
When the program first runs, it will give you a text box to type in the bios file you want to edit.If you were smart and put the file in the same place as the program, just type the name. Otherwise you will need the complete path to it. Then hit ENTER, and the text box will go away and you will see 11 menu choices.The interface is nice and clean, with a list of all the keystrokes you need to use it, plus a description box, lined up along the bottom.
The Menu choices are:
Load BIOS from disk file
Save BIOS to disk file
Edit BIOS Modules
Edit PCI IRQ Routing Tables
Edit Register Tables
Configure Setup Data
Configure Setup Client Item
Configure BIOS Options
Configure BIOS Features
Generate Reports
Exit Discarding Current Bios
The LOAD and SAVE options
Pretty straight forward.LOADS another bios file if you loaded the wrong one at the start, or want to work on a different one.And SAVES the bios file after you have tinkered with it. Don't forget to give it a different name.
The EDIT menus
The 3 EDIT menus are probably the most dangerous ones in the program. Even a small mistake here can make your bios:- a little flaky.- a lot flaky.- a total vegetable
If you want to look in them, that will be OK. But unless you know E*X*A*C*T*L*Y what you are doing, DON'T PLAY IN THERE!They are full of memory address vectors, device ID numbers, and other assorted things (mostly in Hex) that the bios needs to work.
That's all I am going to say about that.
The CONFIGURE Menus
I am going to describe the 4 CONFIGURE menus in reverse order, because the main one I need to mess with is the 1st one (Configure Setup Data). Depending on when your bios was made and what mobo it is on, it will most likely be somewhat different than mine, but this will give you the general idea..
Configure BIOS Features -- Not a lot in here. The BIOS information, and a way to set the ROM password and the text that shows up during the start of the boot sequence.hmmmmmm... Maybe I will change it from K7S5A PRO Release to something like:
Unauthorized Access! Break-in Alert Sent!
That might give someone a nice little adrenaline rush.
Configure BIOS Options -- Another one with not much in it. Turns on /off some more of the info that the bios shows when starting (like the cpu's speed), and which ERROR messages to show when there is a problem. Nothing in here I want to mess with right now.
Configure Setup Client Item -- Hides and Sets Permissions for different sections of the bios. My options are:BOTH -- SUPERVISOR -- ABSENT.
I think I will stay away from this one, also. At least until I do some more reading. It doesn't look dangerous, per se, but you could lock your self out of the bios. Or parts of it.Besides, all I mostly want to do is get rid of the wanky lan port. And it ain't in here. Next!
Changing the Default settings
Configure Setup Data -- Bingo! The Mother Load! The Holy Grail! Houston...We have landed!
OK. A little over the top, but you get the drift. This is where you make your computer different from everybody else's.
When I open this one, I get a sub-menu with 7 choices:
Standard SETUP. -- This just has the hard drive and floppy drive info. The Anti-Virus ON/OFF and Language settings. And the Memory count.I seem to remember that some bios anti-virus, needs 2 settings Enabled to work, so it might be worth the pain to rig it to run on the Fail-Safe setting and not with the Optimal setting. I need to think about that one some.
Advance CMOS SETUP. -- This has a lot of things to play with. It has 4 columns marked:ACTIVE - seems to be for setting what shows on the bios screens. Options are YES/NO. Might be troublesome if you change a NO to a YES, and the mobo doesn't know what it is suppose to do with it.RIGHTS - if using the bios passwords, Defines who gets to see what when in the bios. Options are Supervisor/Both.OPTIMAL - whether the item is on or off when you use the "Load Optimal Settings" key in the bios. The Options vary, but most are Enable/DisableFAILSAFE - Whether the item is on or off when you Clear CMOS, or use the "Load Failsafe" key in the bios. The Options vary, but most are Enable/Disable
In here, I want to Disable the QUICK BOOT in both FAILSAFE and OPTIMAL. I sometimes have trouble getting to the Enter Setup key fast enough.I also want to change the BOOT ORDER to Floppy - CDROM - IDE 0. At least in FAILSAFE. Since I boot to floppies and cd's a fair amount, I might as well do the same in OPTIMAL. I don't worry about shaving a few seconds off the boot time.
Let's see... what else is in here I want to change? A few things, but mostly the memory settings for OPTIMAL, so I can set up an one key overclock, once I know what the hardware will handle.
Chipset SETUP. -- CPU and Memory settings. 4 columns like above. I will leave FAILSAFE alone, and tweak the OPTIMAL for oc'ing
Power Management SETUP. -- Let's see... 4 columns again. I want to Disable the main power management setting in FS and OPT. And the power button will be set to ON/OFF, not Suspend!I can also tell it what to do if the electricity goes off. Stay off, Reboot, or Last State.
PCI/PnP SETUP. -- Not much in here. The Plug-n-Play Aware OS setting and a couple of Video card tweaks, if you know which card you will be using.Most of the stuff is for making the Slots use certain resources. If you don't need to mess with them, don't.
Peripheral SETUP. -- This one is for the onboard stuff. Serial/Printer/Game/Sound/USB, and there is the Lan setting I am wanting to nuke. WooHoo!Besides the onboard Lan, I think I will disable the modem, game port, and serial B (com 2).The USB I will disable in FS, and enable in OPT.
Hardware Monitor SETUP. -- This only has Voltages, Temperatures, and Fan Speeds. Don't need to do anything in here.
Generate Reports
I think you can figure this one out for yourself. Duh!
Exit Discarding Current Bios
This will EXIT the program and flush anything you have changed. So make sure to use the SAVE option first, if you want to keep all your creative endeavors.
When Good BIOS's Go Bad
If things do happen to go horribly wrong, and assuming you cannot boot from the floppy drive to try a re-flash with a good file, you still have a few options before you try to pass off a RMA, or toss it in the garbage can.
The first is if you have a mobo made in the last couple of years. Most of these now have a "second" bios to let you boot up enough to re-flash the cmos with a good file. You will need to read your manual to find out if your mobo has this function, and what you need to do to get it to work.
The next is to send the CMOS chip to someone that has one of those not-cheap machines, and have them re-flash the chip. Or sell you a new one. Along with the bios maker or the vendor you got the machine from, Mr. BIOS and WimsBIOS are good places to start for info on this method.Or if you can get your hands on a DOA mobo that is the same as yours, you should be able to use the chip off of it. The more exact the match, the better chance this will work.
The next method is known as a Hot Swap Flash. For this you need a working mobo the SAME as yours.First you boot the working system (preferably to DOS), and then Very Carefully take out it's chip, and put yours in. Then run the flash program with a good file.There are several good How-To's out on the web, and Google is your friend.
Parting thought
If you have one of those "Branded" machines where the bios is limited in what you can play with, these editors can give you access to the goodies. But I strongly suggest that you be at a level where you are comfortable with working in the bios, and have a good understanding of what the settings do. Mistakes are easy, and can be expensive.
When changing the Default settings, remember, the idea is to have it so the computer will BOOT UP when you move the jumper or take out the battery. So only change those settings you really need to, to make it work best for the way you do things.
The Optimal setting makes a good "one key tweak" to ramp up your system. But you should play with the bios settings before you flash a tweaked version to it. So you will know what settings, and by how much, your system will handle.
I haven't tried flashing a tweaked older bios version to the mobo, then a newer official one, but I suspect it will undo all the hard work. If you are using an older mobo that hasn't had a new bios release in a year or more, you should be fine. But if it is a new mobo, you might need to edit the updated file to restore it to your way of doing things. Flash the Official version first, so you get a feel for what has changed, and then you can flash the tweaked one.
So, go slow, experiment gently, and enjoy the feeling of POWER you get, knowing that you made the machine fit you, instead of you having to fit the machine.
Whoops! Time to go. I've got to mount a rescue mission for a beer that is trapped in the fridge.

No comments:

Post a Comment