title: Why are interrupts disabled by the boot loader?
body: <p>I am taking a course in Operating Systems. I am booting jos os on to qemu x86 PC emulator. I read that BIOS finds bootable devices and loads the bootloader from the first sector of the bootable device to 0x7c00 in the memory. </p>
  
  <p>The first instruction in the bootloader is to disable the interrupts i.e cli.</p>
  
  <p>I read about cli i.e it clears the enable interrupts flag in the eflags register. I read from Wikipedia that it is done to avoid a race condition between kernel code and interrupt handlers. please explain what a race condition is and what sort of race condition is present here.</p>
  
  <p>I still don't understand why it's done? Can someone elaborate on this?</p>