Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
广告位招租
openBHOS
Commits
2a0a6f43
Commit
2a0a6f43
authored
4 years ago
by
广告位招租
Browse files
Options
Download
Patches
Plain Diff
debug
parent
1e775dc8
master
refactor
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/kernel/loader/elf64.c
+5
-5
src/kernel/loader/elf64.c
with
5 additions
and
5 deletions
+5
-5
src/kernel/loader/elf64.c
+
5
−
5
View file @
2a0a6f43
...
...
@@ -25,15 +25,15 @@ addr_t elf64_load(void * thread,const char * path){
ASSERT
(
open_fp
(
fp
)
!=
false
,
"elf load fail
\n
"
);
read_fp
(
fp
,
&
elf64Ehdr
,
sizeof
(
elf64Ehdr
));
printk
(
"read elf head...
\n
"
);
//
printk("p num:0x%h,p off:0x%h\n",elf64Ehdr.e_phnum,elf64Ehdr.e_phoff);
printk
(
"p num:0x%h,p off:0x%h
\n
"
,
elf64Ehdr
.
e_phnum
,
elf64Ehdr
.
e_phoff
);
for
(
int
i
=
0
;
i
<
elf64Ehdr
.
e_phnum
;
i
++
){
seek_fp
(
fp
,
FSEEK_HEAD
,
elf64Ehdr
.
e_phoff
+
i
*
sizeof
(
elf64Phdr
));
read_fp
(
fp
,
&
elf64Phdr
,
sizeof
(
elf64Phdr
));
//
if(elf64Phdr.p_type!=PT_LOAD){
//
continue;
//
}
if
(
elf64Phdr
.
p_type
!=
PT_LOAD
){
continue
;
}
seek_fp
(
fp
,
FSEEK_HEAD
,
elf64Phdr
.
p_offset
);
//
printk("memsz:0x%h,offset:0x%h,align:0x%h,filesize:0x%h,vaddr:0x%h\n",elf64Phdr.p_memsz,elf64Phdr.p_offset,elf64Phdr.p_align,elf64Phdr.p_filesz,elf64Phdr.p_vaddr);
printk
(
"memsz:0x%h,offset:0x%h,align:0x%h,filesize:0x%h,vaddr:0x%h
\n
"
,
elf64Phdr
.
p_memsz
,
elf64Phdr
.
p_offset
,
elf64Phdr
.
p_align
,
elf64Phdr
.
p_filesz
,
elf64Phdr
.
p_vaddr
);
for
(
addr_t
vaddr
=
elf64Phdr
.
p_vaddr
;
vaddr
<
elf64Phdr
.
p_vaddr
+
elf64Phdr
.
p_filesz
;
vaddr
+=
PAGE_SIZE
){
vmm_alloc_req_t
req
=
{
true
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets