EdNutting wrote:I had worked with Cosmos before I started my own project
Okay, that makes a little more sense. I've been using C# since the 1.0 Beta, but it's taken me over 4 years to get an OS that could see a USB 1.x controller and detect connected devices.
And wow okay - that's sounds even more nuts than writing one in C#! I'm rather curious how you can make XML a functional language not just a data syntax?
The key is using XSD files to define elements, and XSLT files to convert those elements into lower level elements. (It's similar to inline functions in C++)
My code is up on
https://ozone.codeplex.com if you want to take a look. (One of the advantages to writing everything in XML is that it's easy to read and convert to other languages.)
I started out using C# to write instructions (byte codes) out to a stream, but a co-worker of mine actually suggested using XML instead, after we worked out that "code" is basically just data in a platform specific format (x86, ARM, MOS, etc.). So I started digging up all of the byte codes for all of these platforms, along with any interesting constants, like memory locations and I/O port numbers, and saving all of them as name-value pairs in XML. Then I wrote two XSLT transforms to convert each of these files into an XSD schema, and an XSLT transform that would convert the elements defined in the XSD into byte codes. Then I just read all of the byte codes and write them out to a stream (.iso file, floppy image file, or actual floppy drive).
Once all of this was in place, I started creating more XSD/XSLT files that would transform function call elements into multiple instructions, and then I started combining these function calls into "class" files (written in XML, of course). Then I just wrote a console shell that lets you type the name of a class, and a method, and the returned value would be converted to a string (.ToString), and displayed on the screen. You can even chain them together, like C#. (i.e. System.GetTime.Hours.ToString.Length)
Most of the compiler work is done with XSLT files, but there are a few things that I'm doing in C#, like calculating memory addresses and disk block indexes, etc. Also, the code that runs all of the XSLT transforms is written in C# as well.
There is a rather lengthy post about it here:
http://forum.osdev.org/viewtopic.php?f=15&t=27971
That thread has a video of the system up and running. (on page 3...)
All the best and I have to say, reading these forums over the past few months has already been a useful source of information (even if it is rather hard to dig-out / find at times!)
Ed
Agreed. This is one of the best resources on the internet for low level development.
Feel free to edit the wiki to add missing information or clean up the existing pages. I've found that adding detailed information to the wiki and answering questions on the forums actually helps me understand what I'm talking about faster than anything...