New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update serial handling in bootloader #7

Open
wants to merge 11 commits into
base: master
from

Conversation

Projects
None yet
1 participant
@dkgroot
Contributor

dkgroot commented Oct 27, 2018

General:

  • /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

boot0

  • 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.
    (freebsd/freebsd@d9d5c6d)
  • 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.

boot1

  • 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.

loader

  • 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

pxeboot

  • 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).

comconsole

  • Handle Multiple/Dual console drivers in a nicer way
  • Add extra functionality to comconsole
  • Add sleep/usleep definitions
SUBDIR+= dloader32
.endif
SUBDIR+= dloader
# Pick the machine-dependant subdir based on the target architecture.

This comment has been minimized.

@dkgroot

dkgroot Oct 27, 2018

Contributor

I needed this change to the make file to be able to compile in place (ie: in /usr/src/sys/boot), does not have a negative effect when running buildworld from /usr/src).

Diederik de Groot added some commits Oct 18, 2018

Diederik de Groot
Merge freebsd/stand/i386/boot0/boot0.S (freebsd/freebsd@f7bf817 on Ma…
…y 16, 2015)

Includes:
- Add a serial console capable version of the FreeBSD boot manager.
  (freebsd/freebsd@6536894)
- Allow one to specify the com port settings for boot0sio.
  (freebsd/freebsd@2a49481)
- Change from '#' to "//" comment character to allow CPP preprocessing.
  (freebsd/freebsd@0a30683)
- 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.
  (freebsd/freebsd@d9d5c6d)
- Remove type 0x4 (FAT12 <32MB) to make room for type 0x7 (NTFS).
  (freebsd/freebsd@b87bf48)
- A number of small changes to make the 'save choice to disk' safer,
  and re-enable it as default.
  (freebsd/freebsd@9b90a7e)
- 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.
  (freebsd/freebsd@2fa7cf8)
Diederik de Groot
Manually synced boot2 with freebsd/freebsd@b730d20
- 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.
- Add boot.config.5 man file
Diederik de Groot
Update/extend console and comconsole drivers
- Handle Multiple/Dual console drivers in a nicer way
- Add extra functionality to comconsole
- Add sleep/usleep definitions
Diederik de Groot
Update loader
- 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
Diederik de Groot
Set default serial console speed to 115200
Use stable names/terms in the Makefile ie COMSPEED and BOOT_COMCONSOLE_SPEED
Diederik de Groot
Update pxeboot
- 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).
- Fix nfs/tftp order for pxeboot
Diederik de Groot
Fix PXE:
- Default to RB_MULTIPLE/RB_DUAL
Fix Loader:
- Handle serial settings when started by pxeldr
- Move/Merge howto_names table to ../sys/boot.h
Fix comc_set_speed
- Sleep function was not working
- Would never stop after changing speed
Update dloader kenv entries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment