473,326 Members | 2,438 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

KeyB typeahead buffer in BIOS

Hello Friends,

i was trying to read the Keyboard typeahead buffer from BIOS
according to its address.
But i'm not able to get the data.
Please tell me how to do so.

void main()
{
char far *p=(char* far)(0x0040001E);
int i=0;
clrscr();

for(i=0;i<32;i++)
printf("\n%4d %c",(*(p+i)),*(p+i));
getch();
}

i tried using a "near" pointer too. But not working!

May 8 '06 #1
2 1889
Sree opined:
Hello Friends,

i was trying to read the Keyboard typeahead buffer from BIOS
according to its address.
But i'm not able to get the data.
Please tell me how to do so.

You're missing at least some #include files:

/* for `printf()` */
#include <stdio.h>

and (I may be wrong here):

/* for non-Standard stuff */
#include <conio.h>
void main()
This should be:

int main(void)

or

int main(int argc, char *argv[])
{
char far *p=(char* far)(0x0040001E);
int i=0;
No need to initialise here, as you do it below anyway.
clrscr();
Why does everybody seem to want to clear the screen for no good reason
whatsoever?
for(i=0;i<32;i++)
printf("\n%4d %c",(*(p+i)),*(p+i));
You need to terminate `printf()` with a '\n' (or do a `fflush(stdout)`)
if you want to be sure anything (on the last line) is displayed.
getch();
There's a perfectly standard `getchar()` for this (it may require you
to press ENTER as well, though).
}

i tried using a "near" pointer too. But not working!


What exactly is not working?

The above shouldn't compile at all (see my comments), but I guess you
just did not get the numbers you expected.

Anyway, your question is system specific (DOS I believe), an here we
discuss only standard C, so you're much better off asking elsewhere.

comp.os.msdos.programming

may be a good starting place.
--
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!\n");
exit(42);
}
(Arnold Robbins in the LJ of February '95, describing RCS)

<http://clc-wiki.net/wiki/Introduction_to_comp.lang.c>

May 8 '06 #2

"Sree" <sr***************@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Hello Friends,

i was trying to read the Keyboard typeahead buffer from BIOS
according to its address.
But i'm not able to get the data.
Please tell me how to do so.

void main()
{
char far *p=(char* far)(0x0040001E);
int i=0;
clrscr();

for(i=0;i<32;i++)
printf("\n%4d %c",(*(p+i)),*(p+i));
getch();
}

i tried using a "near" pointer too. But not working!


My references indicate the keyboard buffer is at segment:offset 0040h:001Eh.
This is a 20bit address representation. The segment is shifted four bits:
0x0040<<4=0x0400 and added to the offset 0x001E. The physical address is
0x0000041E. However, you probably want to look for a macro which creates
the proper address for you called MK_FP.

p=MK_FP(0x0040,0x001E);
Rod Pemberton
May 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number...
1
by: J. Rodrigo A. V. | last post by:
There was this guy in alt.es.hackers asking if there is a way to crack bios password bys software. I of course know you can always resort to the "almigthy" jumper and reset the CMOS. So the...
10
by: just4me | last post by:
Exactly how do I read a specific location in the bios eprom. (such as debug.exe location ffff:0000)
1
by: just4me | last post by:
I would like to access the bios flash using watcom c. To start, I would like to be able to read the entire bios and back it up into a file. I can do everything except reading the bios flash. Any...
2
by: Nowhere Girl | last post by:
I had to purchase an Adapter USB2 Connect CardBus adapter for my Compaq Presario 2700T notebook (WinXP). I did this because the HP DVD Burner I bought requires USB 2.0. The USB 2.0 wasn't working...
2
by: standard149 | last post by:
Basically, what im attempting to do is add some preliminary procedures onto my usb drive. Currently I have a distro of linux, knoppix in my case, which will boot and run entirely from the drive. I...
3
by: standard149 | last post by:
I posted this under the programming lounge because I beleived this to be more of a question of writing a script then dealing with the OS itself, but id really like some feedback so after an...
1
by: adi | last post by:
Hi Is there a possibility to read/write BIOS values? I develop an application that should start running at 6 a.m. every day, so I need to make sure that the computer will start at that time. So...
0
by: cantelow | last post by:
Hi. We're upgrading from ms access 97 to 2003 and finding that the type-ahead buffer in 2003 can't handle as many characters as we are used to in Access 97. I've found this question only once...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.