On Wednesday, 15 July 2026 at 05:26:40 UTC+2 andrewgu...@gmail.com wrote:
> I've been looking around at the space, and noticed that porting efforts for
> Inferno (The Challenges of porting Inferno to RISC-V, Stephansen; Porting
> Inferno OS to ARMv7-M and Cortex-M7, Berven) onto newer platforms would be
> helped by a tighter definition of the semantics of the Dis VM.
>
> Are there any internal documents that describe the behaviour of the Dis VM
> in a more precise or detailed manner? If not, what about any specification
> efforts to tighten down the description of the Dis VM?
I thought there were efforts before to write an improved specification,
though maybe I'm mistaken. There were efforts to write independent
implementations. There's this one, at least:
> I'm asking this because I'm really interested in Inferno, and I think it
> would be a fun project to try to document the semantics of the Dis VM.
> Kind of as a learning project, because I want to learn to read other
> people's code, and also dip my toes into formal methods.
>
> My professor is willing to help me figure this out, so I won't be flying
> blind, but he's also not too familiar with Inferno. He is, however, a
> formal methods junkie.
This sounds like a good situation to be in. You want to learn about
something, tie it to a field of study, and you have a supportive professor.
> Something I've noticed is that the document "The Dis VM Specification" on
> the inferno-os website (https://inferno-os.org/inferno/papers/dis.html) is
> an informal specification that explains per-instruction semantics in prose,
> leaving the reader to interpret any ambiguities by consulting the C source
> code, or the VM execution itself.
>
> For example, in the description for the case instruction:
>
> pc = 0..i: dst[i].pc where
> dst[i].lo >= src && dst[i].hi < src
>
> Meanwhile, the prose says, "searches the table for the first matching value
> where the src operand is greater than or equal to the low word and less
> than the high word"
Yes, it looks like the logic is inverted in the prose.
"icase" corresponds to the case instruction. I imagine that "icase" was used
because "case" is reserved for the case keyword in C.
> While it's extremely tempting to outsource the work to LLMs, so it's
> actually done quicker, I do not want to shortchange my own learning.
> Anyway, I do think that people immersed in this ecosystem may provide
> better insights than an LLM.
Another useful approach you can try to help understand what the VM does is to
generate code with the Limbo compiler then disassemble it with the disdump
tool, or run Limbo to generate source text for the assembler.
disdump <.dis file>
limbo -S <.b file>
This should help with understanding.
> Anyway, this is my first post in this user group :)
Welcome!
David
--
You received this message because you are subscribed to the Google Groups "inferno-os" group.
To unsubscribe from this group and stop receiving emails from it, send an email to inferno-os+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/inferno-os/d24dd43a-5fea-4317-9cbf-3fc0a33aee31n%40googlegroups.com.