[fpc-devel] New FPC target : uefi

Olivier Coursière olivier.coursiere at laposte.net
Sun Aug 17 19:16:40 CEST 2014


Hi,

In the past few days, i have worked on a possibly new FPC target : 
Unified Extensible Firmware Interface (UEFI), the BIOS replacement that 
come with most new PCs nowadays (and on other platforms too).

My initial goal was to discover the UEFI's APIs which seems high level 
enough for a non system programmer like me.

After looking at the usual C tools (gnu-efi and tianocore), i thought it 
would be easier (and funnier) to use Free Pascal instead.

On paper, Free Pascal has already everything needed without requiring 
external software like binutils tools :
- an internal linker to generate a PE binary as expected by UEFI. Only a 
different subsystem number is used in the header.
- support for the required calling conventions : cdecl (UEFI 32 bits) 
and the Windows 64 one for UEFI 64 bits.
- a compiler that could generate position independent code (at least for 
some targets, but maybe not PE's ones ?) as required by UEFI.

Then, i have defined a new i386 target (my new little laptop has 32 bits 
UEFI, the weird version), mostly based on the nativent one.

I am up to the point where i can generate a binary that output the 
firmware vendor on the UEFI console using the UEFI API only. The RTL is 
only a stub that compile (nothing is implemented yet).

I am wondering what would be the best way to continue this work as it is 
the first time i am working on a really new target :
  - a new branch ?
  - submit a polished big patch ?
  - submit small patch through the bug system for simpler review ?
  - other ideas ?

My current patch is not yet polished and complete but is available here, 
just in case someone else is already interested 
http://nan.tf/download/uefi_all.diff.

Olivier



More information about the fpc-devel mailing list