summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2006-09-28 19:42:10 +0000
committerjhb <jhb@FreeBSD.org>2006-09-28 19:42:10 +0000
commitba03f04b1432aba8c3c760cce5119eca140b0025 (patch)
treef865b1adae388a7939e1799dfbe0b680301e566c /sys/boot
parent79660d10e40a475a31576a6b4ffd3ba1ec7ad31f (diff)
downloadFreeBSD-src-ba03f04b1432aba8c3c760cce5119eca140b0025.zip
FreeBSD-src-ba03f04b1432aba8c3c760cce5119eca140b0025.tar.gz
Tweak the code to handle intercepting BIOS calls to int 0x15 to shave
another 16 bytes off of BTX (and thus boot2): - Compare against the value of %eax that is saved on the stack instead of loading it into %eax (which requires saving the current %eax on the stack). - Use %ch to examine the keyboard flag state in the BIOS to see if Ctrl-Alt-Del is pressed instead of %al so we don't have to save %eax on the stack anymore. MFC after: 1 week
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/btx/btx/btx.S27
1 files changed, 10 insertions, 17 deletions
diff --git a/sys/boot/i386/btx/btx/btx.S b/sys/boot/i386/btx/btx/btx.S
index 52c0e5a..c8955a5 100644
--- a/sys/boot/i386/btx/btx/btx.S
+++ b/sys/boot/i386/btx/btx/btx.S
@@ -657,23 +657,16 @@ v86intn: lodsb # Get int no
cmpb $0x19,%al # is it int 19?
je reboot # yes, reboot the machine
cmpb $0x15,%al # is it int 15?
- jne v86intn.3 # no, skip parse
- pushl %eax # stash EAX
- movl 0x1c(%ebp),%eax # user's saved EAX
- cmpb $0x87,%ah # is it the memcpy subfunction?
- jne v86intn.1 # no, keep checking
- popl %eax # get the stack straight
- jmp int15_87 # it's our cue
-v86intn.1: cmpw $0x4f53,%ax # is it the delete key callout?
- jne v86intn.2 # no, handle the int normally
- movb BDA_KEYFLAGS,%al # get the shift key state
- andb $0xc,%al # mask off just Ctrl and Alt
- cmpb $0xc,%al # are both Ctrl and Alt down?
- jne v86intn.2 # no, handle the int normally
- popl %eax # restore EAX
- jmp reboot # reboot the machine
-v86intn.2: popl %eax # restore EAX
-v86intn.3: subl %edi,%esi # From
+ jne v86intn.1 # no, skip parse
+ cmpb $0x87,0x1d(%ebp) # is it the memcpy subfunction?
+ je int15_87 # yes
+ cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout?
+ jne v86intn.1 # no, handle the int normally
+ movb BDA_KEYFLAGS,%ch # get the shift key state
+ andb $0xc,%ch # mask off just Ctrl and Alt
+ cmpb $0xc,%ch # are both Ctrl and Alt down?
+ je reboot # yes, reboot the machine
+v86intn.1: subl %edi,%esi # From
shrl $0x4,%edi # linear
movw %dx,-0x2(%ebx) # Save flags
movw %di,-0x4(%ebx) # Save CS
OpenPOWER on IntegriCloud