In Windows, you can do it the easy way by using what's called "Internet Connection Sharing", or you can do it the advanced way by using a feature called "Routing and Remote Services". As for which OS have which options, I think it depends on which version of Windows you are using, whether it be Home, Pro, or 2003 Server. Windows 2000 (all versions) also have this ability.
As for using Win9x (which I don't recommend), there are third party options. I remember using one from AnalogX years ago.
You can also do it using any of the open source operating systems such as Linux, Free/Open/Net BSD, etc. However, this can be more difficult than doing it on Windows. Fortunately, there are free distros out there that are specifically for routing uses, such as SmoothWall.
As for hardware, what you basically would need are two network cards. One for one network segment, and the other for another network segment. The PC will do all the rout8ing between the two networks.
Also remember that most routers are basically computers that are specialized in that one job. Most of the early Cisco 2500 routers used Motorola 68000 series processors. I believe some of the newer ones now use PowerPC and some x86 solutions, but I'm not quite sure.