예제 #1
0
파일: timer.c 프로젝트: ricardorodab/SO
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
  list_init(&dormidos); //PRACTICA1
}
예제 #2
0
파일: timer.c 프로젝트: meyerhog/pintos-cis
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
  list_init(&threadsToWakeUp);
}
예제 #3
0
파일: timer.c 프로젝트: guotai/pintos
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  list_init (&sleep_list);
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
}
예제 #4
0
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void)
{
  list_init(&blocked_pqueue);
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
}
예제 #5
0
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
  list_init (&wait_sema_list);
  sema_init (&sema_calc_tick,1);
}
예제 #6
0
파일: timer.c 프로젝트: nakulj/cs-402
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
  list_init( &sleeping_threads_list ); // Initialize list of sleeping threads
  ASSERT (list_empty (&sleeping_threads_list));
}
예제 #7
0
파일: timer.c 프로젝트: proctopj/CSE381
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");

  /* Initialize list */
  list_init (&waiting_in_line);
}
예제 #8
0
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");

  //initialize sleepingThreads list
  list_init(&sleepingThreads);
}
예제 #9
0
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
#if 1 /* pj1 */
  list_init(&sleep_list);
  lock_init(&sleep_list_lock);
#endif
}
예제 #10
0
파일: timer.c 프로젝트: 2ral/pintos
/* Sets up the timer to interrupt TIMER_FREQ times per second,
   and registers the corresponding interrupt. */
void
timer_init (void) 
{
  pit_configure_channel (0, 2, TIMER_FREQ);
  intr_register_ext (0x20, timer_interrupt, "8254 Timer");
  list_init (&sleeping_list);
  printf("Sleeping list initialized");

  list_init (&wakeup_list);
}
예제 #11
0
파일: speaker.c 프로젝트: GuruKyuu/PintOS
/* Sets the PC speaker to emit a tone at the given FREQUENCY, in
   Hz. */
void
speaker_on (int frequency)
{
    if (frequency >= 20 && frequency <= 20000)
    {
        /* Set the timer channel that's connected to the speaker to
           output a square wave at the given FREQUENCY, then
           connect the timer channel output to the speaker. */
        enum intr_level old_level = intr_disable ();
        pit_configure_channel (2, 3, frequency);
        outb (SPEAKER_PORT_GATE, inb (SPEAKER_PORT_GATE) | SPEAKER_GATE_ENABLE);
        intr_set_level (old_level);
    }
    else
    {
        /* FREQUENCY is outside the range of normal human hearing.
           Just turn off the speaker. */
        speaker_off ();
    }
}