Close

Starting a compiler and some design updates

A project log for Evolving 68K

Because I'm too poor for a full computer

floppidydingoFloppidyDingo 10/20/2016 at 04:491 Comment

So I have quickly found out how tedious it is to write programs entirely in assembly, and I can't seem to find a way to get C to target this system, so I'm creating my own small program language that's C based, it's going to be called D. This language is system agnostic, you can target any system you like with it, with little to no modification. And you can get it to target different CPUs by telling it to translate with a different definition file, which is a file that tells the compiler what to translate the D instructions into.

What the compiler will do is translate the D code into assembly code, then pass the asm file to this assembler: https://sourceforge.net/projects/sjasmplus/ . Then a binary file is generated and you can upload it to whatever you want.

I'm also starting the design of the OS, called Walls (i am so going to be sued), which will be a multitasking OS with some form of GUI. The way it works is that a timer will supply an interrupt at a set interval, and that interrupt triggers the task scheduler to save the CPU state for that task, then move on to the next task, loading its CPU state. When Walls first starts up, it scans all the entire IO space and determines the available hardware. It then loads resources called System Artifacts, which are packets of data that describe certain things such as configurations, drivers for the scanned hardware, startup applications, and other things. The Artifacts reside in reserved drive sectors so they can be read without a file system. This is pretty much like the Registry in Windows. After it loads everything it needs, Walls then initializes the hardware and sets the graphics mode to Graphic, since it starts off in Text mode, and then loads the UI and then the user can do what they like. The OS can also go into ROM mode, where it loads a ROM file into the RAM and then tells the CPU to jump to that data, while disabling the timer interrupt. So pretty much the OS goes to sleep and the ROM file takes over. To go back to normal operation, the ROM has to jump to an address that contains code to resume normal OS function.

I also have a pinout made for the expansion ports:

I'm also going to add an interrupt controller to the chipset so that way the system can handle more than two interrupts. And I might add a DMA engine. Maybe.

Discussions

ziggurat29 wrote 04/02/2018 at 17:33 point

By all means create your own compiler if you think it's fun.  But I can report success using this C compiler that targets old 8-bit systems, e.g. Z-80:

http://sdcc.sourceforge.net/

Also, be aware there are (a couple) languages named 'D' already; e.g.:
https://en.wikipedia.org/wiki/D_(programming_language)

https://www.codeproject.com/Articles/13639/Db-The-Future-Is-Coming

Have phun haqueing!

  Are you sure? yes | no