~vdupras/duskos-discuss

The return of the HAL

Details
Message ID
<d4cdba8e-561d-4709-a3d6-5a585085c6e1@app.fastmail.com>
DKIM signature
missing
Download raw message
Hello all,

Those who have been following Collapse OS development for a while know that I
tried at some point to have what I call a Harmonized Assembly Layer, a sort of
cross-CPU simplified assembler. It worked, but the cost in binary size was too
great for its benefits, so I removed it. This is my second take.

This is a much different approach. Now, much of the mechanics for the HAL
assembler is directly in each native kernel. Not only that, but the kernel
isn't a kernel anymore, it's a kernel *assembler*. The binary at boot has
almost no word that a Forth needs. No "@", no "!", no ",", no "dup", no "over",
only HAL words (words that assemble native code) as well as the bare minimum to
get the bootstrapping process started (the interpret loop and the ability to
define new words).

What's the point of all this? Replace former comp/c/vm directory. With the HAL,
such a layer isn't be needed anymore and simplifies DuskCC. A kind of
under-powered LLVM. Unlike comp/c/vm, the HAL can also be used directly, like a
regular assembler trading off encoding flexibility for the ability to write
cross-CPU code. It could also be used by compilers for other languages.

After a month of development at breakneck pace, the transition to the HAL, which
implied pretty much a full DuskCC rewrite, is complete! On both POSIX and i386,
all tests pass. I'm really happy about the result and I think that it will open
the door to many new opportunities. The initial HAL design held well to its
fitting into DuskCC, although the whole effort was much larger than anticipated.

You can read more about the HAL in doc/hal[1].

Regards,
Virgil

[1]: https://git.sr.ht/~vdupras/duskos/tree/master/fs/doc/hal.txt
Reply to thread Export thread (mbox)