You can do
everything in Assembler, the question is whether you'd
want to. I know we have a couple of die-hard evangelists here, but the simple matter of fact is that ASM is outside the "sweet spot" of effort-vs-benefit when used for the whole of a large-scale project like an OS kernel. Having
parts in ASM is quite obviously not only acceptable but
required. But deciding on ASM as language-of-choice for a desktop OS project begun today, is about as "insane" as e.g. Java on the other side of the pond. While not getting you a place in the asylum outright, it's quite the initial suspicion. [1]
C is probably
the most well-suited language for kernel work, combining close-to-the-metal functionality as well as high-level language primitives. It's also very, very well understood and documented.
C++ comes a very close second - as Rusky correctly pointed out, initially it can easily and painlessly be pared down to zero runtime requirements; those requirements can be satisfied retro-actively with little effort; it allows the same close-to-the-metal coding as C does; and it provides even higher-level primitives that make maintenance of a large code base (like a kernel) easier. It, too, is well understood and documented, and few people (outside the LKML) will look askance at you for using it in kernel space. It allows to hide complexity behind beautifully simple interfaces. The downside is that C++ makes it somewhat easier to write code that
looks simple but is quite inefficient. This can
easily be avoided by programmers of appropriate skill, but it takes some discipline and attention, while C requires more ineptitude (or mallice) to screw up in this regard.
Then there's a gap until the next-best contenders show up on the map. There is invariably some involved tinkering required to satisfy their runtime requirements in kernel space, and they are rather "esoteric" choices for kernel work (at least when compared to C/C++). I would list Obj-C and Pascal in this area; I don't know enough about ADA to list it or not. There's always the Singularity project popping up in discussion at this point, as proof-of-concept that one could code in C#, but I don't have read enough on that either to judge. The
WP site lists ASM, C, C++, C# and Sing# as languages, so I assume the "tinkering required" is quite involved, and I don't see much (if any) benefit in C# compared to C++ in this area, but YMMV.
(On second thought, this group of languages is "somewhat esoteric" for
any kind of software work.
)
Then there's another, larger gap before we come to the languages that
might be possible, but are
clearly inappropriate for kernel work because they combine prohibitive runtime requirements with no technical advantage whatsoever. Java or VisualBasic have to be listed here - languages aimed at RAD-style coding, the yearning for which usually betrays a programmer who would like the bragging rights of OS development, but is afraid to touch a pointer with ten-foot pliers because he heard they are evil (or actually learn a second programming language after he payed so much for that distance-learning "Java in 21 days" course).
Then another gap until we get to the "ridiculous" section, like JavaScript or XML.
[1]: To clarify. I don't doubt there are people out there who can, with intense care, discipline, and outrageous skill, write ASM code that outperforms optimized compiler output
for a specific CPU. I know a couple of them myself. But such people are few, people capable of
maintaining such code are even fewer, and the effort required to write (or maintain) ASM code at this level is quite intense. And with the next generation of the CPU (or the compiler...), your ASM code might again be outperformed by generic C. Outside the critical path, I say the benefit is simply not worth the effort. Even
inside the critical path, I would
always write the code in C/C++ first to see what the compiler makes of it, and to benchmark my ASM code against it (automatically, so I can test and re-test my code against later CPUs and compiler versions). ASM has its niche, in which it shines, but outside that niche it's just as outclassed as any other language outside its niche.