5 ms·
Is this really possible in a real device? I would like to have a typewriter which really can not run anything except of vim.
by eimrine 4y ago
Is this really possible in a real device? I would like to have a typewriter which really can not run anything except of vim.
- bschwindHN 4y agoAnything is possible with enough work!
- theK 4y agoJust keep in mind that vim is capable enough to execute other binaries, even start a shell as a subprocess.
- codesnik 4y agoI wonder, if processes started in those subshells, even normally terminated, would accumulate without normal init program? I forgot if "reaping" is something special to do.
- guipsp 4y agoPid1 must reap, yes
- mike256 4y agoReally? I think the processes would just accumulate and after some time you require a reset. Imho the same way as WSL-1 (unfortunately WSL-2 is still a no go if using citrix hypervisor) works in Windows. Okay, not really fair. It mostly works but I till get such on reaped, unkillable processed way more often than in a normal linux.
- Brian_K_White 4y agoI think they were agreeing with you that it's a problem. I don't know if it is or not myself, just saying how I read that comment.
- II2II 4y agoI did something similar years ago, though it may have been under NetBSD. The important thing to remember is that init is just a program. It is an important program since it does some setup and starts some services, but any other program can take its place as long as it doesn't depend upon the initialization performed by init. For example: the article mentions statically linking Vim. That is because most systems place shared libraries in /usr/lib, with /usr being on a separate partition. Mounting other partitions is part of the setup stage, so programs that use shared libraries are unlikely to work. That is no longer a concern with static linking. (If I recall correctly, shared libraries will still work in such a scenario if the required libraries are on the root partition. Yet that takes much more effort to setup.) The kernel proper provides enough to run generic programs up to and including a terminal emulator. If you want to run programs with dependencies, you could still bypass init by writing a script that only does the necessary initialization.
- midasuni 4y ago> most systems place shared libraries in /usr/lib, with /usr being on a separate partition It’s not 1995 any more.
- ObscureScience 4y agoI would however say that the justification for using /usr/bin is to simplify the possibility of having most of the system on a separate partition. Merged mounts and namespaces à la Plan9 would be an elegant alternative
- amelius 4y agoEven if it is possible, you still have to wait for your system to boot.
- marginalia_nu 4y agoIt's pretty fast though. I experimented with minimal sysv init setups a bit about 15-20 years ago. I got boot times of like 10-15 seconds. This was off mechanical hard drives. Your average system took minutes to boot back then. I'd guess modern hardware would boot basically in a second (after POST).
- amelius 4y agoI wonder when we finally get lazy booting. I.e., services get initialized when they are actually being used.
- marginalia_nu 4y agoI question whether there's any point to that. Would just make the system randomly and inexplicably sluggish until everything been fully initialized. That's a pretty miserable experience.
- amelius 4y agoWhy? The system can still boot stuff in the background, even if it's not needed yet.
- marginalia_nu 4y agoThat makes stuff sluggish though. I have a laptop that does that. A full minute after it's at the desktop, it can't even render the mouse cursor smoothly, it's so busy doing stuff in the background. I'd rather wait until its responsive than have this.
- qbasic_forever 4y ago
- graypegg 4y agoA visual editor might be a bit too much for a typewriter, so clearly we need boot-to-ed.
- eimrine 4y agoMaybe it should not support something as progressive as letters as well? Let it be some analog of MS Paint instead of text editor, a rock painting simulator. Fits greatly to a modern smartphone.
- qbasic_forever 4y agoDefinitely possible but IMHO I would go a teeny bit further and setup a lightweight WM like XFCE or openbox and configure X11 to run FocusWriter on boot (could even configure a systemd user service to ensure it always stays running): https://gottcode.org/focuswriter/ https://gottcode.org/focuswriter/ Search around for Linux kiosk mode and you'll see tons of options for booting full screen to an exclusive X11 app. FocusWriter looks amazing and can even turn on typewriter sound effects with every keypress.