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
83b7c108
authored
Oct 04, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Style fixes
parent
fca15660
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
5 additions
and
25 deletions
src/gdt.c
src/gdt.h
src/idt.c
src/idt.h
src/kern.c
src/string.c
src/term.c
src/term.h
src/gdt.c
View file @
83b7c108
...
@@ -17,19 +17,13 @@ void gdt_install(){
...
@@ -17,19 +17,13 @@ void gdt_install(){
gdtr
.
limit
=
gdt_limit
;
gdtr
.
limit
=
gdt_limit
;
gdtr
.
base
=
gdt_base
;
gdtr
.
base
=
gdt_base
;
asm
volatile
(
"lgdt (%0)"
:
:
"r"
(
&
gdtr
));
asm
volatile
(
"lgdt (%0)"
:
:
"r"
(
&
gdtr
));
//serial_writestring("gdt installed, now setting cs\n");
set_cs
(
8
);
set_cs
(
8
);
//serial_writestring("cs set, setting ds\n");
asm
volatile
(
"mov $0x10, %ax;\
//asm volatile ("ljmp $0x8,$1f;
mov %ax, %ds; \
// 1:
mov %ax, %es; \
asm
volatile
(
" mov $0x10, %ax;\
mov %ax, %fs; \
mov %ax, %ds;\
mov %ax, %gs; \
mov %ax, %es;\
mov %ax, %fs;\
mov %ax, %gs;\
mov %ax, %ss;"
);
mov %ax, %ss;"
);
//serial_writestring("ds set, we done here. moving on to idt\n");
//terminal_writestring("");
strlen
(
""
);
strlen
(
""
);
}
}
void
gdt_set_desc
(
uint32_t
i
,
uint64_t
base
,
uint64_t
limit
,
uint8_t
access
,
uint8_t
gran
){
void
gdt_set_desc
(
uint32_t
i
,
uint64_t
base
,
uint64_t
limit
,
uint8_t
access
,
uint8_t
gran
){
...
...
src/gdt.h
View file @
83b7c108
src/idt.c
View file @
83b7c108
...
@@ -12,25 +12,15 @@ void idt_install() {
...
@@ -12,25 +12,15 @@ void idt_install() {
uint16_t
limit
;
uint16_t
limit
;
uint32_t
base
;
uint32_t
base
;
}
__attribute__
((
packed
))
idtr
;
}
__attribute__
((
packed
))
idtr
;
//char s[1];
//itoa(sizeof(idtr),s);
//serial_writestring(s);
idtr
.
limit
=
idt_limit
;
idtr
.
limit
=
idt_limit
;
idtr
.
base
=
idt_base
;
idtr
.
base
=
idt_base
;
char
f
[
20
];
char
f
[
20
];
itoa
(
idtr
.
limit
,
f
);
//serial_writestring(f);
//serial_writestring("\n");
itoa
(
idtr
.
base
,
f
);
//serial_writestring(f);
//serial_writestring("\n");
asm
volatile
(
"lidt (%0)"
:
:
"r"
(
&
idtr
));
asm
volatile
(
"lidt (%0)"
:
:
"r"
(
&
idtr
));
}
}
static
void
default_handler
()
{
static
void
default_handler
()
{
//DEBUG OUTPUT MAYBE?
//DEBUG OUTPUT MAYBE?
serial_writestring
(
"int caught
\n
"
);
serial_writestring
(
"int caught
\n
"
);
//for(;;);
return
;
return
;
}
}
...
...
src/idt.h
View file @
83b7c108
src/kern.c
View file @
83b7c108
...
@@ -17,10 +17,6 @@ void kernel_main() {
...
@@ -17,10 +17,6 @@ void kernel_main() {
terminal_initialize
();
terminal_initialize
();
serial_init
();
serial_init
();
char
b
[
2
];
int
a
=
strlen
(
""
);
itoa
(
a
,
b
);
terminal_writestring
(
b
);
gdt_init
();
gdt_init
();
idt_init
(
0x8
);
idt_init
(
0x8
);
...
...
src/string.c
View file @
83b7c108
src/term.c
View file @
83b7c108
src/term.h
View file @
83b7c108
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