specified. The result is that the package will be listed with a '?'
as if it was not found within the INDEX file, so fix this behaviour.
* Remove trailing spaces.
PR: bin/87136
Submitted by: Sean Farley <sean-freebsd at farley dot org>
MFC after: 3 days
the pointer slowly wandering away on its own in an annoying way when the mouse
isn't physically moved.
PR: bin/83970
Submitted by: Lena -at- lena.kiev.ua
X-MFC after: 6.0-RELEASE
files fetched, FreeBSD release level) is transmitted to the portsnap
server when portsnap is run, but that this information is only used
anonymously and in aggregate.
core. This bug was made visible by a recent change to the audio/timidity++
port, which now has itself as a run dependency.
Reported by: Emil Mikulic, Andreas Klemm
when the base system is not compiled with NO_BIND set. Before we start
searching for mirrors, make sure that host(1) can be found, and if it
doesn't exist then fallback to the A record instead of the SRV records.
Submitted by: Luca Morettoni
linked process was exec()'ed, and map samples in that address range
into the appropriate buckets in the runtime loader's profile.
Improve a few comments.
MFC after: 3 days
Apologies to everyone who has run portsnap in 7.0-CURRENT since
Tuesday; if there is a file "/.portsnap.INDEX" on your system, you can
delete it (or even better, move it to /usr/ports/.portsnap.INDEX).
Big pointy hat to: cperciva
Reported that things weren't working properly: Aleksander Fafula
of the form "REFUSE foo" in portsnap.conf will result in parts of the
tree matching "^foo" being (a) not extracted by "portsnap extract", (b)
not updated by "portsnap update", and (c) not having any patches or new
ports downloaded by "portsnap fetch" or "portsnap cron". The example
shown in portsnap.conf demonstrates ignoring all the language categories.
As mentioned in portsnap.conf.5, the use of an imcomplete ports tree is
not officially supported; but this is something which many users have
requested, so I'm adding it anyway.
PR: bin/85619 (but not the patch provided therein)
MFC after: 1 month
Note, that when cron(8) cannot create pidfile, it'll exit. I didn't
changed this behaviour, but its better to ignore errors other than
EEXIST, so daemon can be started on systems where /var/ file system
doesn't support locking (like NFS without rpc.lockd(8)).
- Use pool.ntp.org servers where possible, thanks to
Chuck Swiger <cswiger at mac dot com> .
- Update list of Swedish NTP servers, thanks to
Fredrik Lindberg <fli+freebsd-current at shapeshifter dot se> .
PR: bin/75479
MFC after: 1 day
Trim trailing whitespace and comments before parsing, and skip empty lines.
Skip subvendor / subdevice entries (which start with two tab characters).
Change the scanf() format string to match any amount and type of whitespace
between the device ID and the description text.
MFC after: 3 weeks
1. Provide larger /, /var, and /tmp partitions (the last increase was
in 2001, and we now have both larger hard drives and more space-hungry
software.)
2. If there is enough space available, allocate extra space to /var
sufficient to store a crash dump.
On systems where harddrivesize > 3 * RAMsize + 10GB, the default sizes
will now be as follows:
swap RAMsize * 2
/ 512 MB
/tmp 512 MB
/var 1024 MB + RAMsize
/usr the rest (8GB or more)
On systems where harddrivesize > RAMsize / 8 + 2 GB, the default sizes
will be in the following ranges, with space allocated proportionally:
swap RAMsize / 8 -- RAMsize * 2
/ 256 MB -- 512 MB
/tmp 128 MB -- 512 MB
/var 128 MB -- 1024 MB
/usr 1536 MB -- 8192 MB
On systems with even less disk space, the existing behaviour is not
changed.
Approved by: re (kensmith)
MFC after: 1 day
(or once people stop arguing about colours of paint)
in sysctl_jail_list(). Because of this, jls(8) could enter into
an endless loop. The strange thing is, that we can call jls(8) while
the other one is in loop and it will succeed - SYSCTL_OUT() will
not return ENOMEM there.
Maybe SYSCTL_OUT() returns first ENOMEM, because there is no memory,
but is marking some memory range as wired even on failure and another
SYSCTL_OUT() calls are not going to succeed, because process exceeds
limit of wired memory? ENOVMCLUE.
Anyway. Fix jls(8) to ignore ENOMEM and retry only 4 times.
Submitted by: Niklas Saers
PR: kern/79245
MFC after: 3 days
missing from ${WORKDIR}/files/.
This bug was caused by the astonishing interaction of "return" and
pipelines; in the following code, the "return" does not exit the
function, but instead exits the subshell which was spawned for the last
element of the pipeline; consequently, the output produced is "foo".
foo() {
echo bar | while read baz; do
if [ ${baz} = "bar" ]; then
return 1
fi
done
echo foo
}
Reported by: simon
"portsnap fetch update" or "portsnap -I cron update". They will be
executed in the order that they appear, and duplicates are not removed
(so "portsnap fetch fetch fetch fetch" is meaningful, albeit rather
silly).
Requested by: Roman Divacky
change the permissions. Failures are still recorded.
This allows mtree to do a generally better job of things when uid != 0.
Sponsored by: ActiveState/Sophos
Partially submitted by: neilw at ActiveState dot com
Reviewed by: neilw at ActiveState dot com
MFC after: 3 weeks
from the port number (if any exists). This unbreaks
env HTTP_PROXY="http://localhost:3128/" portsnap fetch
While I'm here, list both the host and the port in the error message
output if getaddrinfo() fails, since either of them could be responsible
for the failure.
than what we already have" message. [1]
When operating with the undocumented --debug option, replace "xargs
phttpget" with "xargs -t phttpget", since that might conceivably help
debugging.
Noticed by: simon [1]
fast, lightweight, and generally good way for users to keep their
ports trees up to date.
This is version 0.9.4 from the ports tree (sysutils/portsnap) with
the following changes:
1. The experimental pipelined http code is enabled. No seatbelts
in -CURRENT. (^_^)
2. The working directory has moved from /usr/local/portsnap to
/var/db/portsnap (as discussed on -arch two days ago).
3. Portsnap now fetches a list of mirrors (distributed as DNS SRV
records) and selects one randomly. This should help to avoid the
uneven loading which plagues the cvsup mirror network.
4. The license is now 2-clause BSD instead of 3-clause BSD.
5. Various incidental changes to make portsnap fit into the base
system's build mechanics.
X-MFC-After: 6.0-RELEASE
X-MFC-Before: 5.5-RELEASE
X-MFC-To: RELENG_6, RELENG_5, ports
discussed on: -arch and several other places
"yes please" from: simon, remko, flz, Diane Bruce
thinks this is a great idea: bsdimp
Hopes he didn't forget any files: cperciva
it is running during installations. The vsystem() function does get
used after this happens (e.g. if you manually configure the network
interface and ask it to enable the interface) so it needs to be a
little smarter about whether it uses /stand/sh or /bin/sh.
MFC after: 3 days
a card is ejected). wpa_supplicant requires that internal events
for interfaces coming+going include a name but after an interface
is removed you cannot use if_indextoname to map the interface index
in the RTM_IFINFO (or RTM_IFANNOUNCE) msg to an interface name.
Instead record the interface index in the driver-private data area
and use that to filter msgs from the routing socket. This insures
that when we have a message to process we know the interface name.
The end result is that we can now dispatch an "interface removed"
event that is understood when notified than an interface went away
(where previously the event dispatched was ignored because the
interface name was unrecognized).
This change also insures we only process events for our interface.
The only downside is that we can no longer wait for an interface
to arrive as we need to map the interface name to an index at
startup. This is not important as wpa_supplicant should be launched
by devd and not include a separate mechanism for doing interface
discovery.
MFC after: 3 days
Rate units are mA/mW, not mAh/mWh. Get full battery status and time
remaining from ACPIIO_BATT_GET_BATTINFO instead of BST.
PR: bin/83672
MFC after: 2 days
-o Show the origin recorded on package generation instead of the
package name.
-O Only list packages whose registered origin is origin.
Based on PR: bin/78640
Submitted by: Marcus Grando <marcus at corp dot grupos.com.br>, flz
on -current by Ben Kaduk <minimarmot@gmail.com>.
Add a hack of my own to allow the user to supply the paths to the INF and
SYS files on the command line.
- file(1) does not recognize UTF-16 encoded .INF file:
netbc564.inf: MPEG ADTS, layer I, v1, 96 kBits, 32 kHz, Stereo
Use egrep(1) to match two strings, i. e., `Signature' and `Class=Net'.
- Fix linking failure. Generate a temporary Makefile to emluate
official kernel module build process.
- Some minor typo/style fixes.
Reviewed by: obrien
section on "make world". The old link still works fine, but all the
hyperlinks of the referenced document are broken; the same links
work find if /doc/en_US.ISO8859-1 is used instead of plain /doc to
reach the online Handbook copy.
vertical virtual scrolling. This also respects -U for the distance.
PR: bin/82762
Submitted by: Eric Kjeldergaard <kjelderg -at- gmail.com>
MFC after: 1 month
o Slightly change KBADDKBD and KBRELKBD ioctl() interface. Instead of passing
keyboard index pass keyboard_info_t structure with populated 'kb_unit' and
'kb_name' fields. Keyboard index is not very user-friendly and is not very
easy to obtain. Keyboard driver name and unit, on the other hand, is much
more user friendly and known almost all the time;
o Move definition of keyboard_info_t structure up;
o Teach kbdcontrol(1) how to attach/detach keyboards to/from the keyboard
multiplexor;
o Update kbdcontrol(1) man page and document new functionality.
To attach/detach keyboard to/from keyboard multiplexor one needs to use
keyboard device name (i.e. ukbd0).
MFC after: 1 week
it about the lease file location and not invoking it with the (non-existant)
'-r' option. Releasing leases works vastly different now, so this isn't
needed.
Submitted by: sam
Approved by: re
o use proper api for setting/deleting keys instead of depending
on key indices
o check mac address to decide whether a key is unicast or group/global
o check set_tx on key set to decide whether a group/global key should
also be marked as default
o explicitly set IEEE80211_KEY_GROUP flag for group keys instead of
depending on kernel auto-add kludge
With the above changes static wep key handling works.
Reviewed by: avatar
Approved by: re (scottl)
of USB2 "duplicate" psuedo busses, it is not at all uncommon for machines
to have more than 4 USB busses nowadays.
PR: bin/81533
Submitted by: Darren Pilgrim dmp at bitfreak dot org
Approved by: re (scottl)
MFC after: 1 week
how to convert these to gprof(1) flat profiles. Augment description
for the '-g' option.
Remove superfluous quotes around a macro argument, bump document date [1].
Reminded by: ru [1]
Approved by: re (blanket hwpmc)
- pmcstat(8) gprof output mode fixes:
lib/libpmc/pmclog.{c,h}, sys/sys/pmclog.h:
+ Add a 'is_usermode' field to the PMCLOG_PCSAMPLE event
+ Add an 'entryaddr' field to the PMCLOG_PROCEXEC event,
so that pmcstat(8) can determine where the runtime loader
/libexec/ld-elf.so.1 is getting loaded.
sys/kern/kern_exec.c:
+ Use a local struct to group the entry address of the image being
exec()'ed and the process credential changed flag to the exec
handling hook inside hwpmc(4).
usr.sbin/pmcstat/*:
+ Support "-k kernelpath", "-D sampledir".
+ Implement the ELF bits of 'gmon.out' profile generation in a new
file "pmcstat_log.c". Move all log related functions to this
file.
+ Move local definitions and prototypes to "pmcstat.h"
- Other bug fixes:
+ lib/libpmc/pmclog.c: correctly handle EOF in pmclog_read().
+ sys/dev/hwpmc_mod.c: unconditionally log a PROCEXIT event to all
attached PMCs when a process exits.
+ sys/sys/pmc.h: correct a function prototype.
+ Improve usage checks in pmcstat(8).
Approved by: re (blanket hwpmc)
- Remove mention of an unimplemented option.
- Clarify the behavior of pmcstat when logging PMCs are
requested, but no log output file is specified.
- Add a cross-reference to pmclog(3).
- Bump document date.
Reviewed by: ru
Submitted by: ru [1]
Approved by: re (blanket hwpmc)
avoid the confusing error message about the line being too long). This
change uses fgetln to detect the right conditions, but the fixed-width
line buffer is kept because too many other places in the program make
assumptions about its maximum width.
Approved by: re (scottl)
function as @comment has. But will be valid only for files and not
for md5 sums, rcsid's and comments in the future.
Submitted by: flz
Approved by: re@ (scottl)
method of executing commands remotely. There are no rexec clients in
the FreeBSD tree, and the client function rexec(3) is present only in
libcompat. It has been documented as "obsolete" since 4.3BSD, and its
use has been discouraged in the man page for over 10 years.
struct ifnet or the layer 2 common structure it was embedded in have
been replaced with a struct ifnet pointer to be filled by a call to the
new function, if_alloc(). The layer 2 common structure is also allocated
via if_alloc() based on the interface type. It is hung off the new
struct ifnet member, if_l2com.
This change removes the size of these structures from the kernel ABI and
will allow us to better manage them as interfaces come and go.
Other changes of note:
- Struct arpcom is no longer referenced in normal interface code.
Instead the Ethernet address is accessed via the IFP2ENADDR() macro.
To enforce this ac_enaddr has been renamed to _ac_enaddr.
- The second argument to ether_ifattach is now always the mac address
from driver private storage rather than sometimes being ac_enaddr.
Reviewed by: sobomax, sam
- Implement sampling modes and logging support in hwpmc(4).
- Separate MI and MD parts of hwpmc(4) and allow sharing of
PMC implementations across different architectures.
Add support for P4 (EMT64) style PMCs to the amd64 code.
- New pmcstat(8) options: -E (exit time counts) -W (counts
every context switch), -R (print log file).
- pmc(3) API changes, improve our ability to keep ABI compatibility
in the future. Add more 'alias' names for commonly used events.
- bug fixes & documentation.
of NTP hosts, if ntpdate_hosts is unset or empty.
PR: conf/79712
Submitted by: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp>
mdoc text by: Matteo Riondato <rionda@gufi.org>
o reorg driver to consolidate state setup in the associate method
o add set_auth_alg method
o cleanup interface state on deinit
o change associate to use revised MLME ioctl api so we can support
ap_scan=2 methodology
o cleanup associate to support WEP and no cipher cases
o s/__FUNCTION__/__func__/
from the locally installed package. When this modifier is specified
pkg_create(8) will also create package files for all packages on
which that locally installed package depends.
MFC after: 5 days
24, and 32 bit modes. To use that, syscons(4) must be built with
the compile time option 'options SC_PIXEL_MODE', and VESA support (a.k.a.
vesa.ko) must be either loaded, or be compiled into the kernel.
Do not return EINVAL when the mouse state is changed to what it already is,
which seems to cause problems when you have two mice attached, and
applications are not likely obtain useful information through the EINVAL
caused by showing the mouse pointer twice.
Teach vidcontrol(8) about mode names like MODE_<NUMBER>, where <NUMBER> is
the video mode number from the vidcontrol -i mode output. Also, revert the
video mode if something fails.
Obtained from: DragonFlyBSD
Discussed at: current@ with patch attached [1]
PR: kern/71142 [2]
Submitted by: Xuefeng DENG <dsnofe at msn com> [1],
Cyrille Lefevre <cyrille dot lefevre at laposte dot net> [2]
additional argument that allows us to specify a timeout, like we do for
the subsequent clnt_call() calls.
Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
MFC after: 3 weeks
- Remove keyword 'continue' for more indepth error reporting
on each line
- WARNS 6 Clean
Submitted by: Liam J. Foy <liamfoy@dragonflybsd.org>
MFC after: 1 week
docs. Last I heard, Harlan Stenn was considering using FreeBSD's
pages as a starting point for the ISC NTP distribution's own pages.
If that happens, everyone wins and these can go away, to be replaced
by imported versions in contrib/ntp.
-I Use only the index file for determining if a package is out of
date. This is much faster than using the version number from a
port's Makefile, at the expense of potentially giving an incor-
rect result if the index file is out of date.
Without this option, the index file is only consulted if "make -V PKGNAME"
cannot be used.
Approved by: portmgr (krion)
catch all transient errors. This fixes situations where transient
error conditions such as network interfaces losing carrier signals
or the system running out of mbufs would result in the permanent
removal of forwarding syslog messages.
MFC after: 1 week
connections to Bluetooth HID device. As soon as Bluetooth HID device
is powered off (or goes out of RF range) the stack will terminate both
connections. File descriptors for both connections will become active
on next select(2) call. Because bthidd(8) processes file descriptors
in order, it will detect descriptor for one of the closed connections
first and kill the session. However, there is still a second (active)
descriptor that used to point to the same session. bthidd(8) used to
assert() if it cant find session by file descriptor, which was wrong.
While I'm here fix a couple of typos in parser.y
Reported by: Eric Anderson anderson AT centtech DOT com
MFC after: 3 days
the same time.
Fix if_ndis_pccard.c so that it sets sc->ndis_dobj and sc->ndis_regvals.
Correct IMPORT_SFUNC() macros for the READ_PORT_BUFFER_xxx() routines,
which take 3 arguments, not 2.
This fixes it so that the Windows driver for my Cisco Aironet 340 PCMCIA
card works again. (Yes, I know the an(4) driver supports this card natively,
but it's the only PCMCIA device I have with a Windows XP driver.)
Have pmcstat(8) and pmccontrol(8) use these APIs.
Return PMC class-related constants (PMC widths and capabilities)
with the OP GETCPUINFO call leaving OP PMCINFO to return only the
dynamic information associated with a PMC (i.e., whether enabled,
owner pid, reload count etc.).
Allow pmc_read() (i.e., OPS PMCRW) on active self-attached PMCs to
get upto-date values from hardware since we can guarantee that the
hardware is running the correct PMC at the time of the call.
Bug fixes:
- (x86 class processors) Fix a bug that prevented an RDPMC
instruction from being recognized as permitted till after the
attached process had context switched out and back in again after
a pmc_start() call.
Tighten the rules for using RDPMC class instructions: a GETMSR
OP is now allowed only after an OP ATTACH has been done by the
PMC's owner to itself. OP GETMSR is not allowed for PMCs that
track descendants, for PMCs attached to processes other than
their owner processes.
- (P4/HTT processors only) Fix a bug that caused the MI and MD
layers to get out of sync. Add a new MD operation 'get_config()'
as part of this fix.
- Allow multiple system-mode PMCs at the same row-index but on
different CPUs to be allocated.
- Reject allocation of an administratively disabled PMC.
Misc. code cleanups and refactoring. Improve a few comments.
the NTP server list.
The servers are by Internet Multifeed Co., and connected to their
IX service JPNAP. It would be a good NTP server for machines in Japan.
See also http://www.jst.mfeed.ad.jp/ for more details (Japanese only).
Reviewed by: nork
When adding users from a preformatted file, do not exit
silently when empty lines or lines starting with a '#'
are encountered - ignore them instead.
- Fix a spelling error in a comment.
PR: bin/80058
here on in, if_ndis.ko will be pre-built as a module, and can be built
into a static kernel (though it's not part of GENERIC). Drivers are
created using the new ndisgen(8) script, which uses ndiscvt(8) under
the covers, along with a few other tools. The result is a driver module
that can be kldloaded into the kernel.
A driver with foo.inf and foo.sys files will be converted into
foo_sys.ko (and foo_sys.o, for those who want/need to make static
kernels). This module contains all of the necessary info from the
.INF file and the driver binary image, converted into an ELF module.
You can kldload this module (or add it to /boot/loader.conf) to have
it loaded automatically. Any required firmware files can be bundled
into the module as well (or converted/loaded separately).
Also, add a workaround for a problem in NdisMSleep(). During system
bootstrap (cold == 1), msleep() always returns 0 without actually
sleeping. The Intel 2200BG driver uses NdisMSleep() to wait for
the NIC's firmware to come to life, and fails to load if NdisMSleep()
doesn't actually delay. As a workaround, if msleep() (and hence
ndis_thsuspend()) returns 0, use a hard DELAY() to sleep instead).
This is not really the right thing to do, but we can't really do much
else. At the very least, this makes the Intel driver happy.
There are probably other drivers that fail in this way during bootstrap.
Unfortunately, the only workaround for those is to avoid pre-loading
them and kldload them once the system is running instead.
attempt to clear its pending jobs list, as this could trigger another
signal, and cause an infinite recursion. What yppush_exit() tests
in order to determine whether to flush pending jobs is the
yppush_joblist chained list, so this is what needs to be cleared
in that case (not the yppush_jobs counter).
Reviewed by: audit@ (no objection)
MFC after: 2 weeks
allows us to specify the machine_arch as well as machine. If
specified then a second link will be made, similar to machine, from
$MACHINE_ARCH to $S/$MACHINE_ARCH/include.
This is for ports where MACHINE != MACHINE_ARCH (pc98 today, others in
the future?).
Reviewed by: arch@, nyan@
sha512, I did not do that since it is not entirely clear where "the one
true place" to hold their implementations is going to be. Sha256 is
different since mtree already links against libmd.
Make recommended procedure for integrity checking in the manpage
consistent.
Fix a bug with -f spec1 -f spec2 comparison, which prevented
test/tes03.sh from running successfully.
Reviewed by: phk, cperciva
fields that got added to it recently-ish. While here document
what each of the fields is based on discussion with portmgr@.
Patch from: murray (slightly adapted)
MFC after: 1 day
format, with humanize_number(3).
- Move the common parts of the code that prints the sizes for a single
swap device and the total to a single function to avoid repeating
the humanize_number() stuff all over the place.
- Change the type of CONVERT() from intmax_t to int64_t, since this
makes calling humanize_number() easier but cast the values to
intmax_t before printing them, to make use of the %jd format that
printf() supports.
- Document the new -h flag in the manpage and bump its date.
Approved by: pjd
Useful tips: brooks
MFC after: 2 weeks
Currently implemented are most things related to states and interfaces, todo
are address tables and altq. I've tried to keep this roughly in sync with a
project implementing this for net-snmpd.
Reviewed by: harti, dhartmei
MFC after: 1 month
This allows us to:
- perform scatter gather operations without using temporary files,
- create non-linear pipelines, and
- implement file views using symbolic links.
File view idea by: Vassilios Karakoidas
Portalfs pointer by: John Ioannidis
MFC after: 1 month
cojunction with -C and is used by /etc/rc.d/newsyslog.
I forgot that this was in my perforce tree and not my running system and
thus committed a non-working newsyslog script.
Reported by: des
Pointy hat: brooks
with EBUSY and a cdrom is not mounted at /cdrom, sysinstall fails to
treat it as an error and thinks that the disk mounted ok. However, it
doesn't find a cdrom.inf file so it complains. Later when it tries to
unmount the disk due to a mediaClose() umount(2) returns an error, and it
never clears its internal mounted flag. The fix here is to properly
handle EBUSY as an error if there isn't a CD already mounted at /cdrom.
- Add a new CDROMInitQuiet variable that can be used to shut up the dialog
box about the mount(2) system call failing when trying to mount a CD-ROM.
This is used by the feature described below.
- When using a fixit CD, first try to see if we can mount the disc in the
drive now and use it as a fixit CD. If not, then prompt the user to
insert the disc and try again. If we do succeed on the first "silent"
probe then we don't ask the user to eject the disk after leaving fixit
mode.
- Add a simple file existence test to make sure that the disc that we mount
really is a livefs disc.
- Explicitly switch back to ttyv0 when using the standard console after
the fixit shell dies. Previously this behavior worked accidentally
because all the fixit modes popped up a dialog box which contained a
hidden switch to ttyv0.
MFC after: 1 day
While version 4 entries are architecture-independent, we
also store old (version 3) entries in native byte order.
Also, the hash itself is created in a native byte order.
With this change, pwd_mkdb(8) can be used to cross-build
*pwd.db files for another architecture.
Tested on: i386, amd64, alpha, sparc64
with moderate IO going on, system usage can hover around 65-77% even
though it would benefit from higher performance. Typically, only truly
idle systems pass the 90% mark so only demote then.
Also, add conditional code to allow different invokations for objcopy
depending on whether we're compiled on an i386 arch or amd64 arch, so
that we can produce x86-64 object files on amd64.
Ville-Pertti Keinonen (will at exomi dot comohmygodnospampleasekthx)
deserves a big thanks for submitting initial patches to make it
work. I have mangled his contributions appropriately.
The main gotcha with Windows/x86-64 is that Microsoft uses a different
calling convention than everyone else. The standard ABI requires using
6 registers for argument passing, with other arguments on the stack.
Microsoft uses only 4 registers, and requires the caller to leave room
on the stack for the register arguments incase the callee needs to
spill them. Unlike x86, where Microsoft uses a mix of _cdecl, _stdcall
and _fastcall, all routines on Windows/x86-64 uses the same convention.
This unfortunately means that all the functions we export to the
driver require an intermediate translation wrapper. Similarly, we have
to wrap all calls back into the driver binary itself.
The original patches provided macros to wrap every single routine at
compile time, providing a secondary jump table with a customized
wrapper for each exported routine. I decided to use a different approach:
the call wrapper for each function is created from a template at
runtime, and the routine to jump to is patched into the wrapper as
it is created. The subr_pe module has been modified to patch in the
wrapped function instead of the original. (On x86, the wrapping
routine is a no-op.)
There are some minor API differences that had to be accounted for:
- KeAcquireSpinLock() is a real function on amd64, not a macro wrapper
around KfAcquireSpinLock()
- NdisFreeBuffer() is actually IoFreeMdl(). I had to change the whole
NDIS_BUFFER API a bit to accomodate this.
Bugs fixed along the way:
- IoAllocateMdl() always returned NULL
- kern_windrv.c:windrv_unload() wasn't releasing private driver object
extensions correctly (found thanks to memguard)
This has only been tested with the driver for the Broadcom 802.11g
chipset, which was the only Windows/x86-64 driver I could find.
properly initialized, that happens when lpc is called from a tty.
Without this change, it's possible to get SIGSEGV simply doing:
echo "..:" | lpc
Reported by: Wojciech A. Koszek <dunstan at freebsd czest pl>
PR: 77462 (patch rewritten by myself)
MFC After: 1 week
entry having stepping value of zero can cause crontab to hang there,
and if the main crontab is being changed in this way, then cron(8)
will keep spining.
Obtained from: OpenBSD [src/usr.sbin/cron/entry.c,v 1.17]
PR: 68683 (my own, but forgot to commit it...)
MFC After: 1 week
o Use SYSCTL_IN() macro instead of direct call of copyin(9).
Submitted by: ume
o Move sysctl_drop() implementation to sys/netinet/tcp_subr.c where
most of tcp sysctls live.
o There are net.inet[6].tcp[6].getcred sysctls already, no needs in
a separate struct tcp_ident_mapping.
Suggested by: ume
nodes from (N + 1) to 1, where N is the number of
nodes in the system.
- Implement "ls -l" which runs the "show" command for
each node.
In collaboration with: glebius
behaviour of chflags within a jail. If set to 0 (the default), then a
jailed root user is treated as an unprivileged user; if set to 1, then
a jailed root user is treated the same as an unjailed root user.
This is necessary to allow "make installworld" to work inside a jail,
since it attempts to manipulate the system immutable flag on certain
files.
Discussed with: csjp, rwatson
MFC after: 2 weeks
Windows DRIVER_OBJECT and DEVICE_OBJECT mechanism so that we can
simulate driver stacking.
In Windows, each loaded driver image is attached to a DRIVER_OBJECT
structure. Windows uses the registry to match up a given vendor/device
ID combination with a corresponding DRIVER_OBJECT. When a driver image
is first loaded, its DriverEntry() routine is invoked, which sets up
the AddDevice() function pointer in the DRIVER_OBJECT and creates
a dispatch table (based on IRP major codes). When a Windows bus driver
detects a new device, it creates a Physical Device Object (PDO) for
it. This is a DEVICE_OBJECT structure, with semantics analagous to
that of a device_t in FreeBSD. The Windows PNP manager will invoke
the driver's AddDevice() function and pass it pointers to the DRIVER_OBJECT
and the PDO.
The AddDevice() function then creates a new DRIVER_OBJECT structure of
its own. This is known as the Functional Device Object (FDO) and
corresponds roughly to a private softc instance. The driver uses
IoAttachDeviceToDeviceStack() to add this device object to the
driver stack for this PDO. Subsequent drivers (called filter drivers
in Windows-speak) can be loaded which add themselves to the stack.
When someone issues an IRP to a device, it travel along the stack
passing through several possible filter drivers until it reaches
the functional driver (which actually knows how to talk to the hardware)
at which point it will be completed. This is how Windows achieves
driver layering.
Project Evil now simulates most of this. if_ndis now has a modevent
handler which will use MOD_LOAD and MOD_UNLOAD events to drive the
creation and destruction of DRIVER_OBJECTs. (The load event also
does the relocation/dynalinking of the image.) We don't have a registry,
so the DRIVER_OBJECTS are stored in a linked list for now. Eventually,
the list entry will contain the vendor/device ID list extracted from
the .INF file. When ndis_probe() is called and detectes a supported
device, it will create a PDO for the device instance and attach it
to the DRIVER_OBJECT just as in Windows. ndis_attach() will then call
our NdisAddDevice() handler to create the FDO. The NDIS miniport block
is now a device extension hung off the FDO, just as it is in Windows.
The miniport characteristics table is now an extension hung off the
DRIVER_OBJECT as well (the characteristics are the same for all devices
handled by a given driver, so they don't need to be per-instance.)
We also do an IoAttachDeviceToDeviceStack() to put the FDO on the
stack for the PDO. There are a couple of fake bus drivers created
for the PCI and pccard buses. Eventually, there will be one for USB,
which will actually accept USB IRP.s
Things should still work just as before, only now we do things in
the proper order and maintain the correct framework to support passing
IRPs between drivers.
Various changes:
- corrected the comments about IRQL handling in subr_hal.c to more
accurately reflect reality
- update ndiscvt to make the drv_data symbol in ndis_driver_data.h a
global so that if_ndis_pci.o and/or if_ndis_pccard.o can see it.
- Obtain the softc pointer from the miniport block by referencing
the PDO rather than a private pointer of our own (nmb_ifp is no
longer used)
- implement IoAttachDeviceToDeviceStack(), IoDetachDevice(),
IoGetAttachedDevice(), IoAllocateDriverObjectExtension(),
IoGetDriverObjectExtension(), IoCreateDevice(), IoDeleteDevice(),
IoAllocateIrp(), IoReuseIrp(), IoMakeAssociatedIrp(), IoFreeIrp(),
IoInitializeIrp()
- fix a few mistakes in the driver_object and device_object definitions
- add a new module, kern_windrv.c, to handle the driver registration
and relocation/dynalinkign duties (which don't really belong in
kern_ndis.c).
- made ndis_block and ndis_chars in the ndis_softc stucture pointers
and modified all references to it
- fixed NdisMRegisterMiniport() and NdisInitializeWrapper() so they
work correctly with the new driver_object mechanism
- changed ndis_attach() to call NdisAddDevice() instead of ndis_load_driver()
(which is now deprecated)
- used ExAllocatePoolWithTag()/ExFreePool() in lookaside list routines
instead of kludged up alloc/free routines
- added kern_windrv.c to sys/modules/ndis/Makefile and files.i386.