Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jul 2002 16:49:40 +0900
From:      Alexander Nedotsukov <bland@mail.ru>
To:        Michael Gratton <mike@vee.net>
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?]
Message-ID:  <3D2E8A14.7040004@mail.ru>
References:  <3D2CFC98.8010803@quack.kfu.com> <3D2E1E39.4070601@quack.kfu.com> <3D2E3A2D.50303@vee.net>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3D2E8A14.7040004>