by linuxontheweb · 3y ago · 0 comments
[1] For whoever doubts that a proper Linux distro can be created through pure Javascript running in a browser, you obviously haven't tried out https://linuxontheweb.github.io/ yet!
Your project is essentially an incomplete implementation of a shell where all commands are builtins, and the interactivity is limited by what you directly programmed in JavaScript.
What you are trying to make is a lot harder than you think, you first need to emulate a CPU and go from there, not read whatever user types and try to behave like a Linux system, which ChatGPT can do already.
What shell it is using? It doesn't seem POSIXy (eg I can't `echo $$` to see the shell pid), and the filesystem is pretty bare
I've previously tried to implement all of those sorts of POSIX-isms, but I've recently been wanting to make the tradeoff where code simplicity and understandability trumps all other considerations. Then, when others start coming on board the project, we can start making determinations about what kinds of "proper" shell functions to support.
So, at this point, "bare yet dependable" is what I'm going for! You can actually get more feedback about the filesystem through the desktop interface. You can show an icon cursor by pressing the 'c' key, and then move it over a file icon. Then, just press the 'p' key to show the properties of the file.
Help page here: https://linuxontheweb.github.io/www/docs/help.html
One guy even made a RISC-V emulator inside VRChat using a shader[1]. Doing it in JavaScript will probably be easier, and I wouldn't be surprised if someone has done that already.
Until you emulate a CPU architecture and boot an actual Linux kernel, it isn't quite fair IMO to call it "Linux".
Cool stuff