-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add process table and exit syscall (#268)
* Add process table * Add exit syscall * Update binaries * Make pid mutable * Use RW lock for the process table * Change pid atomic ordering * Fix return code * Fix lock issue * Add debug print * Add exit to sleep binary * Enable asm_sym feature * Use the end of code area for stack area * Add debug macro * Use array instead of vec for process * Refactor process data clone * Increase max file handles to 32 * Increase sleep to 5 seconds * Fix MAX_PID calculation * Revert max file handle value to fix crash * Close file handle after dup syscall * Remove init * Run the test in release mode * Refactor debug * Refactor debug output of syscall * Remove NULL syscall * Save and restore stack frame * Fix install * Save only scratch registers to the stack * Add write volatile to registers * Overwrite rax register on exit * Set pid back to 0 after exit * Add alloc_page function * Remove debug output * Unmap pages after exit * Allocate memory after kernel heap * Hide unmap error
- Loading branch information
Showing
19 changed files
with
272 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
[bits 64] | ||
_start: | ||
mov rax, 9 ; syscall number for SLEEP | ||
mov rdi, __float64__(1.0) ; time to sleep in seconds | ||
mov rdi, __float64__(5.0) ; time to sleep in seconds | ||
mov rsi, 0 | ||
mov rdx, 0 | ||
int 0x80 | ||
jmp _start | ||
mov rax, 1 ; syscall number for EXIT | ||
mov rdi, 0 ; no error | ||
int 0x80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.