Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-08

New FPC target : uefi

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Olivier Coursière

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

Reply by email

Olivier Coursière
to Florian Klämpfl

Hi,

Florian Klämpfl wrote 5 lines
Am 17.08.2014 19:16, schrieb Olivier Coursière: > 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 ? IMO a branch.

A branch is fine for me. I suppose some administrative work is required to setup a branch with the corresponding writing rights.

No emergency though, it is a very early work in progress !

Olivier

Reply by email

Olivier Coursière
to Olivier Coursière

Hi,

Olivier Coursière wrote 13 lines
Hi, On 18/08/2014 22:18, Florian Klämpfl wrote: > Am 17.08.2014 19:16, schrieb Olivier Coursière: >> 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 ? > IMO a branch. A branch is fine for me. I suppose some administrative work is required to setup a branch with the corresponding writing rights. No emergency though, it is a very early work in progress !

I have resumed my work on this target after finding that an annoying problem with string constants was fixed (i don't know what was exactly the problem, so kudos goes to one or more contributors from the previous year). Since then, WriteLn and memory allocation was implemented and should work as expected.

Maybe it is time to create a branch. I suppose the branch should be created by a core developer and some rights given to me so i can commit to this new branch. Am i right ?

I have updated the UEFI page on the freepascal wiki with my current patch : http://wiki.freepascal.org/UEFI. Most of the remaining work should be to implement features using the UEFI API as a backend (such as file access support).

Olivier

Reply by email