In order to improve development efficiency of pervasive computing system, an OSGI-based framework middleware for pervasive computing is designed. The middleware is implemented under the OSGI framework. The mobile manager is designed to manage the mobility of user and service, and context manager is used to manage context and support context-aware application. The middleware has realized interoperation among the heterogeneous ubiquitous devices by applying standard interface technologies. Results of experiment show that middleware is feasible, and satisfies the characteristics and requirements of the pervasive computing environment very well.