e74c4396a21298a5b69b5736aefa74715e42c458
[ikiwiki.git] / docs / developer / ProjectsPage.mdwn
1 # DragonFly Projects 
2
3 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.
4
5 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.
6
7 [[!toc levels=3 ]]
8
9 ## Documentation projects 
10
11 ### Write manpages
12 * sysref (GCI:Documentation or Research)
13
14 ## Userland projects 
15
16 ### One-liners
17 * Bring in smbfs changes from FreeBSD (GCI:Code)
18 * rpc.lockd and rpc.statd sync with FreeBSD (GCI:Code)
19 * Add extended slice support to `fdisk`
20 * C99 Standards Conformance. The todo list is on [[/docs/developer/StandardsConformanceProject]] (GCI:Code)
21 * Add lwp support to ptrace/gdb/core dumps.
22 * UTF8 support in the console
23
24 ### dma
25 * Make dma(8) our default MTA
26 * Remove sendmail (optional)
27
28 ### Scalability (algorithmic performance) (GCI:Research)
29 * [http://bulk.fefe.de/scalability/](http://bulk.fefe.de/scalability/) 
30 * [http://bulk.fefe.de/lk2006/talk.pdf](http://bulk.fefe.de/lk2006/talk.pdf)
31
32 ### Clean our code to make it [style(9)](http://leaf.dragonflybsd.org/cgi/web-man?command=style&section=ANY#style&sectionANY) compatible.  (GCI:Code)
33 * Compile and test your changes.
34 * Verify that the checksum (sha(1)) of the unmodified object matches the checksum of the cleaned object.  Check also with strip(1)+sha(1)  
35
36 ### Port BSD-licensed tools (ex: `grep`, `diff` and `sort`) (GCI:Code)
37 * The OpenBSD guys already did some work related to that.
38 * If you manage to bring the tools to DragonFly, check if everything works as expected (e.g. rc.d scripts, make world runs, ...).
39
40 ### GDB
41 * ptrace/gdb follow-fork-mode support and more (peek at linux)
42 * Change the build to create one libbfd for gdb and binutils
43 * Separate RPC code from NFS into separate library.
44
45 ### I/O diagnostic utilities
46 * A utility similar to top which displays I/O usage on a per-process basis
47 * Network, Disk
48
49 ### SMART capabilities
50 * Add to camcontrol
51 * Add to natacontrol (see NetBSD's atactl?)
52
53 ### Disk scheduling rc scripts (GCI:Code)
54 * Create a rc script to manage the disk/io scheduling system
55 * 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
56 * Per-device and device class or similar defaults should be definable in rc.conf also
57 * 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.
58
59 ### libHAMMER 
60 * HAMMER has the capability to expose very rich information to userland through ioctl's.
61 * Currently the hammer(8) utility makes use of this information in an ad-hoc manner.
62 * Port this core functionality into a public libhammer library so that other base and third party utilities may take advantage of it.
63 * See commit: cb7575e6a89409a2041a37fcfc22ce9e41297ab8 -- libHAMMER already exists, port functionality into it!
64
65 ### Clean up crypt(3) consumers
66 * crypt(3) can legitimately return NULL on error, but many consumers do not check for this, instead passing the return directly to str[n]cmp. Fix these cases.
67 * Fix these cases in pkgsrc as well.
68
69 ### Live images enhancement
70
71 The live images could be made easier to use by not assuming a QWERTY keyboard layout.
72
73 Not beeing able to choose a localized keyboard layout before having to type 'installer' or 'root' may be a deal breaker for some users.
74 A simple menu replacing login(1) and displaying the following three choices could be a good solution:
75
76 1. Set keyboard layout
77 2. Launch the installer
78 3. Login as root
79
80 ### pkill/pgrep enhancement
81
82 killall recently gained a -T flag to kill all descendents of a tty, bring this feature to pkill/pgrep and evaluate any other features flags of these utilities and bring them to parity.
83
84 ## Kernel projects 
85
86 ### One-liners
87 * Port the BSDL OSS code to DragonFly
88 * 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.
89 * Implement [`sem_open()`](http://www.opengroup.org/onlinepubs/000095399/functions/sem_open.html), [`sem_close()`](http://www.opengroup.org/onlinepubs/000095399/functions/sem_close.html), and [`sem_unlink()`](http://www.opengroup.org/onlinepubs/000095399/functions/sem_unlink.html). (GCI:Code)
90 * Port or update drivers from other systems.
91 * Port Linux emulation to x86-64
92
93 ### Code to port/sync from FreeBSD
94 * PCI code (to take advantage of power saving features)
95 * Bring in support for UFS2, just the changes to extend the width of some fields from 32 bits to 64 bits.  (GCI:Code)
96 * hardware drivers. 
97 * ext2fs
98 * DTrace
99
100 ### Code to port/sync from OpenBSD
101 * Add support for the NoExecute bit as described in [http://www.openbsd.org/papers/auug04/index.html](http://www.openbsd.org/papers/auug04/index.html).
102 * After that, make user stacks and data heaps non-executable. (W^X)
103 * hardware drivers, specially wireless.
104
105 ### CPU scheduler
106 * A scheduler API supporting multiple scheduler implementations already exists
107 * Add a Solaris-like dispatcher framework that can handle more than one installed scheduling policy
108
109 ### I/O scheduler
110 * A pluggable kernel I/O scheduler already exists
111 * Implement additional disk scheduling policies
112
113 ### Implement boot cache
114 * Effectively a smart readahead.
115 * Store the pattern of incoming read requests of the boot disk.
116
117 ### Improve kernel boot speed
118 * Research source of delays in boot process, keyboard init, scsi?
119 * Better thread some hardware init, for example USB?
120 * Perhaps look to see how Linux can boot in one second, better pci scan code?
121 * "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/
122
123 ### Modify firmware framework 
124 * We currently use the firmware(9) FreeBSD also uses
125 * 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).
126 * See "firmware discussion" thread on kernel@ mailing list, March-May 2010.
127 * Since it's not desired to just add another way of doing it, this project should include getting rid of loading firmwares as modules
128
129 ### Work relating to LWKT (LightWeightKernelThreading)
130 * Implement lazy IPI cross-processor lwkt message passing.
131 * Add timeout functionality to lwkt_waitmsg().
132
133 ### Filesystem extended attributes
134 * Generic VFS attributes layer
135 * Emulate attributes ala Darwin
136 * Allow filesystems to define their own attribute vop ops
137 * QUESTIONS: Attributes or subfiles? The consensus is that subfiles are better?
138
139 ### Capabilities
140 * Implement something resembling or inspired by POSIX.1e
141 * This implementation could possibly exist in userland and interlock with the kernel via a VFS Journal or HAMMER mirroring ioctl's.
142 * These should be capable of supporting NFSv4 capabilities.
143 * References: [1](http://leaf.dragonflybsd.org/mailarchive/kernel/2006-07/msg00012.html)
144
145 ### Hardware virtualization extensions
146 * Increase performance of virtual kernels
147 * Make use of hardware virtualization extensions, if supported, to manage vmspaces
148 * Implement a KVM-compatible virtualization device to support qemu
149 * Hardware IOMMU support is not a priority and if implemented must be strictly optional.
150
151 ### Remove zalloc
152 * zalloc is a deprecated kernel interface and all current consumers can be ported to objcache, with varying levels of difficulty.
153 * zlib, pv entries
154 * Once all consumers are ported, zalloc can be removed.
155
156 ### Convert kprintf-enabling sysctl's to KTR's
157 * Many sysctl's simply enable one or more kernel kprintf's
158 * This can be very easy, or can be very unwieldy
159 * Convert all of these cases to ktr's, while slightly less easy they are far easier to wield in all cases.
160
161 ### Tear out C/H/S disk reporting
162 * Cylinders/Heads/Sectors are an outdated concept and the system doesn't rely on them anymore.
163 * Verify the assumption that we don't rely on them in any way, shape or form.
164 * Tear the reporting out of the kernel/installer/etc.
165
166 ### Change vm_map lookup algorithm
167 * The vm_map lookups currently use a Red-Black tree, since 2005.
168 * It has been decided that using an array'ized bucket'ized hash table is probably a better approach.
169 * References: [1](http://kerneltrap.org/mailarchive/freebsd-current/2010/10/1/6260944) [2](http://leaf.dragonflybsd.org/mailarchive/kernel/2005-01/msg00122.html)
170
171 ### Trampoline Code Page instead of direct syscalls
172 * 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.
173
174 ### Compressed in-memory swap device
175 * A device that uses physical memory as swap space, but compresses it.
176 * 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.
177
178 ### mmap MAP_ALIGN
179 * Solaris's mmap support a flag, MAP_ALIGN, where the address to mmap acts as an alignment hint
180 * Our backing VM calls support an alignment parameter, but our public mmap does not
181 * This would allow nmalloc to allocate slabs (64k, 64k-aligned) without wastage
182
183 ### vnode dumps
184 * It may be beneficial to be able to have crash dumps written to an ordinary file in configurations where swap is not configured.
185
186 ### vnode swap
187 * Add a vnode-backed swap pager that respects a file size limit, to allow paging to a "swap file" on a filesystem.
188
189 ### Kernel allocator feature enhancements
190 * 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.
191 * Rework the kmalloc allocator to sit on top of objcache (there are various dependencies to making this work).
192 * Create or sort out a metric for vnode/other cache object cycling rate that can indicate realistic memory pressure.
193 * Clear out free objcache slabs under memory pressure.
194 * Add reclaim functionality to objcache, such that it may ask consumers to free objects back into it under memory pressure.
195
196 ### Tear out serializers
197 * Serializers could be _carefully_ replaced with MTX locks?
198
199 ### Tear out condvars
200 * Conditional vars -- condvar(9), could be replaced with other locking primitives and our tsleep/wakeup interlock.
201
202 ### Make karc4random in libkern per-cpu (or at least wrap its own token around it)
203 * Verify that it is possible and safe to do this, what care would need to be taken, especially with respect to the random seeding?
204 * Pull out locks around calls to karc4rand*
205
206 ### Improve kernel spinlock debug-ability
207 * Add a const char *descr  field to the spinlock structure.
208 * Adjust spin_init() and all use cases, SPINLOCK_INITIALIZER() could juse use macro string extensions (# head) to install the name there.
209 * Adjust error messages to print the spinlock desc field.
210 * This change will require a full world & kernel recompile.
211
212 ### Partially rewrite buffer cache
213 * 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.
214 * 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.
215 * Rewrite the buffer cache to have separate spaces or separate buffer pools for different sizes (16, 32, 64, 128, 256... up to max).
216 * 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.
217
218 ### Sync wireless infrastructure / drivers from FreeBSD
219 * 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.
220
221 ### Add informational hardware-related sysctl's
222 * 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.
223 * Research which of these sysctl's is the most useful and add them, using the same node names as OSX.
224 1. hw.vectorunit = 1
225 1. hw.busfrequency = 100000000
226 1. hw.cpufrequency = 3062000000
227 1. hw.cachelinesize = 64
228 1. hw.l1icachesize = 32768
229 1. hw.l1dcachesize = 32768
230 1. hw.l2settings = 1
231 1. hw.l2cachesize = 262144
232 1. hw.l3settings = 1
233 1. hw.l3cachesize = 6291456
234 1. hw.tbfrequency = 1000000000
235 1. hw.activecpu: 2
236 1. hw.physicalcpu: 2
237 1. hw.physicalcpu_max: 2
238 1. hw.logicalcpu: 2
239 1. hw.logicalcpu_max: 2
240 1. hw.cputype: 7
241 1. hw.cpusubtype: 4
242 1. hw.cpu64bit_capable: 1
243 1. hw.cpufamily: 1418770316
244 1. hw.cacheconfig: 2 1 1 1 0 0 0 0 0 0
245 1. hw.cachesize: 2147483648 32768 262144 6291456 0 0 0 0 0 0
246 1. hw.busfrequency: 100000000
247 1. hw.busfrequency_min: 100000000
248 1. hw.busfrequency_max: 100000000
249 1. hw.cpufrequency: 3062000000
250 1. hw.cpufrequency_min: 3062000000
251 1. hw.cpufrequency_max: 3062000000
252 1. hw.cachelinesize: 64
253 1. hw.l1icachesize: 32768
254 1. hw.l1dcachesize: 32768
255 1. hw.l2cachesize: 262144
256 1. hw.l3cachesize: 6291456
257 1. hw.tbfrequency: 1000000000
258 1. hw.packages: 2
259 1. hw.optional.floatingpoint: 1
260 1. hw.optional.mmx: 1
261 1. hw.optional.sse: 1
262 1. hw.optional.sse2: 1
263 1. hw.optional.sse3: 1
264 1. hw.optional.supplementalsse3: 1
265 1. hw.optional.sse4_1: 1
266 1. hw.optional.sse4_2: 1
267 1. hw.optional.x86_64: 1
268 1. hw.optional.aes: 1
269 1. hw.optional.avx1_0: 1
270 1. hw.optional.rdrand: 0
271 1. hw.optional.f16c: 0
272 1. hw.optional.enfstrg: 0
273 1. machdep.cpu.max_basic: 13
274 1. machdep.cpu.max_ext: 2147483656
275 1. machdep.cpu.vendor: GenuineIntel
276 1. machdep.cpu.brand_string: Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
277 1. machdep.cpu.family: 6
278 1. machdep.cpu.model: 42
279 1. machdep.cpu.extmodel: 2
280 1. machdep.cpu.extfamily: 0
281 1. machdep.cpu.stepping: 7
282 1. machdep.cpu.feature_bits: 262929407 2660770315
283 1. machdep.cpu.extfeature_bits: 672139520 1
284 1. machdep.cpu.signature: 132775
285 1. machdep.cpu.brand: 0
286 1. 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
287 1. machdep.cpu.extfeatures: SYSCALL XD EM64T LAHF RDTSCP TSCI
288 1. machdep.cpu.cores_per_package: 1
289 1. machdep.cpu.microcode_version: 16
290 1. machdep.cpu.processor_flag: 0
291 1. machdep.cpu.mwait.linesize_min: 4096
292 1. machdep.cpu.mwait.linesize_max: 4096
293 1. machdep.cpu.mwait.extensions: 3
294 1. machdep.cpu.mwait.sub_Cstates: 4384
295 1. machdep.cpu.xsave.extended_state: 7 832 832 0
296 1. machdep.cpu.arch_perf.version: 1
297 1. machdep.cpu.arch_perf.number: 8
298 1. machdep.cpu.arch_perf.width: 48
299 1. machdep.cpu.arch_perf.events_number: 7
300 1. machdep.cpu.arch_perf.events: 127
301 1. machdep.cpu.arch_perf.fixed_number: 0
302 1. machdep.cpu.arch_perf.fixed_width: 0
303 1. machdep.cpu.cache.linesize: 64
304 1. machdep.cpu.cache.L2_associativity: 8
305 1. machdep.cpu.cache.size: 256
306 1. machdep.cpu.tlb.inst.small: 128
307 1. machdep.cpu.tlb.data.small: 64
308 1. machdep.cpu.tlb.data.large: 32
309 1. machdep.cpu.tlb.shared: 512
310 1. machdep.cpu.address_bits.physical: 40
311 1. machdep.cpu.address_bits.virtual: 48
312 1. machdep.cpu.core_count: 1
313 1. machdep.cpu.thread_count: 1
314
315
316 For more theoretical projects and project concepts see [[ResearchProjects|/docs/developer/ResearchProjectsPage]]