DragonFly Projects
This page shall serve as a common place to look if you're in search of a DragonFly related project. It's also the place to check if someone else is already working on it (to prevent project collision) or should be contacted.
Projects that can be clearly used for Google Code-In are marked with their category, where applicable. Some unmarked items may be eligible; it depends on how the student wants to tackle the project.
- Documentation projects
- Userland projects
- Kernel projects
- One-liners
- Code to port/sync from FreeBSD
- Code to port/sync from OpenBSD
- CPU scheduler
- Implement boot cache
- Improve kernel boot speed
- Modify firmware framework
- Work relating to LWKT (LightWeightKernelThreading)
- Filesystem extended attributes
- Capabilities
- Hardware virtualization extensions
- Remove zalloc
- Convert kprintf-enabling sysctl's to KTR's
- Tear out C/H/S disk reporting
- Change vm_map lookup algorithm
- Trampoline Code Page instead of direct syscalls
- Compressed in-memory swap device
- mmap MAP_ALIGN
- vnode dumps
- vnode swap
- Kernel allocator feature enhancements
- Tear out serializers
- Tear out condvars
- Partially rewrite buffer cache
- Sync wireless infrastructure / drivers from FreeBSD
- Add informational hardware-related sysctl's
Documentation projects
Write manpages
- sysref (GCI:Documentation or Research)
Userland projects
One-liners
- Bring in smbfs changes from FreeBSD (GCI:Code)
- rpc.lockd and rpc.statd sync with FreeBSD (GCI:Code)
- Add extended slice support to
fdisk
- C99 Standards Conformance. The todo list is on StandardsConformanceProject (GCI:Code)
- Add lwp support to ptrace/gdb/core dumps.
- UTF8 support in the console
Scalability (algorithmic performance) (GCI:Research)
Clean our code to make it style(9) compatible. (GCI:Code)
- Compile and test your changes.
- Verify that the checksum (sha(1)) of the unmodified object matches the checksum of the cleaned object. Check also with strip(1)+sha(1)
Port BSD-licensed tools (ex: diff
and sort
) (GCI:Code)
- The OpenBSD guys already did some work related to that.
- If you manage to bring the tools to DragonFly, check if everything works as expected (e.g. rc.d scripts, make world runs, ...).
GDB
- ptrace/gdb follow-fork-mode support and more (peek at linux)
- Change the build to create one libbfd for gdb and binutils
- Separate RPC code from NFS into separate library.
I/O diagnostic utilities
- A utility similar to top which displays I/O usage on a per-process basis
- Network, Disk
SMART capabilities
- Add to camcontrol
- Add to natacontrol (see NetBSD's atactl?)
Disk scheduling rc scripts (GCI:Code)
- Create a rc script to manage the disk/io scheduling system
- Perhaps 1 entry to "enable" it, and all disks will have mode set to "auto", in auto mode smart inquiries and other heuristics could attempt to determine the best i/o scheduler
- Per-device and device class or similar defaults should be definable in rc.conf also
- The bulk of this functionality could be implemented in a resurrected "dschedctl" utility and exposed through the rc interface using just a thin wrapper, allowing hotplug scripts and etc. an easier option to use the same facilities.
libHAMMER
- HAMMER has the capability to expose very rich information to userland through ioctl's.
- Currently the hammer(8) utility makes use of this information in an ad-hoc manner.
- Port this core functionality into a public libhammer library so that other base and third party utilities may take advantage of it.
- See commit: cb7575e6a89409a2041a37fcfc22ce9e41297ab8 -- libHAMMER already exists, port functionality into it!
Live images enhancement
The live images could be made easier to use by not assuming a QWERTY keyboard layout.
Not beeing able to choose a localized keyboard layout before having to type 'installer' or 'root' may be a deal breaker for some users. A simple menu replacing login(1) and displaying the following three choices could be a good solution:
- Set keyboard layout
- Launch the installer
- Login as root
Kernel projects
One-liners
- Port the BSDL OSS code to DragonFly
- Complete Path MTU Discovery by adding a host route to remember the Path MTU and setting a timer to expire old host routes. See netinet/if_ether.c for an example of this mechanism as used by ARP. Periodically increase MTU of hosts that have had its MTU decreased.
- Port or update drivers from other systems.
- Port Linux emulation to x86-64
Code to port/sync from FreeBSD
- PCI code (to take advantage of power saving features)
- Bring in support for UFS2, just the changes to extend the width of some fields from 32 bits to 64 bits. (GCI:Code)
- hardware drivers.
- ext2fs
Code to port/sync from OpenBSD
- Add support for the NoExecute bit as described in http://www.openbsd.org/papers/auug04/index.html.
- After that, make user stacks and data heaps non-executable. (W^X)
- hardware drivers, specially wireless.
CPU scheduler
- A scheduler API supporting multiple scheduler implementations already exists
- Add a Solaris-like dispatcher framework that can handle more than one installed scheduling policy
Implement boot cache
- Effectively a smart readahead.
- Store the pattern of incoming read requests of the boot disk.
Improve kernel boot speed
- Research source of delays in boot process, keyboard init, scsi?
- Better thread some hardware init, for example USB?
- Perhaps look to see how Linux can boot in one second, better pci scan code?
- "Some kernel work made it possible to do asynchronous initialization of some subsystems. For example, the modified kernel starts the Advanced Host Controller Interface (AHCI) initialization, to handle storage, at the same time as the Universal Host Controller Interface (UHCI), in order to handle USB" - http://lwn.net/Articles/299483/
Modify firmware framework
- We currently use the firmware(9) FreeBSD also uses
- It would be more appropriate to avoid future problems with redistribution problems, etc, to adapt the wifi firmware stuff to use the firmware(9) we used to have before, which was able to load firmware files from userland (/etc/firmware).
- See "firmware discussion" thread on kernel@ mailing list, March-May 2010.
- Since it's not desired to just add another way of doing it, this project should include getting rid of loading firmwares as modules
Work relating to LWKT (LightWeightKernelThreading)
- Implement lazy IPI cross-processor lwkt message passing.
- Add timeout functionality to lwkt_waitmsg().
Filesystem extended attributes
- Generic VFS attributes layer
- Emulate attributes ala Darwin
- Allow filesystems to define their own attribute vop ops
- QUESTIONS: Attributes or subfiles? The consensus is that subfiles are better?
Capabilities
- Implement something resembling or inspired by POSIX.1e
- This implementation could possibly exist in userland and interlock with the kernel via a VFS Journal or HAMMER mirroring ioctl's.
- These should be capable of supporting NFSv4 capabilities.
- References: 1
Hardware virtualization extensions
- Increase performance of virtual kernels
- Make use of hardware virtualization extensions, if supported, to manage vmspaces
- Implement a KVM-compatible virtualization device to support qemu
- Hardware IOMMU support is not a priority and if implemented must be strictly optional.
Remove zalloc
- zalloc is a deprecated kernel interface and all current consumers can be ported to objcache, with varying levels of difficulty.
- zlib, pv entries
- Once all consumers are ported, zalloc can be removed.
Convert kprintf-enabling sysctl's to KTR's
- Many sysctl's simply enable one or more kernel kprintf's
- This can be very easy, or can be very unwieldy
- Convert all of these cases to ktr's, while slightly less easy they are far easier to wield in all cases.
Tear out C/H/S disk reporting
- Cylinders/Heads/Sectors are an outdated concept and the system doesn't rely on them anymore.
- Verify the assumption that we don't rely on them in any way, shape or form.
- Tear the reporting out of the kernel/installer/etc.
Change vm_map lookup algorithm
- The vm_map lookups currently use a Red-Black tree, since 2005.
- It has been decided that using an array'ized bucket'ized hash table is probably a better approach.
- References: 1 2
Trampoline Code Page instead of direct syscalls
- Map a read/execute trampoline page into every process, which has a syscall table, i.e. is used instead of "int" to enter the kernel. This way we can easily change the kernel enter method from "int" to e.g. "sysenter" without having to recompile userland applications, or even implement some syscalls in userspace.
Compressed in-memory swap device
- A device that uses physical memory as swap space, but compresses it.
- Do we support stacking of swap space? For example, one would have this compressed in-memory swap device with highest priority. Replaced objects will be put into the next priority swap device (e.g. a SSD), and so on.
mmap MAP_ALIGN
- Solaris's mmap support a flag, MAP_ALIGN, where the address to mmap acts as an alignment hint
- Our backing VM calls support an alignment parameter, but our public mmap does not
- This would allow nmalloc to allocate slabs (64k, 64k-aligned) without wastage
vnode dumps
- It may be beneficial to be able to have crash dumps written to an ordinary file in configurations where swap is not configured.
vnode swap
- Add a vnode-backed swap pager that respects a file size limit, to allow paging to a "swap file" on a filesystem.
Kernel allocator feature enhancements
- Enhance objcache in a manner that will allow the initialization to specify allocation functions which will allocate and free entire slabs of memory, not just single objects.
- Rework the kmalloc allocator to sit on top of objcache (there are various dependencies to making this work).
- Create or sort out a metric for vnode/other cache object cycling rate that can indicate realistic memory pressure.
- Clear out free objcache slabs under memory pressure.
- Add reclaim functionality to objcache, such that it may ask consumers to free objects back into it under memory pressure.
Tear out serializers
- Serializers could be carefully replaced with MTX locks?
Tear out condvars
- Conditional vars -- condvar(9), could be replaced with other locking primitives and our tsleep/wakeup interlock.
Partially rewrite buffer cache
- Buffer cache buffers map VM pages from the filesystems VM-backed vnodes, the "buffer space" is the maximum amount of virtual space to allocate to these buffers.
- When the buffer_map KVA space gets fragmented it caused very expensive defrag operations, the buffer_map KVA was recently increased to double the actual buffer space to allow full space utilization in the face of fragmentation and reduce the frequency of defrag operations.
- Rewrite the buffer cache to have separate spaces or separate buffer pools for different sizes (16, 32, 64, 128, 256... up to max).
- The vm_map API is used to allocate kvm out of the buffer_map. If the buffer's KVAs are preallocated then things can basically just be setup linearly at boot time.
Sync wireless infrastructure / drivers from FreeBSD
- Rui Paulo ported the wireless infrastructure and ath drivers to DragonFly from FreeBSD in recent history. A lot has changed in the intervening time, the infrastructure should be synchronized/updated to match the state-of-the-art in FreeBSD. At a minimum the drivers that currently work in DragonFly should be tested to ensure functionality and updates as well or improved.
Add informational hardware-related sysctl's
- MacOS X exports a bunch of cpu-specific sysctl's detailing sizes, layout, features, etc. Most/all of this could be detected by a userspace program, but exporting these makes the barrier of entry to cpu-conditional code lower.
- Research which of these sysctl's is the most useful and add them, using the same node names as OSX.
- hw.vectorunit = 1
- hw.busfrequency = 100000000
- hw.cpufrequency = 3062000000
- hw.cachelinesize = 64
- hw.l1icachesize = 32768
- hw.l1dcachesize = 32768
- hw.l2settings = 1
- hw.l2cachesize = 262144
- hw.l3settings = 1
- hw.l3cachesize = 6291456
- hw.tbfrequency = 1000000000
- hw.activecpu: 2
- hw.physicalcpu: 2
- hw.physicalcpu_max: 2
- hw.logicalcpu: 2
- hw.logicalcpu_max: 2
- hw.cputype: 7
- hw.cpusubtype: 4
- hw.cpu64bit_capable: 1
- hw.cpufamily: 1418770316
- hw.cacheconfig: 2 1 1 1 0 0 0 0 0 0
- hw.cachesize: 2147483648 32768 262144 6291456 0 0 0 0 0 0
- hw.busfrequency: 100000000
- hw.busfrequency_min: 100000000
- hw.busfrequency_max: 100000000
- hw.cpufrequency: 3062000000
- hw.cpufrequency_min: 3062000000
- hw.cpufrequency_max: 3062000000
- hw.cachelinesize: 64
- hw.l1icachesize: 32768
- hw.l1dcachesize: 32768
- hw.l2cachesize: 262144
- hw.l3cachesize: 6291456
- hw.tbfrequency: 1000000000
- hw.packages: 2
- hw.optional.floatingpoint: 1
- hw.optional.mmx: 1
- hw.optional.sse: 1
- hw.optional.sse2: 1
- hw.optional.sse3: 1
- hw.optional.supplementalsse3: 1
- hw.optional.sse4_1: 1
- hw.optional.sse4_2: 1
- hw.optional.x86_64: 1
- hw.optional.aes: 1
- hw.optional.avx1_0: 1
- hw.optional.rdrand: 0
- hw.optional.f16c: 0
- hw.optional.enfstrg: 0
- machdep.cpu.max_basic: 13
- machdep.cpu.max_ext: 2147483656
- machdep.cpu.vendor: GenuineIntel
- machdep.cpu.brand_string: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
- machdep.cpu.family: 6
- machdep.cpu.model: 42
- machdep.cpu.extmodel: 2
- machdep.cpu.extfamily: 0
- machdep.cpu.stepping: 7
- machdep.cpu.feature_bits: 262929407 2660770315
- machdep.cpu.extfeature_bits: 672139520 1
- machdep.cpu.signature: 132775
- machdep.cpu.brand: 0
- machdep.cpu.features: FPU VME DE PSE TSC MSR PAE MCE CX8 APIC SEP MTRR PGE MCA CMOV PAT PSE36 CLFSH DS MMX FXSR SSE SSE2 SS SSE3 PCLMULQDQ MON SSSE3 CX16 SSE4.1 SSE4.2 POPCNT AES VMM XSAVE OSXSAVE AVX1.0
- machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF RDTSCP TSCI
- machdep.cpu.cores_per_package: 1
- machdep.cpu.microcode_version: 16
- machdep.cpu.processor_flag: 0
- machdep.cpu.mwait.linesize_min: 4096
- machdep.cpu.mwait.linesize_max: 4096
- machdep.cpu.mwait.extensions: 3
- machdep.cpu.mwait.sub_Cstates: 4384
- machdep.cpu.xsave.extended_state: 7 832 832 0
- machdep.cpu.arch_perf.version: 1
- machdep.cpu.arch_perf.number: 8
- machdep.cpu.arch_perf.width: 48
- machdep.cpu.arch_perf.events_number: 7
- machdep.cpu.arch_perf.events: 127
- machdep.cpu.arch_perf.fixed_number: 0
- machdep.cpu.arch_perf.fixed_width: 0
- machdep.cpu.cache.linesize: 64
- machdep.cpu.cache.L2_associativity: 8
- machdep.cpu.cache.size: 256
- machdep.cpu.tlb.inst.small: 128
- machdep.cpu.tlb.data.small: 64
- machdep.cpu.tlb.data.large: 32
- machdep.cpu.tlb.shared: 512
- machdep.cpu.address_bits.physical: 40
- machdep.cpu.address_bits.virtual: 48
- machdep.cpu.core_count: 1
- machdep.cpu.thread_count: 1
For more theoretical projects and project concepts see ResearchProjects