3 ms·
How do you start writing an OS in a language other than C?
by lambda_obrien 6y ago
How do you start writing an OS in a language other than C?
- aidenn0 6y agoExactly the way you start writing an OS in C. You implement just enough of the language runtime to boot to a hello world, and then iterate from there. C has a runtime (stdin, stdout, stderr, a heap, a stack), it's just so minimal that people don't think about it much. [edit] I should point out that it's typical for a common-lisp implementation to have builtin tools for manipulating pointers and generating arbitrary instructions (since both of those are needed to implement the compiler anyways, and lisp compilers are typically self-hosting).
- higerordermap 6y agoTo add to this, there's an OS written in Go in similar way https://pdos.csail.mit.edu/projects/biscuit.html https://pdos.csail.mit.edu/projects/biscuit.html
- deleted 6y ago[deleted]
- thu2111 6y agoYou write an ahead of time compiler to machine code for your language. You write a program that is then compiled to native code. You do a bit of assembler glue to set up an execution environment that your language runtime needs. You link them together, do a bit more glue to turn the result into a bootable disk image. Done. You start out in kernel mode and will have to do a lot of work to bring online a conventional OS-like environment, but from that point on there's nothing really C-like required.