gsilvis / silvos

half-baked Silvis OS kernel
MIT License
4 stars 2 forks source link

Fix bug where fork() breaks at -O0 #35

Closed gsilvis closed 7 years ago

gsilvis commented 7 years ago

At -O0, gcc stores frame pointers in %rbp and on the stack. These don't work so well when you copy the stack to an entirely new location. To fix this, put 'fork' back into assembly so that all the copied stack frames are in pure assembly. The logic of the return value is now in its own C function.

gsilvis commented 7 years ago

Fixes #32

cstanfill commented 7 years ago

LGTM

allanlw commented 7 years ago

LGTM