Hi Michal,
I'm CC'ing the SeaBIOS mailing list.
On Thu, Mar 25, 2010 at 06:32:50AM -0700, Michal Necasek wrote:
Have you ever looked into the possibility of using a real 16-bit compiler for the 16-bit bits? One obvious candidate would be Open Watcom C/C++. Microsoft Visual C++ 1.52 is also a very capable 16-bit compiler, but probably not a real option for SeaBIOS due to limited availability and host platform support.
This has come up a couple of times in the past.
One thing to note is that SeaBIOS actually has more 32bit code than it does 16bit code. Also, large portions of the code are compiled in both modes.
I hear Open Watcom works well for 16bit code, but I'd guess gcc does a better job with regular 32bit code. A solution for the 16bit code wouldn't work well if it reduced the code sharing with the 32bit code. Either all the code would need to be compiled with Open Watcom or the final SeaBIOS binary would need to be a mix of gcc and Open Watcom code - both seem risky.
The other difficulty with Open Watcom is its availability. It's nice to be able to compile SeaBIOS without requiring special packages. That was a big advantage for the qemu/kvm maintainers.
-Kevin
On 03/26/10 01:46, Kevin O'Connor wrote:
I hear Open Watcom works well for 16bit code, but I'd guess gcc does a better job with regular 32bit code. A solution for the 16bit code wouldn't work well if it reduced the code sharing with the 32bit code. Either all the code would need to be compiled with Open Watcom or the final SeaBIOS binary would need to be a mix of gcc and Open Watcom code - both seem risky.
The other difficulty with Open Watcom is its availability. It's nice to be able to compile SeaBIOS without requiring special packages. That was a big advantage for the qemu/kvm maintainers.
Just my $0.02 here, I think relying on a compiler that doesn't run on Linux would make it practically impossible for some of us to contribute to SeaBIOS. Even if my contributions are rather small.
The way SeaBIOS is built is such a bliss compared to working with the old BOCHS codebase.
Cheers, Jes
On Fri, Mar 26, 2010 at 09:08:45AM +0100, Jes Sorensen wrote:
Just my $0.02 here, I think relying on a compiler that doesn't run on Linux would make it practically impossible for some of us to contribute to SeaBIOS. Even if my contributions are rather small.
Full Linux support is a requirement for me as well.
When I last looked, there was a port of Open Watcom to Linux - though I think it may still be in a "beta" stage. The fact that it's not widely available does weigh heavily against using it.
The way SeaBIOS is built is such a bliss compared to working with the old BOCHS codebase.
Thanks.
-Kevin
(sorry for top posting)
I suppose you don't envision SeaBIOS developers working on Windows then? I expect getting the right GCC bits going on Windows is a roughly comparable effort to getting Open Watcom working on Linux...
Re OW on Linux - the port is a 'beta' in the sense of targeting Linux. But it's possible to build (a subset of) Open Watcom on Linux using GCC and use it as a cross compiler. If it helped, I could probably prepare some kind of a package because I know which parts are needed.
But that's putting the cart before the horse...
I'm not suggesting that OW should replace GCC as the tool to build SeaBIOS, just that it might be a viable alternative. I don't *know* if Open Watcom would generate significantly better code, I'm just assuming that at for the 16-bit parts it's very likely, and the 32-bit code is not likely to be significantly different, especially if code size is a concern.
FWIW, in the past if was toying with the idea of porting the bochs BIOS to Open Watcom, but the code was so bad that it seemed hardly worthwhile (even though Open Watcom could generate about million times better code than bcc). But SeaBIOS is a very different story, it was clearly written by someone who had a clue how to write code :)
Regards,
Michal
----- Original Message ---- From: Kevin O'Connor kevin@koconnor.net To: Jes Sorensen Jes.Sorensen@redhat.com Cc: Michal Necasek mnecasek@yahoo.com; seabios@seabios.org Sent: Fri, March 26, 2010 9:32:41 AM Subject: Re: [SeaBIOS] SeaBIOS 16-bit compiler
On Fri, Mar 26, 2010 at 09:08:45AM +0100, Jes Sorensen wrote:
Just my $0.02 here, I think relying on a compiler that doesn't run on Linux would make it practically impossible for some of us to contribute to SeaBIOS. Even if my contributions are rather small.
Full Linux support is a requirement for me as well.
When I last looked, there was a port of Open Watcom to Linux - though I think it may still be in a "beta" stage. The fact that it's not widely available does weigh heavily against using it.
The way SeaBIOS is built is such a bliss compared to working with the old BOCHS codebase.
Thanks.
-Kevin
On 03/26/10 11:02, Michal Necasek wrote:
(sorry for top posting)
RFC1855
I suppose you don't envision SeaBIOS developers working on Windows then? I expect getting the right GCC bits going on Windows is a roughly comparable effort to getting Open Watcom working on Linux...
Well if you decide to port it to this Watcom compiler, I doubt Kevin would object if you posted patches for it. The issue is more which is the default compiler, and said patches should not be allowed to break the build for the default compiler.
Given the base of SeaBIOS and it's ties to Coreboot and KVM, it's pretty obvious that the primary developer base is working on Linux. Telling these developers that they must do their work on Windows from now on isn't realistic.
Re OW on Linux - the port is a 'beta' in the sense of targeting Linux. But it's possible to build (a subset of) Open Watcom on Linux using GCC and use it as a cross compiler. If it helped, I could probably prepare some kind of a package because I know which parts are needed.
My first question here is, is it free? If it's a proprietary commercial product, it would be out of the question right there.
I'm not suggesting that OW should replace GCC as the tool to build SeaBIOS, just that it might be a viable alternative. I don't *know* if Open Watcom would generate significantly better code, I'm just assuming that at for the 16-bit parts it's very likely, and the 32-bit code is not likely to be significantly different, especially if code size is a concern.
Given that this is BIOS code, performance is really less of an issue than if it was a core driver in your operating system. As long as the compiler used generates code that fits within the space constraints and most importantly, it is correctly generated, then IMHO performance is a lesser issue, and we shouldn't forget that multiple compilers may generate different errors in the code which may be more work to resolve.
Regards, Jes
Jes,
I'm certainly not suggesting to break the GCC build in order to have an Open Watcom build of SeaBIOS. I'm also not in any way suggesting that SeaBIOS developers should be forced to switch to Windows (I didn't say so, did I?). I'm for widening the platform choice, not restricting it.
Open Watcom is free, yes. It's not GPL, but it has an OSI-approved license. See http://www.opensource.org/licenses/sybase.php
Multiple compilers generate different errors, yes - which makes it both more difficult to write "generally acceptable" code and easier to discover genuine problems that one or the other compiler may not diagnose.
Regards,
Michal
----- Original Message ---- From: Jes Sorensen Jes.Sorensen@redhat.com To: Michal Necasek mnecasek@yahoo.com Cc: Kevin O'Connor kevin@koconnor.net; seabios@seabios.org Sent: Fri, March 26, 2010 11:15:12 AM Subject: Re: [SeaBIOS] SeaBIOS 16-bit compiler
On 03/26/10 11:02, Michal Necasek wrote:
(sorry for top posting)
RFC1855
I suppose you don't envision SeaBIOS developers working on Windows then? I expect getting the right GCC bits going on Windows is a roughly comparable effort to getting Open Watcom working on Linux...
Well if you decide to port it to this Watcom compiler, I doubt Kevin would object if you posted patches for it. The issue is more which is the default compiler, and said patches should not be allowed to break the build for the default compiler.
Given the base of SeaBIOS and it's ties to Coreboot and KVM, it's pretty obvious that the primary developer base is working on Linux. Telling these developers that they must do their work on Windows from now on isn't realistic.
Re OW on Linux - the port is a 'beta' in the sense of targeting Linux. But it's possible to build (a subset of) Open Watcom on Linux using GCC and use it as a cross compiler. If it helped, I could probably prepare some kind of a package because I know which parts are needed.
My first question here is, is it free? If it's a proprietary commercial product, it would be out of the question right there.
I'm not suggesting that OW should replace GCC as the tool to build SeaBIOS, just that it might be a viable alternative. I don't *know* if Open Watcom would generate significantly better code, I'm just assuming that at for the 16-bit parts it's very likely, and the 32-bit code is not likely to be significantly different, especially if code size is a concern.
Given that this is BIOS code, performance is really less of an issue than if it was a core driver in your operating system. As long as the compiler used generates code that fits within the space constraints and most importantly, it is correctly generated, then IMHO performance is a lesser issue, and we shouldn't forget that multiple compilers may generate different errors in the code which may be more work to resolve.
Regards, Jes