예제 #1
0
파일: kernel.c 프로젝트: egbertH/EgGS
void kmain(unsigned long magic, multiboot_info_t * mbi)
{
   if (magic != MULTIBOOT_BOOTLOADER_MAGIC)
   {
      printk ("Invalid magic number: 0x%x\n", (unsigned) magic);
      return;
   }

   gdt_install();
   idt_install();
   
   init_video();
   isrs_install();
   irq_install();
   timer_install();
   
   sys_setup(mbi);

   test_inode();
   
   __asm__ __volatile__ ("sti");

   printk("EgGS:hello there!\n");

//   int i = 10 / 0;

   for (;;);
}
예제 #2
0
파일: test.c 프로젝트: ISLEcode/kornshell
int test_binop(Shell_t *shp,register int op,const char *left,const char *right)
{
	register double lnum,rnum;
	if(op&TEST_ARITH)
	{
		while(*left=='0')
			left++;
		while(*right=='0')
			right++;
		lnum = sh_arith(shp,left);
		rnum = sh_arith(shp,right);
	}
	switch(op)
	{
		/* op must be one of the following values */
		case TEST_AND:
		case TEST_OR:
			return(*left!=0);
		case TEST_PEQ:
			return(test_strmatch(shp, left, right));
		case TEST_PNE:
			return(!test_strmatch(shp, left, right));
		case TEST_SGT:
			return(strcoll(left, right)>0);
		case TEST_SLT:
			return(strcoll(left, right)<0);
		case TEST_SEQ:
			return(strcmp(left, right)==0);
		case TEST_SNE:
			return(strcmp(left, right)!=0);
		case TEST_EF:
			return(test_inode(left,right));
		case TEST_NT:
			return(test_time(left,right)>0);
		case TEST_OT:
			return(test_time(left,right)<0);
		case TEST_EQ:
			return(lnum==rnum);
		case TEST_NE:
			return(lnum!=rnum);
		case TEST_GT:
			return(lnum>rnum);
		case TEST_LT:
			return(lnum<rnum);
		case TEST_GE:
			return(lnum>=rnum);
		case TEST_LE:
			return(lnum<=rnum);
	}
	/* NOTREACHED */
	return(0);
}