Page MenuHomeFreeBSD

loader: Respect loader_color=YES for serial consoles
ClosedPublic

Authored by freqlabs on Sep 20 2019, 7:06 PM.
Tags
None
Referenced Files
F81620407: D21732.diff
Fri, Apr 19, 2:31 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 11 2024, 7:50 AM
Unknown Object (File)
Mar 7 2024, 10:37 PM
Unknown Object (File)
Feb 16 2024, 11:46 AM
Unknown Object (File)
Jan 12 2024, 8:13 PM
Subscribers

Details

Summary

It's not uncommon these days for the terminals attached to serial consoles to support ANSI escape sequences. However, we assume escape sequences may break some serial consoles and default to not using them when boot_serial or boot_multicons (or if console contains "comconsole" in the forth loader) for broader compatibility. We also have loader_color which can be explicitly set to "NO" to disable the use of ANSI escape sequences.

The problem is that loader_color=YES gets ignored when boot_serial=YES or boot_multicons=YES (or when console contains "comconsole" in the forth loader).

To fix, the existing default behavior remains unchanged when loader_color is unset, loader_color=NO explicitly disables the use of ANSI escape sequences still, and the change is that loader_color=YES can now be used to explicitly allow ANSI escapes when a serial console is enabled.

Sponsored by: iXsystems, Inc.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Looks good for lualoader side.

This revision is now accepted and ready to land.Sep 20 2019, 7:12 PM
stand/forth/color.4th
33

this is not your code, but could you swap N to t there, since we leave true or false on stack, it is traditionally denoted by char 't''. (N is for signed int).

53

you can use:
boot_serial? 0= -- this will leave proper value on stack and you can save 4 words:)

Fixed up nearby code as requested

This revision now requires review to proceed.Sep 20 2019, 7:29 PM
This revision is now accepted and ready to land.Sep 20 2019, 7:30 PM

Still OK from lua side -- please commit at will.

Thanks! Can I ask someone with a commit bit to please put this in for me?