Slipstreaming AHCI drivers, Windows XP/Asus P5K-E wifi

February 24th, 2009

Ok, I know I was going to hack up my Apple TV but I got a little side tracked.   I needed to backup my original drive just in case something went wrong.  So, I decided I wanted to be able to boot my linux setup with AHCI and sata in order to get the fastest drive speed possible. The problem was that AHCI mode was causing my Windows XP install to blue screen.  So, I decided before I touched my Apple TV, I’d rather get my desktop working the way I wanted it to. After all, I use it more than my Apple TV!

I found several web sites that indicated that I could make some modifications to my current XP install and get it to boot in AHCI mode but none of them seemed to work for me.  So, I decided that I needed to slipstream the appropriate drivers into my Windows install.  The problem was, I wasn’t sure which drivers were the appropriate choice. Do I use the JMicron jmb363 driver, or something else?  None of the websites I found dealt directly with the P5K-E, so I wasn’t having much luck.

Here’s what you need to do.  Pop your XP disk into your drive and copy all of it to your hard drive.  I made a directory on my C: drive called XPCD. Go into that directory and create a directory called ‘$OEM$’. Inside of that, create the directory ‘$1′.  Now create a ‘Drivers’ directory inside of that, and finally create a directory for your AHCI drivers.  At this point you should have something like “C:\XPCP\$OEM$\$1\Drivers\AHCI\”.

If you need the drivers, you can download them directly from Intel. At the time of this writing, my driver file was iata87enu.exe.  You’ll need to extract them from the command-line using a command like below:

iata87enu.exe -A -P C:\IntelDrivers\

The correct files will then be in “C:\inteldrivers\winall\Driver” or “C:\inteldrivers\winall\Driver64″ for the 64-bit version of XP.   You’ll need to copy the files inside that directory into the “C:\XPCP\$OEM$\$1\Drivers\AHCI\” directory.
Next you’ll need to go into your I386 folder (”C:\XPCD\I386″) and modify your TXTSETUP.SIF file so that it knows what PCI device to associate your new driver with. You’ll need to add the following information:

[SourceDisksFiles]
Iastor.sys = 1,,,,,,3_,4,1

[HardwareIdsDatabase]
PCI\VEN_8086&DEV_2922&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_282A&CC_0104 = “iaStor”
PCI\VEN_8086&DEV_2829&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_2822&CC_0104 = “iaStor”
PCI\VEN_8086&DEV_2821&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_2682&CC_0104 = “iaStor”
PCI\VEN_8086&DEV_2681&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_27C3&CC_0104 = “iaStor”
PCI\VEN_8086&DEV_27C6&CC_0104 = “iaStor”
PCI\VEN_8086&DEV_27C1&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_27C5&CC_0106 = “iaStor”
PCI\VEN_8086&DEV_2653&CC_0106 = “iaStor”


[SCSI.Load]
iaStor = iaStor.sys,4

[SCSI]
iaStor = “Intel(R) ICH9 SATA AHCI Controller (Desktop/Server/Workstation)”

Those headers already exist, so you can just paste in your text below the appropriate file in the SIF file.

After you’ve done that, you’ll need to make a CAB file of the actual driver to put into th I386 folder so that Windows can load it on first boot.  Open up the command line and type:

MAKECAB C:\XPCD\$OEM$\$1\Drivers\AHCI\iaStor.SYS C:\XPCD\i386\IASTOR.SY_

Now, since you’ve gone through the effort of making a custom Windows XP CD, you might as well make life a little easier on yourself. After all, who wants to have to type in that damn product key every time they install? Create a file called “WINNT.sif” inside of your I386 folder.  Inside this file we will A) tell Windows where to find the ICH9 driver to install during setup and B) place our Windows product key for an easier install.

[Data]
AutoPartition=0
UnattendedInstall=”No”
MsDosInitiated=No

[Unattended]
OemPreinstall=Yes
OemPnPDriversPath=”DRIVERS\AHCI”
FileSystem=*

[UserData]
ProductKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

Now that you’ve done all of this, you must create a bootable ISO that you can burn to CD.  The easiest way to do that is to use the CDIMAGE tool from Microsoft.  You can download it here, with a pretty GUI front end.

Once your ISO is created, I recommend that you try to install it using a virtual machine.  You can get VMWare server for free now.  If it installs there without a hitch, you’re ready to give it a try on your P5K-E motherboard. Good luck.

There are a bunch of other things you can do while you’re at it, too. You can slipstream in the latest Windows service packs, software updates, and even have it install applications for you.  There is a very excellent guide called MSFN’s Unattended Windows.

**Note** The links provided above are offered by third parties and not by myself.  I do not make any guarantees or warranties about the availability, legality, and functionality of those files.  You should always use extreme caution when running executables from unknown and/or untrusted websites.  I highly recommend you backup all crucial data before attempting to reinstall your operating system.  You follow these instructions at your own risk.

Apple TV Hacking

January 8th, 2009

I managed to get a great deal on an Apple TV from Craigslist.  I decided to pick one up after taking a look at the Apple TV Hacks website.  See, I was looking for a really cheap Mac on Craigslist and was not having any luck. I found out that you can actually turn your Apple TV into a full blown Mac OS X box running at a blazing fast 1GHz.  The whole motivation behind this is to jailbreak my iPhone 3G.

Anyway, at a price tag of $140, I decided that the Apple TV would be my cheapest entry point into the Mac world.  Having acquired Leopard and a 2.5″ external drive enclosure from my vendors, I should be ready to start hacking away as soon as the UPS truck comes today.

I’ll be posting pictures and compiling information here.  For instance, I found a handy little page that tells you how to create a backup image of your original Apple TV drive using FOSS tools (from Linux command line).

For safety purposes, I intend to recommision an old 40GB laptop drive that I have laying around.  Once I know everything seems to work perfectly, I’ll take the plunge for real and use the 160GB drive that came with my Apple TV.  That is, of course, unless I decide to upgrade to a 250GB drive ;o).

(I know that $140 price is ridiculously low for a 160GB Apple TV but I got extremely lucky. No it is NOT stolen.  I bought it off a college student whose parents take such good care of him that he didn’t mind selling it at a loss so that he could get the Blu-Ray player that his parents neglected to get for him.  I thought it was a 40GB unit until I got it home, though he never said in his posting. He had only used it a few times and saw no real value in it.)

Back in business

October 10th, 2008

Okay.  My server has been down for a while but its back.  It took me a while to get it going again after a hosting relocation.  My server is now hosted about 2600 miles from its old locale in sunny Florida.  I’ve also moved it off of an old Dell Optiplex PIII to a virtual machine running a more modern processor.  This should allow it to take advantage of the latest power saving features.  Always pays to be as conservative as possible.  No need to waste resources.  More to come, eventually.

Tradewars 2002 Again

March 7th, 2008

So, a friend of mine decided to start hosting a BBS off his internet connection at home so that a bunch of us could play our old favorite door games again.  He only has two that I am really interested in, Legend of The Red Dragon, and Tradewars.

A lot of the people playing Tradewars are using helper programs that can automate trading, maping out the universe, and things like that.  I’m not a huge fan of using something like that to play the game, but I don’t really say too much about it to them. But, I’ve gotten tired of trying to keep all of the sector information in a notepad type document.

So, I wrote a script that goes through and parses all of that information out of the game by executing commands on the ship computer and then storing them in a database.  I’m also going to be unable to play for a week and so I’ve decided to write a script to do something useful with my turns in my absence. It’ll run as a cron script while I am gone.

All that playing around with scripting has made me decide that I want to write my own helper program that uses my own experience with the game.  It will basically do all of the same things that current database script does but will allow me to interact with the game while it silently logs what is going on.

I’m going to have it do things like remember who owns any planets I see, keep track of where I encounter fighter nets, and allow me to insert notes about sectors.  I also want it to have a UI that draws a map of the entire universe and allows me to zoom in and out, rotate the map three dimensionally, select nearby sectors to view them, and  stuff like that.  It will also remember successful trade values when working on a port pair so that I have a basis to use to try and maximize my exp when trading.  Also handy would be a database that keeps track of where I’ve been caught stealing, and when so that I know if it is safe to steal from a port again (when I am playing evil).

Eventually, I might make a non-interactive version that tries to play “alien” traders with enough intelligence to give a little extra challenge to human players.

So far, I’ve been doing all the scripting in Perl using the expect module.  I’m thinking about making the map using java and have it pull database information out of a central server that corp mates can use to share their travel information real time.  We’ll see how sophisticated this ends up being.  Either way, it has been pretty fun to work on.

Thinking of Updating to Leopard? Maybe you should wait

November 1st, 2007

So I took the plunge and upgraded to OS X Leopard today.   I wish I would have held off.  It’s not that there are X11 bugs that keep me from moving my X11 apps onto my second monitor, there just seems to be quite a few UI issues in general.  I’ve had issues with Parallels not always going to full screen mode on a second monitor and it is completely incapable of going into coherence mode on a second screen.  I’ve also had issues with window focus.  That is to say, I command-tab or click on a window and select it, but it does not gain focus and I can’t do anything inside the window.  I can’t even close it.  At that poitn, the only way to fix it is a force quit.

I’ve also had problems with expose AND the dock.  As in, all of the sudden expose stopped working (no error messages or anything).  At that same point, I could no longer view the dock, command-tab through windows, or anything like that.  I tried to reboot the machine to fix it but it hung on shutdown and I had to cut the power to get it to turn on again.

Performance isn’t that great either.  When I click on an application in the dock, it completely pauses everything for a few seconds.

I think the release was rushed out a little too soon.  It looks like it has a lot of potential though.  We’ll see how long it takes apple to patch all of this up.

Global Variables are Bad (Usually)

August 14th, 2007

I’m working on an embedded software product that decodes network video and renders it to a monitor.  The application is designed to run 24×7, with up to four streams running through it at a time.  I didn’t write all the code from scratch, I took it over from someone else and am now responsible for bug fixes as well as advancing the functionality. When I inherited the project, I also inherited a bug that was caused by a global variable.  I had made almost a dozen releases with this bug, but it never manifested itself.

The global variable was a wrapper written around the sem_t that handled all of the initialization, destruction, etc.  Someone went into an old C style source file and threw a global instance of that class to provide multi-threaded support.  That might seem fine and dandy, but when unloading the library from memory, a race condition existed that wasn’t very obvious.  Some functions needed to be called in the library during cleanup that relied on the semaphore.  As long as that code was able to execute before the global variable was destroyed, everything worked fine.

The problem is, you have no guarantee of the destruction order of objects.  So, after a bunch of problem free releases, some subtle change had caused the semaphore to be destroyed before the library finished cleaning up.  The application would crash then once the library started to clean up.

I enabled core files and it became pretty obvious that the problem had to do with the semaphore.  It wasn’t the most disgusting global variable problem one might encounter.  I’m just so surprised that people continue to use globals so freely.  I’m positive whoever put that in there did it because it was quick and easy.

There’s no reason that this C file couldn’t have been turned into a class.  It would have only taken a few minutes.  If this person felt that the sem_t was really needed globally to these functions, they could have used some quick regular expressions to make the proper conversions.

So, when is it okay to use a global variable? Almost never.  I can’t give you an example off the top of my head because it’s almost never appropriate.  If you can think of a good example, post it as a comment.

RIAA Out Of Control (Again)

August 6th, 2007

So the RIAA has gone after Yuri Shutovsky for copyright infringement.  Our good friend Yuri (no, I don’t really know him) has an alibi during the time that this alledged copyright violation occured.  It seems that he was on an extended trip to Russia.   He even offered up his passport showing that he has entry and exit stamps proving that he was in Russia during this time.

Not to be deterred by such trivial details, the RIAA has asked a judge that Yuri turn over all hard drives in his possession as well as the names and addresses of everyone who has ever used his computer.  Unsuprisingly, the judge has sided with the RIAA and has required that he turn over all of this information.  They even asked (very politely, I’m sure) that his work place be required to turn over all information about any computer that he has ever used while in their employ.

Even though Mr. Shutovsky was in Russia during the time of the alledged violation the RIAA believes that  “regardless of who was using the PC at the time, Yuri Shutovsky is responsible for whatever copyright infringement may have occurred by virtue of his paying for broadband from Verizon” (Arstechnica).  By that very argument, Verizon is also responsible for whatever copyright infringement occured because they allowed someone to commit copyright infringement through their network.

But, we all know that RIAA would never go after Verizon.  Why? Because Verizon has enough money that they can afford to hire attorneys competent enough to defend themselves against such a baseless lawsuit.

Here’s a tip to all you record labels out there.  Quit trying to scare your customers into you buying your product.  I know that downloading pirated music is illegal and I honestly don’t understand why people choose to do so.  I can’t understand it because I can’t understand why most people would want to listen to the crap that you sell.  Instead, focus your time, energy, and money on finding and promoting music that is worth buying.  Once you do that, learn to charge a reasonable fee and guess what? People WILL pay for your music.

Scaring your “customers” into paying for your service reminds me an awful lot of the racketeering performed by the Mafia.  In fact, maybe Mr. Shutovsky should sue the RIAA for racketeering?  I’d love to see that civil suit.

Stack Trace in Linux

June 22nd, 2007

This is incase I forget how to print out my current stack in linux:

#include <execinfo.h>

size_t sz;
void *bt[20];
char **strings;

sz = backtrace(bt, 20);
strings = backtrace_symbols(bt, sz);

for(int i = 0; i < sz; ++i)
fprintf(stderr, “%s\n”, strings[i]);

TorrentSpy Ordered to Log Ram??

June 21st, 2007

So if you check out this article on ZDNet you’ll see that a Los Angeles judge has ordered TorrentSpy to start logging all site traffic and to turn over all data stored in RAM on their servers. This is the most absurd thing I have ever heard of. The article on ZDNet likens this to having to save post-it notes but it goes far beyond that. I would liken it to a person having to store every single thought that they had. The brain, like the RAM on a computer, works far faster than a pencil, keyboard, or a hard drive. That means that the brain, like the computer, would be forced to work at the speed of your fingers. Can you imagine having to think at a rate of 50 or even 100 word per minute? Absolutely absurd.

Anyway, if you folks at TorrentSpy are reading this, here are my suggestions for you. First of all, absolutely insist that the MPAA have to provide you with all the hardware and any software needed to log this. Secondly, insist that any software they provide you be open source and that it be peer reviewable on the internet. This is to protect you from having the MPAA do anything malicious or illegal. I’d then also get the judge to allow you to only put this logging on half of your servers. You, in good faith, would not modify your network structure to keep those servers from receiving less connections than they can handle. We all know they won’t get that much traffic anyway, they will be completely bogged down. Finally, to show just how absurd logging RAM is, I’d suggest you turn on encryption for all server traffic. Might as well make the MPAA sort through thousands and thousands of pages of factoring data. This will cause server performance to be so slow that these servers will only get a few hits per hour. It would affect very little of your clientel.

Good luck to you TorrentSpy! While I never condone piracy (I do work in the software industry, after all), I believe that the RIAA and MPAA have gotten themselves into their own mess by churning out complete CRAP for the last 10+ years. If they actually put out a decent work, maybe people would pay to see it in the theater and even pay to have a copy at home? A good movie is worth $10-15. But, ninty-nine percent of the movies produced these days aren’t even worth the cost of the film they are stored on.

P0171 Check Engine Code on 2000 Toyota Corolla Part 3

June 20th, 2007

Ok, after reviewing the previous charts a few times, I decided that the Mass Airflow Sensor and the second Oxygen sensor were not behaving the same when my check engine light would turn on. That is to say that I could follow the two graphs and they tended to behave the exact same way when everything was normal. When the problem would occur, my MAF sensor was indicating that the air intake was decreasing while the second oxygen sensor was indicating that oxygen was increasing. This suggested to me that the MAF was not reading the amount of air properly and so we were running lean, which caused an upward spike of available oxygen in the air.

I bought a reconditioned MAF sensor for about $80 + $50 core and replaced it on my car. It only takes about 5 minutes to do. I reset the computer and took it for a test drive. The performance seemed better at the time but it was hard to say because the computer had to readjust itself.

It has been about 220 miles and two week now since I replaced the sensor. The cars performance is good, it accelerates more smoothly and has more power. I haven’t put in a new tank of gas yet, so I have no idea if the gas mileage has improved.

So, if you have this problem and cleaning the MAF sensor doesn’t seem to work, that does not mean that the MAF isn’t the problem. Mine seemed to completely malfunction randomly and cause horrible performance. The gas mileage had dropped significantly even though the check engine light didn’t always turn on.


Bad Behavior has blocked 60 access attempts in the last 7 days.