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
8ab5d6ea
authored
Dec 07, 2015
by
triazo
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Make types work. Kinda.
parent
e8e107ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
src/elf.c
src/elf.c
View file @
8ab5d6ea
...
@@ -63,24 +63,25 @@ void load_elf(elf_header* elf_start)
...
@@ -63,24 +63,25 @@ void load_elf(elf_header* elf_start)
// initial esp = highest_vpage + 0x1000
// initial esp = highest_vpage + 0x1000
process
*
pcb
=
kmalloc
(
sizeof
(
process
)
+
sizeof
(
context
)
+
sizeof
(
trapframe
));
process
*
pcb
=
kmalloc
(
sizeof
(
process
)
+
sizeof
(
context
)
+
sizeof
(
trapframe
));
pcb
->
ctxt
=
pcb
+
sizeof
(
process
);
pcb
->
ctxt
=
(
context
*
)((
size_t
)
pcb
+
sizeof
(
process
)
);
pcb
->
tf
=
pcb
+
sizeof
(
process
)
+
sizeof
(
context
)
pcb
->
tf
=
(
trapframe
*
)((
size_t
)
pcb
+
sizeof
(
process
)
+
sizeof
(
context
));
pcb
->
mem
=
pgdir
;
pcb
->
mem
=
pgdir
;
pcb
->
pid
=
-
1
;
pcb
->
pid
=
-
1
;
pcb
->
parent
=
0
;
pcb
->
parent
=
0
;
pcb
->
kstack
=
0
;
pcb
->
kstack
=
0
;
pcb
->
name
=
"debugstuff"
;
//
pcb->name = "debugstuff";
pcb
->
proc
state
=
RUNNABLE
;
pcb
->
state
=
RUNNABLE
;
pcb
->
ctxt
->
edi
=
0
;
pcb
->
ctxt
->
edi
=
0
;
pcb
->
ctxt
->
esi
=
0
;
pcb
->
ctxt
->
esi
=
0
;
pcb
->
ctxt
->
ebx
=
0
;
pcb
->
ctxt
->
ebx
=
0
;
pcb
->
ctxt
->
ebp
=
highest_vpage
+
0x1000
;
pcb
->
ctxt
->
ebp
=
(
uint32_t
)
highest_vpage
+
0x1000
;
pcb
->
ctxt
->
eip
=
elf_start
->
program_entry_position
;
pcb
->
ctxt
->
eip
=
(
uint32_t
)
elf_start
->
program_entry_position
;
pcb
->
tf
->
ebp
=
highest_vpage
+
0x1000
;
pcb
->
tf
->
eip
=
elf_start
->
program_entry_position
;
pcb
->
tf
->
ebp
=
(
uint32_t
)
highest_vpage
+
0x1000
;
pcb
->
tf
->
eip
=
(
uint32_t
)
elf_start
->
program_entry_position
;
addproc
(
pcb
);
asm
(
"mov $3, %eax; int 0x80"
);
}
}
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