summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2000-11-30 14:55:10 +0000
committerps <ps@FreeBSD.org>2000-11-30 14:55:10 +0000
commit3d64810c121c1b65bc5e732ab78b0d425d6b6ca2 (patch)
treece4451ebba3e58e824566065dfc45ebf3254e5ee /sys/boot
parent4e7062f7a76f231ee5e81e160fac28829caa7f6a (diff)
downloadFreeBSD-src-3d64810c121c1b65bc5e732ab78b0d425d6b6ca2.zip
FreeBSD-src-3d64810c121c1b65bc5e732ab78b0d425d6b6ca2.tar.gz
Add support for probing the keyboard from pxeboot which will behave
exactly the same as passing -P to boot2. Submitted by: jhb
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/pxeldr/Makefile8
-rw-r--r--sys/boot/i386/pxeldr/pxeldr.S18
-rw-r--r--sys/boot/i386/pxeldr/pxeldr.s18
3 files changed, 44 insertions, 0 deletions
diff --git a/sys/boot/i386/pxeldr/Makefile b/sys/boot/i386/pxeldr/Makefile
index e299579..6f1b58e 100644
--- a/sys/boot/i386/pxeldr/Makefile
+++ b/sys/boot/i386/pxeldr/Makefile
@@ -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>
diff --git a/sys/boot/i386/pxeldr/pxeldr.S b/sys/boot/i386/pxeldr/pxeldr.S
index 510aff8..8558523 100644
--- a/sys/boot/i386/pxeldr/pxeldr.S
+++ b/sys/boot/i386/pxeldr/pxeldr.S
@@ -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
#
diff --git a/sys/boot/i386/pxeldr/pxeldr.s b/sys/boot/i386/pxeldr/pxeldr.s
index 510aff8..8558523 100644
--- a/sys/boot/i386/pxeldr/pxeldr.s
+++ b/sys/boot/i386/pxeldr/pxeldr.s
@@ -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
#
OpenPOWER on IntegriCloud