Add support for probing the keyboard from pxeboot which will behave

exactly the same as passing -P to boot2.

Submitted by:	jhb
This commit is contained in:
Paul Saab 2000-11-30 14:55:10 +00:00
parent 313c36f04b
commit 43ab35c8c7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=69391
3 changed files with 44 additions and 0 deletions

View File

@ -10,7 +10,11 @@ PROG= ${BOOT}
MAN8= ${BOOT}.8
STRIP=
BINDIR?= /boot
M4?= m4
.if defined(BOOT_PXELDR_PROBE_KEYBOARD)
M4FLAGS+= -DPROBE_KEYBOARD
.endif
.if exists(${.OBJDIR}/../loader)
LOADER= ${.OBJDIR}/../loader/loader
@ -32,6 +36,10 @@ ${LDR}: ${LDR}.o
objcopy -S -O binary ${LDR}.out ${.TARGET}
.endif
${LDR}.o: ${LDR}.s
(cd ${.CURDIR}; ${M4} ${M4FLAGS} ${LDR}.s) | \
${AS} ${AFLAGS} -o ${.TARGET}
CLEANFILES+= ${LDR} ${LDR}.out ${LDR}.o ${BOOT}.tmp
.include <bsd.prog.mk>

View File

@ -37,6 +37,7 @@
.set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute
.set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader
.set MEM_BTX_CLIENT,0xa000 # where BTX clients live
.set MEM_BIOS_KEYBOARD,0x496 # BDA byte with keyboard bit
#
# a.out header fields
#
@ -52,6 +53,10 @@
.set KARGS_FLAGS_PXE,0x2 # flag to indicate booting from
# PXE loader
#
# Boot howto bits
#
.set RBX_SERIAL,0xc # serial console
#
# Segment selectors.
#
.set SEL_SDATA,0x8 # Supervisor data
@ -63,6 +68,10 @@
#
.set INT_SYS,0x30 # BTX syscall interrupt
#
# Bit in MEM_BIOS_KEYBOARD that is set if an enhanced keyboard is present
#
.set KEYBOARD_BIT,0x10
#
# We expect to be loaded by the BIOS at 0x7c00 (standard boot loader entry
# point)
#
@ -101,6 +110,15 @@ start: cld # string ops inc
orb $KARGS_FLAGS_PXE, 0x8(%bx) # kargs->bootflags |=
# KARGS_FLAGS_PXE
popl 0xc(%bx) # kargs->pxeinfo = *PXENV+
ifdef(`PROBE_KEYBOARD',`
#
# Look at the BIOS data area to see if we have an enhanced keyboard. If not,
# set the RBX_SERIAL bit in the howto byte.
testb $KEYBOARD_BIT, MEM_BIOS_KEYBOARD # keyboard present?
jnz keyb # yes, so skip
orb $RBX_SERIAL, (%bx) # enable serial console
keyb:
')
#
# Turn on the A20 address line
#

View File

@ -37,6 +37,7 @@
.set MEM_BTX_ENTRY,0x9010 # where BTX starts to execute
.set MEM_BTX_OFFSET,MEM_PAGE_SIZE # offset of BTX in the loader
.set MEM_BTX_CLIENT,0xa000 # where BTX clients live
.set MEM_BIOS_KEYBOARD,0x496 # BDA byte with keyboard bit
#
# a.out header fields
#
@ -52,6 +53,10 @@
.set KARGS_FLAGS_PXE,0x2 # flag to indicate booting from
# PXE loader
#
# Boot howto bits
#
.set RBX_SERIAL,0xc # serial console
#
# Segment selectors.
#
.set SEL_SDATA,0x8 # Supervisor data
@ -63,6 +68,10 @@
#
.set INT_SYS,0x30 # BTX syscall interrupt
#
# Bit in MEM_BIOS_KEYBOARD that is set if an enhanced keyboard is present
#
.set KEYBOARD_BIT,0x10
#
# We expect to be loaded by the BIOS at 0x7c00 (standard boot loader entry
# point)
#
@ -101,6 +110,15 @@ start: cld # string ops inc
orb $KARGS_FLAGS_PXE, 0x8(%bx) # kargs->bootflags |=
# KARGS_FLAGS_PXE
popl 0xc(%bx) # kargs->pxeinfo = *PXENV+
ifdef(`PROBE_KEYBOARD',`
#
# Look at the BIOS data area to see if we have an enhanced keyboard. If not,
# set the RBX_SERIAL bit in the howto byte.
testb $KEYBOARD_BIT, MEM_BIOS_KEYBOARD # keyboard present?
jnz keyb # yes, so skip
orb $RBX_SERIAL, (%bx) # enable serial console
keyb:
')
#
# Turn on the A20 address line
#