You're in protected mode, so the BIOS functions... do not function
. Especially if you've moved the IDT to a different place.
The reason you're causing an exception is because you're calling one directly! Interrupt 31 is classified as a reserved exception (in protected and long mode) by Intel, and if you call it, then it'll occur, and an emulator would report it as an exception
. There'd probably be no code to handle it, leading to a triple fault, and crashing the computer.
Here's an article on using the Real Time Clock (if you want to get the date and time), and
here's an article on using the Programmable Interval Timer (PIT) to generate an interrupt at set time intervals.
Good luck
EDIT: Damn, I'm slow at replying. TroyMartin, don't be too hard on him. From his previous posts, he seems like a welcome change to the regular how-2-rite-os!? n00bs that we usually have. How many of us were actually aware of the functionality of 16-bit real mode and programming the PIT before we started OSDev?