473,948 Members | 15,319 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1917
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.p rogramming

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.goo glegroups.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=0x040 0 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
43149
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 (or would HDD be better, or both?) and put that info into VB prog so the program won't work on another computer. My program uses an MSAccess table. Much appreciated if you can help! Thanks
1
5449
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 question in this case is: Do you know of a good place to read about a way to access the BIOS using C/C++ or a way to access the CMOS. If i remember a part of the BIOS is copied in the 640K-1MB area of the RAM, but what about the CMOS data ?
10
3109
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
1796
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 suggestions on how to do this?
2
1638
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 and after talking to a tech support at Adaptec, I found out that by going to Start>Run>msinfo32, I have too many items under IRQ9 which is listed under BIOS Version/Date (which is, btw: Phoenix Technologies LTD 4.06,8/14/2002). The tech support...
2
4033
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 really would like to streamline the entire process of booting a machine into knoppix (Shutting down, rebooting into bios, changing boot order). What I have so far is an autorun to open my batch file containg psshutdown. I chose this app as it...
3
4327
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 suggestion im posting it here. 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 really would like to...
1
5260
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 I thought that setting this value each time the app starts will reduce the possibility that someone changed this value (I am not allowed to password-protect the BIOS, so anyone will be able to modify this value). Windows modifies the BIOS when...
0
1545
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 in the archives, with no response, and no entries at all in the ms knowledgebase, so I must be missing something very basic or have done something obscure. Is there a setting somewhere I have missed that can increase the size of the buffer for...
0
10169
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9989
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11589
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
11358
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9900
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8261
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4545
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.