Re:Xv6 – A Simple Unix-Like Teaching Operating System
by webkike on Monday November 17, 2014 @05:04PM
(#8620963)
None of the tiny self-compiling C compilers could possibly used to compile xv6, as none of them implement structures (arguably the hardest part of compiling C code).
Re:Xv6 – A Simple Unix-Like Teaching Operating System
by lamacase on Monday November 17, 2014 @05:18PM
(#8621054)
The guy who did the C4 compiler also has a more fully featured one that does support structures:
https://github.com/rswier/swieros/blob/master/root/bin/c.c
It's part of an OS he's building based on xv6
Re:Xv6 – A Simple Unix-Like Teaching Operating System
by webkike on Monday November 17, 2014 @09:32PM
(#8622085)
Very cool, although this implementation is significantly less trivial than C4. The difference is over a thousand lines!
Re:Xv6 – A Simple Unix-Like Teaching Operating System
by arto on Monday November 17, 2014 @05:39PM
(#8621166)
LICE is a public-domain C99 compiler in about 10 KLOC:
Re:Xv6 – A Simple Unix-Like Teaching Operating System
by e12e on Monday November 17, 2014 @09:30PM
(#8622080)
There's also TCC which at one point was able to compile (a somewhat patched version of) the Linux kernel. Also c99, but I thibk it might be closer to 20kloc these days?
However, I wish they'd use something other than GAS for the Asm parts... a minimal self-assembling assembler (and a C-subset compiler written in it, to bootstrap the whole thing) would be nice.