I've been feeling a bit more confident with gcc-m68k and I've been increasing the complexity of the programs. I managed to link in the gcc library (libgcc), I tried out the -msoftfloat option (compile, I didn't check the results of a floating operation yet) and I created my own putc and getc functions using the USART of the MC68901 (MFP) in pooled mode.
I want to change my CRT0.S to include some hardware support functions before main() is run. Initialize the interrupt vectors (pointing to a "interrupt error" routine), printing some console message during initialization and doing some hardware test (RAM, MFP).
I'm still unsure of a few things:
- An interrupt level 7 is basically a NMI, my system switches from ROM to RAM at the 8th clock, at the 9th clock if a NMI is pending the CPU will jump to an uninitialized vector! I must read the specs again but I think this could be a problem. Or not, if the system is int7 incapable (IPL2/0 or IPL1 permanently to 1) or has a gate enabling interrupts;
- the MFP interrupt is physically enabled (i.e. connected to the CPU or gated by self for example)? (see point above), how does gcc link to interrupts (newer gcc versions work well ex. AVR-gcc), how do I place the vectors in memory?;
- I want to build a gdb-stub/rom monitor, will it handle the vector allocation/writing? If so, my operating system (loading from somewhere ROM or disk) will also be in supervisor mode? (and also handle these?);
- Can/Should I implement some sort of memory protection (writes to first 1K-vectors and last 1K-SupervisorStack of RAM must be made in supervisor mode)?;
- For the end project of a CP/M 68k what type of media do I use? Going back to floppies would be definitely cool but I'm sure I would need some sort of DMA as I don't think the 68000 is fast enough (and surely not at the current speed of 4MHz). With SD I'd use only a few I/O pins (from the MFP?) but some SD cards are only 3.3V and my system runs at 5V. Or I could use a Compact Flash card, most can work at 5V, and it is easy to get some old CF cards (64/128MB) or even a IBM microdrive I've found once here; I would need to build two 8bit ports (A output to control the drive, B for bidirectional data) and this is breadboard space...
- I would also like to "upgrade" the logic circuits to one of the M4A5-32/32 I've build an adaptor for and change the DTACK circuit to actually drive the line when releasing the bus (until AS goes high).