[lkl] UEFI LKL port

  • From: Michael Zimmermann <sigmaepsilon92@xxxxxxxxx>
  • To: linux-kernel-library@xxxxxxxxxxxxx
  • Date: Wed, 21 Sep 2016 12:14:36 +0200

Hi,

I just wanna say thank you for this awesome project.
I successfully ported LKL to UEFI now and wrote a working Filesystem driver
for UEFI.
I don't need any kernel hacks and there are just like 3 small patches which
I think you'll be fine merging.

I previously used clover's GrubFs driver which ports GNU GRUB's readonly
filesystem drivers to UEFI.
Aside of being readonly, these had many problems like unexplainable crashes
and very slow transfer speed.

to give you some numbers, listing 144 files with GubFs took 33s, with LKL
it just takes 3s.
Listing 367 files takes forever with GrubFs(maybe it even crashes, I didn't
check that) and 5s with LKL.
And that's insanely fast because it means that a fair amount of that time
is used by rendering my UI and that LKL itself is insanely fast.

If you consider that I'm running this on a low-end ARM smartphone on a
single core, the fs is mounted with MS_SYNCHRONOUS|MS_DIRSYNC and that I'm
using set/get/swap -context threading because UEFI doesn't support threads,
it becomes even more mind-blowing.

Also, after tuning .config and cflags the size of the resulting *.efi is
"just" around 2MB(which is small if you consider that vmlinux usually is
betwen 15M and 100M). Placed inside UEFI's lzma-compressed FirmwareVolume
it's even 950KB only.

The only thing I regret is not googling "linux kernel library" two days
before I started trying to rewrite the whole ext4 fs driver :D
Also I can't believe that this means that "porting" ANY linux fs driver
just involves detecting the superblock-magic and enabling a few CONFIG's
now. Looks like I ported all fs drivers(with RW support) supported by
linux(which should be pretty much all which exist) within just a week :D

to sum things up: AWESOME project! If there's interest in using my driver
on x86/x64(I saw that tavip works for Intel), just tell me, it should only
involve porting glibc's set/get/swap -context functions and wrapping a few
arm specific syscalls like lkl_sys_*64 and lkl_sys_llseek.

Thanks
Michael

Other related posts: