Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
triazo
/
kernel
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
3
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
515d0d6d
authored
Sep 28, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fixed GCC flags and added ASM calls
parent
21be04fc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
src/gdt.c
src/gdt.h
src/idt.c
src/idt.h
src/gdt.c
View file @
515d0d6d
...
...
@@ -3,13 +3,13 @@
typedef
struct
{
uint16_t
limit
;
uint32_t
base
;
}
gdtr
;
}
__attribute__
((
packed
))
gdtr
;
static
gdt_desc
_gdt
[
MAX_GDT_DESC
];
static
gdtr
_gdtr
;
static
void
gdt_install
()
{
//TODO: VOODOO MAGIC
asm
volatile
(
"lgdt [%0]"
:
:
"p"
(
&
_gdtr
));
}
void
gdt_set_desc
(
uint32_t
i
,
uint64_t
base
,
uint64_t
limit
,
uint8_t
access
,
uint8_t
gran
)
...
...
src/gdt.h
View file @
515d0d6d
...
...
@@ -24,7 +24,7 @@ typedef struct{
uint8_t
flags
;
uint8_t
gran
;
uint8_t
high_base
;
}
gdt_desc
;
}
__attribute__
((
packed
))
gdt_desc
;
extern
void
gdt_set_desc
(
uint32_t
i
,
uint64_t
base
,
uint64_t
limit
,
uint8_t
access
,
uint8_t
gran
);
extern
gdt_desc
*
gdt_get_desc
(
int
i
);
...
...
src/idt.c
View file @
515d0d6d
...
...
@@ -3,13 +3,14 @@
typedef
struct
{
uint16_t
limit
;
uint32_t
base
;
}
idtr
;
}
__attribute__
((
packed
))
idtr
;
static
idt_desc
_idt
[
MAX_IDT_INT
];
static
idtr
_idtr
;
static
void
idt_install
()
{
//TODO: VOODOO MAGIC
asm
volatile
(
"lidt [%0]"
:
:
"p"
(
&
_idtr
));
}
static
void
default_handler
()
{
//DEBUG OUTPUT MAYBE?
...
...
src/idt.h
View file @
515d0d6d
...
...
@@ -20,7 +20,7 @@ typedef struct {
uint8_t
reserved
;
uint8_t
flags
;
uint16_t
high_base
;
}
idt_desc
;
}
__attibute__
((
packed
))
idt_desc
;
extern
idt_desc
*
get_ir
(
uint32_t
i
);
extern
int
install_ir
(
uint32_t
i
,
uint16_t
flags
,
uint16_t
code_sel
,
IRQ_HANDLER
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment