As far as I know, there are not many OSes completely written just in Assembler, most of the OSes have the the kernel (and even, not all the kernel, but just some of the functions) written in ASM. One of the reasons is to take control over the CPU and the machine, sometimes C/C++ just do not provide statements to do so, or they just take "too" long (several millisecs!!!) because of the function callings, etc.
For example, if you want to control cache, you'll probably prefer to take control of it directly with ASM. Or if you have to take control of the MMX/SSE resources (I don't guess for what... but who knows!

) you can just access them using ASM or with the Intel Intrinsics library... I just cannot imagine an OS which is dependent not only on an architecture but also on a proprietary library...
Another differente question is why isn't so common to embed Assembler code in C/C++ code... I prefer this option, however, "puritans of the Assembler" prefer to write the functions completely in ASM... not sure why they prefer to take control of the arguments, initializations of the variables, etc. For me, C/C++ just do a great work with those items.
Reply