Пример #1
0
static void gdb_vmm_npg_unmap(uint8_t *data, size_t len)
{
   uint64_t args[2];

   if(!__gdb_vmm_parse_args(data, len, args, 2))
   {
      gdb_nak();
      return;
   }

   npg_unmap((offset_t)args[0], (offset_t)args[1]);
   gdb_ok();
}
Пример #2
0
static void vm_dev_init()
{
   info->vm.dev.mem.a20 = 1;

   dev_kbd_init(&info->vm.dev.kbd);
   dev_uart_init(&info->vm.dev.uart, SERIAL_COM1);
   dev_ata_init(&info->vm.dev.ata[0], ATA1_START_PORT);

   /* proxify to detect rebase for uart irq injection */
   info->vm.dev.pic1_icw2 = DFLT_PIC1_ICW2;
   __deny_io_range(PIC1_START_PORT, PIC1_END_PORT);

   /* lazzy emulation */
   __deny_io_range(COM1_START_PORT, COM1_END_PORT);

   /* monitor reboot and A20 */
   __deny_io_range(KBD_START_PORT, KBD_END_PORT);
   __deny_io(PS2_SYS_CTRL_PORT_A);

   /* ata filtering */
   /* __deny_io(ATA1_CTRL_PORT); */
   /* __deny_io_range(ATA1_START_PORT, ATA1_END_PORT); */

   /* prevent PCI device detection */
#if defined(CONFIG_HAS_NET) || \
   (defined(CONFIG_HAS_EHCI) && defined(CONFIG_EHCI_2ND))
   __deny_io(PCI_CONFIG_ADDR);
#endif

#if defined(CONFIG_HAS_NET) && defined(CONFIG_HAS_E1000)
   {
      e1k_info_t *e1k = &info->hrd.dev.net.arch;
      npg_unmap(e1k->base.linear, e1k->base.linear + (128<<10));
      debug(E1000, "protect e1000 mmio space [0x%X - 0x%X]\n"
            ,e1k->base.linear, e1k->base.linear + (128<<10));
   }
#endif

   /* super io */
   __deny_io(SIO_INDEX);

   /* acpi PM1_CTL register */
   __deny_io(info->hrd.acpi.pm1_ctl_port);
}