Working PIT irqs, fix GDT bugs

This commit is contained in:
2025-12-09 17:14:01 +01:00
parent 9c8946de51
commit 64b14f3878
16 changed files with 382 additions and 138 deletions

View File

@ -33,22 +33,33 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/cpu.h>
#include <sys/serialdbg.h>
#include <sys/halt.h>
#include <sys/pit.h>
#include <sys/isr.h>
#include <sys/pic.h>
#include <config.h>
void except_fini(struct trapframe *tf) {
dbgf("EXCEPTION %u\n", tf->trapno);
/* dbgf("trapframe:\n"); */
/* dbgf("ds =%08x, edi=%08x, esi=%08x, ebp=%08x\n", */
/* tf->ds, tf->edi, tf->esi, tf->ebp); */
/* dbgf("esp=%08x, ebx=%08x, edx=%08x, ecx=%08x\n", */
/* tf->esp, tf->ebx, tf->edx, tf->ecx); */
/* dbgf("trp=%08x, erc=%08x, eip=%08x, cs =%08x\n", */
/* tf->trapno, tf->ec, tf->eip, tf->cs); */
/* dbgf("efl=%08x, usp=%08x, uss=%08x, cr3=%08x\n", */
/* tf->eflags, tf->uesp, tf->uss, tf->cr3); */
dbgf("trapframe:\n");
dbgf("ds =%08x, edi=%08x, esi=%08x, ebp=%08x\n",
tf->ds, tf->edi, tf->esi, tf->ebp);
dbgf("esp=%08x, ebx=%08x, edx=%08x, ecx=%08x\n",
tf->esp, tf->ebx, tf->edx, tf->ecx);
dbgf("trp=%08x, erc=%08x, eip=%08x, cs =%08x\n",
tf->trapno, tf->ec, tf->eip, tf->cs);
dbgf("efl=%08x, usp=%08x, uss=%08x\n",
tf->eflags, tf->uesp, tf->uss);
halt();
}
void irq_fini(struct trapframe *tf) {
dbgf("IRQ %u\n", tf->trapno);
if (tf->trapno == ISR_PIT) {
ticks_increment();
goto done;
}
done:
pic_fini(tf->trapno);
return;
}