mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 00:14:32 -08:00
No longer using the rsp from the entry to the kernel, but instead switching rsp at task-switching time in assembly. This currently breaks fork()
25 lines
337 B
C++
25 lines
337 B
C++
#include <stdint.h>
|
|
#include <stdlib.h>
|
|
|
|
extern "C" {
|
|
int32_t getpid();
|
|
int32_t fork();
|
|
void sleep(uint64_t til);
|
|
void debug();
|
|
|
|
int main(int, const char **);
|
|
}
|
|
|
|
|
|
int
|
|
main(int argc, const char **argv)
|
|
{
|
|
int32_t pid = getpid();
|
|
//int32_t child = fork();
|
|
debug();
|
|
for (int i = 1; i < 5; ++i)
|
|
sleep(i*10);
|
|
debug();
|
|
return 0;
|
|
}
|