mirror of
https://github.com/gbowne1/ClassicOS.git
synced 2024-11-22 06:06:52 -08:00
fixing some issues in my editor. Also adding a utility for working with interrupts and fixing isr.c
This commit is contained in:
parent
791af944f7
commit
4a2e72ce2c
6
.vscode/c_cpp_properties.json
vendored
6
.vscode/c_cpp_properties.json
vendored
@ -8,9 +8,9 @@
|
|||||||
],
|
],
|
||||||
"defines": [],
|
"defines": [],
|
||||||
"compilerPath": "/usr/bin/gcc",
|
"compilerPath": "/usr/bin/gcc",
|
||||||
"cStandard": "c17",
|
"cStandard": "c11",
|
||||||
"cppStandard": "c++20",
|
"cppStandard": "c++11",
|
||||||
"intelliSenseMode": "gcc-x64",
|
"intelliSenseMode": "linux-gcc-x64",
|
||||||
"browse": {
|
"browse": {
|
||||||
"path": [
|
"path": [
|
||||||
"${workspaceFolder}/**",
|
"${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 "idt.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.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
|
enum
|
||||||
{
|
{
|
||||||
@ -17,9 +27,6 @@ void dummy_isr(struct isr_regs *regs)
|
|||||||
printf("Timer interrupt occurred!\n");
|
printf("Timer interrupt occurred!\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// ISR table
|
|
||||||
void (*isr_table[256])(struct isr_regs *regs) = {0};
|
|
||||||
|
|
||||||
// Register an ISR
|
// Register an ISR
|
||||||
extern void isr_register(uint8_t num, void (*handler)(struct isr_regs *regs))
|
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()
|
void timer()
|
||||||
{
|
{
|
||||||
// Handle timer interrupt
|
static int count = 0;
|
||||||
|
printf ("timer expired %d times\n", ++count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void keyboard()
|
void keyboard()
|
||||||
|
Loading…
Reference in New Issue
Block a user