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
7de0adfc
authored
Dec 31, 2015
by
malcolm
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed crashes, mapping, and corrected return address in switch
parent
8e231276
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
src/elf.c
src/idt.c
src/switch.asm
src/elf.c
View file @
7de0adfc
...
@@ -62,7 +62,9 @@ void load_elf(elf_header* elf_start)
...
@@ -62,7 +62,9 @@ void load_elf(elf_header* elf_start)
}
}
// Map the kernel 1:1 in memory
// Map the kernel 1:1 in memory
page_region
(
pgdir
,
0x0
,
&
_kernel_end
);
//page_region(pgdir, 0x0, &_kernel_end);
for
(
int
i
=
0
;
i
<
7
;
i
++
)
pgdir
[
i
]
=
kernel_page_directory
[
i
];
// Allocate two more pages for stack
// Allocate two more pages for stack
page_map
(
pgdir
,
highest_vpage
+
0x1000
);
page_map
(
pgdir
,
highest_vpage
+
0x1000
);
...
...
src/idt.c
View file @
7de0adfc
...
@@ -48,7 +48,13 @@ void default_handler(trapframe reg)
...
@@ -48,7 +48,13 @@ void default_handler(trapframe reg)
{
{
settf
(
&
reg
);
settf
(
&
reg
);
if
(
reg
.
trap
<
32
)
if
(
reg
.
trap
<
32
)
reg
.
eip
+=
2
;
{
serial_writestring
(
"exception from address: "
);
serial_hexword
(
reg
.
eip
);
serial_writestring
(
"
\n
"
);
//reg.eip+=2;
}
if
(
handlers
[
reg
.
trap
]
!=
NULL
)
if
(
handlers
[
reg
.
trap
]
!=
NULL
)
{
{
handlers
[
reg
.
trap
](
reg
.
err
);
handlers
[
reg
.
trap
](
reg
.
err
);
...
...
src/switch.asm
View file @
7de0adfc
...
@@ -2,6 +2,9 @@ global context_switch
...
@@ -2,6 +2,9 @@ global context_switch
context_switch
:
context_switch
:
mov
eax
,
[
esp
+
4
]
mov
eax
,
[
esp
+
4
]
mov
edx
,
[
esp
+
8
]
mov
edx
,
[
esp
+
8
]
mov
ecx
,
[esp]
mov
[
edx
+
20
]
,
ecx
push
ebp
push
ebp
push
ebx
push
ebx
...
...
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