Page 1 of 1

BIOS wait x time for keypress

Posted: Fri Jan 23, 2009 4:28 pm
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?

Re: BIOS wait x time for keypress

Posted: Fri Jan 23, 2009 4:42 pm
by abachler
INT 0x16h Function 0x01h - Check For Keystroke

INT 0x15h Function 0x86h - Wait

Re: BIOS wait x time for keypress

Posted: Fri Jan 23, 2009 5:55 pm
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...