From owner-freebsd-stable Fri Jul 12 0:50:11 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 40EE737B400 for ; Fri, 12 Jul 2002 00:49:55 -0700 (PDT) Received: from smtp1.jp.viruscheck.net (smtp1.jp.viruscheck.net [154.33.69.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 371DE43E58 for ; Fri, 12 Jul 2002 00:49:54 -0700 (PDT) (envelope-from bland@mail.ru) Received: from [154.33.69.38] (helo=mail3.jp.viruscheck.net) by smtp1.jp.viruscheck.net with esmtp (Exim 3.16 #2) id 17SvAN-0000lh-00; Fri, 12 Jul 2002 16:48:39 +0900 Received: from [218.47.36.57] (helo=noc.orchid) by mail3.jp.viruscheck.net with esmtp (Exim 3.20 #2) id 17SvBR-0000VF-00; Fri, 12 Jul 2002 16:49:45 +0900 Received: from mail.ru (horse.orchid [89.60.10.11]) by noc.orchid (8.10.2+Sun/8.10.2) with ESMTP id g6C7ne425083; Fri, 12 Jul 2002 16:49:44 +0900 (JST) Message-ID: <3D2E8A14.7040004@mail.ru> Date: Fri, 12 Jul 2002 16:49:40 +0900 From: Alexander Nedotsukov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1a) Gecko/20020611 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Gratton Cc: freebsd-stable@FreeBSD.ORG Subject: Re: bootstrap loader + USB keyboard no-worky [was: Do VIA 83C572 USB controllers suck or is it just me?] References: <3D2CFC98.8010803@quack.kfu.com> <3D2E1E39.4070601@quack.kfu.com> <3D2E3A2D.50303@vee.net> Content-Type: multipart/mixed; boundary="------------030403060703050003020904" Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------030403060703050003020904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Michael, Your problem is in buggy usb keyboard legacy emulator. FreeBSD bootstrap uses old days hardware method to open A20 line. This seems to lockup a number of usb keyboards. Take a look at the patches I have created some time ago to resolve this problem. So, at least they works for me. - cd /usr/src/sys/boot/i386, apply patches attached - rebuild bootstrap code - install it (don't forget to update rebuilded bootsector as well. actualy lockup source resides inside it) Since this patches affects bootsector and /boot/loader it's very good idea to backup both There is another method to fix this problem. It seems like all modern pc's has A20 gate open by default. So, if this true in your case you may just comment out A20 open code in boot1.s Cheers, Alexander. Michael Gratton wrote: > > > Nick Sayer wrote: > >> >> Now if only my USB legacy keyboard support would work for the FreeBSD >> loader... :-) >> > > Yeah, does anyone know what is up with that? It's a pain to have to > find and switch to a PS/2 keyboard just to boot to single user mode, > play with boot params, or to use an alternate kernel. > > I've looked around for some solutions before, but never come up with > anything useful. > > /mike > --------------030403060703050003020904 Content-Type: text/plain; name="boot1.s.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="boot1.s.diff" *** boot2/boot1.s.orig Sat Oct 20 13:28:58 2001 --- boot2/boot1.s Sat Oct 20 16:07:00 2001 *************** *** 195,218 **** xorb %al,%al # Zero assumed bss from rep # the end of boot2.bin stosb # up to 0x10000 - callw seta20 # Enable A20 jmp start+MEM_JMP-MEM_ORG # Start BTX - # - # Enable A20 so we can access memory above 1 meg. - # - seta20: cli # Disable interrupts - seta20.1: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.1 # Yes - movb $0xd1,%al # Command: Write - outb %al,$0x64 # output port - seta20.2: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.2 # Yes - movb $0xdf,%al # Enable - outb %al,$0x60 # A20 - sti # Enable interrupts - retw # To caller # # Trampoline used to call read from within boot1. # --- 195,201 ---- --------------030403060703050003020904 Content-Type: text/plain; name="btx.s.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="btx.s.diff" *** btx/btx/btx.s.orig Sun Oct 28 18:19:03 2001 --- btx/btx/btx.s Mon Oct 29 00:05:34 2001 *************** *** 195,200 **** --- 195,201 ---- # # Bring up the system. # + callw seta20 # Turn A20 on mov $0x2820,%bx # Set protected mode callw setpic # IRQ offsets lidt idtdesc # Set IDT *************** *** 294,299 **** --- 295,321 ---- exit.3: jz exit.3 # No movw $0x1234, BDA_BOOT # Do a warm boot ljmp $0xffff,$0x0 # reboot the machine + # + # Enable A20 so we can access memory above 1 meg. + # + seta20: lidt ivtdesc # Restore IVT + stc # Have we? + mov $0x2401,%ax # BIOS: enable A20 gate + int $0x15 # on later PS/2s + jnc return # If enabled + cli # Disable interrupts + seta20.1: inb $0x64,%al # Get status + testb $0x2,%al # Busy? + jnz seta20.1 # Yes + movb $0xd1,%al # Command: Write + outb %al,$0x64 # output port + seta20.2: inb $0x64,%al # Get status + testb $0x2,%al # Busy? + jnz seta20.2 # Yes + movb $0xdf,%al # Enable + outb %al,$0x60 # A20 + sti # Enable interrupts + return: retw # To caller # # Set IRQ offsets by reprogramming 8259A PICs. # --------------030403060703050003020904 Content-Type: text/plain; name="pxeldr.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pxeldr.diff" *** pxeldr/pxeldr.s.orig Mon Oct 29 00:19:34 2001 --- pxeldr/pxeldr.s Mon Oct 29 00:20:02 2001 *************** *** 120,129 **** keyb: ') # - # Turn on the A20 address line - # - callw seta20 # Turn A20 on - # # Relocate the loader and BTX using a very lazy protected mode # movw $relocate_msg, %si # Display the --- 120,125 ---- *************** *** 218,240 **** movb $0xe,%ah # BIOS: put_char int $0x10 # call BIOS, print char in %al jmp putstr # keep looping - - # - # Enable A20 - # - seta20: cli # Disable interrupts - seta20.1: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.1 # Yes - movb $0xd1,%al # Command: Write - outb %al,$0x64 # output port - seta20.2: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.2 # Yes - movb $0xdf,%al # Enable - outb %al,$0x60 # A20 - sti # Enable interrupts - retw # To caller # # BTX client to start btxldr --- 214,219 ---- --------------030403060703050003020904 Content-Type: text/plain; name="cdldr.s.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cdldr.s.diff" *** cdldr/cdldr.s.orig Mon Oct 29 00:17:07 2001 --- cdldr/cdldr.s Mon Oct 29 00:17:44 2001 *************** *** 99,108 **** orb $KARGS_FLAGS_CD, 0x8(%bx) # kargs->bootflags |= # KARGS_FLAGS_CD # - # Turn on the A20 address line - # - callw seta20 # Turn A20 on - # # Relocate the loader and BTX using a very lazy protected mode # movw $relocate_msg, %si # Display the --- 99,104 ---- *************** *** 197,219 **** movb $0xe,%ah # BIOS: put_char int $0x10 # call BIOS, print char in %al jmp putstr # keep looping - - # - # Enable A20 - # - seta20: cli # Disable interrupts - seta20.1: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.1 # Yes - movb $0xd1,%al # Command: Write - outb %al,$0x64 # output port - seta20.2: inb $0x64,%al # Get status - testb $0x2,%al # Busy? - jnz seta20.2 # Yes - movb $0xdf,%al # Enable - outb %al,$0x60 # A20 - sti # Enable interrupts - retw # To caller # # BTX client to start btxldr --- 193,198 ---- --------------030403060703050003020904-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message