Submit #3154

Update serial handling in bootloader

Added by ddegroot over 2 years ago. Updated over 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


Allow changing serial baud rate in bootloader during boot1/boot2. The speed will automatically be taken over by the loader.

The patch contains multiple changes to improve serial handling through the bootprocess and
can be found here:



Updated by ddegroot over 2 years ago

Excerpt of changes:
- /usr/src/sys/boot makefile fix
- Set default serial console speed to 115200
- Use stable names/terms in the Makefile ie COMSPEED and BOOT_COMCONSOLE_SPEED

- Update boot0.S with the newer fbsd version (not sure if this is like/ok)
- If the COMSPEED is set to 0, then don't try to initialize the serial
port and assume that the BIOS has set it up for us. This allows folks
with a serial-aware BIOS to set the BIOS to speeds above 9600 and
allow boot0 to just use the existing settings.
- Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
preferred slice.

- Use most of the newer fbsd boot1.S (freebsd/freebsd@b730d20)
- Allows you to set the Serial Speed (ie: S115200)
Correct line breaks / nicer commandline output when manually entering commands
- Once the first parameter is entered on the commandline, stop timeout
- Suppress twiddle when autoboot is off
- Show current set of flags when making a change
- Allow setting the serial speed (which will also activate RB_SERIAL)
- D for DUAL makes more sense then -D for Keyboard
Continue to loader/kernel using an empty commandline (\n) instead of timing out
- Error on unknown flags/cmds
- Move/Reorder some functions
- Use unsigned char / uint8_t to reduce size.

- Reuse the speed already set in boot1
- Allow handling of boot_multicons (currently until loader and not in the kernel (yet))
- Reuse isa_inb/isa_outb from comconsole.c (via extern bootstrap.h)
- Add print RB flags which were passed in (used for debugging)
- Use new cons_probe function
- Updated loader.8 to show change functionality

- Synced with fbsd (freebsd/freebsd@433bd38)
- Integrate support for tftp and nfs in one pxeloader
Remove need for loader_tftp and pxeldr_tftp as special versions
Update man pages accordingly
- Use RB_SERIAL and RB_MULTIPLE (aka boot_multicons) from sys/reboot.h
when no keyboard was detected (potential false positive).

- Handle Multiple/Dual console drivers in a nicer way
- Add extra functionality to comconsole
- Add sleep/usleep definitions

Also available in: Atom PDF