IRC channel logs

2025-05-12.log

back to list of logs

<stikonas>mihi: indeed. And posix-runner does already disable interrupts, I had to do that in order to emulate "syscalls"
<stikonas>and anything pre posix-runner wouldn't care about paging
<nikolar>I have a silly question, does anyone know of an easily retargetabble c compiler
<nikolar>I'd like to mess with implementing a CPU on an FPGA and it would be handy to have a c compiler
<stikonas>nikolar: well, we have M2-Planet...
<stikonas>in the machine code -> GCC chain that's the first (subset of) C compiler written in (even smaller subset of) C
<nikolar>Interesting
<stikonas> https://github.com/oriansj/M2-Planet/
<nikolar>I'll have to take a look
<stikonas>recently it gained quite a few features mostly thanks to gtker
<nikolar>Oh it just has bit ifs for arch selection, simple enough
<nikolar>Thanks!
<stikonas>though with current optimizations it needs at least 8 registers
<stikonas>the downside is that it emits M1 assembly and not GAS compatible...
<stikonas> (https://github.com/fosslinux/live-bootstrap/blob/master/parts.rst might provide some more context to it)
<nikolar>Interesting, how does it handle different classes of registers
<nikolar>(like n68k's address and data registers)
<nikolar>And I imagine I can make it output whatever assembly I want, I don't necessarily target bootstrappability
<stikonas>how are they different in practice?
<stikonas>at least on other arches, registers don't really differ, we just picked some for specific roles
<stikonas>not necesserily matching ABI's used by GCC/Linux, etc...
<stikonas>though for most arches at least base and stack registers are conventional
<nikolar>On m68k, some instructions only accept either data or address registers
<nikolar>And some addressing modes can only use address registers
<nikolar>And such
<stikonas>I see...
<stikonas>well, you could see if in those new emit functions (in cc_emit.c) you could somehow match registers / instructions to the ones that n68k needs
<stikonas>presumably you can move data between registers?
<stikonas>that's another option (if that works)
<nikolar>Yeah, you can
<nikolar>And a few addressing modes work with both types, etc