mikaku / Fiwix

A UNIX-like kernel for the i386 architecture
https://www.fiwix.org
Other
407 stars 32 forks source link

Map a configurable number of free user stack pages. #23

Closed rick-masters closed 1 year ago

rick-masters commented 1 year ago

Fixes #22

mikaku commented 1 year ago

This patch worked, but I think that we should better follow the Linux approach and using the constant RLIMIT_STACK, defined in resource.h to properly set a limit in the user stack region (not set yet).

~My next patch will create the function expand_stack() which follow the same idea as in Linux, but without using the RLIMIT_STACK resource yet. That's something to be implemented in the future. This doesn't affect the functionality of the kernel.~

I think that is not necessary to implement such expand_stack() function. Instead we can let kernel accept the non-existent addr in verify_addr() and let do_page_fault do the rest.