The structure and the functionalities of a device driver are strongly influenced by the target platform architecture, as well as by the device communication protocol. This makes the generation of device drivers designed for complex embedded platforms a very time consuming and error prone activity. Validation becomes then a nodal point in the design flow. The aim of this paper is to present a co-simulation framework that allows validation of device drivers. The proposed framework supports all mechanisms used by device drivers to communicate with HW devices so that both modeled and actual components can be included in the simulated embedded platform. In this way, the generated code can be tested and validated even if the final platform is not ready yet. The framework has been applied to some examples to highlight the performance and effectiveness of this approach.