当然是可以的。
这个是 2018 osdi 上面的一篇 paper : the benefits and costs of writing a posix kernel in a high-level language。在这篇 paper 中,作者就对比了用 go 语言和 c 语言写操作系统内核的区别,最后的结论是:
in experiments comparing nearly identical system call, page fault, and context switch code paths written in go and c, the go version was 5% to 15% slower.
在比较用go和c编写的几乎相同的系统调用,页面错误和上下文切换代码路径的实验中,go版本的速度慢了5%至15%。
除此之外,google 开源的 gvisor, go 语言实现的用户态的 linux 内核,也可以了解一下。
相关推荐:golang教程
以上就是golang能写操作系统吗的详细内容。