LaTeX and Linux kernels compared
Doug McKenna
doug at mathemaesthetics.com
Thu Oct 19 21:02:49 CEST 2023
Jonathan -
>| Both LaTeX and Linux have a kernel. I'd appreciate a concise statement of their differences and similarities.
Here's my attempt at an answer:
For an OS such as Unix or Linux, the kernel is the set of subroutines representing services made available by the OS at a very low low level that typically manage hardware access, security, and other stuff that needs to be protected from higher order processes, programs, apps, etc., especially with respect to any shared resources that must be managed safely among competing processes wanting access, especially when they are running "simultaneously" (interrupts, multitasking, time-sharing, choose your terminology). Calling these special kernel routines can also involve changing hardware state, particularly with respect to process privileges. There's an extra doe-see-doe dance that goes on when calling a kernel subroutine, as opposed to one of a program's own subroutines.
In the TeX world, there's no such thing as multi-tasking; every job runs on its own self-contained virtual machine in its own process (as I understand things). The "kernel" in LaTeX (or perhaps LaTeX 3) is referring to the low-level set of macro subroutines or primitive re-definitions that have been built atop the TeX primitives so as to provide higher-level services to LaTeX's own macros and to jobs using those LaTeX macros. To the extent these macro "subroutines" in the kernel replace TeX primitive commands in a manner that prevents a LaTeX job from restoring original meanings, then the LaTeX kernel is in a way protecting against abuse or other harmful "lower-level" access within TeX's innards in a similar way to the Linux kernel's responsibilities. I don't have a clear idea of how protective such a set of re-definitions are; it depends on what the LaTeX format file has saved in its state, and how much information the format might have thrown away before that fateful \dump command.
TeX's virtual machine is designed for source code to have access to everything in the virtual machine. If that's still true after the LaTeX kernel has been loaded, then the meaning of "kernel" in LaTeX-world is a subset of the meaning in OS-world.
But I'm not a LaTeX (3?) kernel grokker, so take the above guesses with a kernel of NaCL.
- Doug McKenna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/texhax/attachments/20231019/1fd96455/attachment-0001.htm>
More information about the texhax
mailing list.