Merge branch 'main' of gitlab.ibr.cs.tu-bs.de:vss/teaching/ss25/v_bsb1/Gruppe_018

main
Eggert Jung 6 months ago
commit ecc3b1011d

1
.gitignore vendored

@ -1,3 +1,4 @@
.build* .build*
/build* /build*
/tools/qemu.mk /tools/qemu.mk
/tools/remote.mk

@ -28,7 +28,7 @@ constexpr uintptr_t FLAG_ENABLE = 1 << 9;
* *
* \see [ISDMv3, 6.15 Exception and Interrupt * \see [ISDMv3, 6.15 Exception and Interrupt
* Reference](intel_manual_vol3.pdf#page=203) * Reference](intel_manual_vol3.pdf#page=203)
* \todo(12) Add Keyboard and Panic vector numbers * \todo
*/ */
enum Vector { enum Vector {
// Predefined Exceptions // Predefined Exceptions
@ -67,6 +67,8 @@ enum Vector {
SECURITY_EXCEPTION = 31, SECURITY_EXCEPTION = 31,
// Interrupts // Interrupts
Keyboard=32,
PANIC=33
}; };
constexpr size_t VECTORS = 256; constexpr size_t VECTORS = 256;

@ -11,4 +11,27 @@ handle_keyboard_asm:
; continue. The C++ compiler will only generates code to preserve ; continue. The C++ compiler will only generates code to preserve
; non-scratch registers in the high-level interrupt handler -- the scratch ; non-scratch registers in the high-level interrupt handler -- the scratch
; registers have to be saved (and restored later) manually! ; registers have to be saved (and restored later) manually!
; TODO(12): Implement the context save and restore for the keyboard interrupt ; TODO: Implement the context save and restore for the keyboard interrupt
;
;
push rax;
push rdi;
push rsi;
push rdx;
push rcx;
push r8;
push r9;
push r10;
push r11;
call handle_keyboard;
pop r11;
pop r10;
pop r9;
pop r8;
pop rcx;
pop rdx;
pop rsi;
pop rdi;
pop rax;
iret ;

@ -68,7 +68,9 @@ enum PAGE_FAULT_ERROR {
void handle_keyboard() {} void handle_keyboard() {}
[[gnu::interrupt]] void handle_panic(InterruptContext *context) { [[gnu::interrupt]] void handle_panic(InterruptContext *context) {
(void)context; DBG << "Generic KernelPanic triggered"<< endl;
printContext(context);
kernelpanic("Generic Panic Triggerd");
} }
[[gnu::interrupt]] void handle_timer(InterruptContext *context) { [[gnu::interrupt]] void handle_timer(InterruptContext *context) {

@ -82,7 +82,7 @@ void handle_keyboard();
/*! \brief handle_panic /*! \brief handle_panic
* *
* \todo(12) Trigger a kernel panic * \todo Trigger a kernel panic
*/ */
[[gnu::interrupt]] void handle_panic(InterruptContext *context); [[gnu::interrupt]] void handle_panic(InterruptContext *context);

Loading…
Cancel
Save