By David Kirkpatrick

(FORTUNE Magazine) – Sun Microsystems CEO Scott McNealy is one of Silicon Valley's hardiest characters. The amateur hockey player has been chief executive of the company he co-founded for more than 20 years now--and obsessed with besting Microsoft for almost as long. After the Internet bubble burst, Sun lost so many customers for its servers and software that many questioned whether the company would survive. But a recent flurry of deals and new products suggests Sun's--and McNealy's--competitive fires are still burning. FORTUNE's David Kirkpatrick spoke to the wisecracking McNealy a few days after Sun launched a new software partnership with Google.

Hello, Scott ...

I guess you're calling because we're relevant again, huh?

Well, are you?

We're hot. A whole bunch of stuff is rolling out bigtime into the marketplace right now. That's because we took the peak-of-the-bubble R&D level and maintained it, even though revenue came down. This year we're going to spend $2.2 billion.

Can you explain your deal with Google?

The simplest way to put it is that the network is the computer, and software-as-a-service is the tactical implementation of that. We're going to work with them to develop next-generation services. Google's got the platform, and we've got the computing environments, so it's a natural. We target the big problems. That's what Sun is good at. That's where Microsoft doesn't scale and where IBM gets too expensive.

Sun's tagline now is "Sun=Share." How come you're excited about free products?

It's like what you learn in preschool: Let's make the pie bigger and we'll all do better.

Does giving software away help sell hardware?

Absolutely. If you've decided Solaris [Sun's now-free open source operating system] is the best software, don't you think you're going to ask Sun to bid on the short list for hardware or storage or services? This is not new. Explaining it properly is.

So you're working on your image.

When you're not making money, your competitors position you. When you're making money, you get to position yourself. We're just having a hard time with the image thing.

It doesn't help that your stock has been stuck at $4.

But we've got a market valuation of $13 billion, about 1.2 times revenues, which is a wonderful valuation.

So was it ridiculously distorted during the bubble?

Are you kidding me? Every analyst on the Street had us as a raging buy at ten times revenues. So, yeah, that's why we have an image issue. But you know what? The company's very solidly capitalized. It's been cash flow positive for 16 straight years, and we're driving unit volumes and building a community. We have $4.5 billion in cash. Hey, there's no question we hired too many people during the bubble. And we should have adopted the industry-standard architecture more aggressively in hardware. But I think the next five years will treat us nicely.

You guys at Sun talk a lot about the participation age. What do you mean?

If you ain't on the Internet, you aren't participating in the greatest accumulation of creativity on the planet ever--look at Wikipedia, instant messaging, blogging, podcasting, home shopping, telemedicine, home banking, distance learning, voice over IP. The problem is that three in four folks on the earth aren't there yet. There's a huge digital divide. Our mission is to provide the infrastructure that powers the participation age. But our cause is to eliminate the digital divide. That's personal.