Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Unoptimised C for kernels. That's what uck is. It isn't good for apps, thus uck!!!
I am wondering if anyone would like to develop this compiler with me. It would be totally unoptimised. It would basically have a 1:1 assembly ratio. Inotherwords:
and other osdev specific stuff. This would be great to use because you don't have to worry about any optimizations or register trashing(not as much anyway).
Anywho, reply if you want to help out and i'll give you more info on how to contact me. If no one replies then i guess it won't be coded.
As far as unwanted optimizations, can't you just set the optimization level to 0 with a -O0 ? There may be other useful things in your compiler, but as far as the optimization goes I would think this would take care of it pretty well. But idk the internals, maybe it's still not unoptimized enough.... (or should this be "over optimized" )
Yeah you can, I mentioned that possibility too. But for one, GCC limits what you do with your code. IIRC, it must be open source or the like. I also want simpler inline assembly. I hate AT&T asm. I want intel type asm.
That's about it. I really just want to make my own C compiler that outputs nasm syntax asm.
Anyway, anyone interested in helping, I hope so. Post if you want to help. :-\
i'm not sure i would really be interrested by such a one-to-one translation. I'm fine with a compiler that sees i'm doing "x*=3" and implements it with "shl <reg>,1; add <reg>,<x>" ...
On the other side, i would be very interrested by a C compiler that could receive "language plugins" so that i can for instance have a
beyond infinity wrote:
...as if they were the holy grail of all things and able to keep earth away from spinning round the sun...
Harumph.
All I wanted to point out is that it is quite likely that Pype's favourite C compiler (which I assume to be gcc) is already capable of the things Pype is looking for.
OK, I won't mention them again.
Them? Who's Them? Dunno, I've forgotten...
Every good solution is obvious once you've found it.
ok, nm then. Screw that idea. It was gonna be more like a C to asm converter than anything. Like i said that made asm that could be read by nasm. Faster, closer to hardware, easier inline asm. outp() would be a asm command not a lib function. Stuff like that.
But nevermind, it seems i'm the only one that sees any reason to code such a thing.
Do not just kill off your ideas cause others do not support it initially. You could have an idea that is initially dismissed but after it's implemented and made powerful and useful , discover that there are hundreds of people willing to use it. Think of Linux,I'm sure if Trovald had told people he was going to write an OS (kernel) that will one day be a major player in the computing world, everyone would have told him FAT CHANCE.
ok, nm then. Screw that idea. It was gonna be more like a C to asm converter than anything. Like i said that made asm that could be read by nasm. Faster, closer to hardware, easier inline asm. outp() would be a asm command not a lib function. Stuff like that.
But nevermind, it seems i'm the only one that sees any reason to code such a thing.
When I first started designing my operating system, I thought about first writing my own tools and then starting on the development of my os. But for some reason, I decided not to maybe because it was too much work.
I thought about a C to asm converter but at the time I didnt know what kind of assembly language code I wanted to use. My initial design was to support nasm intel style syntax, simpler version of AT&T, and for the Motorola 68HC11 microprocessor.
I would be glad to help out in any way that I can, though I am pretty busy myself.
This could actually be done with a few NASM macros...
Just have a few macros that convert a C-like syntax directly to assembly. It's been done before, and there really wouldn't be a need for a whole compiler to be written, because you could just write a NASM include file with the macros in it.