FreeNOS
IntelKernel.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Niek Linnenbank
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __INTEL_KERNEL_H
19 #define __INTEL_KERNEL_H
20 
21 #include <FreeNOS/Kernel.h>
22 #include <intel/IntelPIT.h>
23 #include <intel/IntelPIC.h>
24 #include <intel/IntelAPIC.h>
25 #include <Timer.h>
26 #include <Types.h>
27 #include <BootImage.h>
28 
43 class IntelKernel : public Kernel
44 {
45  public:
46 
50  IntelKernel(CoreInfo *info);
51 
58  virtual void enableIRQ(u32 irq, bool enabled);
59 
60  private:
61 
69  static void exception(CPUState *state, ulong param, ulong vector);
70 
78  static void interrupt(CPUState *state, ulong param, ulong vector);
79 
87  static void trap(CPUState *state, ulong param, ulong vector);
88 
96  static void clocktick(CPUState *state, ulong param, ulong vector);
97 
98  private:
99 
102 
105 
108 };
109 
115 #endif /* __INTEL_KERNEL_H */
IntelKernel::enableIRQ
virtual void enableIRQ(u32 irq, bool enabled)
Enable or disable an hardware interrupt (IRQ).
Definition: IntelKernel.cpp:140
IntelPIT
Intel 8254 Programmable Interrupt Timer (PIT).
Definition: IntelPIT.h:40
IntelKernel::clocktick
static void clocktick(CPUState *state, ulong param, ulong vector)
i8253 system clock interrupt handler.
Definition: IntelKernel.cpp:192
IntelAPIC.h
ulong
unsigned long ulong
Unsigned long number.
Definition: Types.h:47
Types.h
IntelPIC
Intel 8259 Programmable Interrupt Controller (PIC).
Definition: IntelPIC.h:40
IntelPIT.h
IntelKernel::IntelKernel
IntelKernel(CoreInfo *info)
Constructor function.
Definition: IntelKernel.cpp:37
param
void param(Terminal *term, int key, int value)
Set terminal parameters.
Definition: Terminal.cpp:305
IntelKernel::trap
static void trap(CPUState *state, ulong param, ulong vector)
Kernel trap handler (system calls).
Definition: IntelKernel.cpp:180
IntelKernel::m_pit
IntelPIT m_pit
PIT timer instance.
Definition: IntelKernel.h:101
Timer.h
BootImage.h
IntelPIC.h
IntelKernel::interrupt
static void interrupt(CPUState *state, ulong param, ulong vector)
Default interrupt handler.
Definition: IntelKernel.cpp:168
IntelKernel
Implements an x86 compatible kernel.
Definition: IntelKernel.h:43
u32
unsigned int u32
Unsigned 32-bit number.
Definition: Types.h:53
Kernel
FreeNOS kernel implementation.
Definition: Kernel.h:92
IntelKernel::m_apic
IntelAPIC m_apic
APIC instance (used if available)
Definition: IntelKernel.h:104
CPUState
Contains all the CPU registers.
Definition: ARMCore.h:243
CoreInfo
Per-Core information structure.
Definition: CoreInfo.h:60
IntelKernel::m_pic
IntelPIC m_pic
PIC instance.
Definition: IntelKernel.h:107
IntelKernel::exception
static void exception(CPUState *state, ulong param, ulong vector)
Called when the CPU detects a fault.
Definition: IntelKernel.cpp:155
IntelAPIC
Intel Advanced Programmable Interrupt Controller (APIC)
Definition: IntelAPIC.h:45