Exemplo n.º 1
0
/** loop() - to show a beautiful clock in "off"-Mode
 * will be shown, if the user pushes the "left" button for 1 sec
 * and the ignition is off. A permanent Voltage supply is
 * required for this clock
 */
void speedo_clock::loop(){
	if(pSpeedo->disp_zeile_bak[0]!=1){
		pSpeedo->disp_zeile_bak[0]=1;
		pOLED->clear_screen();
		char temp[9];
		sprintf(temp,"%02i:%02i:%02i",m_hh,m_mm,m_ss);
		pOLED->string(VISITOR_SMALL_2X_FONT,temp,CLOCKMODE_COL,CLOCKMODE_ROW);
	};

	// hour
	if((pSpeedo->disp_zeile_bak[1])!=m_hh){
		pSpeedo->disp_zeile_bak[1]=m_hh;
		char temp[3];
		sprintf(temp,"%02i",m_hh);
		pOLED->string(VISITOR_SMALL_2X_FONT,temp,CLOCKMODE_COL,CLOCKMODE_ROW);
	};

	// min
	if((pSpeedo->disp_zeile_bak[2])!=m_mm){
		pSpeedo->disp_zeile_bak[2]=m_mm;
		char temp[3];
		sprintf(temp,"%02i",m_mm);
		pOLED->string(VISITOR_SMALL_2X_FONT,temp,CLOCKMODE_COL+6,CLOCKMODE_ROW);
	};

	// sec
	if((pSpeedo->disp_zeile_bak[3])!=get_ss()){
		pSpeedo->disp_zeile_bak[3]=get_ss();
		char temp[3];
		sprintf(temp,"%02i",m_ss);
		pOLED->string(VISITOR_SMALL_2X_FONT,temp,CLOCKMODE_COL+12,CLOCKMODE_ROW);
	};

};
Exemplo n.º 2
0
void trap_dump(const struct trap_state *st)
{
	int from_user = (st->cs & 3) || (st->eflags & EFL_VM);
	int i;

	printf("Dump of trap_state at %p:\n", st);
	printf("EAX %08x EBX %08x ECX %08x EDX %08x\n",
		st->eax, st->ebx, st->ecx, st->edx);
	printf("ESI %08x EDI %08x EBP %08x ESP %08x\n",
		st->esi, st->edi, st->ebp,
		from_user ? st->esp : (unsigned)&st->esp);
	printf("EIP %08x EFLAGS %08x\n", st->eip, st->eflags);
	printf("CS %04x SS %04x DS %04x ES %04x FS %04x GS %04x\n",
		st->cs & 0xffff, from_user ? st->ss & 0xffff : get_ss(),
		st->ds & 0xffff, st->es & 0xffff,
		st->fs & 0xffff, st->gs & 0xffff);
	if (st->eflags & EFL_VM)
		printf("v86:            DS %04x ES %04x FS %04x GS %04x\n",
			st->v86_ds & 0xffff, st->v86_es & 0xffff,
			st->v86_gs & 0xffff, st->v86_gs & 0xffff);
	printf("trapno %d, error %08x, from %s mode\n",
		st->trapno, st->err, from_user ? "user" : "kernel");
	if (st->trapno == T_PAGE_FAULT)
		printf("page fault linear address %08x\n", st->cr2);

	/* Dump the top of the stack too.  */
	if (!from_user)
	{
		for (i = 0; i < 32; i++)
		{
			printf("%08x%c", (&st->esp)[i],
				((i & 7) == 7) ? '\n' : ' ');
		}
	}
}
Exemplo n.º 3
0
/* c_intr_sysall ------------------------------------------------------------*/
W
c_intr_syscall(unsigned long apic, unsigned long sysid,
		unsigned long arg1, unsigned long arg2, unsigned long arg3,
		unsigned long arg4, unsigned long arg5, unsigned long arg6,
		unsigned long arg7)
{
#if 0
	extern unsigned long	k_nest;
	short	cs = get_cs();
	short	ds = get_ds();
	short	ss = get_ss();
#endif
	W	ret;

	if (apic)
		apic = 1;
	if (cpu_num == 0)
		apic = 0;
#if 0
	(*tron_syscall_p)(sysid, arg1, arg2, arg3);
	printk("SYSCALL(%x, %x, %x, %x, %x)\n", sysid, apic, arg1, arg2, arg3);
	printk("SYSCALL(%x, %x, %x, %x)\n", sysid, apic, c_tskid[apic], arg1);
	printk("c_tskid = %x, cuurentproc-id = %x(%x)\n", c_tskid[apic],
		current_proc[apic]->id, k_nest);
#else
	ret = tron_syscall(apic, sysid,
			arg1, arg2, arg3, arg4, arg5, arg6, arg7);
	current_proc[apic]->reg[EAX] = ret;	/* set return value */
	return ret;
#endif
}
Exemplo n.º 4
0
static void intr_79(struct intr_frame *frame) {
  (void)frame;
  intr_79_counter += 1;
  print_intr_frame("intr 79:", frame);
  ac_printf(" ss: %x\n", get_ss());
  ac_printf(" sp: %p\n", get_sp());
  ac_printf(" intr_79_counter=%d\n", intr_79_counter);
}
Exemplo n.º 5
0
int main(int argc, char *argv[])
{
	char *device = NULL;
	int port = 666;
	int ch;
	int chan = 1;
	struct sstate *ss = get_ss();

	memset(ss, 0, sizeof(*ss));
	ss->ss_clients.c_next = ss->ss_clients.c_prev = &ss->ss_clients;

	while ((ch = getopt(argc, argv, "p:d:hc:v:")) != -1) {
		switch (ch) {
		case 'p':
			port = atoi(optarg);
			break;

		case 'd':
			device = optarg;
			break;

		case 'v':
			ss->ss_level = atoi(optarg);
			break;

		case 'c':
			chan = atoi(optarg);
			break;

		case 'h':
		default:
			usage(argv[0]);
			break;
		}
	}

        signal(SIGPIPE, sighandler);

	if (!device || chan <= 0)
		usage(argv[0]);

	serv(ss, device, port, chan);

	exit(0);
}
Exemplo n.º 6
0
Arquivo: build.cpp Projeto: qzlshy/smc
int Build_s::build(Build_m m_c,Read_res r_r,Res_rtm rt)
{
 get_ss(m_c,r_r);
 get_cs(rt);
 rt_fit(m_c);
}