For the C compiler that I developed to replace the GNU Mes compiler in the live-bootstrap project, I also used a Forth like language that uses two stack. One stack for parameters and return values and one for the return addresses and local variables. The Forth like language is transpiled in assembly and through some steps made into an ELF file. The targets are: x86, x86_46, and arm64. Work on supporting riscv64 has started, but is currently on hold due to other responsibilities. If there is anyone willing to complete it, I do have some small funds as a bonus.
> An alternate way to go about this is to sidestep that complexity entirely and build your own OS.
> We'll go bare metal and then build an operating system of our own, with a C compiler of our own. It's simpler this way.
I love the audacity of those statements. And I appreciate this sort of approach which says "let's implement the simplest possible version of _______ to learn how it is done."
Oh yeah, this is right up my alley. I've been thinking about making a Forth on bare metal for a while (made a Forth interpreter in C last summer, and a tiny amount of testing stack manipulation in hand-assembled machine language on a C64U), and the thought I (coincidentally) had moments before seeing this link was about making a boot sector on some floppies I just got for my 8088 IBM PC. I know that will only work for the Real Mode part but it might be fun to start there anyway. Edit: I knew about CollapseOS but didn’t realize this had been around too.
For the C compiler that I developed to replace the GNU Mes compiler in the live-bootstrap project, I also used a Forth like language that uses two stack. One stack for parameters and return values and one for the return addresses and local variables. The Forth like language is transpiled in assembly and through some steps made into an ELF file. The targets are: x86, x86_46, and arm64. Work on supporting riscv64 has started, but is currently on hold due to other responsibilities. If there is anyone willing to complete it, I do have some small funds as a bonus.
> An alternate way to go about this is to sidestep that complexity entirely and build your own OS.
> We'll go bare metal and then build an operating system of our own, with a C compiler of our own. It's simpler this way.
I love the audacity of those statements. And I appreciate this sort of approach which says "let's implement the simplest possible version of _______ to learn how it is done."
Oh yeah, this is right up my alley. I've been thinking about making a Forth on bare metal for a while (made a Forth interpreter in C last summer, and a tiny amount of testing stack manipulation in hand-assembled machine language on a C64U), and the thought I (coincidentally) had moments before seeing this link was about making a boot sector on some floppies I just got for my 8088 IBM PC. I know that will only work for the Real Mode part but it might be fun to start there anyway. Edit: I knew about CollapseOS but didn’t realize this had been around too.
Related. Others?
Tumble Forth - https://news.ycombinator.com/item?id=38184539 - Nov 2023 (22 comments)
Point of clarification: Rummaging through that site, and as far I can see - the Forth language is not used.
It is. When you read "6. A Tale Of Two Stacks" you can be pretty sure that Forth is involved.
They start implementing their Forth in chapter 4: https://tumbleforth.hardcoded.net/01-duskcc/04-wordsshell.ht...
Did you miss the C compiler written in Forth?