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.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 4, 3:32 PM
Unknown Object (File)
Wed, Dec 4, 3:20 PM
Unknown Object (File)
Wed, Nov 27, 9:09 AM
Unknown Object (File)
Sat, Nov 16, 1:20 PM
Unknown Object (File)
Sat, Nov 16, 2:24 AM
Unknown Object (File)
Fri, Nov 15, 11:14 PM
Unknown Object (File)
Thu, Nov 14, 3:07 PM
Unknown Object (File)
Thu, Nov 14, 9:56 AM
Subscribers

Details

Reviewers
imp
freqlabs
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
Tests Skipped

Event Timeline

lev added a reviewer: imp.
lev edited the summary of this revision. (Show Details)

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.

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 marked an inline comment as done.
freqlabs 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
6

This doesn't seem right.

stand/i386/zfsboot/zfsboot.c
1115–1121

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

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 marked 2 inline comments as done.
freqlabs 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
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

Regenerate against new git repository