This is an old revision of the document!


Enable EFI Loader to load FreeBSD Xen Dom0 (draft)

  • Student: Kristaps Čivkulis (kristaps.civkulis@gmail.com)
  • Mentor: Roger Pau Monné (royger@freebsd.org)

Currently only BIOS FreeBSD Loader can load Xen kernel which then uses FreeBSD as Dom0 (Control domain). The EFI FreeBSD Loader can’t load Xen kernel, because it can’t load multiboot2 compliant binaries. The first part of project is to add multiboot2 protocol support to EFI FreeBSD Loader, so that it will be able to load Xen kernel (multiboot2 support is general feature in itself, even if it wasn’t related to Xen Kernel). The second part of project is to correctly pass all the needed information to Xen kernel (using multiboot2 protocol) so that it can load FreeBSD kernel as Dom0.

Study multiboot2 protocol and get familiar with source code in stand/. At first I will try to understand how EFI FreeBSD loader currently behaves when it loads FreeBSD kernel and when it loads Xen kernel, so that I can see where loader starts to behave differently. I guess that will the place where I will add my code. I will refer to currently implemented multiboot1 support under BIOS loader. (Details as to how you intend to approach the problem, if applicable. May include ideas as to how to break the problem down into smaller parts, or notes on research you need to do before settling on your final approach to solving the problem)

  • Add a file parser to EFI FreeBSD loader to check if given binary file is multiboot2 binary.
  • Add multiboot2 features one by one, so that EFI FreeBSD Loader can be tested by loading simple binaries which use only subset of multiboot2 features.
  • Correctly boot Xen Kernel.
  • Pass all the needed information to Xen Kernel so that it can load FreeBSD kernel as Dom0.

(5-10 milestones, with dates, indicating when you hope or expect to be able to complete features. This section is mandatory. Please negotiate these with your mentor to make sure you're not under- or over-estimating the amount of work to be done. Please also make sure the following four dates are included within your milestones)

  • May 14th:
    • Read source code, study current EFI Loader
  • May 21st:
    • Read multiboot2 protocol and implement multiboot2 parser
  • May 28th:
    • Start working on loading Xen kernel
  • June 11th - June 15th: Mid-term Evaluations #1
    • I should be able to boot Xen kernel by now
  • June 15th: Get a machine with serial port.
  • July 9th - July 13th: Mid-term Evaluations #2
  • August 6th: End of coding (soft)
    • You may wish to use this time to complete documentation etc
  • August 14th: End of coding (hard)

(List of steps you plan to use to test your work, as discussed with your mentor)

I can test multiboot2 implementation by trying to load simple multiboot2 binaries inside QEMU. Second part can be tested by trying to boot FreeBSD Xen Dom0 on bare-metal.

(Link to your code, for example https://svnweb.freebsd.org/socsvn/soc2018/username/ or a Github URL etc)

(A place to make notes that will be useful to others looking at your code. You probably don't need to put anything here on day one)

(Links to any external resources, work, research etc which may be useful to you or to anybody wanting to understand your work)

  • summerofcode2018projects/efiloaderforxendom0.1525947745.txt.gz
  • Last modified: 2018/05/10 10:22
  • by KristapsCivkulis