Self hosting OS/Compiler from scratch
Posted: Sun Jan 19, 2014 12:05 pm
Hello all,
For a long time I've always wanted to achieve the lofty goal of creating a completely self-hosting operating system and compiler from scratch. No external libraries would be used or ported.
I've been coming closer to this goal little by little, whenever I get bored and feel like working on my own projects again
When I was younger I wrote an x86 protected mode operating system with multithreading, ELF loading, a FAT32 file system, and graphical display thanks to the wiki
To demonstrate my understanding of machine architecture, I wrote this mips simulator a while back: https://code.google.com/p/mips-machine/
I have written a simple yet useful top down parser complete with .NET code generation: https://code.google.com/p/game-creator/. However, a recursive descent parser doesn't meet my needs. I always loved how simple and elegant C# is. My language should be able to correctly parse things such as:
So I'm currently learning how to generate a parser table for an LALR parser. I have attempted such a language in the past using the recursive descent method, but that's where I always hit a roadblock. The rest of the language parsed fine
I'm still trying to figure out a general way to do register allocation that will work with x86 and ARM. Once I do, I'll be able to generate code for both those platforms with my compiler.
My ultimate goal is to have a cross-platform, general purpose, self-hosting OS
Any thoughts that might help me along the way? Maybe with parsing and register allocation? I tend not to understand the greek and formulas so well and I just want to figure out how to apply it in my code.
Thanks!
Josh
For a long time I've always wanted to achieve the lofty goal of creating a completely self-hosting operating system and compiler from scratch. No external libraries would be used or ported.
I've been coming closer to this goal little by little, whenever I get bored and feel like working on my own projects again
When I was younger I wrote an x86 protected mode operating system with multithreading, ELF loading, a FAT32 file system, and graphical display thanks to the wiki
To demonstrate my understanding of machine architecture, I wrote this mips simulator a while back: https://code.google.com/p/mips-machine/
I have written a simple yet useful top down parser complete with .NET code generation: https://code.google.com/p/game-creator/. However, a recursive descent parser doesn't meet my needs. I always loved how simple and elegant C# is. My language should be able to correctly parse things such as:
Code: Select all
List<Nullable<int>> list;
f(g<a. b>(c));
I'm still trying to figure out a general way to do register allocation that will work with x86 and ARM. Once I do, I'll be able to generate code for both those platforms with my compiler.
My ultimate goal is to have a cross-platform, general purpose, self-hosting OS
Any thoughts that might help me along the way? Maybe with parsing and register allocation? I tend not to understand the greek and formulas so well and I just want to figure out how to apply it in my code.
Thanks!
Josh