Middleware for virtualization support in TinyOS