add ctrl alt del

main
Eggert Jung 6 months ago
parent e9500c1b40
commit 383561a4f6

@ -1,6 +1,7 @@
#include "ioapic.h" #include "ioapic.h"
#include "apic.h" #include "apic.h"
#include "core.h" #include "core.h"
#include "../debug/assert.h"
namespace IOAPIC { namespace IOAPIC {
/*! \brief IOAPIC registers memory mapped into the CPU's address space. /*! \brief IOAPIC registers memory mapped into the CPU's address space.
@ -61,13 +62,16 @@ void init() {
void config(uint8_t slot, Core::Interrupt::Vector vector, void config(uint8_t slot, Core::Interrupt::Vector vector,
TriggerMode trigger_mode, Polarity polarity) { TriggerMode trigger_mode, Polarity polarity) {
(void)slot; assert(slot < slot_max);
(void)vector; RedirectionTableEntry entry = readEntry(slot);
(void)trigger_mode; entry.vector = vector;
(void)polarity; entry.trigger_mode = trigger_mode;
entry.polarity = polarity;
writeEntry(slot, entry);
} }
void allow(uint8_t slot) { (void)slot; } void allow(uint8_t slot) {
}
void forbid(uint8_t slot) { (void)slot; } void forbid(uint8_t slot) { (void)slot; }

@ -1,5 +1,6 @@
#include "ps2controller.h" #include "ps2controller.h"
#include "../arch/system.h"
#include "../arch/core_interrupt.h" #include "../arch/core_interrupt.h"
#include "../arch/ioport.h" #include "../arch/ioport.h"
#include "../compiler/fix.h" #include "../compiler/fix.h"
@ -121,6 +122,9 @@ bool fetch(Key &pressed) {
pressed = key_decoder.decode(out_buffer); pressed = key_decoder.decode(out_buffer);
if (pressed.ctrl() && pressed.alt() && pressed.scancode == Key::KEY_DEL)
System::reboot();
if (pressed.alt() || pressed.ctrl() || !pressed.valid()) if (pressed.alt() || pressed.ctrl() || !pressed.valid())
return false; return false;
else else

@ -10,6 +10,8 @@
#include "device/serialstream.h" #include "device/serialstream.h"
#include "device/textstream.h" #include "device/textstream.h"
#include "device/ps2controller.h" #include "device/ps2controller.h"
#include "arch/ioapic.h"
TextStream kout = TextStream(0, 80, 0, 10, true); TextStream kout = TextStream(0, 80, 0, 10, true);
//TextStream dout[8] = { //TextStream dout[8] = {
@ -55,6 +57,9 @@ OutputStream* copyout[Core::MAX]{
&dout[7] &dout[7]
}; };
void test(){
kout << "test" << endl << flush;
}
// Main function // Main function
// (the bootstrap processor starts here)} // (the bootstrap processor starts here)}
@ -112,6 +117,10 @@ extern "C" int main() {
ApplicationProcessor::boot(); ApplicationProcessor::boot();
PS2Controller::init(); PS2Controller::init();
IOAPIC::init();
//IOAPIC::config(Core::Interrupt::KEYBOARD, Core::Interrupt::Vector vect);
Core::Interrupt::enable(); Core::Interrupt::enable();
Key key = Key(); Key key = Key();

Loading…
Cancel
Save