As the proliferation of mobile devices has ignited cloud computing, it is expected that increasing development and deployment of IoT services will expedite the era of fog computing. Fog computing brings computing, storage, and networking even closer to end users and devices for services with better QoS. We introduce FogOS, a fog computing architecture for IoT services. We take the perspective of designing an operating system, practicing the architectural lessons from the long history of operating systems. We focus on addressing the challenges raised by the diversity and heterogeneity of IoT services and edge devices that are owned by individuals and different owners, and presenting how FogOS is designed to effectively and efficiently provide and manage such IoT services. We provide a city-scale surveillance use case to demonstrate FogOS in action.