mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-21 01:03:42 +00:00
Allow us to enable the 'XT_KEYBOARD' code using a configuration flag.
This allows the user to add modify syscons's configuration flags using UserConfig that will allow older/quirky hardware (most notably older IBM ThinkPad laptops) to work with the standard boot kernel. Inspired by: The Nomads
This commit is contained in:
parent
b345ce1b4c
commit
a973755bfa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19613
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.182 1996/10/26 20:16:58 sos Exp $
|
||||
* $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
|
@ -295,6 +295,7 @@ static int
|
|||
scprobe(struct isa_device *dev)
|
||||
{
|
||||
int i, j, retries = 5;
|
||||
int xt_keyboard = 0;
|
||||
u_char val;
|
||||
|
||||
/* Enable interrupts and keyboard controller */
|
||||
|
@ -341,13 +342,23 @@ scprobe(struct isa_device *dev)
|
|||
goto fail;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
|
||||
* such as those on the IBM ThinkPad laptop computers can be used
|
||||
* with the standard console driver.
|
||||
*/
|
||||
if ( dev->id_flags & XT_KEYBD )
|
||||
xt_keyboard = 1;
|
||||
#ifdef XT_KEYBOARD
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
#endif /* XT_KEYBOARD */
|
||||
xt_keyboard = 1;
|
||||
#endif
|
||||
if ( xt_keyboard ) {
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
}
|
||||
|
||||
succeed:
|
||||
return (IO_KBDSIZE);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.h,v 1.22 1996/10/18 18:51:37 sos Exp $
|
||||
* $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_ISA_SYSCONS_H_
|
||||
|
@ -70,6 +70,7 @@
|
|||
#define BLINK_CURSOR 0x00002
|
||||
#define CHAR_CURSOR 0x00004
|
||||
#define DETECT_KBD 0x00008
|
||||
#define XT_KEYBD 0x00010
|
||||
|
||||
/* attribute flags */
|
||||
#define NORMAL_ATTR 0x00
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.182 1996/10/26 20:16:58 sos Exp $
|
||||
* $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
|
@ -295,6 +295,7 @@ static int
|
|||
scprobe(struct isa_device *dev)
|
||||
{
|
||||
int i, j, retries = 5;
|
||||
int xt_keyboard = 0;
|
||||
u_char val;
|
||||
|
||||
/* Enable interrupts and keyboard controller */
|
||||
|
@ -341,13 +342,23 @@ scprobe(struct isa_device *dev)
|
|||
goto fail;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
|
||||
* such as those on the IBM ThinkPad laptop computers can be used
|
||||
* with the standard console driver.
|
||||
*/
|
||||
if ( dev->id_flags & XT_KEYBD )
|
||||
xt_keyboard = 1;
|
||||
#ifdef XT_KEYBOARD
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
#endif /* XT_KEYBOARD */
|
||||
xt_keyboard = 1;
|
||||
#endif
|
||||
if ( xt_keyboard ) {
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
}
|
||||
|
||||
succeed:
|
||||
return (IO_KBDSIZE);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.h,v 1.22 1996/10/18 18:51:37 sos Exp $
|
||||
* $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_ISA_SYSCONS_H_
|
||||
|
@ -70,6 +70,7 @@
|
|||
#define BLINK_CURSOR 0x00002
|
||||
#define CHAR_CURSOR 0x00004
|
||||
#define DETECT_KBD 0x00008
|
||||
#define XT_KEYBD 0x00010
|
||||
|
||||
/* attribute flags */
|
||||
#define NORMAL_ATTR 0x00
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.c,v 1.182 1996/10/26 20:16:58 sos Exp $
|
||||
* $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $
|
||||
*/
|
||||
|
||||
#include "sc.h"
|
||||
|
@ -295,6 +295,7 @@ static int
|
|||
scprobe(struct isa_device *dev)
|
||||
{
|
||||
int i, j, retries = 5;
|
||||
int xt_keyboard = 0;
|
||||
u_char val;
|
||||
|
||||
/* Enable interrupts and keyboard controller */
|
||||
|
@ -341,13 +342,23 @@ scprobe(struct isa_device *dev)
|
|||
goto fail;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Allow us to set the XT_KEYBD flag in UserConfig so that keyboards
|
||||
* such as those on the IBM ThinkPad laptop computers can be used
|
||||
* with the standard console driver.
|
||||
*/
|
||||
if ( dev->id_flags & XT_KEYBD )
|
||||
xt_keyboard = 1;
|
||||
#ifdef XT_KEYBOARD
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
#endif /* XT_KEYBOARD */
|
||||
xt_keyboard = 1;
|
||||
#endif
|
||||
if ( xt_keyboard ) {
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 0xF0);
|
||||
kbd_wait();
|
||||
outb(KB_DATA, 1);
|
||||
kbd_wait();
|
||||
}
|
||||
|
||||
succeed:
|
||||
return (IO_KBDSIZE);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $Id: syscons.h,v 1.22 1996/10/18 18:51:37 sos Exp $
|
||||
* $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $
|
||||
*/
|
||||
|
||||
#ifndef _I386_ISA_SYSCONS_H_
|
||||
|
@ -70,6 +70,7 @@
|
|||
#define BLINK_CURSOR 0x00002
|
||||
#define CHAR_CURSOR 0x00004
|
||||
#define DETECT_KBD 0x00008
|
||||
#define XT_KEYBD 0x00010
|
||||
|
||||
/* attribute flags */
|
||||
#define NORMAL_ATTR 0x00
|
||||
|
|
Loading…
Reference in a new issue