Pages

Labels

Rabu, 28 Januari 2009

The seagate problem

I've posted about it in the wiki already, so if you want to see that information, it's at http://screenplayprohd.wikia.com/wiki/Detecting_drive_identity

But my blog is for documenting how I did it.

I started out as I do with many of my ventures by going to google. In looking up how to read the disk drive serial number, I came across the linux IOCTL command, which is for direct device communication. May come in handy in the future. In trying to find a working example of how to use it, I found somebody opening the /proc/something else (I don't recall what it was) and I started thinking that maybe there was something for the drive.

So I looked in proc and found ide, found ide0 inside of it, and several files inside of that.

cat them all out and I could see tons of hexadecimal. So my first thought was to convert the hexadecimal to character format. I went to my favorite hex editor "HxD" (freeware, works really nice) and manually entered the codes. Sure enough, I saw the "SD15" code appear and then the drive model number.

Great, but I can't explain that process to non-programmers very easily. So I figured I'd see if there was some way to do it on the command line. Got as far as awk and decided it would be easier to do this in a simple C program. That would enable me to use my toolchain that I spent so long trying to build.

So the program is simple enough. It uses the built in ability of C to convert a hex string to decimal using strtol command, which is then echoed out as a character.

In other news...I think I've made some progress deciphering the memory dump I took of the machine. I was able to reconstruct a view of the screen that was on the TV at the time I took the screenshot. Don't have time to tell about it now, but details will come.

0 komentar:

Posting Komentar