commit 935b0db17b846de4d163397d2b78691aab1cc8f2
parent 11c3fc010221669ecc8ef44223f57f4de9326615
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Fri, 18 Nov 2022 19:13:29 -0500
Update README
Diffstat:
M | README.md | | | 35 | ++++++++++++++++++++++++++++++++++- |
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -41,7 +41,9 @@ To be clear: this is a research project, we don't know what it will yield
beforehand. We have the intuition that it might lead to a big "ah ah!" moment
and reveal a breathtaking combination of power and simplicity.
-## A whole OS built from source on boot
+## Features making Dusk OS special
+
+### A whole OS built from source on boot
One thing that makes Dusk OS special is that it boots from a very tiny core
(1000 lines of i386 assembly). From this tiny core, on boot, it builds its way
@@ -63,6 +65,37 @@ generated in the first place. This is so much simpler!
Object files? Global symbols? Nah. C functions that don't have a static storage
type are simple Forth words.
+### Shortest path to self-hosting for a C compiler
+
+Dusk OS self-hosts in about 1000 lines of assembly and a few hundred lines of
+Forth (the exact number depends on the target machine). From there, it
+bootstraps to a C compiler, which is roughly 3000 lines of Forth code (including
+arch-specific backend and assembler). To my knowledge, Dusk OS is unique in that
+regard.
+
+You can pick any C compiler that requires POSIX and it will automatically
+require order of magnitudes more lines of code to bootstrap because you need
+that POSIX system in addition to the C compiler. So even if you pick a small C
+compiler such as tcc, you still need a POSIX system to build it, which is
+usually in the millions of LOCs.
+
+In your search for competitors for DuskCC, you can go back in time and look for
+simpler systems that have a C compiler. There's plenty of them, some of them
+open source. For example, there is FreeDOS, an open source implementation
+compatible with MS-DOS. It can certainly run a C compiler, but its kernel is
+26 000 lines of C and assembler and building it requires Open Watcom, which
+clocks at more than 2 000 000 lines of code (since it's an IDE, it's probably
+only a subset of it that is actually needed for compilation, but I haven't
+looked closely enough to have a precise figure), and NASM which is 15 000 lines
+of C code for its "juicy" part (the assembler).
+
+You can try to dive further down the history lane for even simpler systems such
+as CP/M and BDS C. But even then, you're still looking at 25 000 lines of
+assembler for BDS C and it's going to lack backends for modern CPUs.
+
+So, unless someone tell me about some option I don't know about, DuskCC is quite
+innovative on the aspect of self-hosting path length.
+
## Who is Dusk for?
The target Dusk user is someone who's [creative][creative], close to hardware,