Page MenuHomeFreeBSD

Add runtime option for all second-stage boot blocks to reset terminal
Needs ReviewPublic

Authored by lev on Sep 10 2018, 3:35 PM.

Details

Summary

Some hardware/firmware leaves serial console in bogus state before calling user boot code. After that output of boot2, gptboot and other second level boot blocks could not be seen by user, which is inconvenient.
This diff adds new runtime option -R, which force all these boot blocks to send default VT-100 reset command <ESC>c before all output. This sequence could be changed with build time option BOOT_COMCONSOLE_RESET_TERM_CMD.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

lev created this revision.Sep 10 2018, 3:35 PM
lev added a reviewer: imp.
lev edited the summary of this revision. (Show Details)
lev updated this revision to Diff 57099.May 6 2019, 7:16 PM
imp added a comment.May 6 2019, 8:08 PM

lots of duplication in this area still :( that's beyond this review.
except for the duplication you added: it can be done in defs.mk.
boot2 is always short of space, how are we doing?

stand/i386/boot2/boot2.c
419

So this adds about 30-40 bytes of code to boot2. We've had size issues with this code forever... how are we doing these days for size?

stand/i386/gptboot/Makefile
13

Put this in stand/def.mk. No need to repeat it everywehere.

stand/i386/isoboot/isoboot.c
61

It would be nice to abstract the 'small parsing routines' down into one copy rather than the 6 we have in the tree today.

lev added inline comments.May 7 2019, 12:15 PM
stand/i386/boot2/boot2.c
419

It works for me :-)

# pwd
/usr/obj/nanobsd/gateway.v3/data/src/amd64.amd64/stand/i386/boot2
# ls -la boot2*
-rw-r--r--  1 root  wheel   7680 Feb 24 21:28 boot2
-rwxr-xr-x  1 root  wheel   5352 Feb 24 21:28 boot2.bin
-rw-r--r--  1 root  wheel     23 Feb 24 21:28 boot2.h
-rw-r--r--  1 root  wheel   7576 Feb 24 21:28 boot2.ld
-rw-r--r--  1 root  wheel    512 Feb 24 21:28 boot2.ldr
-rw-r--r--  1 root  wheel  10296 Feb 24 21:28 boot2.o
-rwxr-xr-x  1 root  wheel  15300 Feb 24 21:28 boot2.out
#
stand/i386/isoboot/isoboot.c
61

I'm not sure, that it should be done in this change.

lev updated this revision to Diff 57128.May 7 2019, 12:17 PM
lev marked an inline comment as done.
ryan_freqlabs.com added inline comments.
sbin/reboot/boot_i386.8
263

reset the serial terminal
the serial terminal in an unspecified or bogus state. The reset sequence

stand/i386/gptzfsboot/Makefile
4

This doesn't seem right.

stand/i386/zfsboot/zfsboot.c
1115

The white space in this block breaks the convention of the rest of this file.

lev updated this revision to Diff 59850.Jul 17 2019, 7:01 PM
lev marked 3 inline comments as done.

Whoops, spotted a few more spelling errors.

sbin/reboot/boot_i386.8
262

s/prevous/previous/

264

s/overriden/overridden/

lev updated this revision to Diff 59856.Jul 17 2019, 7:41 PM
lev marked 2 inline comments as done.
ryan_freqlabs.com added inline comments.
sbin/reboot/boot_i386.8
126

Should add R preceding r here.

187

Should add R preceding r here as well.

This revision is now accepted and ready to land.Jul 18 2019, 2:48 AM
lev updated this revision to Diff 59871.Jul 18 2019, 9:27 AM
This revision now requires review to proceed.Jul 18 2019, 9:27 AM
lev marked 2 inline comments as done.Jul 18 2019, 9:27 AM