depends on what you mean by the OS. but in general, most of the initial firewalls were in fact OS firewalls! iptables/ipchains/ipfw on linux/freebsd/variants provide packet/port filtering and other firewall features. tcp wrappers offer further protection against cracking of poorly written networking code. etc. etc.
spam and virus protection is also available as open source products that integrate with your OS or mail gateway program (sendmail/qmail/etc): spamassassin, clamAV, etc.
finally, microsoft, eric allman, and others are talking about authentication extensions to SMTP called 'sender id' that will validate the sender's host address before accepting the message. there are other similar ways to combat spam, as well.
in the meantime, like a broken record, i will re-pitch mozilla (http://www.mozilla.org/) as a decent guard against both spam (excellent built-in spam filtering), spyware (fine-tunable cookie settings, popup windows, etc) and viruses (limited and configurable client side code execution, none of it using OS backdoors and proprietary scripting).
--ravi