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
e8e107ce
authored
Dec 07, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add pcb initilization
parent
7ad4babe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
src/elf.c
src/elf.h
src/elf.c
View file @
e8e107ce
...
@@ -61,4 +61,26 @@ void load_elf(elf_header* elf_start)
...
@@ -61,4 +61,26 @@ void load_elf(elf_header* elf_start)
page_map
(
pgdir
,
highest_vpage
+
0x1000
);
page_map
(
pgdir
,
highest_vpage
+
0x1000
);
page_map
(
pgdir
,
highest_vpage
+
0x2000
);
page_map
(
pgdir
,
highest_vpage
+
0x2000
);
// initial esp = highest_vpage + 0x1000
// initial esp = highest_vpage + 0x1000
process
*
pcb
=
kmalloc
(
sizeof
(
process
)
+
sizeof
(
context
)
+
sizeof
(
trapframe
));
pcb
->
ctxt
=
pcb
+
sizeof
(
process
);
pcb
->
tf
=
pcb
+
sizeof
(
process
)
+
sizeof
(
context
)
pcb
->
mem
=
pgdir
;
pcb
->
pid
=
-
1
;
pcb
->
parent
=
0
;
pcb
->
kstack
=
0
;
pcb
->
name
=
"debugstuff"
;
pcb
->
procstate
=
RUNNABLE
;
pcb
->
ctxt
->
edi
=
0
;
pcb
->
ctxt
->
esi
=
0
;
pcb
->
ctxt
->
ebx
=
0
;
pcb
->
ctxt
->
ebp
=
highest_vpage
+
0x1000
;
pcb
->
ctxt
->
eip
=
elf_start
->
program_entry_position
;
pcb
->
tf
->
ebp
=
highest_vpage
+
0x1000
;
pcb
->
tf
->
eip
=
elf_start
->
program_entry_position
;
}
}
src/elf.h
View file @
e8e107ce
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
#include "mem.h"
#include "mem.h"
#include "string.h"
#include "string.h"
#include "serial.h"
#include "serial.h"
#include "PCB.h"
extern
uint8_t
elf_hello
[]
asm
(
"_binary_hello_elf_start"
);
extern
uint8_t
elf_hello
[]
asm
(
"_binary_hello_elf_start"
);
...
...
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