Skip to content

Instantly share code, notes, and snippets.

@mfleming
Created April 16, 2015 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfleming/5fb77eb761ae0fd0c64a to your computer and use it in GitHub Desktop.
Save mfleming/5fb77eb761ae0fd0c64a to your computer and use it in GitHub Desktop.
grub empty IDT
struct grub_cpu_idt_descriptor
{
grub_uint16_t limit;
grub_uint32_t base;
} __attribute__ ((packed));
static struct grub_cpu_idt_descriptor no_idt __attribute__((aligned(16)));
/* The main routine. */
void __attribute__ ((noreturn))
grub_main (void)
{
void (*fo)(void) = NULL;
asm volatile ("lidt %0" :: "m" (no_idt));
fo();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment