MenuetOS is an example of an OS written entirely in Assembly. Is there any advantage to writing it in Assembly instead of a low-level programming language such as C?
Interfacing with an OS tends to be easiest in the language it was written in -- C in UNIX and Win32, C++ in BeOS, etc. MenuetOS was designed specifically to make developing assembly applications easy, so the best choice was to write the OS itself in assembly.
For OSes which aren't intended to be general-purpose, such as embedded systems and microcontrollers, the overhead introduced by mechanical translation (ie compilation) of C into assembly can be unacceptable. Compilers aren't as smart as humans, especially when it comes to the sorts of fiddly little optimizations required on embedded platforms, and writing directly in assembly guarantees there won't be a compiler mucking up carefully-designed algorithms.
Presumably you can write a compact and fast OS. Though you may not be able to write it quickly, and you lose any hope of trivial portability.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With