History log of /freebsd/sys/kern/kern_cons.c (Results 1 – 25 of 96)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/14.2.0, release/13.4.0
# df79daa0 03-Sep-2024 Craig Woodward <Craig.Woodward@redcom.com>

Reduce additional console output when muted

While trying to resolve some custom installer issues, we found that
using conscontrol(8) or setting kern.always_console_output=0 in
sysctrl.conf(5) did no

Reduce additional console output when muted

While trying to resolve some custom installer issues, we found that
using conscontrol(8) or setting kern.always_console_output=0 in
sysctrl.conf(5) did not always prevent console output. This is in part
because some areas of the kernel were outputting to the console device
without checking the status of the setting. These changes enforce
checking of the value in both locations where console output occurs from
kernel and init(8) based callouts.

Details on changes:

- Moves check for mute to earlier in sequence to silence kernel output
even if EARLY_PRINTF is defined.
- Modifies call prf_putbuf() and prf_putchar() in subr_prf.c to strip
TOCONS flag if muting is enabled, to honor the setting at print
level.

This is a rather simple change, which increases areas where flags to
silence console output are honored. We have been running this change
since 10/23 in-house without issue. (Patching prior to 14.0 also
required making cn_mute non-static.)

Signed-off-by: Craig.Woodward@redcom.com
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1407

show more ...


Revision tags: release/14.1.0
# 9b1de7e4 24-May-2024 Ed Maste <emaste@FreeBSD.org>

vt/sc: retire logic to select vt(4) by default for UEFI boot

We previously defaulted to using sc(4) with a special case to prefer
vt(4) when booted via UEFI. As vt(4) is now always the default we c

vt/sc: retire logic to select vt(4) by default for UEFI boot

We previously defaulted to using sc(4) with a special case to prefer
vt(4) when booted via UEFI. As vt(4) is now always the default we can
simplify this.

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

show more ...


# 2cb49090 30-Apr-2024 Justin Hibbits <jhibbits@FreeBSD.org>

cons: Add boot option to mute boot messages after banner

This is useful for embedded systems, where it provides feedback that the
kernel has booted, but avoids printing the probe messages. If both

cons: Add boot option to mute boot messages after banner

This is useful for embedded systems, where it provides feedback that the
kernel has booted, but avoids printing the probe messages. If both
mutemsgs and verbose are set, verbose cancels the mute.

Additionally, this unmutes the console on panic, so a user can see what
happened leading up to the panic.

Obtained from: Juniper Networks, Inc.

show more ...


Revision tags: release/13.3.0
# 20289092 08-Jan-2024 Andrew Turner <andrew@FreeBSD.org>

sys: Simplify enabling EARLY_PRINTF uarts

Support selecting the early uart with "options EARLY_PRINTF=foo" in
the kernel configuration file. This allows us to not have to change
source files when en

sys: Simplify enabling EARLY_PRINTF uarts

Support selecting the early uart with "options EARLY_PRINTF=foo" in
the kernel configuration file. This allows us to not have to change
source files when enabling EARLY_PRINTF, simplifying enabling it.

New uart drivers can be enabled by defining a new early_printf_foo
value to be unique, then using "#if CHECK_EARLY_PRINTF(foo)" to decide
when to enable the uart.

While here add pl011 early printf support.

Reviewed by: imp (earlier version)
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43360

show more ...


# a68d5a66 05-Jan-2024 Kyle Evans <kevans@FreeBSD.org>

Revert "kern: console: make /dev/console backing console more predictable"

This accidentally snuck into a different branch, and has not been
reviewed for sanity yet..

This reverts commit 8ec6d7be2e

Revert "kern: console: make /dev/console backing console more predictable"

This accidentally snuck into a different branch, and has not been
reviewed for sanity yet..

This reverts commit 8ec6d7be2e27622b8b9e192b4da9ce88a4118636.

show more ...


# 8ec6d7be 05-Jan-2024 Kyle Evans <kevans@FreeBSD.org>

kern: console: make /dev/console backing console more predictable

Specifically, altering the console list with conscontrol has some weird
behavior:

1. If you remove the first configured console, /d

kern: console: make /dev/console backing console more predictable

Specifically, altering the console list with conscontrol has some weird
behavior:

1. If you remove the first configured console, /dev/console will become
unconfigured
2. Any console added becomes the /dev/console

In a multicons situation, #1 is clearly a bug and #2 is perhaps slightly
less clear. If we have ttyu0, ttyv0, then it seems obvious that one
would want ttyv0 to take over the console if ttyu0 is removed. If we
add ttyu0 back in, then it's debatable whether it should take over the
console or not.

Fix it now to make the /dev/console selection more FIFO-ish, with
respect to how conscontrol affects it. A `primary` verb for
conscontrol(8) might be a good addition.

show more ...


# 29363fb4 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl s

sys: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


# 0a713948 22-Nov-2023 Alexander Motin <mav@FreeBSD.org>

Replace random sbuf_printf() with cheaper cat/putc.


Revision tags: release/14.0.0
# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 9d6ae1e3 05-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

Revert "Revert "tslog: Annotate some early boot functions""

Now that <sys/tslog.h> is wrapped in #ifdef _KERNEL, it's safe to have
tslog annotations in files which might be built from userland (i.e.

Revert "Revert "tslog: Annotate some early boot functions""

Now that <sys/tslog.h> is wrapped in #ifdef _KERNEL, it's safe to have
tslog annotations in files which might be built from userland (i.e. in
subr_boot.c, which is built as part of the boot loader).

This reverts commit 59588a546f55523d6fd37ab42eb08b719311d7d6.

show more ...


# 59588a54 04-Jun-2023 Colin Percival <cperciva@FreeBSD.org>

Revert "tslog: Annotate some early boot functions"

The change to subr_boot.c broke the libsa build because the TSLOG
macros have their own definitions for the boot loader -- I didn't
realize that th

Revert "tslog: Annotate some early boot functions"

The change to subr_boot.c broke the libsa build because the TSLOG
macros have their own definitions for the boot loader -- I didn't
realize that the loader code used subr_boot.c.

I'm currently testing a fix and I'll revert this revert once I'm
satisfied that everything works, but I don't want to leave the
tree broken for too long.

This reverts commit 469cfa3c30ee7a5ddeb597d0a8c3e7cac909b27a.

show more ...


# 469cfa3c 22-May-2023 Colin Percival <cperciva@FreeBSD.org>

tslog: Annotate some early boot functions

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
hammer_time takes roughly 2740 us:
* 55 us in xen_pvh_parse_preload_data
* 20 us in b

tslog: Annotate some early boot functions

Booting an amd64 kernel on Firecracker with 1 CPU and 128 MB of RAM,
hammer_time takes roughly 2740 us:
* 55 us in xen_pvh_parse_preload_data
* 20 us in boot_parse_cmdline_delim
* 20 us in boot_env_to_howto
* 15 us in identify_hypervisor
* 1320 us in link_elf_reloc
* 1310 us in relocate_file1 handling ef->rela
* 25 us in init_param1
* 30 us in dpcpu_init
* 355 us in initializecpu
* 255 us in initializecpu calling load_cr4
* 425 us in getmemsize
* 280 us in pmap_bootstrap
* 205 us in create_pagetables
* 10 us in init_param2
* 25 us in pci_early_quirks
* 60 us in cninit
* 90 us in kdb_init
* 105 us in msgbufinit
* 20 us in fpuinit
* 205 us elsewhere in hammer_time

Some of these are unavoidable (e.g. identify_hypervisor uses CPUID and
load_cr4 loads the CR4 register, both of which trap to the hypervisor)
but others may deserve attention.

Sponsored by: https://www.patreon.com/cperciva
Differential Revision: https://reviews.freebsd.org/D40325

show more ...


Revision tags: release/13.2.0, release/12.4.0
# 9806e82a 26-Jul-2022 Dimitry Andric <dim@FreeBSD.org>

Adjust function definitions in kern_cons.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

sys/kern/kern_cons.c:201:14: error: a function declaration with

Adjust function definitions in kern_cons.c to avoid clang 15 warnings

With clang 15, the following -Werror warnings are produced:

sys/kern/kern_cons.c:201:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cninit_finish()
^
void
sys/kern/kern_cons.c:376:7: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cngrab()
^
void
sys/kern/kern_cons.c:389:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cnungrab()
^
void
sys/kern/kern_cons.c:402:9: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
cnresume()
^
void

This is because cninit_finish(), cngrab(), cnungrab(), and cnresume()
are declared with (void) argument lists, but defined with empty argument
lists. Make the definitions match the declarations.

MFC after: 3 days

show more ...


Revision tags: release/13.1.0
# 2bfdc1ee 24-Feb-2022 Warner Losh <imp@FreeBSD.org>

cons: Use bool for boolean variables

MFC After: 3 days
Sponsored by: Netflix


Revision tags: release/12.3.0
# 072d5b98 03-Nov-2021 Warner Losh <imp@FreeBSD.org>

sysbeep: Adjust interface to take a duration as a sbt

Change the 'period' argument to 'duration' and change its type to
sbintime_t so we can more easily express different durations.

Reviewed by: ts

sysbeep: Adjust interface to take a duration as a sbt

Change the 'period' argument to 'duration' and change its type to
sbintime_t so we can more easily express different durations.

Reviewed by: tsoome, glebius
Differential Revision: https://reviews.freebsd.org/D32619

show more ...


# bd6085c6 04-Sep-2021 Alexander Motin <mav@FreeBSD.org>

Re-implement virtual console (constty).

Protect conscallout with tty lock instead of Giant. In addition to
Giant removal it also closes race on console unset.

Introduce additional lock to protect

Re-implement virtual console (constty).

Protect conscallout with tty lock instead of Giant. In addition to
Giant removal it also closes race on console unset.

Introduce additional lock to protect against concurrent console sets.

Remove consbuf free on console unset as unsafe, making impossible to
change buffer size after first allocation. Instead increase default
buffer size from 8KB to 64KB and processing rate from 5Hz to 10-15Hz
to make the output more smooth.

MFC after: 1 month

show more ...


Revision tags: release/13.0.0, release/12.2.0
# 780766eb 05-Oct-2020 Mark Johnston <markj@FreeBSD.org>

Remove sysctl_kern_consmute()

It is a trivial wrapper for sysctl_handle_int() since r184521. Also
remove the NEEDGIANT flag, cn_mute is accessed locklessly.

MFC after: 1 week


# 6fed89b1 02-Sep-2020 Mateusz Guzik <mjg@FreeBSD.org>

kern: clean up empty lines in .c and .h files


Revision tags: release/11.4.0
# 75dfc66c 27-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358269 through r358399.


# 7029da5c 26-Feb-2020 Pawel Biernacki <kaktus@FreeBSD.org>

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly mark

Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)

r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are
still not MPSAFE (or already are but aren’t properly marked).
Use it in preparation for a general review of all nodes.

This is non-functional change that adds annotations to SYSCTL_NODE and
SYSCTL_PROC nodes using one of the soon-to-be-required flags.

Mark all obvious cases as MPSAFE. All entries that haven't been marked
as MPSAFE before are by default marked as NEEDGIANT

Approved by: kib (mentor, blanket)
Commented by: kib, gallatin, melifaro
Differential Revision: https://reviews.freebsd.org/D23718

show more ...


# 5d25f943 23-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r358239 through r358262.


# fe20aaec 23-Feb-2020 Ryan Libby <rlibby@FreeBSD.org>

sys/kern: quiet -Wwrite-strings

Quiet a variety of Wwrite-strings warnings in sys/kern at low-impact
sites. This patch avoids addressing certain others which would need to
plumb const through struc

sys/kern: quiet -Wwrite-strings

Quiet a variety of Wwrite-strings warnings in sys/kern at low-impact
sites. This patch avoids addressing certain others which would need to
plumb const through structure definitions.

Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D23798

show more ...


# f46412c0 26-Dec-2019 Kyle Evans <kevans@FreeBSD.org>

kern_cons: add a stub kbdinit for configs with no keyboard/console drivers

A weak symbol here is decidedly cleaner than any #ifdef soup or relocating
kbdinit, the former leading to maintenance requi

kern_cons: add a stub kbdinit for configs with no keyboard/console drivers

A weak symbol here is decidedly cleaner than any #ifdef soup or relocating
kbdinit, the former leading to maintenance required on addition of any
console/keyboard drivers and the latter pushing kbd init bits away from
where they're used.

show more ...


# 3ed7166a 26-Dec-2019 Kyle Evans <kevans@FreeBSD.org>

kbd: merge linker set drivers into standard kbd driver list

This leads to the revert of r355806; this reduces duplication in keyboard
registration and driver switch lookup and leaves us with one aut

kbd: merge linker set drivers into standard kbd driver list

This leads to the revert of r355806; this reduces duplication in keyboard
registration and driver switch lookup and leaves us with one authoritative
source for currently registered drivers. The reduced duplication later is
nice as we have more procedure involved in keyboard setup.

keyboard_driver->flags is used to more quickly detect bogus adds/removes.
From KPI consumers' perspective, nothing changes- kbd_add_driver of an
already-registered driver will succeed, and a single kbd_delete_driver will
later remove it as expected. In contrast to historical behavior,
kbd_delete_driver on a driver registered via linker set will now actually
de-register the driver so that it may not be used -- e.g. if kbdmux's
MOD_LOAD handler fails somewhere.

Detection for already-registered drivers in kbd_add_driver has improved, as
the previous SLIST_NEXT(driver) != NULL check would not have caught a driver
that's at the tail end.

kbdinit is now called from cninit() rather than via SYSINIT so that keyboard
drivers are available as early as console drivers. This is particularly
important as cnprobe will, in both syscons and vt, attempt to do any early
configuration of keyboard drivers built-in (see: kbd_configure).

Reviewed by: imp (earlier version, pre-cninit change)
Differential Revision: https://reviews.freebsd.org/D22835

show more ...


Revision tags: release/12.1.0, release/11.3.0, release/12.0.0
# c6879c6c 23-Oct-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r339015 through r339669.


1234