An operating system for Internet of Things