summaryrefslogtreecommitdiffstats
path: root/share/examples
Commit message (Collapse)AuthorAgeFilesLines
* Add sample test programs.jmmv2013-12-2912-0/+710
| | | | | | | | This is a MFC of the following into stable/10: - r258299 Add some sample test programs. - r258552 Generate plain sh test programs from a source file. As usual, "make tinderbox" clean on ref10-amd64.
* MFC r257293.neel2013-10-301-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for PCI-to-ISA LPC bridge emulation. If the LPC bus is attached to a virtual machine then we implicitly create COM1 and COM2 ISA devices. Prior to this change the only way of attaching a COM port to the virtual machine was by presenting it as a PCI device that is mapped at the legacy I/O address 0x3F8 or 0x2F8. There were some issues with the original approach: - It did not work at all with UEFI because UEFI will reprogram the PCI device BARs and remap the COM1/COM2 ports at non-legacy addresses. - OpenBSD GENERIC kernel does not create a /dev/console because it expects the uart device at the legacy 0x3F8/0x2F8 address to be an ISA device. - It was functional with a FreeBSD guest but caused the console to appear on /dev/ttyu2 which was not intuitive. The uart emulation is now independent of the bus on which it resides. Thus it is possible to have uart devices on the PCI bus in addition to the legacy COM1/COM2 devices behind the LPC bus. The command line option to attach ISA COM1/COM2 ports to a virtual machine is "-s <bus>,lpc -l com1,stdio". The command line option to create a PCI-attached uart device is: "-s <bus>,uart[,stdio]" The command line option to create PCI-attached COM1/COM2 device is: "-S <bus>,uart[,stdio]". This style of creating COM ports is deprecated. Approved by: re (glebius)
* Merge from project branch via main. Uninteresting commits are trimmed.markm2013-10-121-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor of /dev/random device. Main points include: * Userland seeding is no longer used. This auto-seeds at boot time on PC/Desktop setups; this may need some tweeking and intelligence from those folks setting up embedded boxes, but the work is believed to be minimal. * An entropy cache is written to /entropy (even during installation) and the kernel uses this at next boot. * An entropy file written to /boot/entropy can be loaded by loader(8) * Hardware sources such as rdrand are fed into Yarrow, and are no longer available raw. ------------------------------------------------------------------------ r256240 | des | 2013-10-09 21:14:16 +0100 (Wed, 09 Oct 2013) | 4 lines Add a RANDOM_RWFILE option and hide the entropy cache code behind it. Rename YARROW_RNG and FORTUNA_RNG to RANDOM_YARROW and RANDOM_FORTUNA. Add the RANDOM_* options to LINT. ------------------------------------------------------------------------ r256239 | des | 2013-10-09 21:12:59 +0100 (Wed, 09 Oct 2013) | 2 lines Define RANDOM_PURE_RNDTEST for rndtest(4). ------------------------------------------------------------------------ r256204 | des | 2013-10-09 18:51:38 +0100 (Wed, 09 Oct 2013) | 2 lines staticize struct random_hardware_source ------------------------------------------------------------------------ r256203 | markm | 2013-10-09 18:50:36 +0100 (Wed, 09 Oct 2013) | 2 lines Wrap some policy-rich code in 'if NOTYET' until we can thresh out what it really needs to do. ------------------------------------------------------------------------ r256184 | des | 2013-10-09 10:13:12 +0100 (Wed, 09 Oct 2013) | 2 lines Re-add /dev/urandom for compatibility purposes. ------------------------------------------------------------------------ r256182 | des | 2013-10-09 10:11:14 +0100 (Wed, 09 Oct 2013) | 3 lines Add missing include guards and move the existing ones out of the implementation namespace. ------------------------------------------------------------------------ r256168 | markm | 2013-10-08 23:14:07 +0100 (Tue, 08 Oct 2013) | 10 lines Fix some just-noticed problems: o Allow this to work with "nodevice random" by fixing where the MALLOC pool is defined. o Fix the explicit reseed code. This was correct as submitted, but in the project branch doesn't need to set the "seeded" bit as this is done correctly in the "unblock" function. o Remove some debug ifdeffing. o Adjust comments. ------------------------------------------------------------------------ r256159 | markm | 2013-10-08 19:48:11 +0100 (Tue, 08 Oct 2013) | 6 lines Time to eat crow for me. I replaced the sx_* locks that Arthur used with regular mutexes; this turned out the be the wrong thing to do as the locks need to be sleepable. Revert this folly. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> (In original diff) ------------------------------------------------------------------------ r256138 | des | 2013-10-08 12:05:26 +0100 (Tue, 08 Oct 2013) | 10 lines Add YARROW_RNG and FORTUNA_RNG to sys/conf/options. Add a SYSINIT that forces a reseed during proc0 setup, which happens fairly late in the boot process. Add a RANDOM_DEBUG option which enables some debugging printf()s. Add a new RANDOM_ATTACH entropy source which harvests entropy from the get_cyclecount() delta across each call to a device attach method. ------------------------------------------------------------------------ r256135 | markm | 2013-10-08 07:54:52 +0100 (Tue, 08 Oct 2013) | 8 lines Debugging. My attempt at EVENTHANDLER(multiuser) was a failure; use EVENTHANDLER(mountroot) instead. This means we can't count on /var being present, so something will need to be done about harvesting /var/db/entropy/... . Some policy now needs to be sorted out, and a pre-sync cache needs to be written, but apart from that we are now ready to go. Over to review. ------------------------------------------------------------------------ r256094 | markm | 2013-10-06 23:45:02 +0100 (Sun, 06 Oct 2013) | 8 lines Snapshot. Looking pretty good; this mostly works now. New code includes: * Read cached entropy at startup, both from files and from loader(8) preloaded entropy. Failures are soft, but announced. Untested. * Use EVENTHANDLER to do above just before we go multiuser. Untested. ------------------------------------------------------------------------ r256088 | markm | 2013-10-06 14:01:42 +0100 (Sun, 06 Oct 2013) | 2 lines Fix up the man page for random(4). This mainly removes no-longer-relevant details about HW RNGs, reseeding explicitly and user-supplied entropy. ------------------------------------------------------------------------ r256087 | markm | 2013-10-06 13:43:42 +0100 (Sun, 06 Oct 2013) | 6 lines As userland writing to /dev/random is no more, remove the "better than nothing" bootstrap mode. Add SWI harvesting to the mix. My box seeds Yarrow by itself in a few seconds! YMMV; more to follow. ------------------------------------------------------------------------ r256086 | markm | 2013-10-06 13:40:32 +0100 (Sun, 06 Oct 2013) | 11 lines Debug run. This now works, except that the "live" sources haven't been tested. With all sources turned on, this unlocks itself in a couple of seconds! That is no my box, and there is no guarantee that this will be the case everywhere. * Cut debug prints. * Use the same locks/mutexes all the way through. * Be a tad more conservative about entropy estimates. ------------------------------------------------------------------------ r256084 | markm | 2013-10-06 13:35:29 +0100 (Sun, 06 Oct 2013) | 5 lines Don't use the "real" assembler mnemonics; older compilers may not understand them (like when building CURRENT on 9.x). # Submitted by: Konstantin Belousov <kostikbel@gmail.com> ------------------------------------------------------------------------ r256081 | markm | 2013-10-06 10:55:28 +0100 (Sun, 06 Oct 2013) | 12 lines SNAPSHOT. Simplify the malloc pools; We only need one for this device. Simplify the harvest queue. Marginally improve the entropy pool hashing, making it a bit faster in the process. Connect up the hardware "live" source harvesting. This is simplistic for now, and will need to be made rate-adaptive. All of the above passes a compile test but needs to be debugged. ------------------------------------------------------------------------ r256042 | markm | 2013-10-04 07:55:06 +0100 (Fri, 04 Oct 2013) | 25 lines Snapshot. This passes the build test, but has not yet been finished or debugged. Contains: * Refactor the hardware RNG CPU instruction sources to feed into the software mixer. This is unfinished. The actual harvesting needs to be sorted out. Modified by me (see below). * Remove 'frac' parameter from random_harvest(). This was never used and adds extra code for no good reason. * Remove device write entropy harvesting. This provided a weak attack vector, was not very good at bootstrapping the device. To follow will be a replacement explicit reseed knob. * Separate out all the RANDOM_PURE sources into separate harvest entities. This adds some secuity in the case where more than one is present. * Review all the code and fix anything obviously messy or inconsistent. Address som review concerns while I'm here, like rename the pseudo-rng to 'dummy'. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> (the first item) ------------------------------------------------------------------------ r255319 | markm | 2013-09-06 18:51:52 +0100 (Fri, 06 Sep 2013) | 4 lines Yarrow wants entropy estimations to be conservative; the usual idea is that if you are certain you have N bits of entropy, you declare N/2. ------------------------------------------------------------------------ r255075 | markm | 2013-08-30 18:47:53 +0100 (Fri, 30 Aug 2013) | 4 lines Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the usual harvest queues. It was a nifty idea, but too heavyweight. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> ------------------------------------------------------------------------ r255071 | markm | 2013-08-30 12:42:57 +0100 (Fri, 30 Aug 2013) | 4 lines Separate out the Software RNG entropy harvesting queue and thread into its own files. # Submitted by: Arthur Mesh <arthurmesh@gmail.com> ------------------------------------------------------------------------ r254934 | markm | 2013-08-26 20:07:03 +0100 (Mon, 26 Aug 2013) | 2 lines Remove the short-lived namei experiment. ------------------------------------------------------------------------ r254928 | markm | 2013-08-26 19:35:21 +0100 (Mon, 26 Aug 2013) | 2 lines Snapshot; Do some running repairs on entropy harvesting. More needs to follow. ------------------------------------------------------------------------ r254927 | markm | 2013-08-26 19:29:51 +0100 (Mon, 26 Aug 2013) | 15 lines Snapshot of current work; 1) Clean up namespace; only use "Yarrow" where it is Yarrow-specific or close enough to the Yarrow algorithm. For the rest use a neutral name. 2) Tidy up headers; put private stuff in private places. More could be done here. 3) Streamline the hashing/encryption; no need for a 256-bit counter; 128 bits will last for long enough. There are bits of debug code lying around; these will be removed at a later stage. ------------------------------------------------------------------------ r254784 | markm | 2013-08-24 14:54:56 +0100 (Sat, 24 Aug 2013) | 39 lines 1) example (partially humorous random_adaptor, that I call "EXAMPLE") * It's not meant to be used in a real system, it's there to show how the basics of how to create interfaces for random_adaptors. Perhaps it should belong in a manual page 2) Move probe.c's functionality in to random_adaptors.c * rename random_ident_hardware() to random_adaptor_choose() 3) Introduce a new way to choose (or select) random_adaptors via tunable "rngs_want" It's a list of comma separated names of adaptors, ordered by preferences. I.e.: rngs_want="yarrow,rdrand" Such setting would cause yarrow to be preferred to rdrand. If neither of them are available (or registered), then system will default to something reasonable (currently yarrow). If yarrow is not present, then we fall back to the adaptor that's first on the list of registered adaptors. 4) Introduce a way where RNGs can play a role of entropy source. This is mostly useful for HW rngs. The way I envision this is that every HW RNG will use this functionality by default. Functionality to disable this is also present. I have an example of how to use this in random_adaptor_example.c (see modload event, and init function) 5) fix kern.random.adaptors from kern.random.adaptors: yarrowpanicblock to kern.random.adaptors: yarrow,panic,block 6) add kern.random.active_adaptor to indicate currently selected adaptor: root@freebsd04:~ # sysctl kern.random.active_adaptor kern.random.active_adaptor: yarrow # Submitted by: Arthur Mesh <arthurmesh@gmail.com> Submitted by: Dag-Erling Smørgrav <des@FreeBSD.org>, Arthur Mesh <arthurmesh@gmail.com> Reviewed by: des@FreeBSD.org Approved by: re (delphij) Approved by: secteam (des,delphij)
* MFC 256365rpaulo2013-10-122-42/+0
| | | | | | Remove most of the ATF tools and the _atf user. Approved by: re
* Parse the memory size parameter using expand_number() to allow specifyingneel2013-10-091-2/+2
| | | | | | | | the memory size more intuitively (e.g. 512M, 4G etc). Submitted by: rodrigc Reviewed by: grehan Approved by: re (blanket)
* MFCmarkm2013-09-011-4/+4
|\
| * Bring legacy CAM target implementation back into API/KPI-coherent and evenmav2013-09-011-4/+4
| | | | | | | | | | | | | | | | | | functional state. While CTL is much more superior target from all points, there is no reason why this code should not work. Tested with ahc(4) as target side HBA. MFC after: 2 weeks
* | Remove short-lived idea; thread to harvest (eg) RDRAND enropy into the usual ↵markm2013-08-301-19/+1
| | | | | | | | | | | | harvest queues. It was a nifty idea, but too heavyweight. Submitted by: Arthur Mesh <arthurmesh@gmail.com>
* | 1) example (partially humorous random_adaptor, that I call "EXAMPLE")markm2013-08-243-1/+119
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * It's not meant to be used in a real system, it's there to show how the basics of how to create interfaces for random_adaptors. Perhaps it should belong in a manual page 2) Move probe.c's functionality in to random_adaptors.c * rename random_ident_hardware() to random_adaptor_choose() 3) Introduce a new way to choose (or select) random_adaptors via tunable "rngs_want" It's a list of comma separated names of adaptors, ordered by preferences. I.e.: rngs_want="yarrow,rdrand" Such setting would cause yarrow to be preferred to rdrand. If neither of them are available (or registered), then system will default to something reasonable (currently yarrow). If yarrow is not present, then we fall back to the adaptor that's first on the list of registered adaptors. 4) Introduce a way where RNGs can play a role of entropy source. This is mostly useful for HW rngs. The way I envision this is that every HW RNG will use this functionality by default. Functionality to disable this is also present. I have an example of how to use this in random_adaptor_example.c (see modload event, and init function) 5) fix kern.random.adaptors from kern.random.adaptors: yarrowpanicblock to kern.random.adaptors: yarrow,panic,block 6) add kern.random.active_adaptor to indicate currently selected adaptor: root@freebsd04:~ # sysctl kern.random.active_adaptor kern.random.active_adaptor: yarrow Submitted by: Arthur Mesh <arthurmesh@gmail.com>
* Revert r253748,253749avg2013-07-281-0/+1
| | | | | | This WIP should not have been committed yet. Pointyhat to: avg
* remove needless inclusion of machine/cpu.h in userlandavg2013-07-281-1/+0
| | | | MFC after: 21 days
* Fix typo.glebius2013-07-171-1/+1
| | | | Submitted by: ae
* Improve example, so that it doesn't dump core when example moduleglebius2013-07-171-2/+6
| | | | isn't loaded.
* - Trim an unused and bogus Makefile for mount_smbfs.davide2013-06-282-0/+2
| | | | | | - Reconnect with some minor modifications, in particular now selsocket() internals are adapted to use sbintime units after recent'ish calloutng switch.
* Add "amdfam10" to the supported CPU types for amd64. This complementsjkim2013-06-271-2/+2
| | | | r251691 and 251692.
* Add a missing comma.jkim2013-06-131-1/+1
|
* - Document GCC support for AMD Family 10h processors (amdfam10).jkim2013-06-131-5/+5
| | | | - Document Clang support for AMD Jaguar processors (btver2).
* Fxi a bunch of typos.eadler2013-05-101-1/+1
| | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
* Add an alternate version of beastie to the examples directory.eadler2013-04-282-0/+2474
| | | | | | | PR: docs/38556 Submitted by: Rahul Siddharthan <rsidd@online.fr> Submitted on: 25 May 2002 22:49:56 -0000 MFC After: 2 weeks
* Fix examples for overriding INSTALL to not suggest hardcodingbdrewery2013-04-261-1/+1
| | | | | | | | | | 'install' since it breaks buildworld after the introduction and use of 'install -l' in r245752. Overriding INSTALL causes /usr/bin/install to be used instead of the proper /usr/src/tools/install.sh which handles the new flag. Approved by: bapt MFC after: 2 weeks
* Add the "-g <gdport>" option to the vmrun.sh script that enables remoteneel2013-03-281-3/+8
| | | | | | | | debugging of the guest via kgdb. See also: https://wiki.freebsd.org/BHyVe/gdb Obtained from: NetApp
* Retire the mislabeled ENABLE_SUID_SSH knob.des2013-03-221-3/+0
|
* Add bhyve to examples.neel2013-03-182-0/+181
| | | | | Requested by: alfred, julian Obtained from: NetApp
* Disconnect files removed in r248151bapt2013-03-111-3/+0
|
* Ports are no more exported via cvsup, remove cvsup examples and ↵bapt2013-03-116-159/+3
| | | | | | documentation refering to ports MFC after: 2 days
* Garbage collect NWFS and NCP bits which are now completely disconnectedattilio2013-03-092-112/+0
| | | | | | from the tree since few months. This patch is not targeted for MFC.
* Garbage collect PORTALFS bits which are now completely disconnected fromattilio2013-03-022-68/+0
| | | | | | the tree since few months. This patch is not targeted for MFC.
* Tone down the encouragement to use cvsup. Add directions to the handbookpeter2013-01-037-315/+46
| | | | pages that cover the more current methods and bring closer to reality.
* Remove 'dangerous' instructions from the example make.conf.eadler2012-12-111-8/+7
| | | | | | | | | | Clarify when and why these might be used and that this isn't a supported configuration. PR: docs/144488 Submitted by: amdmi3 Approved by: cperciva (implicit) MFC after: 2 weeks
* A number of places in the source tree still reference cuad.* aftereadler2012-12-082-7/+7
| | | | | | | | | | | sio(4) was deprecated by uart(4). s/cuad/cuau/g/ PR: docs/171533 Reviewed by: imp Approved by: cperciva (implicit) MFC after: 3 weeks
* Tidy up bsd.cpu.mk for X86 CPUs:jkim2012-12-041-5/+6
| | | | | | | | | | | | | | | | | | | | - Do not limit recent processors to "prescott" class for i386 target. There is no reason for this hack because clang is default now. On top of that, it will only grow indefinitely over time. - Add more CPUTYPEs, i.e., "athlon-fx", "core-avx2", "atom", "penryn", and "yonah". Note "penryn" and "yonah" are intentionally undocumented because they are not supported by gcc and marked deprecated by clang. - Add more CPUTYPE aliases, i.e., "barcelona" (-> amdfam10), "westmere" and "nehalem" (-> corei7). Note these are intentionally undocumented because they are not supported by (base) gcc and/or clang. However, LLVM (backend) seems to "know" the differences. Most likely, they were deprecated with other vendor code names and clang did not bother implementing them at all. - Add i686 to MACHINE_CPU for "c3-2" (VIA Nehemiah). Both gcc & clang treat it like an i686-class processor. - Add IDT "winchip2" and "winchip-c6" for completeness (undocumented). - Order processors per make.conf example, i.e., CPU vendors and models. - Tidy up make.conf example, i.e., remove "by gcc" (because we have aliases) and remove "prescott" from AMD64 architecture (because it is not correct).
* Remove fictitious support for 80386-class CPUs from bsd.cpu.mk and make(1).jkim2012-12-031-1/+1
| | | | | | It was removed from head more than 8 years ago (see r137784 and r137785). Reviewed by: imp, delphij, dim
* Clean up and update comments for CPUTYPE.jkim2012-11-191-11/+16
| | | | Requested by: rdivacky
* Decode common state bits in getencstat output.mav2012-11-061-2/+6
|
* Add -c option to sesd to make it clear enclosure status after reading itmav2012-11-062-22/+38
| | | | in case if it is not permanent and was fixed.
* Rise priority of the informational messages from LOG_INFO to LOG_NOTICE,mav2012-11-051-3/+2
| | | | | same as used for OK status. Otherwise it looks strange when OK status is reported, while informational is not.
* Fix a minor typo.mav2012-11-051-1/+1
|
* Add ATF to the build. This is may be a bit rought around the egdes,marcel2012-10-222-0/+42
| | | | | | | | | | | | | | | | | but committing it helps to get everyone on the same page and makes sure we make progress. Tinderbox breakages that are the result of this commit are entirely the committer's fault -- in other words: buildworld testing on amd64 only. Credits follow: Submitted by: Garrett Cooper <yanegomi@gmail.com> Sponsored by: Isilon Systems Based on work by: keramida@ Thanks to: gnn@, mdf@, mlaier@, sjg@ Special thanks to: keramida@
* Disconnect non-MPSAFE SMBFS from the build in preparation for droppingattilio2012-10-182-2/+0
| | | | | | | | | | | | | GIANT from VFS. In addition, disconnect also netsmb, which is a base requirement for SMBFS. In the while SMBFS regular users can use FUSE interface and smbnetfs port to work with their SMBFS partitions. Also, there are ongoing efforts by vendor to support in-kernel smbfs, so there are good chances that it will get relinked once properly locked. This is not targeted for MFC.
* Disconnect non-MPSAFE NWFS from the build in preparation for droppingattilio2012-10-171-3/+0
| | | | | | | | | | | | GIANT from VFS. In addition, disconnect also netncp, which is a base requirement for NWFS. In the possibility of a future maintenance of the code and later readd to the FreeBSD base, maybe we should think about a better location for netncp. I'm not entirely sure the / top location is actually right, however I will let network people to comment on that more specifically. This is not targeted for MFC.
* Disconnect non-MPSAFE PORTALFS from the build in preparation for droppingattilio2012-10-161-3/+0
| | | | | | GIANT from VFS. This is not targeted for MFC.
* Add a bunch more example completions.eadler2012-10-161-14/+84
| | | | | | Submitted by: wblock Approved by: cperciva (implicit) MFC after: 3 days
* Revert previous commit...kevlo2012-10-102-2/+2
| | | | Pointyhat to: kevlo (myself)
* Prefer NULL over 0 for pointerskevlo2012-10-092-2/+2
|
* Indicate (loudly) that ports csup is going away.eadler2012-10-011-6/+13
| | | | | | | While here clarify some other portions. Approved by: cperciva (implicit) MFC after: 3 days
* Correct double "the the"eadler2012-09-141-1/+1
| | | | | Approved by: cperciva MFC after: 3 days
* Minor English grammar fixes.eadler2012-09-091-5/+4
| | | | | | | | | | Specifically document that an incomplete ports tree is not supported. Remove useless comment about sendmail. Reviewed by: yuri.pankov@gmail.com Approved by: cperciva (implicit) MFC after: 1 week X-MFC-With: r240252
* Remove documentation and www cvsup files as they are no longer usefuleadler2012-09-098-184/+3
| | | | | | | | with the switch to subversion. Approved by: gjb (man pages) Approved by: cperciva (example files, implicit) MFC after: 1 week
* Minor style(9) improvementemaste2012-08-071-3/+3
|
* Add some examples about how to use FreeBSD's libusb20 in your ownjoerg2012-07-187-0/+854
| | | | code.
OpenPOWER on IntegriCloud