While the previous chapter presented an industrial perspective and a broad overview of building management systems in general, this chapter focuses on a specific aspect of the small and medium commercial buildings, namely, the Building Operating System. Traditionally controlled by simple thermostats, timers, and manual controllers, these buildings are frequently operated suboptimally. Several studies suggest that improved controls can afford energy and cost savings for building owners. With the diffusion of networked devices, such as smart thermostats, there is now an opportunity to inexpensively retrofit these buildings. As the market rapidly evolves, both commercial and open-source software platforms have emerged. In the academic literature, this software is frequently called the building operating system (BOS). In this chapter, we review previous recent work on BOS and describe one common architecture and its features. Since most of the research has not focused on controls, we propose an extension that aims at facilitating the task of writing, testing, and deploying control sequences. We illustrate the design and development of such software and present preliminary test results. Finally, we discuss the lessons learned during implementation, and the challenges and future work necessary to advance this area of research.