logoalt Hacker News

asveikauyesterday at 3:58 PM2 repliesview on HN

> And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js?

I bet somebody has done that.

https://www.google.com/search?q=os+kernel+in+javascript

Seems like a small number of hobbyists have attempted.

I've heard of people doing this with other high level languages. Basically you need enough low level code to bootstrap a VM. Once you have that, you can make the high level language decide some logic that traditionally would be in C code, like manipulating page tables or whatever.


Replies

gwbas1cyesterday at 4:11 PM

Automatic Garbage Collection in a kernel probably won't work:

I vaguely remember hearing about someone trying to use .Net in the Windows kernel.

The big problem is garbage collection: If I remember correctly, the fact that "any" operation can fail with an out of memory exception was a huge problem. Another problem was that random pauses for garbage collections in the kernel had major stability issues.

In short, I hope that the js kernel is for amusement and education; otherwise it would need a much more advanced garbage collector then earl 2000's .Net.

show 1 reply
leoedinyesterday at 4:21 PM

You'd need to write an entire hardware abstraction layer to do anything useful. There's projects that do this for microcontrollers - eg MicroPython and Espruino.

show 1 reply