BIOS wait x time for keypress

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

BIOS wait x time for keypress

Post by Firestryke31 »

I'm kind of bored, and somewhat enjoy the restrictions of bootsector programming. On top of that, my laptop's current boot system is rather horrid in getting Windows Vista, Firebird (my OS), and Leopard 10.5.6 all working nicely with each other. So I decided to try writing an MBR just for the fun of it. It should, in theory, be easier than writing my FAT32 bootloader.

My current problem is this: I want to wait 3 seconds for the user to press F8, and if they do, I want to do one thing, but if not, I want to do something else. Unfortunately, a quick Google gave me "Halt the program X amount of time" or "Halt the program until a key is pressed." What's the easiest way to do this?
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
User avatar
abachler
Member
Member
Posts: 33
Joined: Thu Jan 15, 2009 2:21 pm

Re: BIOS wait x time for keypress

Post by abachler »

INT 0x16h Function 0x01h - Check For Keystroke

INT 0x15h Function 0x86h - Wait
User avatar
Firestryke31
Member
Member
Posts: 550
Joined: Sat Nov 29, 2008 1:07 pm
Location: Throw a dart at central Texas
Contact:

Re: BIOS wait x time for keypress

Post by Firestryke31 »

Thanks! I didn't notice the "Check for keypress" function in int 16h, and I thought I was probably going to have to use int 15h ah:86h in a loop. It's not as painful as I thought it would be...
Owner of Fawkes Software.
Wierd Al wrote: You think your Commodore 64 is really neato,
What kind of chip you got in there, a Dorito?
Post Reply