add pit indicator
This commit is contained in:
@ -25,6 +25,16 @@
|
||||
void PIT::interval (int us) {
|
||||
|
||||
/* hier muss Code eingefuegt werden */
|
||||
|
||||
IOport control(0x43);
|
||||
control.outb(0x36); // Zähler 0 Mode 3
|
||||
|
||||
unsigned int cntStart = (1193180.0 / 1000000.0) * us; // 1.19Mhz PIT
|
||||
|
||||
IOport data0(0x40);
|
||||
data0.outb(cntStart & 0xFF); // Zaehler-0 laden (Lobyte)
|
||||
data0.outb(cntStart >> 8); // Zaehler-0 laden (Hibyte)
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -40,6 +50,8 @@ void PIT::plugin () {
|
||||
|
||||
/* hier muss Code eingefuegt werden */
|
||||
|
||||
intdis.assign(IntDispatcher::timer, *this);
|
||||
pic.allow(PIC::timer);
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +75,20 @@ void PIT::trigger () {
|
||||
// und ein weiterer Thread rechnen moechte
|
||||
|
||||
/* hier muss Code eingefuegt werden */
|
||||
|
||||
// Indicator
|
||||
if (systime - this->last_indicator_refresh >= 10) {
|
||||
this->indicator_pos = (this->indicator_pos + 1) % 4;
|
||||
kout.show(79, 0, this->indicator[this->indicator_pos]);
|
||||
this->last_indicator_refresh = systime;
|
||||
}
|
||||
|
||||
// Preemption
|
||||
if (scheduler.isInitialized()) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user