Strange problem with loop
Posted: Sat Apr 29, 2006 9:36 pm
I am rewriting my keyboard driver (again) and I have ran into this problem: I have a loop in my getchar() function that waits until a key is pressed:
The problem is that this just keeps looping forever. However, for some reason, this following code works perfectly, but it fills the screen with "2"s:
I can't get it to work unless I print the 2s.... Why is this?
Thanks,
-Stephen
Code: Select all
while(keypressed!=1)
{
__asm__ __volatile__("hlt");
}
Code: Select all
while(keypressed!=1)
{
__asm__ __volatile__("hlt");
puts("2");
}
Thanks,
-Stephen