Skip to content

Commit

Permalink
Increase stack size to 20 pages
Browse files Browse the repository at this point in the history
This workaround bad codegen in debug mode on libfat's GenericIterator.
  • Loading branch information
Thomas Guillemard committed Aug 12, 2019
1 parent 80f37ad commit 8788131
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions fs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! Clock applet
//! Filesystem sysmodule
//!
//! Show the current time in the bottom left corner of the screen.
//! High level access to filesystem and disks.
//!
//! NOTE: This need at least 16 pages of stack to run in debug builds because of bad codegen on the compiler side for libfat's iterators.
#![no_std]
// rustc warnings
Expand Down
6 changes: 3 additions & 3 deletions kernel/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@ fn main() {

let ep = elf_loader::load_builtin(&mut pmemlock, &mapped_module);

let stack = pmemlock.find_available_space(9 * PAGE_SIZE)
let stack = pmemlock.find_available_space(20 * PAGE_SIZE)
.unwrap_or_else(|_| panic!("Cannot create a stack for process {:?}", proc));
pmemlock.guard(stack, PAGE_SIZE, MemoryType::Reserved).unwrap();
pmemlock.create_regular_mapping(stack + PAGE_SIZE, 8 * PAGE_SIZE, MemoryType::Stack, MappingAccessRights::u_rw()).unwrap();
pmemlock.create_regular_mapping(stack + PAGE_SIZE, 19 * PAGE_SIZE, MemoryType::Stack, MappingAccessRights::u_rw()).unwrap();

(VirtualAddress(ep), stack + 9 * PAGE_SIZE)
(VirtualAddress(ep), stack + 20 * PAGE_SIZE)
};
let thread = ThreadStruct::new(&proc, ep, sp, 0)
.expect("failed creating thread for service");
Expand Down

0 comments on commit 8788131

Please sign in to comment.