Page 1 of 1
UCK development
Posted: Mon Sep 22, 2003 8:43 pm
by mr. xsism
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:
Code: Select all
int var =0;
var = var + 1;
var == var << 4;
translates to:
Code: Select all
var db 0
add SIZEOF(TYPE) [var],1
shl var,4
There could even be inline asm like:
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.
Regards,
mr. xsism
Re:UCK development
Posted: Tue Sep 23, 2003 12:36 am
by bkilgore
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"
)
Re:UCK development
Posted: Tue Sep 23, 2003 1:11 am
by mr. xsism
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. :-\
Regards,
mr. xsism
Re:UCK development
Posted: Tue Sep 23, 2003 1:15 am
by Perica
..
Re:UCK development
Posted: Tue Sep 23, 2003 1:53 am
by Solar
Misunderstandings abound.
gcc does in no way limit the licensing of your code, and can handle Intel ASM syntax just fine.
Re:UCK development
Posted: Tue Sep 23, 2003 2:55 am
by Pype.Clicker
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
Code: Select all
#plugin <synchronize>
synchronized(lock) {
... some code
}
that could translate into
Code: Select all
{
ksemWait(lock);
... some code ...
ksemSignal(lock);
}
and make sure "lock" had the appropriate type, etc.
Re:UCK development
Posted: Tue Sep 23, 2003 3:51 am
by Solar
Pype.Clicker wrote:
On the other side, i would be very interrested by a C compiler that could receive "language plugins"...
...he says and goes forth describing one of the many nice things you can do with C++ templates.
Re:UCK development
Posted: Tue Sep 23, 2003 4:51 am
by distantvoices
...as if they were the holy grail of all things and able to keep earth away from spinning round the sun...
besides, what would be the benefit of a non optimizing c compiler without options to turn on optimization if desired?
Don't want to be discouraging, but I wouldna spend energy in such a project.
Re:UCK development
Posted: Tue Sep 23, 2003 6:04 am
by Solar
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...
Re:UCK development
Posted: Tue Sep 23, 2003 10:13 am
by mr. xsism
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.
Regards,
mr. xsism
Re:UCK development
Posted: Tue Sep 23, 2003 10:34 am
by Slasher
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.
Re:UCK development
Posted: Tue Sep 23, 2003 5:47 pm
by beyondsociety
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.
Re:UCK development
Posted: Tue Sep 23, 2003 7:16 pm
by RuneOfFire
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.