ArcaneTek from LowTek

Monday, July 03, 2006

Secret Dell hard drive diagnostics in the BIOS

My drive started to fail in my Dell PowerEdge 400SC, so Dell shipped me a new drive. I installed it and Dell Support told me to boot-up and repeatedly press Ctrl-Alt-D. Apparently this runs some sort of built-in BIOS hard drive diagnostics.

In my case, it happened to print out "Fail. Return Code: 4". The tech explained that this means "electrical failure".

I sent back the two bad drives, Dell shipped me a new one and it seems to be running fine. If this happens again on another Dell, I'll be sure to run Ctrl-Alt-D to start...

UPDATE: Looks like this is briefly documented here. I didn't find a list of return codes, but Return Code 7 seems to mean "bad tracks or sectors".

Memory tester software roundup

I recently got 2 sticks of 1GB memory for my system so the first thing I did was test it using some free memory testing software. I'm too paranoid, so I didn't want to rely on a single app, so I tried the following:
  1. Windows Memory Diagnostic



    Direct from Microsoft's Online Crash Analysis team. My guess is that these guys spend all day long looking at uploaded Watson blue-screen dumps and they've figured out "patterns" in crashes due to flaky memory.

  2. Memtest86



    Popular GPL memory testing software. One cool feature is that it'll tell you whether your memory is running in Dual Channel, whether PAT is enabled, etc. Though the screen-shot above doesn't show that probably because the screen-shot is from a virtual machine.

  3. Memtest86+



    An updated version of memtest86 by more contributors.

  4. DocMemory

    Years ago I used this software to detect some bad memory. I tried it again and it didn't seem to work right anymore (i.e. bizarre errors that didn't seem to be related to my memory). In fact, it even gave errors in a virtual machine.


Saturday, July 01, 2006

CTU Newhire Guide to Opening a Socket

NOTE: See this post for information on MySpace Account Hacking.

In FOX's 24, whenever Jack Bauer is in a pinch, resident techgeek Chloe O'Brien has to "open a socket" or "open up a socket to the server". What does it all mean?

Well, I've been doing "network programming" (i.e. writing software that uses the Internet) since the 90's (I even have a web site about it) and I'm here to set everyone straight.


Sockets, schmockets, what's the deal?

Just like a house has multiple phone numbers for multiple land-lines (in a chatty house, one for uncle Bob, one for little Jimmy, one for grandma, etc.), a computer has multiple numbered "ports". For example, port 80 is often used for web sites.

When you make a phone call, you just pick up the phone and call someone's number. With computer "ports", you can't just contact a port on someone's computer -- they also have to be "listening" on that port. The way I think about it, the moment you plugin your phone handset into the wall, your phone is "listening". This web site you're reading right now has a web server program that is "listening" on port 80.

So how did your computer "call" this web site to download this page that you're reading right now?

Believe it or not, but the first thing it did was "open a socket". I kid you not.

Opening a socket is basically like picking up the phone handset to hear the dialtone. It's all just software bookkeeping on your local computer, until the next step:

The next thing your computer (your browser, really) did, was to "connect" that open socket to the listening port on my web site. This is basically the equivalent of connecting the phone call.

Once the socket connection is made, data can be transferred both ways. i.e. your computer requests a specific page, then this web site sends the page.


Socket Cheatsheet

To summarize:

  • Phone number = computer port number
  • Plugging in phone handset into wall = program listening on a port
  • Picking up the phone handset = opening a socket
  • Dialing the phone = connecting the socket

So what does the show really mean when they open a socket?

My guess is that the writers wanted something cryptic sounding, yet still based in reality. The good thing about using the phrase "socket" is that because sockets are fairly "low level", they don't really imply anything about what you do with them, in the same sense that who knows what people do with phones (i.e. ask for Mom's apple pie recipe, or find the hours of a store, etc.).

Of course, now that I've explained what "opening a socket" is, it just isn't as cryptic anymore. I'd suggest to the writers that they try something even more cryptic, yet still based in reality like this:

CTU newbie: I can't get it to work.
Chloe: You probably forgot to bind your socket.
(Chloe shoots the newbie that "lamer" look.)


Who wants to open a socket?

Everyone who uses the Internet opens up plenty of sockets, but it's all sort of hidden with complex software like browsers, etc. Anyone like Chloe would do something way more hardcore like... before I ramble on, does anyone want to see how to do these things hardcore? Drop me a comment and I'll write-up another part to this guide.


A Note to Hardcore Socket Programmers

Before someone comes down from Division or the Department of Homeland Security to escort me away, yes, I've omitted tons of details above like: IP addresses, binding, the socket used for listening, the socket returned from accept(), TCP vs. UDP, HTTP, protocols, how TCP works, etc., etc. Though I did try to use terminology like "listen" and "connect" based on the BSD socket APIs of the same names.