Пример #1
0
void debugger_init(running_machine &machine)
{
    /* only if debugging is enabled */
    if (machine.debug_flags & DEBUG_FLAG_ENABLED)
    {
        machine_entry *entry;

        /* initialize the submodules */
        machine.m_debug_view.reset(global_alloc(debug_view_manager(machine)));
        debug_cpu_init(machine);
        debug_command_init(machine);
        debug_console_init(machine);

        /* allocate a new entry for our global list */
        machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(debugger_exit), &machine));
        entry = global_alloc(machine_entry);
        entry->next = machine_list;
        entry->machine = &machine;
        machine_list = entry;

        /* register an atexit handler if we haven't yet */
        if (!atexit_registered)
            atexit(debugger_flush_all_traces_on_abnormal_exit);
        atexit_registered = TRUE;

        /* listen in on the errorlog */
        machine.add_logerror_callback(debug_errorlog_write_line);

        /* initialize osd debugger features */
        machine.osd().init_debugger();
    }
}
Пример #2
0
void debugger_init(running_machine *machine)
{
	/* only if debugging is enabled */
	if (machine->debug_flags & DEBUG_FLAG_ENABLED)
	{
		machine_entry *entry;

		/* initialize the submodules */
		debug_cpu_init(machine);
		debug_command_init(machine);
		debug_console_init(machine);
		debug_view_init(machine);
		debug_comment_init(machine);

		/* always initialize the internal render debugger */
		debugint_init(machine);

		/* allocate a new entry for our global list */
		add_exit_callback(machine, debugger_exit);
		entry = global_alloc(machine_entry);
		entry->next = machine_list;
		entry->machine = machine;
		machine_list = entry;

		/* register an atexit handler if we haven't yet */
		if (!atexit_registered)
			atexit(debugger_flush_all_traces_on_abnormal_exit);
		atexit_registered = TRUE;

		/* listen in on the errorlog */
		add_logerror_callback(machine, debug_errorlog_write_line);
	}
}
Пример #3
0
/** Entry point of the test kernel.
 * @param magic         KBoot magic number.
 * @param tags          Tag list pointer. */
void kmain(uint32_t magic, kboot_tag_t *tags) {
    debug_console_init();

    if (magic != KBOOT_MAGIC) {
        printf("Incorrect magic number 0x%x\n", magic);
        while (true)
            arch_pause();
    }

    mm_init(tags);
    primary_console_init(tags);

    printf("Test kernel loaded: magic: 0x%x, tags: %p\n", magic, tags);

    while (tags->type != KBOOT_TAG_NONE) {
        switch (tags->type) {
        case KBOOT_TAG_CORE:
            dump_core_tag((kboot_tag_core_t *)tags);
            break;
        case KBOOT_TAG_OPTION:
            dump_option_tag((kboot_tag_option_t *)tags);
            break;
        case KBOOT_TAG_MEMORY:
            dump_memory_tag((kboot_tag_memory_t *)tags);
            break;
        case KBOOT_TAG_VMEM:
            dump_vmem_tag((kboot_tag_vmem_t *)tags);
            break;
        case KBOOT_TAG_PAGETABLES:
            dump_pagetables_tag((kboot_tag_pagetables_t *)tags);
            break;
        case KBOOT_TAG_MODULE:
            dump_module_tag((kboot_tag_module_t *)tags);
            break;
        case KBOOT_TAG_VIDEO:
            dump_video_tag((kboot_tag_video_t *)tags);
            break;
        case KBOOT_TAG_BOOTDEV:
            dump_bootdev_tag((kboot_tag_bootdev_t *)tags);
            break;
        case KBOOT_TAG_LOG:
            dump_log_tag((kboot_tag_log_t *)tags);
            break;
        case KBOOT_TAG_SECTIONS:
            dump_sections_tag((kboot_tag_sections_t *)tags);
            break;
        case KBOOT_TAG_BIOS_E820:
            dump_bios_e820_tag((kboot_tag_bios_e820_t *)tags);
            break;
        case KBOOT_TAG_EFI:
            dump_efi_tag((kboot_tag_efi_t *)tags);
            break;
        }

        tags = (kboot_tag_t *)round_up((ptr_t)tags + tags->size, 8);
    }

    printf("Tag list dump complete\n");

    #if defined(__i386__) || defined(__x86_64__)
        __asm__ volatile("wbinvd");
    #endif

    while (true)
        arch_pause();
}