Beispiel #1
0
int kmain (void){
	init_hw();
  	uart_init();
  	
	/*-- INPUT --*/
	//char buffer[32];
  	//uart_receive_str(buffer, 32);  //read

	/*-- PROCESS --*/
	create_process(funcA, NULL, STACK_SIZE,0);
	create_process(funcB, NULL, STACK_SIZE,0);
	create_process(functC,NULL,STACK_SIZE,1);
	
	/*-- virtual memory --*/
	//init_kern_translation_table();

	//configure_mmu_C();
	//start_mmu_C();

	//uint32_t* pt = (uint32_t*)vMem_Alloc(1);
	//*pt = sizeof(uint32_t);
	//uint32_t* pt = 0x500000;
	
	/*-- start --*/
	start_sched();

	while(1){}
	/* Pas atteignable vues nos 2 fonctions */
	return 0;
  
}
Beispiel #2
0
//------------------------------------------------------------------------
int start_kernel ( void ) {
    malloc_init((void*) HEAP_START);
    init_priorities();
    
    // Initializing the elements
    int unsorted[MAX_SIZE];
    unsorted[0] = 3;
    unsorted[1] = 8;
    unsorted[2] = 6;
    unsorted[3] = 2;
    unsorted[4] = 4;
    unsorted[5] = 1;
    unsorted[6] = 12;
    unsorted[7] = 10;

    int i;
    for (i = 0; i < MAX_SIZE; i++) {
        create_process(sort, (void*) unsorted[i], 2);
    }

    sem_init(&insert_sem, 1);

    start_sched();

    return(0);
}
Beispiel #3
0
int main(int argc, char *argv[])
{
  sem_init(&gsem,1);
  create_ctx(16384, f_ping, NULL);
  create_ctx(16384, f_pong, NULL);
  start_sched();
  for(;;);
  exit(EXIT_SUCCESS);
}
Beispiel #4
0
//------------------------------------------------------------------------
int kmain ( void )
{
	init_hw();
	create_process(funcB, NULL, STACK_SIZE);
	create_process(funcA, NULL, STACK_SIZE);
	start_sched();
	ctx_switch();
	/* Pas atteignable vu nos 2 fonctions */
	return 0;
}
Beispiel #5
0
int main(int argc, char *argv[])
{
  create_ctx(16384, f_ping, NULL);
  create_ctx(16384, f_pong, NULL);
  start_sched();
  // le sleep sert a attendre 1 seconde, dans le cas contraire, l'application fini trop vite pour pouvoir réaliser le ping pong
  sleep(1000);
  printf("\ntest retour au main\n");
  exit(EXIT_SUCCESS);
}
Beispiel #6
0
int main(void){
  sem_init(&mutex, 1);                /* controle d'acces au tampon */
  sem_init(&vide, N);                 /* nb de places libres */
  sem_init(&plein, 0);                /* nb de places occupees */
  create_ctx(16384, producteur, NULL);
  create_ctx(16384, consommateur, NULL);
  start_sched();
  printf("\ntest retour au main\n");

return EXIT_SUCCESS;
}
int main(int argc,char* argv[]){
    
  if(setjmp(proc[INIT_PROC].buf) == 0) {
    start_sched();
  }
  else {
    printf("\n\n\n ****************** Retour au main, fin du programme ***************** \n\n\n");
  }

  return EXIT_SUCCESS;
}
Beispiel #8
0
//------------------------------------------------------------------------
int start_kernel ( void ) {
    malloc_init((void *) HEAP_START);

    create_process(&funcOne, (void*) 0);
    create_process(&funcTwo, (void*) 0);

    sem_init(&sem_test, 1);
    
    start_sched();

    /* Pas atteignable vues nos 2 fonctions */
    return(0);
}
Beispiel #9
0
int main(int argc, char *argv[])
{
	int retour=0;	
	init();
	/*Spawn du module Traduction*/
	retour+=create_ctx(16384, lancerTraducteur, NULL);
	/*Spawn du module Actionneur*/
	retour+=create_ctx(16384, lancerActionneur, NULL);
	if(retour==0)
	{
		start_sched();
		exit(EXIT_SUCCESS);
	}
	exit(EXIT_FAILURE);
}
Beispiel #10
0
//------------------------------------------------------------------------
int
notmain ( void )
{
	malloc_init((void *) HEAP_START);

	music_init();

	create_process(processus_A, 128);
	create_process(processus_A, 128);

	create_process(play_music, 2048);

	create_process(processus_B, 128);
	create_process(processus_B, 128);

	start_sched();

	return(0);
}
Beispiel #11
0
//------------------------------------------------------------------------
int
notmain ( void )
{


  	DISABLE_IRQ();
  	init_hw();
  	malloc_init( (void*)0x50000);

	//On cree les deux processus
	create_process(STACK_SIZE,funcA, NULL,2);
	create_process(STACK_SIZE,funcB, NULL,2);
	create_process(STACK_SIZE,funcC, NULL,1);
	
	//On lance l'ordonnanceur	
	start_sched();
	
	/* Pas atteignable vues nos 2 fonctions */
	return(0);
}
Beispiel #12
0
void main(struct multiboot *mboot) {

    int rc;

    /* init the kmsg buffer and printk */
    console_sys_init();
    kmsg_init();
    console_register(&kmsg_con);

    /* arch might want to setup stuff */
    arch_early_init();

    printk("kmsg: buffer setup!\n");

    printk("sys: kernel relocation: 0x%x -> 0x%x  size 0x%x\n",
        &kernel_base, &kernel_end, 
        (uintptr_t)&kernel_end - (uintptr_t)&kernel_base);

    parse_multiboot(mboot);

    paging_fini();

    heap_install();

    /* arch should finish init now */
    arch_late_init();

    printk("sys: init done!\n");

    drivers_init();
    do_mount();
    do_test();
    syscall_init();
    /* wait forever */
    asm volatile("mov $0x1337, %eax");
    asm volatile("mov $0x1337, %ebx");
    asm volatile("mov $0x1337, %ecx");
    asm volatile("mov $0x1337, %edx");
    start_sched();
    panic("finished with main, but no idle task was started\n");
}
Beispiel #13
0
int main(int argc, char *argv[])
{
  /*create the context for all the fonctions*/
  /*create_ctx(16384, f_ping, NULL);
    create_ctx(16384, f_pong, NULL);*/
  create_ctx(16384, producteur, NULL);
  create_ctx(16384, consommateur, NULL);

  /*initialise the semaphore*/
  mutex = malloc(sizeof(struct sem_s));
  sem_init(mutex, 1);
  fullSem = malloc(sizeof(struct sem_s));
  sem_init(fullSem, 0);
  emptySem = malloc(sizeof(struct sem_s));
  sem_init(emptySem, 1);

  /*start the schedule*/
  start_sched();
  printf("je suis revenu dans le main\n");
  exit(EXIT_SUCCESS);
}
Beispiel #14
0
//------------------------------------------------------------------------
int
notmain ( void )
{
  hw_init();
  music_init();

  /* hw_init(); */
  /* led_init(); */
  /* switch_init(); */

  /* play_music(); */
  create_ctx(processus_A, NULL, 128);
  create_ctx(processus_A, NULL, 128);

  create_ctx(play_music, NULL, 2048);

  create_ctx(processus_B, NULL, 128);
  create_ctx(processus_B, NULL, 128);

  start_sched();

  return(0);
}