Partial Update: January 24, 2009 - Had a friend whose hard drive (Vista Ultimate x64) got partitioned wrong due to my own stupidity. It looked like this:
Code: Select all
[---Unallocated---][---WINDOWS---][---Unallocated---]
Code: Select all
[---WINDOWS---][---UNALLOCATED---]
I'm of the belief that problems with hard-drive partitions are obsolete with Vista (at least as relates to HAL.DLL) and 7, since the automated repair offered on the installation disk seems to be able to take care of the problem.
UPDATE: March 26, 2007 - This thread applies to Windows XP only! I do not know how Windows Vista's boot loader and HAL.DLL files work, so please do not ask me or use this guide to repair Windows Vista powered PCs! If someone would like to add onto this thread about fixing corrupt Vista HAL.DLLs, please post a reply (I would imagine the process is similar to Windows XP, but I do not know that for certain so I will not make that claim.)
This is from my own personal experience (that I just had), it's something I couldn't find anywhere and figured out myself. I offer this "AS IS" with no warranties or guarantees, express or implied. You use this advice at your own risk and accept sole responsibility for anything resulting from your use of this information.
Whew! Now that the boring stuff is over, on to fixing the problem.
You boot your PC, perhaps because you upgraded something or upgraded to Windows XP. You get an error:
I tried the following methods to fix this problem. None of them worked.Windows XP Hates You wrote:Windows could not start because the following file is missing or corrupt:
<Windows root>\system32\hal.dll.
Please re-install a copy of the above file.
1. Just restart, Windows can be dumb sometimes.
2. CHKDSK /F /R (the file could have been damaged due to a sudden power-off, but I doubt this could happen. This is just what any power user reflexively does when it looks like data could be damaged).
3. Boot into Safe Mode (or any of the other options that you can get with F8 like Last Known Good)
4. Edit the BOOT.INI file (this fix assumes BOOT.INI is corrupt, when it is not, HAL.DLL is actually damaged.) This is what was suggested by Topher a few posts down. I actually read that article, having found it in a Google search about corrupt HAL.DLLs, and used the rebuild command to no effect.
5. Use the Repair Option in Windows XP. It has been mentioned that my steps did not go "far enough" but I used an OEM copy of XP that had in the past been used to "Repair" my own machine. It simply did not find any valid Windows installations, fixed BOOT.INI files notwithstanding.
6. Expanding HAL.DLL from the XP installation disc or copying HAL.DLL from another computer. The HAL.DL_ file would not expand, even though I had used BartPE to delete the original HAL.DLL. From my understanding of HAL.DLL, it is dynamically generated from a base template file (the one on the XP CD) upon installation. Therefore, unless the hardware in your machine is very similar to the one of the machine you are trying to repair, chances of copying and pasting a HAL.DLL and having it work are slim to none. (If this is wrong and you can in fact point me to a case where this worked, please tell me as 3+ hours of Google searches seemed to vindicate the idea that HAL.DLL cannot be dragged and dropped.)
So, you're just about to format right? There is a way around this, that I discovered after accidentally damaging a friend's hard drive with PartitionMagic (that app is the DEVIL do not use it to "merge" partitions that were created in the factory before Windows was installed, it crashed two friend's computers and I got stuck fixing them).
You need a CD of Windows XP. I do not believe it matters which Service Pack or whatnot. Any will do. You are going to reinstall Windows (regardless of version, you can install Windows XP next to another installation of Windows XP, it's dual-booting the same OS) to regenerate HAL.DLL.
Now, follow these steps.
1. Boot from the CD and start the installer
2. Choose to install onto the already formatted partition with the unbootable Windows, but opt to leave the existing filesystem and any other OSes alone. Choosing this will require you to create another folder for Windows to avoid writing over the existing installation (that it somehow sees now but not when the Repair "Scanning for previous installations of Windows" is run, argh!) I usually call the new folder "WINXP."
3. Install Windows as you would normally, you'll need a Product Key but you can actually use your personal key on someone else's computer with no danger to you losing it or being accused of piracy, I'll explain this later.
4. Boot the NEW Windows XP install. Do not "Activate" or "register," you're going to be deleting this copy of Windows from the machine if all goes well.
5. Edit the BOOT.INI on the hard drive from the original installation of Windows with the corrupted HAL if you messed it up like I did and had four OS entries in it, none of which worked. This usually happens when you try to use the method outlined in the InformationWeek article repeatedly and it does not work.
6. Go to C:\WINXP\system32\hal.dll (where "WINXP" is the folder you installed the second copy of Windows XP) and copy it from the new Windows to C:\WINDOWS\system32\hal.dll (or wherever you installed Windows XP originally, I use "WINDOWS" but some people use strange folder names for their XP) and overwrite any file there. The new hal.dll is uncorrupt and newly regenerated. The file is specific to each machine's hardware configuration and we needed to rebuild it. The installer did that for us with the new installation.
7. Try rebooting your computer to see if you can get into your OLD Windows installation. If you can, congratulations!
8. DELETE the "WINXP" folder (or wherever you put your new Windows install).
Now PayPal me some money for all this effort...
j/k! If anyone runs into this situation, they will know how to deal with it.
But it didn't work! I still can't boot! What should I do?
First of all, breathe. Did you choose the right OS to boot from (chances are if you didn't edit BOOT.INI you still have a pointer from your install of Windows that you used to regenerate hal.dll and then deleted once you thought you were finished. Try a different OS choice and if it boots, go to the System control panel, Advanced, Startup and Recovery, click the "Edit" button so you can mess around with BOOT.INI.
Sample BOOT.INI for XP Pro
NOEXECUTE is for Data Execution Protection, and this setting means only core Windows apps will be DEPped.Microsoft wrote:[boot loader]
timeout=10
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /NOEXECUTE=OPTIN /FASTDETECT
If you have any questions, just ask them here.
Version 1.2
- Added "This is not for Vista and I don't know so don't ask" clarification
Version 1.1
- Cleaned up start of thread, made it cleaner. Added clarification throughout.
- Addressed Topher's points, I wasn't clear and he misunderstood that the methods he suggested were tried by me in this process and did not work.
- Version 1.0
Original post