  In this paper, a new hierarchical software architecture is proposed to
improve the safety and reliability of a safety-critical drone system from the
perspective of its source code. The proposed architecture uses formal
verification methods to ensure that the implementation of each module satisfies
its expected design specification, so that it prevents a drone from crashing
due to unexpected software failures. This study builds on top of a formally
verified operating system kernel, certified kit operating system (CertiKOS).
Since device drivers are considered the most important parts affecting the
safety of the drone system, we focus mainly on verifying bus drivers such as
the serial peripheral interface and the inter-integrated circuit drivers in a
drone system using a rigorous formal verification method. Experiments have been
carried out to demonstrate the improvement in reliability in case of device
anomalies.
