Billions have been spent in pursuit of a device to turn the boob tube into a smart machine. Now this dream may finally come true. What do television executives call "the most valuable square of real estate in America"? No, it's not Regis Philbin's high chair on Who Wants to Be a Millionaire. It's the space on top of your TV set where the cable box sits. For most channel surfers the box is little more than a glorified pair of rabbit ears, but to the people who pump programs into your home, that little box promises so much besides.

For a decade, television executives have tried to cross-breed the set-top box with a PC and create a gateway for all things digital. The idea of a box with a hard drive, a high-speed processor, and a broadband connection has been a recurring obsession, and it's easy to see why: The average American family watches television seven hours a day. And unlike Web surfers, TV watchers aren't trading bootlegged music; they are paying for digital media. No wonder the likes of John Malone, Bill Gates, and Jerry Levin have lain awake at night thinking about the money that could be made with such a box. They have spent billions in pursuit of this Holy Grail, with next to nothing to show for it.

But now, finally, the smart boxes are about to arrive. The costs are no longer wildly out of whack, and the technology got a big shove with all the digital entrepreneurship financed by the Internet bubble. Satellite companies are developing receivers with hard drives so that they can beam digital movies into subscribers' television sets. Cable providers are beginning to fight back with souped-up boxes of their own.

Every major set-top-box manufacturer from Motorola on down is readying a device that will act as a home media server. These machines will track your consumption habits and help you find movies, music, and other things floating in the digital media universe. They will screen out advertising. They will feed content to your stereo system, your personal computer, and additional television sets. They will forever alter your relationship with your TV. This is why media moguls lie awake at night thinking about them.

The existing box on your television bears little resemblance to this vision. There's a good chance it's an analog device. The U.S. satellite industry has been digital since its launch in 1994, but three-quarters of cable subscribers still have boxes that can't receive a digital signal, let alone recommend a Mel Brooks movie. Digital cable boxes are expected to outnumber analog ones by 2004. But the most widely used of these second-generation boxes--the Motorola DCT2000--is still a dumb device with virtually no memory and only a smidgen of processing power.

Wasn't the cable industry supposed to have been a lot further along by now? It sure was. Back in the early '90s, when people started talking about the "information highway," cable operators had an epiphany. They had vast networks through which digital information could travel if their customers had better set-top boxes. First came Malone, then CEO of Tele-Communications Inc., promising a "500-channel interactive universe" in 1992. The problem was, this new universe meant digging up streets and making systems digital, something his industry wasn't willing to do until Congress passed a law in 1996 allowing it to raise rates for the upgrade. Then there was the cost of smarter boxes. Malone tussled with his set-top supplier, General Instruments. Eventually the plan fizzled.

Levin was more of a true believer. In 1994, Levin, then CEO of Time Warner, rolled out the Full Service Network, the world's most advanced interactive cable system, in Orlando, enabling customers to play videogames, order movies, and shop through a cable box that was ten times more powerful than a 486 PC. The service, not surprisingly, was far too expensive to generate a profit. "It was so unrealistic," says Peter Ausnit, an analyst for Deutsche Banc Alex. Brown. "They put about $15,000 of equipment in people's homes just so they could order a pizza." Three years later the Full Service Network was abandoned.

Next came Microsoft. By most accounts, Gates tried to get cable operators to swap a share of their revenue for set-top software, figuring that the box would be the next frontier for Windows. The cable guys declined. Then Gates tried to woo them with money, investing $5 billion in AT&T Broadband and $1 billion in Comcast in the late '90s. At first it seemed Microsoft would get a return on its investment. At the height of the Internet craziness in 1999, AT&T ordered 250,000 Microsoft-enabled boxes with modems. But last year, saying it had doubts about both the software and the demand, AT&T canceled its plan.

The cable industry's treatment of Microsoft underscored a fundamental truth: Cable guys are monopolists at heart. They've operated their networks without competition for three decades. What do they need Bill Gates for? They talk about advanced set-tops, but they are in no rush. They purchase boxes cheaply from suppliers like Motorola, expecting them to last seven years, and recoup their investment by leasing them to customers.

Not surprisingly, then, the path breaking in the set-top market has been done by satellite companies, which carved out a market by stealing cable customers. The dish providers realized that they could use the set-top box to bond with subscribers. Companies like DirecTV and EchoStar put their boxes on the shelves of electronics stores and gave customers a choice of models. What's more, they understood that the purpose of advanced set-tops wasn't to provide e-commerce but to enhance TV viewing. They designed set-tops with hard drives and personal video recording functions. According to Ausnit, EchoStar has put 500,000 of these boxes in U.S. households--more than better-known personal video recorder brands such as TiVo, ReplayTV, and Microsoft's UltimateTV combined.

The strategy is working. Over the past five years, says PricewaterhouseCoopers, the satellite industry sold 15.3 million new premium subscriptions--more than twice as many as cable. Satellite subscribers are far more loyal too. The annual customer churn rate in the satellite world is about 18%; in the cable universe, it's about 60% (that's digital subscribers going back to analog). There is little doubt that the satellite set-tops are part of the reason for that loyalty.

The cable industry is slowly waking up to the reality that low-end boxes are not enough. AOL Time Warner (parent of FORTUNE's publisher), for one, is putting boxes with hard drives in the hands of some customers. But EchoStar is still a step ahead. The company has a box in the works that's probably the closest yet to fulfilling the television industry's dream. The Dish-PVR 721, which analysts say will retail for $499, records up to 110 hours of television and has an Internet connection. EchoStar is also working on a more advanced version through which you can download music and store it on a digital jukebox. EchoStar is even talking about a CD-burning option. "I think that will be our next-biggest revenue generator, behind video," says Mark Jackson, a senior vice president of EchoStar.

EchoStar hopes to tie these functions together using software designed by Moxi Digital, a Palo Alto startup. Moxi will let you use a single remote to roam through the universe of digital media feeds, and even the Internet, with a nifty user interface on your TV screen. Type in "Madonna," and presto!--you can select any of her films, songs, or pay-per-view appearances. Moxi will recommend songs or shows that might appeal to you based on your previous selections. It can do the same with commercials. What's more, Moxi will feed digital media using wireless connections (or your existing cable wires) to all the other digital entertainment devices in your house. "It's one box and one remote control, and no cables," says Moxi creator Steve Perlman. "That's a revolution!"

Most cable operators shrug off Moxi and even question whether the startup can survive. (Perlman resigned as Moxi's CEO in February amid reports that Moxi was running short of cash, but EchoStar says it is going ahead with trials.) Clearly, though, Moxi's having an impact. Paul Allen's Charter Communications, perhaps the most technologically savvy of the cable club, recently announced a deal with Motorola to manufacture a "sophisticated broadband media center" for its customers that will include personal video recording and wireless home networking. But like other cable operators, Charter has a bunch of low-end Motorola DCT2000s that it doesn't want to replace, so it asked Motorola for a second box that can sit on top of the dumb boxes and add brainpower.

Here lies the cable industry's dilemma. Operators have invested heavily in digital set-top boxes to fend off satellite. But these boxes are rapidly becoming out of date. Indeed, cable companies are rolling out video-on-demand using massive in-house servers because virtually none of their customers have boxes with hard drives. (Time Warner's video-on-demand HBO trial in Columbia, S.C., last year was overwhelmed by demand for shows like Sex and the City.)

The cable industry's suppliers all say they have boxes that could compete with EchoStar's product. But the cable guys aren't yet ready to let go of their old boxes. "They are on our balance sheets," says Michael Willner, CEO of Insight, the nation's eighth-largest cable company. "They have to work from five to seven years. So we are not pulling these boxes out."

They may have to. EchoStar hopes to have boxes with Moxi software in the hands of its customers by the end of the year. If Moxi's demonstrations are any indication, these multitalented boxes will be a reminder of what cable subscribers are missing by not getting a dish. That's a choice cable doesn't want its customers to make.