mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2024-11-22 06:06:52 -08:00
Merge pull request #35 from gbowne1/gbowne1-fixes-interrupts
Fixing interrupts
This commit is contained in:
commit
5c2e3146a6
6
.vscode/c_cpp_properties.json
vendored
6
.vscode/c_cpp_properties.json
vendored
@ -8,9 +8,9 @@
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++20",
|
||||
"intelliSenseMode": "gcc-x64",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "linux-gcc-x64",
|
||||
"browse": {
|
||||
"path": [
|
||||
"${workspaceFolder}/**",
|
||||
|
12
.vscode/compile_commands.json
vendored
12
.vscode/compile_commands.json
vendored
@ -1,12 +0,0 @@
|
||||
[
|
||||
{
|
||||
"directory": "/path/to/project",
|
||||
"command": "gcc -c -o file1.o file1.c",
|
||||
"file": "/path/to/project/file1.c"
|
||||
},
|
||||
{
|
||||
"directory": "/path/to/project",
|
||||
"command": "g++ -c -o file2.o file2.cpp",
|
||||
"file": "/path/to/project/file2.cpp"
|
||||
}
|
||||
]
|
8
src/kernel/arch/x86/interrupt_utils.h
Normal file
8
src/kernel/arch/x86/interrupt_utils.h
Normal file
@ -0,0 +1,8 @@
|
||||
#ifndef INTERRUPT_UTILS_H
|
||||
#define INTERRUPT_UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
uint32_t read_interrupt_type(void);
|
||||
|
||||
#endif /* INTERRUPT_UTILS_H */
|
@ -2,6 +2,16 @@
|
||||
#include "idt.h"
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "./interrupt_utils.h"
|
||||
|
||||
void invalid_opcode(void);
|
||||
void general_protection_fault(struct idt_regs *regs);
|
||||
void page_fault(struct idt_regs *regs);
|
||||
void system_call(struct idt_regs *regs);
|
||||
|
||||
enum
|
||||
{
|
||||
@ -17,9 +27,6 @@ void dummy_isr(struct isr_regs *regs)
|
||||
printf("Timer interrupt occurred!\n");
|
||||
}
|
||||
|
||||
// ISR table
|
||||
void (*isr_table[256])(struct isr_regs *regs) = {0};
|
||||
|
||||
// Register an ISR
|
||||
extern void isr_register(uint8_t num, void (*handler)(struct isr_regs *regs))
|
||||
{
|
||||
@ -141,7 +148,8 @@ void system_call(struct idt_regs *regs)
|
||||
|
||||
void timer()
|
||||
{
|
||||
// Handle timer interrupt
|
||||
static int count = 0;
|
||||
printf ("timer expired %d times\n", ++count);
|
||||
}
|
||||
|
||||
void keyboard()
|
||||
|
Loading…
Reference in New Issue
Block a user