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