Newer Cisco IOS versions (IOS XE for example) are running as a process in linux. Old IOSes were linux-based too. Don't mix up Cisco IOS with Apple iOS (which has roots in BSD).
IOS XR runs on QNX and tends to be used on routers in a carrier role.
IOS XE runs on Linux and tends to be used on service/aggregation routers.