DragonFly BSD

Google Summer of Code Project List

Have a look at our SoC pages from 2008, 2009, 2010, 2011, and 2012, to get an overview about prior year's projects.

For more details on Google's Summer of Code: Google's SoC page

Alternate project links: Projects page, Research Projects

Note to prospective students: These project proposals are meant to be a first approximation; we're looking forward to your own suggestions (even for completely new directions) and will try to integrate your ideas to make the GSoC project more interesting to all parties. Even when a proposal is very specific about the goals that must be achieved and the path that should be taken, these are always negotiable. Keep in mind that we have tried to limit the proposals on this page to those that (based on our past experience) are appropriate for the GSoC program. This is by no means a comprehensive list, original ideas or proposals based on project ideas found on other pages are very welcome.

Note to everyone else: These proposals are by no means Summer of Code specific, anyone is welcome and encouraged to adopt any of these projects at any time (just please let us know, or make a note on this page).

Legend:

Project ideas


Port pf firewall changes from FreeBSD

DragonFly's version of the pf firewall was brought in from OpenBSD 4.7. FreeBSD imported the pf from OpenBSD 4.8 and has significantly enhanced the SMP performance of the firewall. Port the FreeBSD version of pf.

Meta information:


Implement GEM for the DragonFly kernel

The Graphics Execution Manager is a memory management system dedicated to Intel graphics chipsets. Along with KMS, it is a requirement of 2010 and more recent Intel Xorg drivers.

The dports third-party application collection already contains all the userland bits needed to use the new drivers, provided WITH_NEW_XORG and WITH_KMS options are used in make.conf

Background GEM information:

Some kernel work has already been done in this domain by FreeBSD and could probably be adapted:

Related work has also been done previously by David Shao during a 2010 GSoC project:

The dflygsocdrm branch is kept up-to-date but sadly seems to only be working on i386 DragonFly systems, and with ~2010 era Intel chipsets.

An experimental port of the FreeBSD i915/kms code is also available, albeit non-working due to the missing GEM support.

Adding PAT (Page Attribute Table) support to the kernel seems to be a required first step:

Meta information:


Implement Linux compatibility for the x86_64 DragonFly kernel

DragonFly/i386 supports the execution of 32 bit Linux binaries; it is only natural to implement the same kind of binary compatibility for 64-bit systems.

Some of the other *BSD systems may already have implemented such a mechanism.

Meta information:


Sync DragonFly jail capability with FreeBSD jail capability

The DragonFly jails were updated from FreeBSD-4.8 capability to FreeBSD 5.1 capability in 2005. They haven't been improved on since. This goal of this project is to make DragonFly jails to be functionally identical to FreeBSD 9.x jail functionality such that software designed to work using modern FreeBSD jail functions will work on DragonFly without modification.

Meta information:


Make allocation in the DragonFly kernel NUMA-aware

Meta information:


Port valgrind to DragonFlyBSD

Valgrind is a very useful tool on a system like DragonFly that's under heavy development. Since valgrind is very target specific, a student doing the port will have to get acquainted with many low level details of the system libraries and the user<->kernel interface (system calls, signal delivery, threading...). This is a project that should appeal to aspiring systems programmers. Ideally, we would want the port to be usable with vkernel processes, thus enabling complex checking of the core kernel code.

The goal of this project is to port valgrind to the DragonFlyBSD platform so that at least the memcheck tool runs sufficiently well to be useful. This is in itself a challenging task. If time remains, the student should try to get at least a trivial valgrind tool to work on a vkernel process.

Meta information:


Make vkernels checkpointable

Meta information:


HAMMER compression

Doing compression would require flagging the data record as being compressed and also require double-buffering since the buffer cache buffer associated with the uncompressed data might have holes in it and otherwise referenced by user programs and cannot serve as a buffer for in-place compression or decompression.

The direct read / direct write mechanic would almost certainly have to be disabled for compressed buffers and the small-data zone would probably have to be used (the large-data zone is designed only for use with 16K or 64K buffers).

Meta information:


Userland System V Shared Memory / Semaphore / Message Queue implementation

Meta information:


Port Hyper-V Linux Integration components to DragonFly

Meta information:


Implement more dm targets

Meta information:


Implement a new unionfs

Meta information:


Improve compatibility of libdevattr with Linux' libudev

Meta information:


Implement further dsched disk scheduling policies (2011 Project: BFQ)

Meta information:


Implement hardware nested page table support for vkernels

Meta information:


Access to ktr(4) buffers via shared memory

Our event tracing system, ktr(4), records interesting events in per-cpu buffers that are printed out with ktrdump(8). Currently, ktrdump uses libkvm to access these buffers, which is suboptimal. One can allow a sufficiently-privileged userspace process to map those buffers read-only and access them directly. For bonus points, design an extensible, discoverable (think reflection) mechanism that provides fast access via shared memory to data structures that the kernel chooses to expose to userland.

Meta information:


nmalloc (libc malloc) measurements and performance work

nmalloc is our libc memory allocator it is a slab-like allocator; it recently had some work done to add per-thread caches, but there is much more work that could be done. A project on this might characterize fragmentation, try out a number of techniques to improve per-thread caching and reduce the number of total syscalls, and see if any are worth applying.

Possible things to work on: (thread caches) * The per-thread caches are fixed-size; at larger object sizes (say 4K), this can result in a lot of memory tied up. Perhaps they should scale their max size inversely to the object size.

(slab zone allocation) * zone_alloc() currently burst-allocates slab zones with the zone magazine held across a spinlock.

(VMEM): * currently allocations > either 4k or 8k are forced directly to mmap(); this means that idle memory from free slabs cannot be used to service those allocations and that we do no caching for allocations > than that size. this is almost certainly a mistake.

(Note) * These are just ideas; there are many more things possible and many of these things need a lot of measurement to evaluate them. It'd be interesting to see if any of these are appropriate for it.

References: * http://www.usenix.org/event/usenix01/bonwick.html

A description of the Sun Solaris work on which the DragonFly allocator is based; use this as an overview, but do not take it as gospel for how the DFly allocator works.

jemalloc is FreeBSD's and Firefox's (and NetBSD and GNASH and ...)'s malloc; in this tech talk, Jason Evans reviews how jemalloc works, how it has changed recently, and how it avoid fragmentation.

This thesis is an excellent overview of many techniques to reduce contention and the effects these techniques have on fragmentation.


Make DragonFly multiboot capable

Adjust the DragonFly kernel to be multiboot (the specification) capable. In addition, add necessary code to grub2 to understand our disklabel64 and anything else we need to be able to use grub2 to multiboot DragonFly without any chainloading involved.

Meta information:


Extend dsched framework to support jails

Extend/modify the dsched framework to take into account jails and etc. instead of always allocating a 'tdio'. This would allow different process groupings (such as all processes in a jail) to be scheduled together. A new jail-specific policy would have to be written to support this, or an existing policy modified.

Meta information:


Implement i386 32-bit ABI for x86_64 64-bit kernel

The idea here is to support the execution of 32 bit DragonFly binaries in 64 bit DragonFly environments, something numerous other operating systems have done. Several things must be done to support this. First, the appropriate control bits must be set to execute in 32-bit compatibility mode while in usermode instead of 64-bit mode. Second, when a system call is made from 32-bit mode a translation layer is needed to translate the system call into the 64-bit requivalent within the kernel. Third, the signal handler and trampoline code needs to operate on the 32-bit signal frame. Fourth, the 32 and 64 bit ELF loaders both have to be in the kernel at the same time, which may require some messing around with procedure names and include files since originally the source was designed to be one or the other.

There are several hundred system calls which translates to a great deal of 'grunt work' when it comes time to actually do all the translations.

In 2012 a GSoC made reasonable progress on this project, a future GSoC student could pick up where he left off: http://gitweb.dragonflybsd.org/~ivan/dragonfly.git/shortlog/refs/heads/32bit_api_dirty_2

Meta information:


Adapt pkgsrc to create a package system with dependency independence.

Meta information:


Ability to execute Mach-O (OS X) binaries

This is a project for a student with something to prove, executing a binary touches a huge number of moving parts of a modern kernel. This project would entail adding or porting support for Mach-O binaries to the DragonFly BSD kernel. It would also involve adding an additional system call vector, like the Linux vector used for linux binary emulation. This is quite a large and complicated task and any proposal will be expected to be well-researched to reflect that. The ability to execute non-GUI binaries that make use of shared libraries should be the minimum to which such a project should aspire. OpenDarwin is available as a reference or to port relevant code from.

Meta information:


Installer rework

Upgrade/partially rewrite the installer to be much simpler to maintain. As part of reworking the installer, several functions scattered around in other base utils should be factored out into libraries that both the installer and the util it comes from can use, e.g.:

The updated installer should then make use of all these new libraries and other ones that are already available (libcryptsetup, libluks, liblvm, libtcplay) to offer more advanced features.

Meta information:


Kernel - Add support for more CPUs

DragonFly is currently limited to 63 CPU cores. Servers with more core than that are becoming sort of available or even potentially affordable. Supporting a number of cores greater than 63 is the first step in really testing SMP.

See this post for details:

http://lists.dragonflybsd.org/pipermail/kernel/2014-February/063062.html

Meta information:


HAMMER2 - Add block encryption feature

Add physical block encryption to HAMMER2.

Meta information:


HAMMER2 - Add copies feature

Add block redundancy to HAMMER2

Meta information:


Regression framework improvements

DragonFly has a simple regression testing framework, dfregress(8) and tbridge(9), that supports testing both userland and kernel modules. Potential work to be done:

Meta information:


Port bhyve - The BSD Hypervisor

DragonFly has no efficient solution for running other operating systems as guests. Bhyve is virtual machine manager for FreeBSD similar to the Linux KVM. This would be a big step forward for DragonFlyBSD, as it would allow us to run DragonFly on native hardware in situations where also Linux (or other operating systems) is required. IMHO, this would also reduce/eliminate the need for Linux 64-bit compatibility.

Meta information:


Support DragonFly on bhyve - The BSD Hypervisor

DragonFly needs a new loader to run on Bhyve

Meta information:


Port VirtualBox

DragonFly has no efficient solution for running other operating systems as guests. VirtualBox depends on a kernel module. Port this from FreeBSD.

Meta information:


Improve DragonFly as a VirtualBox guest

When running DragonFly under VirtualBox, you don't have good support for graphics and also the clipboard is not working between host and guest. Port the virtualbox guest extensions to DragonFly.

Meta information:


Support KVM

Add a KVM-compatible API to DragonFly, to be able to run qemu-kvm natively. This requires a fair bit of prior investigation as part of the proposal.

This could be based on a port of bhyve (see the bhyve project on this page), with an added compatibility API for KVM.

[https://www.kernel.org/doc/Documentation/virtual/kvm/api.txt]

Meta information:


Tickless Kernel

Make the DragonFly kernel tickless.

Meta information:


Experiment with Rust in the kernel

Rust is a safetly-oriented language in the same leage as C++ but without many of it's short-comings. It doesn't depend on a GC and can be used for very low-level tasks as well as high-level code. It is heavily developed by the Mozilla foundation.

The GSoC project would consist of being able to write a simple kernel module in Rust and access some of the kernel API (kmalloc, etc.). It also includes bootstrapping Rust to DragonFly.

What can be accomplished with Rust in the kernel? What would be the advantages and what the disadvantages? For example how could the device hierarchy be represented in Rust? Implementing a simple device driver. How can existing APIs be represented in Rust using traits? How could C call Rust code?

[http://blog.theincredibleholk.org/blog/2013/11/18/booting-to-rust/]

Meta information:


Improve Kernel boot speed

How fast can be boot? Where (in which subsystems) is most time spend. What can we do to boot faster?

Meta information:


(please add)