Commit graph

290848 commits

Author SHA1 Message Date
Dimitry Andric
de45d36ffb bsd.sys.mk: for clang >= 19, similar to gcc >= 8.1, turn off -Werror for
-Wcast-function-type-mismatch.

PR:		280562
MFC after:	1 month

(cherry picked from commit d575077527d448ee45b923fa8c6b0cb7216ca5c5)
2024-11-06 19:52:10 +01:00
Michael Tuexen
69a31343a4 sctp: fix debug message
(cherry picked from commit 518a1163d0aa73b26da1dd1a4bb186042ea3c66e)
2024-11-06 10:13:14 +01:00
Michael Tuexen
5616189419 sctp: improve handling of address changes
Identify interfaces consistenly by the pair of the ifn pointer
and the index.
This avoids a use after free when the ifn and or index was reused.

Reported by:	bz, pho, and others

(cherry picked from commit 523913c94371ab50a8129cbab820394d25f7a269)
2024-11-06 10:12:28 +01:00
Michael Tuexen
1550ba0662 sctp: garbage collect two unused functions
(cherry picked from commit 470a63cde4285ea4a317b0bba966514c11f4ed5b)
2024-11-06 10:11:34 +01:00
Michael Tuexen
7fe14d4bb8 sctp: don't consider the interface name when removing an address
Checking the interface name can not be done consistently, so
don't do it.

(cherry picked from commit bf11fdaf0d095fecca61fa8b457d06e27fae5946)
2024-11-06 10:10:56 +01:00
Michael Tuexen
107704217b sctp: editorial cleanup
Improve consistency, no functional change intended.

(cherry picked from commit d839cf2fbb47c52d5153fb366c51bd6f6a3dd0fd)
2024-11-06 10:09:04 +01:00
Baptiste Daroussin
6c682f5c38 nuageinit: add support for OpenStack network config
Add naive support for openstack network config.
if no config driver have been found, try to detect that we are running a
VM on openstack via the smbios information, use the first iface
available and temporary activate dhcp on it, to be able to fetch the
necessary informations for cloudinit.

While here make the rc script execute after devmatch, some ethernet
device might be attached via devmatch and may be needed for cloudinit.

Tested on OVHCloud Public Cloud.

MFC after:	3 weeks
Sponsored by:	OVHCloud

(cherry picked from commit 2775b9b0bcc278dd4183b57784953c26a3fcdc89)
2024-11-06 09:36:12 +01:00
Christos Margiolis
136c2b5a8e sound: Remove unused pcm_channel->data fields
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D47360

(cherry picked from commit 829951f857b73faaf28cbfcf09e861668692d8a1)
2024-11-05 22:45:07 +01:00
Christos Margiolis
5aece3be1c sound: Make device registration more intuitive
The way a sound driver currently registers to sound(4) is using the
following sequence of function calls:

1. pcm_register() to initialize snddev_info.
2. pcm_addchan() calls to create the device's primary channels.
3. pcm_setstatus() to do the final setup.

While using 3 different functions in a specific order might not be very
elegant, this pattern cannot be easily avoided. However, pcm_register()
and pcm_setstatus() are especially confusing, since one would
intuitively expect:

1. pcm_register() to actually do the registration, as opposed to a basic
   initialization.
2. pcm_setstatus() to, as the name suggests, set some kind of status, as
   opposed to finalizing the registration.

This patch renames pcm_register() to pcm_init(), and pcm_setstatus() to
pcm_register(). Drivers are modified accordingly.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D47325

(cherry picked from commit 516a9c0212b003e1da0c6f4476dbe4f3f431606c)
2024-11-05 22:45:01 +01:00
Christos Margiolis
c874fcc4ca sound: Remove early SD_F_SIMPLEX and SD_F_AUTOVCHAN assignments
These flags are properly set in pcm_setstatus(), once the primary
channels have been created. The existing comment already states that
this is wrong.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47324

(cherry picked from commit 3a7d40c692622cc614a3839491c345d945f474fe)
2024-11-05 22:44:41 +01:00
Christos Margiolis
9e36026dc3 sound: Move sndstat_register() call to pcm_setstatus()
The d->status string is populated in pcm_setstatus() anyway, so call
sndstat_register() after we populate it, and are closer to finalizing
the device creation.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47323

(cherry picked from commit 181a31d8349088cbcead8dcbff8d62ee8af6c913)
2024-11-05 22:44:41 +01:00
Christos Margiolis
00c066cd57 sound: Move sysctl and /dev/dspX creation to pcm_setstatus()
Create the sysctl and /dev/dsp* nodes in pcm_setstatus(), which is
responsible for finalizing the device initialization, instead of doing
this in the middle of the initialization.

For the sysctl creation specifically, move them into pcm_sysinit(),
since this is where we create the rest of the sysctl nodes anyway.

A side effect of this change is, that we avoid the possibility of racing
in between pcm_register() and pcm_setstatus() by accessing /dev/dspX or
the sysctls within that window.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D47322

(cherry picked from commit 66f3eb14e955d3917f817ff346d33d839679c2cf)
2024-11-05 22:44:41 +01:00
Christos Margiolis
3dace161c2 sound: Retire pcm_veto_load
pcm_veto_load is used to prevent pcm_register() from running if the root
feeder has not been registered yet. However, feeder_register_root() is a
SYSINIT.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D47280

(cherry picked from commit 98cd27c8e13418fa517a02844641f390f9389987)
2024-11-05 22:44:41 +01:00
Mark Johnston
b698c825f3 rpc: Fix the definition of xdr_void()
xdr_void() should have type xdrproc_t, make it so.

PR:		280514
Reviewed by:	brooks, dim
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D47340

(cherry picked from commit a5d1cf5e362a2e3c3ebdf6d8f2b86658a6d0b9d6)
2024-11-05 01:05:26 +00:00
Mark Johnston
ef89eefaa8 makefs: Remove the warning printed when makefs -t zfs is used
We haven't seen bug reports relating to this feature for a while, so
stop printing a warning.

Reviewed by:	cperciva
MFC after:	2 weeks

(cherry picked from commit d9fe71828797508d1d28655e40780a5ae9078e66)
2024-11-05 00:56:50 +00:00
Mark Johnston
4c0effbb1d libarchive tests: Re-enable a broken test
It passes and so appears to have been silently fixed at some point.

PR:		240683
MFC after:	1 week

(cherry picked from commit 218f80226b82763c3cbd48de560959ad546b5e26)
2024-11-05 00:55:43 +00:00
Mark Johnston
26d85a5aba geom_flashmap: Rename the kernel module
Absent a linker.hints, if a module dependency exists on disk, the loader
will automatically load it.  That is, if something depends on module
foo, and foo.ko exists, we'll load foo.ko even though the linker hints
file is missing.  It's a bit of a hack but it's handy.

This breaks with geom_flashmap though, since it's geom_flashmap.ko on
disk but the module is called g_flashmap.  However, pretty much every
other GEOM module is given a "geom_" prefix, so for consistency's sake
alone, it seems nice to rename the module.

PR:		274388
Reviewed by:	jhb
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D47311

(cherry picked from commit 2352336ad9b26fd21d9b0013e195e41d6d02b914)
2024-11-05 00:55:43 +00:00
Graham Percival
cdffbea57c manuals: Fix dates
These were reported by `mandoc -T lint ...` as warnings.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1475

(cherry picked from commit b74aaa1a2199261f9078247d29481a994b6b5e42)
2024-11-04 12:16:22 -04:00
Graham Percival
260a432417 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1472

(cherry picked from commit 759ddb4d246f5db5963369a82f1ab165d0dfccce)
2024-11-04 12:15:27 -04:00
Mitchell Horne
ba036fce25 thr_kill(2): fix title
Mandoc emits a STYLE warning due to the lowercase letters.

(cherry picked from commit 23cb03d145292d7a3e6165b4ca74837d497bd3db)
2024-11-04 12:15:11 -04:00
Graham Percival
e40097e01a manuals: Fix some "missing section argument"
These were reported by `mandoc -T lint ...` as warnings.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1467

(cherry picked from commit a51584a2d2fb3731a68eaf93b59e14227e572427)
2024-11-04 12:15:01 -04:00
Graham Percival
666d4c2bbd manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459

(cherry picked from commit 229381deb270e8e240d20b572c63234a61cbd977)
2024-11-04 12:13:50 -04:00
Graham Percival
ddf4df54a7 manuals: Fix "unusual .Xr" warnings with a script
These were reported by `mandoc -T lint ...` as warnings:
- unusual Xr order
- unusual Xr punctuation

Fixes made by script in https://github.com/Tarsnap/freebsd-doc-scripts

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1464

(cherry picked from commit 6e1fc0118033f42b7c0d3623c8f67a89ebecabb2)
2024-11-04 12:13:13 -04:00
Alexander Ziaee
3dedfaa01a mitigations.7: minor cleanup (linter errors)
Reviewed by:	emaste
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1428

(cherry picked from commit c3294033e024620874ecfc219174347989378a3b)
2024-11-04 12:08:38 -04:00
Alexander Ziaee
64e8a9679e mitigations.7: markup functions with Fn macro
+ include this page in `apropos Fn=memcpy`

Reviewed by:	emaste
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1428

(cherry picked from commit 22fb46af90d62d8177bfa0f1a8e4d89efa0b1905)
2024-11-04 12:08:38 -04:00
Graham Percival
6a65bb7ed8 manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1454

(cherry picked from commit 643fc698203b9b0ed386b0583c2200c428135c9d)
2024-11-04 12:08:13 -04:00
Graham Percival
c0bd4ec70b manuals: Fix "missing end of block" errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1448

(cherry picked from commit d21e322d563e0fd1f92c22205c2ced4bcd22dc23)
2024-11-04 12:07:50 -04:00
Graham Percival
6136631124 manuals: Fix "skipping end of block" .El errors
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .El commands.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1447

(cherry picked from commit c801836ff43deea3c86935abcad1069bfcd3989c)
2024-11-04 12:05:53 -04:00
Alexander Ziaee
7965dbfd5b wpa_supplicant: xref relevant wpa_passphrase(8)
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1461

(cherry picked from commit 5c59e40bc419870659946156b45a390cabd69c02)
2024-11-04 11:56:25 -04:00
Alexander Ziaee
babcb82910 manpath.1: align lists + tag spdx
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1458

(cherry picked from commit d928328f8d2d25a4632401795e1c0ebbaeb7b10d)
2024-11-04 11:56:24 -04:00
Alexander Ziaee
64e531624f vmem.9: align lists + tag spdx
Reviewed by:	mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1456

(cherry picked from commit 5793008745115f9523f9de32cec3136cea2dd8d5)
2024-11-04 11:56:24 -04:00
Graham Percival
62cb0f7137 manuals: Fix syntax of list width
Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1455

(cherry picked from commit 9fd66e40cac02691d36386cf275d23367e34fc43)
2024-11-04 11:56:24 -04:00
Graham Percival
7624e15726 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1453

(cherry picked from commit 8b92fa1ceb95bbe80b473fc35d4276146201e802)
2024-11-04 11:56:24 -04:00
Graham Percival
3a75b41bd9 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Additional clarification: there was a non-breaking space in
lib/libcasper/services/cap_grp/cap_grp.3.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1449

(cherry picked from commit c8b31033c3971b2b7349804ffda0cea5e4835b40)
2024-11-04 11:56:24 -04:00
Graham Percival
e2830c5d35 manuals: Fix "skipping end of block" .Ed errors
These were reported by `mandoc -T lint ...` as errors; this commit only
handles unnecessary .Ed commands.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1435

(cherry picked from commit 4f2ef756a404df70272b79c16fa7b1689cb0118b)
2024-11-04 11:56:24 -04:00
Graham Percival
7d7c17b7f6 manuals: Fix typos in -offset for .Bd and .Bl
The intended value is:
    -offset indent
If there's any typo such that the value doesn't match the pre-defined
strings, then the offset is the same width as the value.  So by chance,
"-offset -ident" ended up being a standard-width indent (since the
default indent is 6 chars, and "-ident" also has 6 chars), whereas
"-offset -indent" had a longer indent, and "-offset ident" had a shorter
one.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1436

(cherry picked from commit c013ca2cf772194de340aeb452a6ccfe7e1cecd8)
2024-11-04 11:56:24 -04:00
Lexi Winter
34b80cbdaf service(8): direct user to rc(8) for a list of valid commands
New users may refer to service(8) to discover how to manage services,
but this manpage does not explain which commands are permitted besides
start/stop (for example, 'enable').  Add a paragraph that directs the
reader to rc(8) to discover this.

While here, add a few examples of common use-cases.

Reported by:	Mina Galić <freebsd@igalic.co>
Pull request:	https://github.com/freebsd/freebsd-src/pull/1057

(cherry picked from commit a84e01f02b15dc1ec091feab6e532d5ba36ffbbb)
2024-11-04 11:56:24 -04:00
Tom Hukins
fcfb9a7a03 valectl(8): explicitly mention network switches
Use the term "network switch" instead of the ambiguous term "switch".

Signed-off-by:	Tom Hukins <tom@FreeBSD.org>
Reviewed by:	imp, mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1369

(cherry picked from commit a2f53837f0a8934cfcf7ba3c1fdfc93f217d3703)
2024-11-04 11:56:24 -04:00
Tom Hukins
3ee3a5a768 vale(4): refer to the valectl(8) management tool
Signed-off-by:	Tom Hukins <tom@FreeBSD.org>
Reviewed by:	imp, mhorne
MFC after:	3 days
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1369

(cherry picked from commit 9a3fa77585e55e78004cdc9467b986968a77e8de)
2024-11-04 11:56:24 -04:00
Graham Percival
055d2819bb stats.3: Fix "skipping end of block" syntax errors
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

There was a small misunderstanding about the mdoc format: a 1-line
enclosure does not need a closing tag.  For example, Pc is for closing
an Po; if a line uses Pq (enclose the remainder of this line), there's
no need for Pc.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1434

(cherry picked from commit 2d69f02c5745a89c01bcd76389d53fd2a4189f02)
2024-11-04 11:56:24 -04:00
Graham Percival
5b9e1a3ac1 ipf.5: revert C style(9) applied to man page
These changes were made by accident in:
    ipfilter: Adjust userland returns to conform to style(9)
    2582ae5740

That commit made similar mistakes in other man pages, but those have
already been fixed.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1433

(cherry picked from commit ce251baf42f32317b4b4ef60203d6f47204c47e9)
2024-11-04 11:56:24 -04:00
Graham Percival
3609e56813 manuals: Fix errors in .2 pages
These were reported by `mandoc -T lint ...` as errors.

fhlink.2, fhreadlink.2: remove unneeded block closing.

getfh.2, procctl.2: add necessary block closing.

ptrace.2: -width only takes one argument.

swapon.2: <sys/vmparam.h> and <vm/swap_pager.h> weren't being displayed,
    because .It is for a list item whereas .In is for included files.
    Also, we want a blank line between <sys/ > headers and the other
    one.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
PR:		281597
Reviewed by:	mhorne
Sponsored by:	Tarsnap Backup Inc.

(cherry picked from commit 650056363baddb83c61c85b0539ee536f3d4b56c)
2024-11-04 11:56:24 -04:00
Mark Johnston
5a07e99407 camcontrol: Plug a memory leak in getdevtree()
PR:		275338
MFC after:	1 week

(cherry picked from commit abfd031b482f92320e29a2c2ac80fcd23e134446)
2024-11-04 15:38:35 +00:00
Mark Johnston
8635c1ad51 shm: Respect PROT_MAX when creating private mappings
We were previously unconditionally adding PROT_WRITE to the maxprot of
private mapping (because a private mapping can be written even if the
fd is read-only), but this might violate the user's PROT_MAX request.

While here, rename cap_maxprot to max_maxprot.  This is the intersection
of the maximum protections imposed by capsicum rights on the fd (not
really relevant for private mappings) and the user-required maximum
protections (which were not being obeyed).  In particular, cap_maxprot
is a misnomer after the introduction of PROT_MAX.

Add some regression test cases.  mmap__maxprot_shm fails without this
patch.

Note: Capsicum's CAP_MMAP_W is a bit ambiguous.  Should it be required
in order to create writeable private mappings?  Currently it is, even
though such mappings don't permit writes to the object referenced by the
fd.

Reported by:	brooks
Reviewed by:	brooks
MFC after:	1 month
Fixes:		c7841c6b8e ("Relax restrictions on private mappings of POSIX shm objects.")
Differential Revision:	https://reviews.freebsd.org/D46741

(cherry picked from commit 33c2c58f0a3db0a6d3996fa14ac7967274678771)
2024-11-04 15:38:35 +00:00
Mateusz Piotrowski
4ff71ffaa7 rc.d/sendmail: Return non-zero if the daemon fails to start or is not running
If you have a mail server that is running sendmail daemon
(sendmail_enable=YES) and sendmail queue runner (sendmail_msp_queue=YES)
and the sendmail daemon dies, /etc/rc.d/sendmail status does see the
daemon is not running but returns 0 as the exit code.  This prevents
other programs (like puppet) from restarting sendmail to fix the issue.

Make sure that the exit code is propagated towards the end of the script
if any of the sendmail services fail.

This patch does not call exit directly but instead just sets the exit
status code by calling exit in a subshell. This way we do not exit the
current shell in case the service script is sourced (e.g., when
rc_fast_and_loose is active).

PR:		223132
MFC after:	2 weeks
Reported by:	pirzyk
Discussed with:	jilles, eugen
Reviewed by:	christos, gshapiro (previous version), markj
Approved by:	christos (mentor), markj (mentor)
Differential Revision:	https://reviews.freebsd.org/D46862
Co-authored-by: Jim Pirzyk <pirzyk@FreeBSD.org>

(cherry picked from commit d2e7bb630b83848a774d8213014a9e0747775019)
2024-11-04 15:55:40 +01:00
Ed Maste
752c25c01c vt: add comments for KDMKTONE ioctl implementation
The KDMKTONE ioctl, introduced in commit 916347f77e, is used to beep
the PC speaker.  For historical reasons the frequency is specified as an
8254 PIT divisor for a 1.19MHz clock.  Linux provides this same ioctl.
Add a comment to vtterm_beep to avoid someone wanting to "fix" this in
the future.

Also add an XXX comment that the period unit is supposed to be "timer
ticks."  Note that nothing in the base system uses this ioctl.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47395

(cherry picked from commit adba3c74209eb5d2197b9092002cc9d7505fd3c6)
2024-11-04 08:54:10 -05:00
Ed Maste
8c922db4f3 syscons: add deprecation notice
syscons(4) is not compatible with UEFI, does not support UTF-8, and is
Giant-locked.  There is no specific timeline yet for removing it, but
support for the Giant lock is expected to go away in one or two major
release cycles.  Add a deprecation notice to avoid surprises, and help
ensure that any material deficiencies in vt(4) become known.

Reviewed by:	manu, markj, imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47396

(cherry picked from commit fc2a3ec6fe6aa00d9be0c293c38e0ef9ac7e2b64)
2024-11-04 08:54:10 -05:00
Tatiana
adce5eaab9 loader.efi: Fix LOADER_NET_SUPPORT=no builds
We include too many references to networking things in the
non-networking build for loader.efi. Ifdef out netserver command when we
are disabling network support to resolve.

PR: 277528
MFC After: 2 days
Reviewed by: imp

(cherry picked from commit 47ef2a131091508e049ab10cad7f91a3c1342cd9)
2024-11-03 17:51:25 -07:00
Warner Losh
f2103edaf5 loader: Fix boot menu on BIOS
Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.

PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D47403

(cherry picked from commit c2ba66d4d01f23303352bfe3cbd50ff5d9a05947)
2024-11-03 17:51:24 -07:00
Warner Losh
1c9f1cb4f0 vt: Fix frequency calcuation for bell
386BSD provided a MD function sysbeep. This took two arguments (pitch
and period). Pitch was jammed into the PIT's divisor directly (which
means the argument was expected to sound a tone at '1193182 / pitch'
Hz). FreeBSD inherited this interface.

In commit e465985885 (svn 177642, Mar 26 2008), phk changed this
function to take a tone to sound in hz. He converted all in-tree
instances of 1193182 / hz to just hz (and kept the few misguided folks
that passed hz directly unchanged -- this was part of what motivated the
change). He converted the places where we pre-computed the 8254 divisor
from being pitch to 1193182 / pitch (since that converts the divisor to
the frequency and the interfaces that were exposed to userland exposed
it in these units in places, continuing the tradition inherited from SCO
System V/386 Unix in spots).

In 2009, Ed Shouten was contracted by the FreeBSD Foundation to write /
finish newcons. This work was done in perforce and was imported into
subversion in user/ed/newcons in revision 199072
(https://svnweb.freebsd.org/base?view=revision&revision=199072) which
was later imported into FreeBSD by ray@ (Aleksandr Rybalko).

From that earliest import into svn import to this date, we ring the bell
with:
      sysbeep(1193182 / VT_BELLPITCH, VT_BELLDURATION);
where VT_BELLPITCH was defined to be 800. This results in a bell
frequency of 1491Hz, more or less today. This is similar to the
frequency that syscons and pcvt used (1493Hz and 1500Hz respectively).
This in turn was inherited from 386BSD, it seems, which used the hard
coded value 0x31b which is 795 -> 1500Hz.

This '800' was intended to be the bell tone (eg 800Hz) and this
interface was one that wasn't converted. The most common terminal prior
to the rise of PCs was the VT100, which had an approximately 800Hz
bell. Ed Shouten has confirmed that the original intent was 800Hz and
changing this was overlooked after the change to -current was made.
This restors that original intent and makes the bell less obnoxious in
the process.

Reviewed by:		des, adrian
Differential Revision:	https://reviews.freebsd.org/D32594
Sponsored by:		Netflix

(cherry picked from commit ba48d52ca6)

This change was accidentally reverted in 80f21bb039.

(cherry picked from commit 2416be588ea113cc06b924ed85861ed3bc391fe0)
2024-11-03 11:57:19 -05:00