Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
106 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/**************************************************************************** | ||
* Copyright (C) 2009 meh. [http://meh.doesntexist.org] * | ||
* * | ||
* This file is part of lulzKey. * | ||
* * | ||
* See COPYING or http://www.gnu.org/licenses/agpl-3.0.txt * | ||
****************************************************************************/ | ||
|
||
#include <Interrupt/Interrupt.h> | ||
|
||
namespace Kernel { | ||
|
||
namespace Processor { | ||
|
||
namespace Interrupts { | ||
|
||
void init (void); | ||
|
||
/** | ||
* System interrupts, only the god service can call them. | ||
* | ||
* 1 - disable paging { void (void) } | ||
* 2 - enable paging { void (void) } | ||
* 3 - set paging directory to the ebx { void (physycal table address) } | ||
* 4 - flush TLB { void (void) } | ||
*/ | ||
void system (Interrupt::Registers& regs); | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/**************************************************************************** | ||
* Copyright (C) 2009 meh. [http://meh.doesntexist.org] * | ||
* * | ||
* This file is part of lulzKey. * | ||
* * | ||
* See COPYING or http://www.gnu.org/licenses/agpl-3.0.txt * | ||
****************************************************************************/ | ||
|
||
#include <Processor/x86/Interrupt/Interrupts.h> | ||
|
||
namespace Kernel { | ||
|
||
namespace Processor { | ||
|
||
namespace Interrupts { | ||
|
||
void | ||
init (void) | ||
{ | ||
|
||
} | ||
|
||
void | ||
system (Interrupt::Registers& regs) | ||
{ | ||
if (regs.ring <= 1) { | ||
switch (regs.eax) { | ||
case 1: // disable paging | ||
asm volatile ( | ||
"mov %%cr0, %%edx \n" | ||
"and $0x7fffffff, %%edx \n" | ||
"mov %%edx, %%cr0 \n" | ||
::: "edx"); | ||
break; | ||
|
||
case 2: // enable paging | ||
asm volatile ( | ||
"movl %%cr0, %%edx \n" | ||
"orl $0x80000000, %%edx \n" | ||
"movl %%edx, %%cr0 \n" | ||
::: "edx"); | ||
break; | ||
|
||
case 3: // set paging directory to ebx | ||
asm volatile ( | ||
"movl %0, %%cr3 \n" :: "r" (regs.ebx) | ||
); | ||
break; | ||
|
||
case 4: // flush TLB | ||
asm volatile ( | ||
"mov %%cr3, %%edx \n" | ||
"mov %%edx, %%cr3 \n" | ||
::: "edx"); | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters