Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
RayeR(R)

Homepage

CZ,
26.10.2014, 13:44
 

How to detect if keyboard is connected? (Developers)

Hi, on 86duino zero there's a real PS/2 port an also USB HID emulation. I'd like to make a small utility that will automatically detect a keyboard and if it is not found it will pass an error code that will be used fo console redirection CTTY COMx.

With USB KBD I tried some basic tricks like sending KBD echo command EEh to port 60h but I didn't get EEh reply and result was same regardless if KBD attached (FEh). Also bit4 at address 0:0496h that should indicate 101-key KBD present is still set. Status byte at port 64h is still 50h. Putting a char to KBD buffer via INT16 also success. So I need to find something that will give aq different result when KBD connented or not.

---
DOS gives me freedom to unlimited HW access.

Oso2k(R)

08.11.2014, 00:41

@ RayeR

How to detect if keyboard is connected?

> Well, I got info that I would need to mess with USB to detect the KBD on
> this HW so I rather decided to write simple utility for detection a VGA
> (BIOS). If VGA is detected the console is not redirected to COM port
> (without checking kbd but it's linked together). For my case on 86duino it
> does the job.

Does the 86duino support the BDA fields 40:89 [0]?

[0] http://stanislavs.org/helppc/bios_data_area.html

RayeR(R)

Homepage

CZ,
02.11.2014, 01:23

@ RayeR

How to detect if keyboard is connected?

Well, I got info that I would need to mess with USB to detect the KBD on this HW so I rather decided to write simple utility for detection a VGA (BIOS). If VGA is detected the console is not redirected to COM port (without checking kbd but it's linked together). For my case on 86duino it does the job.

---
DOS gives me freedom to unlimited HW access.

RayeR(R)

Homepage

CZ,
26.10.2014, 15:11

@ RayeR

How to detect if keyboard is connected?

As I tried neither EDh command works - it returns FEh - NAK. So it seems that USB HID emulation routine does not emulate it on hardware/port level but only on BIOS level.
If I use mode con command I can set numlock regardless if keyboard is connected.

---
DOS gives me freedom to unlimited HW access.

Back to the board
Thread view  Mix view  Order
15113 Postings in 1359 Threads, 249 registered users, 22 users online (0 registered, 22 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum