Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178128773
D32656.1796057507.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D32656.1796057507.diff
View Options
Index: sbin/devd/devd.conf.5
===================================================================
--- sbin/devd/devd.conf.5
+++ sbin/devd/devd.conf.5
@@ -40,7 +40,7 @@
.\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
.\" SOFTWARE.
.\"
-.Dd June 23, 2021
+.Dd November 3, 2021
.Dt DEVD.CONF 5
.Os
.Sh NAME
@@ -604,6 +604,15 @@
.Pp
.Bl -column "System" "Subsystem" "1234567" -compact
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
+.It Li VT Ta BELL Ta RING Ta
+Notification that the console bell has rung.
+See
+.Xr vt 4
+for details.
+.El
+.Pp
+.Bl -column "System" "Subsystem" "1234567" -compact
+.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li ZFS Ta ZFS Ta Ta
Events about the ZFS subsystem.
See
Index: share/man/man4/vt.4
===================================================================
--- share/man/man4/vt.4
+++ share/man/man4/vt.4
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 4, 2020
+.Dd November 3, 2021
.Dt "VT" 4
.Os
.Sh NAME
@@ -297,6 +297,21 @@
.It Pa /usr/share/vt/keymaps/*.kbd
keyboard layouts
.El
+.Sh DEVCTL MESSAGES
+.Bl -column "System" "Subsystem" "1234567" -compact
+.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
+.It Li VT Ta BELL Ta RING Ta
+Notification that the console bell has rung.
+.El
+.Pp
+.Bl -column "Variable" "Meaning" -compact
+.Sy "Variable" Ta Sy "Meaning"
+.It Li duration_ms Ta Length of time the bell was requested to ring in milliseconds.
+.It Li enabled Ta true or false indicating whether or not the bell was administratively enabled when rung.
+.It Li hushed Ta true or false indicating whether or not the bell was quieted by the user when rung.
+.It Li hz Ta Tone that was requested in Hz.
+.El
+.Pp
.Sh EXAMPLES
This example changes the default color of normal text to green on a
black background, or black on a green background when reversed.
Index: sys/dev/vt/vt_core.c
===================================================================
--- sys/dev/vt/vt_core.c
+++ sys/dev/vt/vt_core.c
@@ -36,6 +36,7 @@
#include <sys/param.h>
#include <sys/consio.h>
+#include <sys/devctl.h>
#include <sys/eventhandler.h>
#include <sys/fbio.h>
#include <sys/font.h>
@@ -51,6 +52,7 @@
#include <sys/proc.h>
#include <sys/random.h>
#include <sys/reboot.h>
+#include <sys/sbuf.h>
#include <sys/systm.h>
#include <sys/terminal.h>
@@ -1090,12 +1092,36 @@
return (idx0);
}
+#define DEVCTL_LEN 64
+static void
+vtterm_devctl(bool enabled, bool hushed, int hz, sbintime_t duration)
+{
+ struct sbuf sb;
+ char *buf;
+
+ buf = malloc(DEVCTL_LEN, M_VT, M_NOWAIT);
+ if (buf == NULL)
+ return;
+ sbuf_new(&sb, buf, DEVCTL_LEN, SBUF_FIXEDLEN);
+ sbuf_printf(&sb, "enabled=%s hushed=%s hz=%d duration_ms=%d",
+ enabled ? "true" : "false", hushed ? "true" : "false",
+ hz, (int)(duration / SBT_1MS));
+ sbuf_finish(&sb);
+ if (sbuf_error(&sb) == 0)
+ devctl_notify("VT", "BELL", "RING", sbuf_data(&sb));
+ sbuf_delete(&sb);
+ free(buf, M_VT);
+}
+
static void
vtterm_bell(struct terminal *tm)
{
struct vt_window *vw = tm->tm_softc;
struct vt_device *vd = vw->vw_device;
+ vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL,
+ vw->vw_bell_pitch, vw->vw_bell_duration);
+
if (!vt_enable_bell)
return;
@@ -1112,10 +1138,10 @@
static void
vtterm_beep(struct terminal *tm, u_int param)
{
- u_int freq, period;
-
- if (!vt_enable_bell)
- return;
+ u_int freq;
+ sbintime_t period;
+ struct vt_window *vw = tm->tm_softc;
+ struct vt_device *vd = vw->vw_device;
if ((param == 0) || ((param & 0xffff) == 0)) {
vtterm_bell(tm);
@@ -1125,6 +1151,12 @@
period = ((param >> 16) & 0xffff) * SBT_1MS;
freq = 1193182 / (param & 0xffff);
+ vtterm_devctl(vt_enable_bell, vd->vd_flags & VDF_QUIET_BELL,
+ freq, period);
+
+ if (!vt_enable_bell)
+ return;
+
sysbeep(freq, period);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 4:51 PM (17 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42108509
Default Alt Text
D32656.1796057507.diff (3 KB)
Attached To
Mode
D32656: vt: Add devctl message for bells
Attached
Detach File
Event Timeline