public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Idea for Google Summer Code : C Compiler for EFI Byte Code  implement in gcc
@ 2010-02-27 15:07 b95705030
  0 siblings, 0 replies; 15+ messages in thread
From: b95705030 @ 2010-02-27 15:07 UTC (permalink / raw)
  To: gcc


Hello all,

I am highly interestd in implementing C compiler for EFI Byte Code in  
gcc and participate in Google Summer Code.

EFI is a much larger, more complex,OS-like replacement for the older BIOS
firmware interface present in all IBM PC-compatible personal computers.
and the EFI specification provides for a processor-independent device  
driver environment(like virtualmachine), called EFI Byte Code or EBC.

Intel(R) C Compiler for EFI Byte Code, the only one C compiler for EFI  
Byte Code
(http://sx.intel.com/p-553-intel-c-compiler-for-efi-byte-code.aspx)
is not open source, and also a pay software.

So i am wondering whether this kind of idea is valuable to the gcc  
community?  or are there any other related ideas is more valuable?


thanks

       yi-hong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code   implement  in gcc
  2010-03-03 10:54   ` Tristan Gingold
  2010-03-03 11:35     ` Andrew Haley
  2010-03-19 12:35     ` b95705030
@ 2010-04-01 18:10     ` b95705030
  2 siblings, 0 replies; 15+ messages in thread
From: b95705030 @ 2010-04-01 18:10 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: gcc

Hello Tristan

> I think the main issue is that EFI C dialect is not ANSI-C  
> compliant: the size of pointer is determined
> at the run-time and therefore the layout of the structure is not  
> static.  Gcc doesn't support this model.

I have read the sizeof and VLA in C99
I found a example:
EXAMPLE 3 In this example, the size of a variable-length array is  
computed and returned from a function:
#include <stddef.h>
size_t fsize3(int n)
{
   char b[n+3]; // variable length array
   return sizeof b; // execution time sizeof
}
int main()
{
   size_t size;
   size = fsize3(10); // fsize3 returns 13
   return 0;
}
And I found some information with gcc about VLA
(http://gcc.gnu.org/c99status.html)
Does it means that gcc support layout of structure is not static??

thanks

yi-hong



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code implement  in gcc
  2010-03-19 12:35     ` b95705030
  2010-03-19 13:04       ` Tristan Gingold
@ 2010-03-19 18:00       ` Chris Lattner
  1 sibling, 0 replies; 15+ messages in thread
From: Chris Lattner @ 2010-03-19 18:00 UTC (permalink / raw)
  To: b95705030; +Cc: Tristan Gingold, gcc


On Mar 19, 2010, at 5:33 AM, b95705030@ntu.edu.tw wrote:

> Hello Tristan,
> 
>> I think the main issue is that EFI C dialect is not ANSI-C compliant: the size of pointer is determined
>> at the run-time and therefore the layout of the structure is not static.  Gcc doesn't support this model.
> 
> As I read some related information, LLVM IR doesn't care the size of pointer
> and the front end of LLVM is derived from GCC.I am wondering to know should
> I do some work at this aspect??

FYI, the LLVM Clang front-end provides a C/ObjC and (real soon now) C++ compiler that is GCC-free.  Further questions should definitely go to the llvm or clang lists.  More information is at http://clang.llvm.org/

-Chris

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code    implement in gcc
  2010-03-19 12:07       ` b95705030
@ 2010-03-19 14:06         ` Tristan Gingold
  0 siblings, 0 replies; 15+ messages in thread
From: Tristan Gingold @ 2010-03-19 14:06 UTC (permalink / raw)
  To: b95705030; +Cc: Joe Vernaci, gcc


On Mar 19, 2010, at 12:48 PM, b95705030@ntu.edu.tw wrote:
> I use Macbook with refit ,and its EFI shell version is 1.10.I have read
> some related information but I don't find how to launch EBC virture machine.
> I am truely want to know how could I launch it with fully appreciation.
> And I am wondering to know is there some EBC binery file to download that
> I can execute if I successfully launch EBC virture machine ??

Take a look at tianocore.org.  There is an open source implementation of EFI
(with a virtual machine), as well as some precompiled EBC files.

Tristan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code  implement  in gcc
  2010-03-19 12:35     ` b95705030
@ 2010-03-19 13:04       ` Tristan Gingold
  2010-03-19 18:00       ` Chris Lattner
  1 sibling, 0 replies; 15+ messages in thread
From: Tristan Gingold @ 2010-03-19 13:04 UTC (permalink / raw)
  To: b95705030; +Cc: gcc


On Mar 19, 2010, at 1:33 PM, b95705030@ntu.edu.tw wrote:

> Hello Tristan,
> 
>> I think the main issue is that EFI C dialect is not ANSI-C compliant: the size of pointer is determined
>> at the run-time and therefore the layout of the structure is not static.  Gcc doesn't support this model.
> 
> As I read some related information, LLVM IR doesn't care the size of pointer
> and the front end of LLVM is derived from GCC.I am wondering to know should
> I do some work at this aspect??

I don't know enough about LLVM to reply.  Sorry.  Try on the LLVM mailing list.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code   implement  in gcc
  2010-03-03 10:54   ` Tristan Gingold
  2010-03-03 11:35     ` Andrew Haley
@ 2010-03-19 12:35     ` b95705030
  2010-03-19 13:04       ` Tristan Gingold
  2010-03-19 18:00       ` Chris Lattner
  2010-04-01 18:10     ` b95705030
  2 siblings, 2 replies; 15+ messages in thread
From: b95705030 @ 2010-03-19 12:35 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: gcc

Hello Tristan,

> I think the main issue is that EFI C dialect is not ANSI-C  
> compliant: the size of pointer is determined
> at the run-time and therefore the layout of the structure is not  
> static.  Gcc doesn't support this model.

As I read some related information, LLVM IR doesn't care the size of pointer
and the front end of LLVM is derived from GCC.I am wondering to know should
I do some work at this aspect??

thanks

yi-hong



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code     implement in gcc
  2010-03-05  9:43     ` Andrew Haley
@ 2010-03-19 12:21       ` b95705030
  0 siblings, 0 replies; 15+ messages in thread
From: b95705030 @ 2010-03-19 12:21 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc

Hello Andrew,

>>> Who would maintain this EFI back-end?
>>
>> The EFI specification was originally developed by Intel, and is now
>> managed by the Unified EFI Forum[http://www.uefi.org/home/].
>
> So, you don't know who would maintain the EFI back-end that you're
> proposing for gcc?

I feel sorry that I misunderstand your question. After finishing
this project,I will like to maintain it.

> As others have suggested, there may be severe technical problems
> implementing gcc->efi.  There seem to be changes needed to the
> front end.  This might work if you could get a group to support
> the work, but it may be too much for one person in a summer.
>
> I don't want to dissuade you, but it's important to be realistic.

I am a follower of open source.Even I can't finish the project in this
summer,I still want to contribute .

thanks

yi-hong



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code    implement in gcc
  2010-03-05  7:58     ` Joe Vernaci
@ 2010-03-19 12:07       ` b95705030
  2010-03-19 14:06         ` Tristan Gingold
  0 siblings, 1 reply; 15+ messages in thread
From: b95705030 @ 2010-03-19 12:07 UTC (permalink / raw)
  To: Joe Vernaci; +Cc: gcc

Hello Joe,

> The other hurdle would be the ABI.  It's very particular since it has
> to accommodate calling into and from EBC, x86, x86_64, ia64, and any
> other architecture available.  It's structured mainly on Microsoft's
> stdcall ABI.

I have read the part about EBC of EFI specification.But I found it only
concern to a small part that related to Thunking.As you say, Thunking is
mainly on Microsoft's stdcall ABI.Should I survey information about this
aspect??

> There is an open source interpreter available from the EDK.  I'm not
> 100% sure if you can use it in the emulated environment, but there are
> quite a few platforms to work on.

I use Macbook with refit ,and its EFI shell version is 1.10.I have read
some related information but I don't find how to launch EBC virture machine.
I am truely want to know how could I launch it with fully appreciation.
And I am wondering to know is there some EBC binery file to download that
I can execute if I successfully launch EBC virture machine ??

thanks

yi-hong


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code    implement in gcc
  2010-03-04 19:29   ` b95705030
  2010-03-05  7:58     ` Joe Vernaci
@ 2010-03-05  9:43     ` Andrew Haley
  2010-03-19 12:21       ` b95705030
  1 sibling, 1 reply; 15+ messages in thread
From: Andrew Haley @ 2010-03-05  9:43 UTC (permalink / raw)
  To: b95705030; +Cc: gcc

On 03/04/2010 07:27 PM, b95705030@ntu.edu.tw wrote:
> 引述 Andrew Haley <aph@redhat.com>:
> 
>> There is no reason in principle this shouldn't be part of gcc.
>>
>> I think no-one has responded yet because they don't know what it would
>> be for, and how much work it would involve.
> 
> What compiler doing is: c -> intermediate language -> asm(ex. x86).
> And then, c compiler for efi byte code is: c -> intermediate language ->
> efi byte code.
> For the c -> intermediate language part, I hope to use original  source
> code of gcc,so the main point of the project is implementing
> intermediate language -> efi byte code part
> 
> In my opinion,the project has some how similarity with compiling c
> language to java byte code. And in fact,it has been done by some open
> source project(ex.
> egcs-jvm[http://sourceforge.net/projects/egcs-jvm/]).  I am wondering to
> know that trace some existing c to java byte code project would give
> direction to implement this project or not.

Perhaps.  I don't know if egcs-jvm was ever completed.

>> Is this in any way related to plans for a free BIOS?
> 
> YES, coreboot[http://www.coreboot.org/Welcome_to_coreboot]and
> gnufi[http://www.gnu.org/software/gnufi/]

Ah, good.

>> Who would maintain this EFI back-end?
> 
> The EFI specification was originally developed by Intel, and is now
> managed by the Unified EFI Forum[http://www.uefi.org/home/].

So, you don't know who would maintain the EFI back-end that you're
proposing for gcc?

As others have suggested, there may be severe technical problems
implementing gcc->efi.  There seem to be changes needed to the
front end.  This might work if you could get a group to support
the work, but it may be too much for one person in a summer.

I don't want to dissuade you, but it's important to be realistic.

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code   implement in gcc
  2010-03-04 19:29   ` b95705030
@ 2010-03-05  7:58     ` Joe Vernaci
  2010-03-19 12:07       ` b95705030
  2010-03-05  9:43     ` Andrew Haley
  1 sibling, 1 reply; 15+ messages in thread
From: Joe Vernaci @ 2010-03-05  7:58 UTC (permalink / raw)
  To: b95705030; +Cc: Andrew Haley, gcc

Hello.  I'm actually an EFI engineer so this project is of great
interest to me.  I would be willing to lend a hand off hours if this
goes through, so please keep me in the loop.

I think the biggest hurdle would be the c front end since EBC (EFI
byte code) introduces variable sized pointers as well as a (u)intn
(natural sized integer).  The idea was you could have an addin card
with an option rom compiled with EBC that would work in any system
using EFI.  From my limited experience with the Intel EBC compiler
they just changed sizeof to a function.  For instance using iec the
following could fail to compile:

int array_mask[sizeof(my_array)/sizeof(array_entry)];

If array_entry had a pointer or natural sized integer the compiler
would complain and exit.  I did a little research to see if I could
just change sizeof to a function for gcc but found it would break
quite a few things, and even more optimizations (although it's
interpreted so optimization is not a priority).  I'm no gcc guru but
it seemed like quite a bit of work to the front end to deal with it.

The other hurdle would be the ABI.  It's very particular since it has
to accommodate calling into and from EBC, x86, x86_64, ia64, and any
other architecture available.  It's structured mainly on Microsoft's
stdcall ABI.

EBC's instruction set is fairly simple so I don't think it would be
very hard to create another target for gas.

There is an open source interpreter available from the EDK.  I'm not
100% sure if you can use it in the emulated environment, but there are
quite a few platforms to work on.



2010/3/4  <b95705030@ntu.edu.tw>:
> 引述 Andrew Haley <aph@redhat.com>:
>
>> There is no reason in principle this shouldn't be part of gcc.
>>
>> I think no-one has responded yet because they don't know what it would
>> be for, and how much work it would involve.
>
> What compiler doing is: c -> intermediate language -> asm(ex. x86).
> And then, c compiler for efi byte code is: c -> intermediate language -> efi
> byte code.
> For the c -> intermediate language part, I hope to use original  source code
> of gcc,so the main point of the project is implementing intermediate
> language -> efi byte code part
>
> In my opinion,the project has some how similarity with compiling c language
> to java byte code. And in fact,it has been done by some open source
> project(ex. egcs-jvm[http://sourceforge.net/projects/egcs-jvm/]).  I am
> wondering to know that trace some existing c to java byte code project would
> give direction to implement this project or not.
>
>> Is there an EFI interpreter that is free software?
>
> EFI,the
> specification[http://download.intel.com/technology/efi/docs/EFI_1-10_Update.zip]
> which is a replacement for the older BIOS that defines EBC virtual machine.
> So BIOS in the future will contain this  part. In additional some present
> BIOS (ex.BIOS of MAC, BIOS of virtualbox) has already support EFI.
>
>> Is this in any way related to plans for a free BIOS?
>
> YES, coreboot[http://www.coreboot.org/Welcome_to_coreboot]and
> gnufi[http://www.gnu.org/software/gnufi/]
>
>> Who would maintain this EFI back-end?
>
> The EFI specification was originally developed by Intel, and is now managed
> by the Unified EFI Forum[http://www.uefi.org/home/].
>
>> ... etc.
>>
>> Andrew.
>>
>
>
> thanks
>
> yi-hong
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code   implement in gcc
  2010-03-03 10:37 ` Andrew Haley
  2010-03-03 10:54   ` Tristan Gingold
@ 2010-03-04 19:29   ` b95705030
  2010-03-05  7:58     ` Joe Vernaci
  2010-03-05  9:43     ` Andrew Haley
  1 sibling, 2 replies; 15+ messages in thread
From: b95705030 @ 2010-03-04 19:29 UTC (permalink / raw)
  To: Andrew Haley, gcc

引述 Andrew Haley <aph@redhat.com>:

> There is no reason in principle this shouldn't be part of gcc.
>
> I think no-one has responded yet because they don't know what it would
> be for, and how much work it would involve.

What compiler doing is: c -> intermediate language -> asm(ex. x86).
And then, c compiler for efi byte code is: c -> intermediate language  
-> efi byte code.
For the c -> intermediate language part, I hope to use original   
source code of gcc,so the main point of the project is implementing  
intermediate language -> efi byte code part

In my opinion,the project has some how similarity with compiling c  
language to java byte code. And in fact,it has been done by some open  
source project(ex.  
egcs-jvm[http://sourceforge.net/projects/egcs-jvm/]).  I am wondering  
to know that trace some existing c to java byte code project would  
give direction to implement this project or not.

> Is there an EFI interpreter that is free software?

EFI,the  
specification[http://download.intel.com/technology/efi/docs/EFI_1-10_Update.zip] which is a replacement for the older BIOS that defines EBC virtual machine. So BIOS in the future will contain this  part. In additional some present BIOS (ex.BIOS of MAC, BIOS of virtualbox) has already support  
EFI.

> Is this in any way related to plans for a free BIOS?

YES, coreboot[http://www.coreboot.org/Welcome_to_coreboot]and  
gnufi[http://www.gnu.org/software/gnufi/]

> Who would maintain this EFI back-end?

The EFI specification was originally developed by Intel, and is now  
managed by the Unified EFI Forum[http://www.uefi.org/home/].

> ... etc.
>
> Andrew.
>


thanks

yi-hong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code  implement   in gcc
  2010-03-03 10:54   ` Tristan Gingold
@ 2010-03-03 11:35     ` Andrew Haley
  2010-03-19 12:35     ` b95705030
  2010-04-01 18:10     ` b95705030
  2 siblings, 0 replies; 15+ messages in thread
From: Andrew Haley @ 2010-03-03 11:35 UTC (permalink / raw)
  To: gcc

On 03/03/2010 10:53 AM, Tristan Gingold wrote:
> 
> On Mar 3, 2010, at 11:36 AM, Andrew Haley wrote:
> 
>> On 03/03/2010 04:52 AM, b95705030@ntu.edu.tw wrote:
>>
>>> I am highly interestd in implementing C compiler for EFI Byte Code in
>>> gcc and participate in Google Summer Code.
>>>
>>> EFI is a much larger, more complex,OS-like replacement for the older BIOS
>>> firmware interface present in all IBM PC-compatible personal computers.
>>> and the EFI specification provides for a processor-independent device
>>> driver environment(like virtualmachine), called EFI Byte Code or EBC.
>>>
>>> Intel(R) C Compiler for EFI Byte Code, the only one C compiler for EFI
>>> Byte Code
>>> (http://sx.intel.com/p-553-intel-c-compiler-for-efi-byte-code.aspx)
>>> is not open source, and also a pay software.
>>>
>>> So i am wondering whether this kind of idea is valuable to the gcc
>>> community?  or are there any other related ideas is more valuable?
>>
>> There is no reason in principle this shouldn't be part of gcc.
> 
> I think the main issue is that EFI C dialect is not ANSI-C compliant: the size of pointer is determined
> at the run-time and therefore the layout of the structure is not static.  Gcc doesn't support this model.

Ouch.  That does sound difficult.

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code  implement  in gcc
  2010-03-03 10:37 ` Andrew Haley
@ 2010-03-03 10:54   ` Tristan Gingold
  2010-03-03 11:35     ` Andrew Haley
                       ` (2 more replies)
  2010-03-04 19:29   ` b95705030
  1 sibling, 3 replies; 15+ messages in thread
From: Tristan Gingold @ 2010-03-03 10:54 UTC (permalink / raw)
  To: b95705030; +Cc: gcc, Andrew Haley


On Mar 3, 2010, at 11:36 AM, Andrew Haley wrote:

> On 03/03/2010 04:52 AM, b95705030@ntu.edu.tw wrote:
> 
>> I am highly interestd in implementing C compiler for EFI Byte Code in
>> gcc and participate in Google Summer Code.
>> 
>> EFI is a much larger, more complex,OS-like replacement for the older BIOS
>> firmware interface present in all IBM PC-compatible personal computers.
>> and the EFI specification provides for a processor-independent device
>> driver environment(like virtualmachine), called EFI Byte Code or EBC.
>> 
>> Intel(R) C Compiler for EFI Byte Code, the only one C compiler for EFI
>> Byte Code
>> (http://sx.intel.com/p-553-intel-c-compiler-for-efi-byte-code.aspx)
>> is not open source, and also a pay software.
>> 
>> So i am wondering whether this kind of idea is valuable to the gcc
>> community?  or are there any other related ideas is more valuable?
> 
> There is no reason in principle this shouldn't be part of gcc.

I think the main issue is that EFI C dialect is not ANSI-C compliant: the size of pointer is determined
at the run-time and therefore the layout of the structure is not static.  Gcc doesn't support this model.

Tristan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Idea for Google Summer Code : C Compiler for EFI Byte Code  implement  in gcc
  2010-03-03  5:00 b95705030
@ 2010-03-03 10:37 ` Andrew Haley
  2010-03-03 10:54   ` Tristan Gingold
  2010-03-04 19:29   ` b95705030
  0 siblings, 2 replies; 15+ messages in thread
From: Andrew Haley @ 2010-03-03 10:37 UTC (permalink / raw)
  To: b95705030; +Cc: gcc

On 03/03/2010 04:52 AM, b95705030@ntu.edu.tw wrote:

> I am highly interestd in implementing C compiler for EFI Byte Code in
> gcc and participate in Google Summer Code.
> 
> EFI is a much larger, more complex,OS-like replacement for the older BIOS
> firmware interface present in all IBM PC-compatible personal computers.
> and the EFI specification provides for a processor-independent device
> driver environment(like virtualmachine), called EFI Byte Code or EBC.
> 
> Intel(R) C Compiler for EFI Byte Code, the only one C compiler for EFI
> Byte Code
> (http://sx.intel.com/p-553-intel-c-compiler-for-efi-byte-code.aspx)
> is not open source, and also a pay software.
> 
> So i am wondering whether this kind of idea is valuable to the gcc
> community?  or are there any other related ideas is more valuable?

There is no reason in principle this shouldn't be part of gcc.

I think no-one has responded yet because they don't know what it would
be for, and how much work it would involve.  Is there an EFI
interpreter that is free software?  Is this in any way related to
plans for a free BIOS?  Who would maintain this EFI back-end?

... etc.

Andrew.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Idea for Google Summer Code : C Compiler for EFI Byte Code  implement in gcc
@ 2010-03-03  5:00 b95705030
  2010-03-03 10:37 ` Andrew Haley
  0 siblings, 1 reply; 15+ messages in thread
From: b95705030 @ 2010-03-03  5:00 UTC (permalink / raw)
  To: gcc


Hello all,

I am highly interestd in implementing C compiler for EFI Byte Code in  
gcc and participate in Google Summer Code.

EFI is a much larger, more complex,OS-like replacement for the older BIOS
firmware interface present in all IBM PC-compatible personal computers.
and the EFI specification provides for a processor-independent device  
driver environment(like virtualmachine), called EFI Byte Code or EBC.

Intel(R) C Compiler for EFI Byte Code, the only one C compiler for EFI  
Byte Code
(http://sx.intel.com/p-553-intel-c-compiler-for-efi-byte-code.aspx)
is not open source, and also a pay software.

So i am wondering whether this kind of idea is valuable to the gcc  
community?  or are there any other related ideas is more valuable?


thanks

       yi-hong

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-04-01 18:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-27 15:07 Idea for Google Summer Code : C Compiler for EFI Byte Code implement in gcc b95705030
2010-03-03  5:00 b95705030
2010-03-03 10:37 ` Andrew Haley
2010-03-03 10:54   ` Tristan Gingold
2010-03-03 11:35     ` Andrew Haley
2010-03-19 12:35     ` b95705030
2010-03-19 13:04       ` Tristan Gingold
2010-03-19 18:00       ` Chris Lattner
2010-04-01 18:10     ` b95705030
2010-03-04 19:29   ` b95705030
2010-03-05  7:58     ` Joe Vernaci
2010-03-19 12:07       ` b95705030
2010-03-19 14:06         ` Tristan Gingold
2010-03-05  9:43     ` Andrew Haley
2010-03-19 12:21       ` b95705030

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).