backported fixes from 256boss:
- moved early serial console from 1st to 2nd stage loader, to leave
space for the partition table if needed.
- saving boot_drive_number for later use.
- fixed floppy motor turnoff after 2nd stage loader is done.
- saving of carry flag before returning from int86.
- added functions in intr.h/intr.c to manipulate the PIC IRQ masks.
- restoring irq masks after returning from int86.
- keyboard controller voodoo: do a single read after returning from
int86 to clear any pending inputs that would otherwise clog the
buffer and we'd never get an interrupt again from the keyboard.