projects
/
voyage-au-centre-des-fichiers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e1adeea
)
Fixed missing value init in elf loader
author
Amelia Coutard
<eliottulio.coutard@gmail.com>
Sun, 6 Aug 2023 01:53:57 +0000
(
03:53
+0200)
committer
Amelia Coutard
<eliottulio.coutard@gmail.com>
Sun, 6 Aug 2023 01:53:57 +0000
(
03:53
+0200)
kernel/src/elf64.cpp
patch
|
blob
|
history
diff --git
a/kernel/src/elf64.cpp
b/kernel/src/elf64.cpp
index 88fbf299e5624d62c5b581ed2d29ff1dab13d746..cf586ac97a3e4e644df013d62b4ad6bb64b4fd16 100644
(file)
--- a/
kernel/src/elf64.cpp
+++ b/
kernel/src/elf64.cpp
@@
-34,6
+34,7
@@
void os::elf::load_elf(os::process& result, std::byte* start, std::size_t length
std::byte* const stack = (std::byte*)0x0000'8000'0000'0000 - stack_size;
result.PML4T = phys_ptr<paging::PML4T>(os::paging::page_allocator.allocate(1).ptr.get_phys_addr());
+ memset(&*result.PML4T, 0, 0x1000);
result.rip = std::uint64_t(elf_header.entry);
result.rsp = std::uint64_t(stack + stack_size);
result.rax = 0;