Villani had already been working on a DOS-like operating system for use in embedded systems for some while before the advent of FreeDOS. His efforts started when he developed an MS-DOS 3.1-compatible interface emulator to write device drivers in the C high-level language instead of in assembly language, as was the usual approach at that time. This interface emulator grew into a minimal operating system named XDOS around 1988. He added an IPL to set up a boot environment before loading the actual operating system and developed an MS-DOS-compatible frontend API to applications. In contrast to MS-DOS, which is not designed to be reentrant, the system calls of his operating system were, which is often a requirement for multitasking and real-time applications in embedded systems. This system was named NSS-DOS and also offered commercially. When one potential contractor sought to use the OS in a system equipped with Motorola 680x0 processors instead of Intel x86 processors, for which the system was designed originally and which utilize different instruction sets and memory models, Villani was able to redesign his system to become portable across a range of different compilers and target environments. This move to a completely different target platform, while losing binary compatibility with existing applications, would have required a complete rewrite from scratch had his system not been written in a high-level language such as C, which allowed him to reuse large parts. His new DOS/NT used a microkernel architecture with logical separation of file system, memory and task manager. Villani joined the FreeDOS project in 1994 after reading Jim Hall's announcement of a "PD-DOS" on . In response to Hall's announcement, Villani devised a derivative of DOS/NT named DOS-C with a monolithic kernel and an architecture more similar to the non-multitasking MS-DOS, and in 1995 he made it available for dual-use under a GPLopen-source license to become the kernel component of the new "Free-DOS" operating system, as "PD-DOS" was called at this time. In 1996, Villani wrote the book FreeDOS Kernel, which describes the design of the DOS-C / FreeDOS kernel and the original FreeDOS COMMAND.COM command line interpreter. The name of the operating system was subsequently officially changed to FreeDOS to reflect the spelling used in the book. Internally, the FreeDOS kernel was still significantly different from MS-DOS, which, while no problem for embedded applications specifically written for FreeDOS, caused various compatibility issues in conjunction with misbehaving DOS applications. Villani and other contributors analyzed and addressed many of these issues over the years for FreeDOS to become much more MS-DOS compatible. With some breaks Villani remained active with the FreeDOS project, including preparations for the release of FreeDOS 1.1. Since 2009 he had also held the role of the project coordinator, but he had to step down in April 2011 for health reasons. The FreeDOS 1.1 release, published on 2 January 2012, is dedicated to him.