Commit Graph

1923 Commits

Author SHA1 Message Date
192621eac5
base: Mount the user's home directory before showing the MOTD
All checks were successful
continuous-integration/drone/push Build is passing
This way, the MOTD is shown just before login and there's less noticeable delay between the two.
2023-07-12 19:39:41 +02:00
acf4fef6f5
sysfuzz: Skip invoking sigreturn
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 19:37:22 +02:00
546d900454
libc+apps: Start implementing POSIX-compliant termios.h wrappers around tty ioctls
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 19:23:06 +02:00
2951d6d112
libc+tests: Check for manual modifications of environ
All checks were successful
continuous-integration/drone/push Build is passing
Closes #31.
2023-07-12 16:25:06 +02:00
5f698b4774
kernel: Don't create a new kernel stack on exec()
All checks were successful
continuous-integration/drone/push Build is passing
The old one was not getting freed, creating a memory leak every exec(),
which can get huge over time.
Plus, there was no need for a new stack.
And we couldn't just free the old one, since sys_execve() runs on the old stack...
2023-07-12 16:06:56 +02:00
f629e17ff4
kernel/x86_64: Only show kernel addresses in backtraces
This avoids walking off into userspace memory where we don't know what could happen.
2023-07-12 16:04:45 +02:00
1f6a0db188
su: Handle more signals gracefully
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 13:52:49 +02:00
81e1fdf81e
kernel+libc+login+sh+su: Implement foreground and background process groups in the default console
All checks were successful
continuous-integration/drone/push Build is passing
Also, the console sends SIGINT to the foreground process group when ^C is pressed!
2023-07-12 13:49:37 +02:00
9f45026cc2
kernel+sh: Implement interruptible syscalls 2023-07-12 13:48:43 +02:00
71ff763dd9
kernel+libc: Add the SIGTTIN and SIGTTOU signals 2023-07-12 13:45:36 +02:00
b64093dee5
kernel+libc: Implement getpgid() 2023-07-12 13:44:25 +02:00
d27ffce5db
kernel: Move the signal handling logic to after a syscall sets its return value
When a signal was caught after a syscall, it was doing so without preserving the return value of the syscall.
2023-07-12 13:34:30 +02:00
1091798195
libc: Add stub memory.h header for legacy programs
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-12 11:24:54 +02:00
9cf35f761f
libc: Fix another conversion error
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-11 12:45:55 +02:00
a51fb6a428
libc: Fix conversion error in isatty()
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-11 12:45:08 +02:00
69f9701097
kernel+libc: Implement isatty()
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-11 12:05:09 +02:00
7328cfe734
kernel: Add basic process groups
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-11 11:51:07 +02:00
6546f490b6
Update README.md 2023-07-11 11:50:57 +02:00
f7e8fd9cb8
libc: Add octal specifiers to inttypes.h 2023-07-11 11:49:27 +02:00
0fed45d1c6
libc: Implement _exit()
Apparently, I implemented _Exit in stdlib.h but forgot to add _exit to unistd.h...
2023-07-11 11:49:10 +02:00
82411789e8
libos+apps: Add kill
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-10 22:17:05 +02:00
86d14e0d0e
kernel+libc: Add the SA_NODEFER and SA_RESETHAND flags for sigaction()
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-10 21:54:04 +02:00
237184a8bf
libc+sh: Implement strsignal and use it in the shell
All checks were successful
continuous-integration/drone/pr Build is passing
2023-07-10 21:39:22 +02:00
e0b5acb2ab
libc: Make struct sigaction C-compatible
All checks were successful
continuous-integration/drone/pr Build is passing
2023-07-10 21:19:43 +02:00
66365e15a7
libc: Block and ignore appropriate signals in system()
All checks were successful
continuous-integration/drone/pr Build is passing
2023-07-10 21:17:56 +02:00
4a5947e10e
libc: Implement signal() 2023-07-10 21:17:25 +02:00
fe9827bbeb
kernel: Fix fallthrough in switch statement
All checks were successful
continuous-integration/drone/pr Build is passing
2023-07-10 21:09:12 +02:00
3df40beaf2
libc: Rewrite abort() using the new signals
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-10 21:08:23 +02:00
8066e8f1d8
kernel+libc: Implement sigprocmask() and friends
Some checks failed
continuous-integration/drone/pr Build is failing
2023-07-10 21:01:59 +02:00
015419b8f5
kernel: Generate signals when children exit / when faults occur
Userspace can now catch segfaults!
2023-07-10 20:49:22 +02:00
60d68b74e1
kernel: Define a good set of default signals
Most of these have POSIX-defined numbers.
2023-07-10 20:30:37 +02:00
cde467ee46
kernel: Support returning termination signals from waitpid
All checks were successful
continuous-integration/drone/pr Build is passing
2023-07-10 20:16:06 +02:00
fc3fdc2b87
kernel: Add default actions for signals 2023-07-10 19:59:01 +02:00
bdcb690a7a
kernel: Avoid processing unregistered signals for init 2023-07-10 19:48:46 +02:00
15d6aae701
kernel+libc: Implement basic signals 2023-07-10 19:46:57 +02:00
15199a2366
libluna+libc: Implement memchr() and strstr()
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-10 15:30:05 +02:00
56f3d26969
kernel+libluna: Fix the CRC32 algorithm and use it to verify the GPT header
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-10 14:54:55 +02:00
16b0531d42
kernel+apps+base+tools: Use Ext2 for the root partition file system
All checks were successful
continuous-integration/drone/push Build is passing
init is now split into two parts: preinit, which lives in the initrd and prepares the root file system for init,
and the actual /usr/bin/init, which lives in the root partition and starts services and reaps zombies.

The kernel now looks for /bin/preinit instead of /bin/init as the executable for the init process.

All configuration files in initrd/etc have been moved to base/etc. (The plan is to have only moon and preinit in the initrd.)

Since the current Ext2 implementation is read-only (and it's on a CDROM so it would be read-only anyways),
/home/selene is a tmpfs (as well as /tmp), to allow for a writable home directory.

The system is slower now, but that's to expect since the Ext2 code doesn't use caching and the ATA code still uses PIO.
2023-07-10 13:05:06 +02:00
40413eee18
kernel: Panic when PID 1 exits/crashes 2023-07-10 13:04:47 +02:00
e3552d9df0
kernel: Log hostname changes 2023-07-10 13:04:40 +02:00
a1b92fcc3f
kernel: Add the MOUNT_DEBUG flag 2023-07-10 13:04:34 +02:00
0b488c1232
kernel: Actually use config.cmake
Looks like file(EXISTS) needs a full path.
2023-07-10 13:04:26 +02:00
b920ffee42
kernel: Don't use an active directory for the idle thread
Just take the currently used directory.
2023-07-10 13:04:18 +02:00
503dc72686
kernel: Set kernel threads' initial active directories to avoid taking the first directory they use
This ends up being init's directory, which is fine when init's directory doesn't change...
but a little less fine when the init process calls exec()...
which is what it does in the new configuration I'm testing...
2023-07-10 13:04:00 +02:00
7908c5a63e
kernel/ATA: Do not discard the controller if at least one channel initialized properly
This was causing problems in VirtualBox.
2023-07-10 13:01:43 +02:00
ae0cd155c3
kernel: Fix AddressSpace's move assignment operator
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-09 20:43:03 +02:00
c599251d2a
kernel: Rename UserVM to AddressSpace
All checks were successful
continuous-integration/drone/push Build is passing
This is a more appropriate name now that it does more stuff than allocate virtual memory.

To be fair, the name was a bit awkward anyway. Should have been UserVMAllocator I guess.
2023-07-09 20:38:04 +02:00
5e564e9ae3
kernel: Move Thread::self_directory to UserVM
Since this is only used by user threads, UserVM is a convenient/related place to store the PageDirectory in a RAII manner.
2023-07-09 20:32:42 +02:00
5c9503ac71
libos+cp: Add prompt functionality
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-08 18:30:39 +02:00
6d9ba8deb4
libos+apps: Make the vector argument more flexible
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-08 16:44:02 +02:00