Live data from Hacker News

UEFI Bindings for JavaScript

codeberg.org

51–60 of 117 posts

Re: UEFI Bindings for JavaScript

#51

Can someone break this down for me? Looks like it's using... C? to load a js interpreter which bootstraps an API around all UEFI features? Do I have that right? And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js? Or are there other abstractions that would need to be migrated first?

> 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 leve…

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.

Re: UEFI Bindings for JavaScript

#56
post #54

This is hilarious lol, it’ll be any day now before we get a full JS kernel. Garbage collection could be an obstacle, but I know there have been some kernels written in Go/Java before

Who needs to garbage collect? Just leak memory until the system dies! That strategy seems to be good enough for claude code, anyway.

Re: UEFI Bindings for JavaScript

#58

Can someone break this down for me? Looks like it's using... C? to load a js interpreter which bootstraps an API around all UEFI features? Do I have that right? And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js? Or are there other abstractions that would need to be migrated first?

> 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 leve…

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.

Re: UEFI Bindings for JavaScript

#59

Can someone break this down for me? Looks like it's using... C? to load a js interpreter which bootstraps an API around all UEFI features? Do I have that right? And, if so, does that mean that once the API has been bootstrapped, one could actually write an OS in js? Or are there other abstractions that would need to be migrated first?

You don't need a JS bootloader to write an OS in JS. The bootloader just drops the machine into some memory address for it to start executing your OS init script. that bit could be a Javascript interpreter. You can't do much with the architecture in Javascript though, because it doesn't allow you to map memory directly to your types (unless there's some ungodly nonesense I'm not aware of) so you'll have to drop into C/asm to e.g. interact with the ports/registers/tables to set up userspace.

Re: UEFI Bindings for JavaScript

#60
post #54

This is hilarious lol, it’ll be any day now before we get a full JS kernel. Garbage collection could be an obstacle, but I know there have been some kernels written in Go/Java before

It could be even better!

https://en.wikipedia.org/wiki/Java_processor

Post reply on HN