Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-03-2009, 12:49 PM
|
#1
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Rep: 
|
function to read keyboard from withen my kernel not working
for some reason that i can not see when i call read_keyboard()
it locks the machine in both the debugger and bootloaded
here is the disassembley:
Code:
push bp
mov bp,sp
sub sp,0002
xor ax,ax
int 16
mov ah,00
mov [bp-02],ax
mov al,[bp-02]
jmp j0001
j0001:
mov sp,bp
pop bp
ret
original C:
Code:
unsigned char read_keyboard(){
int al;
_AX = 0;
asm {int 16h}
al=_AL;
return al;
}
it does not make sense
i am positive this is how you read from the keyboard
Last edited by smeezekitty; 10-03-2009 at 12:51 PM.
|
|
|
|
10-03-2009, 08:59 PM
|
#2
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Original Poster
Rep: 
|
Hello World!
Lets all play drive over the BUMP
|
|
|
|
10-03-2009, 10:30 PM
|
#3
|
|
Member
Registered: Sep 2009
Distribution: Fedora
Posts: 835
Rep: 
|
Quote:
Originally Posted by smeezekitty
for some reason that i can not see when i call read_keyboard()
it locks the machine in both the debugger and bootloaded
here is the disassembley:
Code:
push bp
mov bp,sp
sub sp,0002
xor ax,ax
int 16
mov ah,00
mov [bp-02],ax
mov al,[bp-02]
jmp j0001
j0001:
mov sp,bp
pop bp
ret
original C:
Code:
unsigned char read_keyboard(){
int al;
_AX = 0;
asm {int 16h}
al=_AL;
return al;
}
it does not make sense
i am positive this is how you read from the keyboard
|
It is. But first you have to check the keyboard buffer to see if there are any characters available. It seems the routine is waiting for you to hit a key, and won't return until you do. Naturally enough this locks up the entire machine.
You may want to delay the promised release date for your replacement for Linux.
|
|
|
|
10-03-2009, 11:12 PM
|
#4
|
|
Senior Member
Registered: Sep 2009
Location: Washington U.S.
Distribution: Damn Small Linux, KateOs, M$ Ickdows Vista, My own OS
Posts: 2,136
Original Poster
Rep: 
|
i never said it was a replacement to linux
and i want it to wait for a key
the thing is it never returns even if you press a key
i had i working for a second then it stopped
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:09 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|