Page MenuHomeFreeBSD

stand: Add support for `print_delay` environment variable in loader
AcceptedPublic

Authored by obiwac on Fri, Jun 13, 1:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 27, 4:57 AM
Unknown Object (File)
Thu, Jun 26, 3:06 AM
Unknown Object (File)
Wed, Jun 25, 3:00 PM
Unknown Object (File)
Tue, Jun 24, 10:12 PM
Unknown Object (File)
Sun, Jun 22, 12:22 AM
Unknown Object (File)
Fri, Jun 20, 4:55 AM
Unknown Object (File)
Wed, Jun 18, 7:15 PM
Unknown Object (File)
Wed, Jun 18, 5:38 PM
Subscribers

Details

Summary

This adds support for a new print_delay environment variable, which inserts a delay (in microseconds, maybe this should be in millis instead?) when putchar encounters a newline character. This can be useful when debugging.

Let me know if it's not desirable to add new error codes to libsa.

Test Plan

Just tested in loader.efi, on my machine & in VM.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64860
Build 61743: arc lint + arc unit

Event Timeline

Let me know if it's not desirable to add new error codes to libsa.

For my taste it's a bit gratuitous--EINVAL should be fine. I'd think that we want to avoid adding new error strings in memory-constrained loader, but Warner has better intuition there.

stand/common/misc.c
216 ↗(On Diff #156965)
222 ↗(On Diff #156965)

Why not have this function in console.c? Then you don't need to export print_delay_usec.

I tend to think the new error values are a bit gratuitous as well... strtonum is approximately what we're doing and it return ERANGE or EINVAL.

stand/common/misc.c
222 ↗(On Diff #156965)

and the print_delay_usec variable...

Move setprint_delay to console.c

Replace ENAN and ENUMNEG errors with existing EINVAL

This revision is now accepted and ready to land.Fri, Jun 13, 8:00 PM
markj added inline comments.
stand/common/console.c
47
This revision now requires review to proceed.Sat, Jun 14, 1:58 AM
This revision is now accepted and ready to land.Sat, Jun 14, 4:25 AM

Rene and John Grafton helped with the doc also in the hacker lounge.