UCK development

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.
Post Reply
mr. xsism

UCK development

Post 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:

Code: Select all

var += 1;
#asm
    push [var]
#endasm
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
bkilgore

Re:UCK development

Post 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" ;))
mr. xsism

Re:UCK development

Post 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
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:UCK development

Post by Perica »

..
Last edited by Perica on Sun Dec 03, 2006 9:17 pm, edited 1 time in total.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:UCK development

Post by Solar »

Misunderstandings abound.

gcc does in no way limit the licensing of your code, and can handle Intel ASM syntax just fine.
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:UCK development

Post 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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:UCK development

Post 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. ;-)
Every good solution is obvious once you've found it.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:UCK development

Post by distantvoices »

...as if they were the holy grail of all things and able to keep earth away from spinning round the sun... :P

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.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:UCK development

Post 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... :P
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... :P ;)
Every good solution is obvious once you've found it.
mr. xsism

Re:UCK development

Post 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
Slasher

Re:UCK development

Post 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. ;)
beyondsociety

Re:UCK development

Post 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.
RuneOfFire

Re:UCK development

Post 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.
Post Reply