On Wednesday 26 December 2007, Timothy Normand Miller wrote:
> On 12/26/07, Rudolf Marek <[EMAIL PROTECTED]> wrote:
> > Hi all,
> >
> > Just few comments to BIOS ROMs. Please do use C to write most of the
> > BIOS. Use assembly just for a trampoline to C (compile code for 16bit
> > code, relative to one segment?). The BIOS could be 64KB in size.IMHO the
> > LGPLed BIOS from bochs/qemu could be used to get full implementation of
> > VGA, rest could be added to this existing code base.
>
> Can we get GCC to emit code that's fixed to a certain address or all
> PC-relative so that we can easily drop it into the PROM?  Maybe we can
> get it to emit assembly code that we combine with the trampoline.

Linking code at an arbitrary location is fairly easy, you just an appropriate 
linker script.

Position independent code is sufficiently hard that I wouldn't bother.

The main limitation of GCC is that it can only generate 32-bit code.
However in many cases this doesn't really matter. You implement the majority 
of your bios as 32-bit code, and have the real mode entry points be simple 
assembly trampolines that switch modes and invoke the C routines.

Paul
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to