コード例 #1
0
ファイル: space_border.c プロジェクト: DieterKoblenz/aspace
/*
 * Alerts any space-object that is in range of the inbound or outbound border crossing
 */
void alert_border_cross (int x, int a, int way)
{
	register int i;

	if (sdb[x].move.out != 0.0)
		for (i = MIN_SPACE_OBJECTS; i <= max_space_objects; ++i)
			if (sdb[i].status.active)
				 if (sdb[i].space == sdb[x].space)
					if (sdb[i].move.empire == a)
						if (i != x)
							if (sdb2range(x, i) < MAX_NOTIFICATION_DISTANCE) {
								if (way) {
									console_message(i, "helm science security",
									  ansi_warn(tprintf("Inbound border crossing reported at %.3f %.3f %.3f",
									  su2pc(sdb[x].coords.x - sdb[i].coords.xo),
									  su2pc(sdb[x].coords.y - sdb[i].coords.yo),
									  su2pc(sdb[x].coords.z - sdb[i].coords.zo))));
								} else
									console_message(i, "helm science security",
									  ansi_warn(tprintf("Outbound border crossing reported at %.3f %.3f %.3f",
									  su2pc(sdb[x].coords.x - sdb[i].coords.xo),
									  su2pc(sdb[x].coords.y - sdb[i].coords.yo),
									  su2pc(sdb[x].coords.z - sdb[i].coords.zo))));
							}
	return;
}
コード例 #2
0
ファイル: pm.c プロジェクト: Nakrez/zOS
void pm_setup(void)
{
    cr0_set(cr0_get() | CR0_PM);

    cs_set(KERNEL_CS);
    ds_set(KERNEL_DS);
    es_set(KERNEL_DS);
    fs_set(KERNEL_DS);
    gs_set(KERNEL_DS);
    ss_set(KERNEL_DS);

    console_message(T_OK, "Kernel now running in protected-mode");
}
コード例 #3
0
ファイル: timer.c プロジェクト: Nakrez/zOS
int i386_pc_timer_initialize(void)
{
    int err;

    pit_initialize();

    err = interrupt_register(PIC_IRQ_PIT, INTERRUPT_CALLBACK, timer_handler);
    if (err < 0) {
        console_message(T_ERR, "Unable to register timer handler");
        return err;
    }

    return 0;
}
コード例 #4
0
ファイル: interrupt.c プロジェクト: Nakrez/zOS
void interrupt_dispatch(struct irq_regs *regs)
{
    /*
     * FIXME: we use reg->irq_num and reg->irq_data that must be here
     * for every architecture ....
     */
    interrupt_acnowledge(regs->irq_num);

    if (regs->irq_num >= MAX_IRQ_NUMBER)
        kernel_panic("Invalid IRQ number");

    if (interrupt_entries[regs->irq_num].type == INTERRUPT_CALLBACK)
        interrupt_entries[regs->irq_num].callback(regs);
    else
        console_message(T_INF, "Unhandled IRQ %i fired with data = 0x%x",
                        regs->irq_num, regs->irq_data);

}
コード例 #5
0
ファイル: space_border.c プロジェクト: DieterKoblenz/aspace
/* Alerts the ship when it has departed an empires space */
void alert_exit_empire (int x)
{
	console_message(x, "helm", ansi_alert(tprintf("Departing %s space", unparse_empire(x))));
	return;
}
コード例 #6
0
ファイル: space_border.c プロジェクト: DieterKoblenz/aspace
/* Alerts the ship when it has entered an empires space */
void alert_enter_empire (int x)
{
	console_message(x, "helm", 	ansi_warn(tprintf("Entering %s space", unparse_empire(x))));
	return;
}