Commit Graph

43 Commits

Author SHA1 Message Date
Bananymous 79f3aa5419 Kernel/LibC: add dup() syscall and function 2023-08-17 12:03:29 +03:00
Bananymous 834bf33e57 LibC: we don't parse syscall arguments in unistd
We just call Kernel::syscall() with 5 arguments from the variadic function.

This was a necessary addition since the syscall() function
used over 2 KiB of stack space.
2023-07-31 22:24:11 +03:00
Bananymous f6ee4b3496 Kernel: Implement SYS_GET_PID and SYS_TCSETPGID
we don't have consept of process groups yet
2023-07-24 22:29:59 +03:00
Bananymous 2dce0a0415 Kernel: Userspace signal handlers are now called one at a time
I added a syscall for telling the kernel when signal execution has
finished. We should send a random hash or id to the signal trampoline
that we would include in the syscall, so validity of signal exit can
be confirmed.
2023-07-23 13:34:53 +03:00
Bananymous d560137ae6 Kernel/LibC: add SYS_SIGNAL/signal() 2023-07-21 20:08:13 +03:00
Bananymous 10169d773d Kernel/LibC: Add SYS_KILL/kill() 2023-07-21 19:27:38 +03:00
Bananymous c2cf98e32f Kernel/LibC: Add bareboness signals
You can now call raise() to raise a signal. Signal handlers are
not yet supported, but the handling works :)
2023-07-21 15:45:02 +03:00
Bananymous f7c4bc908e Kernel: open() and openat() now take mode as parameter
O_CREAT now tries to create file if O_CREAT is specified
2023-07-10 15:08:54 +03:00
Bananymous 07fec6e211 Kernel/LibC: add basic dup2 2023-07-06 23:17:54 +03:00
Bananymous 4cd72992c8 Kernel/LibC: Add basic pipe() syscall and command
You can now create pipes :)
2023-07-06 22:16:26 +03:00
Bananymous cdcb395640 LibC: add read() and write() to unistd 2023-07-06 22:15:55 +03:00
Bananymous 1fb305fa45 Kernel/LibC: add clock_gettime() for CLOCK_MONOTONIC
This gets the number of milliseconds since boot
2023-07-06 00:38:29 +03:00
Bananymous 60fe5a656c LibC: Fix syscall SYS_READ and SYS_WRITE arguments 2023-06-19 10:38:29 +03:00
Bananymous f09b82c4b5 Kernel/LibC: add SYS_{SET,GET}_PWD and chdir, getpwd 2023-06-12 02:02:52 +03:00
Bananymous 11b68f6a53 Kernel: Add SYS_GET_{,E}{UID,GID} 2023-06-11 22:37:00 +03:00
Bananymous 3fe67e4882 Kernel: Add syscalls for set{,e,re}{uid,gid} 2023-06-11 22:37:00 +03:00
Bananymous 78536f9678 Kernel/Userspace: Add basic init process
This process parses /etc/passwd and promps login screen.
When an username is entered, it will launch that users shell
2023-06-11 22:37:00 +03:00
Bananymous 83a6e6f637 LibC: Reorder some syscalls 2023-06-11 03:29:22 +03:00
Bananymous 68ec443e07 LibC: implement close 2023-06-11 03:29:22 +03:00
Bananymous aa86125f2b Kernel: Implement SYS_FSTAT 2023-06-11 03:29:22 +03:00
Bananymous eae6119039 Kernel: Add syscall for reading directory entries 2023-06-11 00:18:08 +03:00
Bananymous 24993f6020 LibC: implement setenv, unsetenv, putenv 2023-06-05 22:51:02 +03:00
Bananymous 55ea5c5488 Kernel: add basic support for environment variables
exec functions will search files from PATH
2023-06-05 22:51:02 +03:00
Bananymous 896b919c9d Kernel/LibC: pass environ pointer to process 2023-06-05 21:12:08 +03:00
Bananymous d1ad38c8d4 Kernel/LibC: add SYS_STAT and stat(), lstat() 2023-06-05 14:37:14 +03:00
Bananymous 40055f023c LibC: add wait and waitpid
Note that wait() doesn't work since only waiting for specified
pid is supported. wait() will just return -1 and set errno to
ECHILD.
2023-06-04 18:00:52 +03:00
Bananymous 88e92eec9e LibC: Add simple definition for realloc
The syscall just crashes the kernel currently. I will implement
this when needed
2023-06-02 17:56:13 +03:00
Bananymous 0f412e570c LibC: add execl 2023-05-31 22:36:26 +03:00
Bananymous 24a190d1f7 Kernel: Add SYS_EXEC syscall 2023-05-31 20:57:33 +03:00
Bananymous fb17af4844 Kernel/LibC: opening standard files is done in libc 2023-05-29 20:21:19 +03:00
Bananymous 998999a755 Kernel: Add SYS_SLEEP 2023-05-28 22:34:48 +03:00
Bananymous f2d767b799 Kernel: Add bareboness fork() function 2023-05-28 18:08:49 +03:00
Bananymous faf14b880e LibC: Rewrite all the headers.
We now have more or less posix issue 2018 conforming libc headers.

This was a really time consuming and boring operation but it had to
be done.

Now we get to actually start implementing libc :)
2023-05-26 22:31:21 +03:00
Bananymous 1658e925f2 Kernel: Add bareboness possibility to set termios 2023-05-26 22:31:21 +03:00
Bananymous 80d9f6131b Kernel/LibC: move file offset back to kernel
This makes keeping track of offsets easier and more proper
2023-05-26 22:31:21 +03:00
Bananymous ff2e2937a5 Kernel: Remove offset from OpenFileDescriptor
This is now handled on the libc side. There might be reasons to
have it in kernel side, but for simplicity's sake I'm moving it
to libc for now :)
2023-05-09 20:31:22 +03:00
Bananymous 054c5450df LibC: syscall() now returns -1 on error and updates errno 2023-05-07 01:51:39 +03:00
Bananymous 12e42f40c5 Kernel/LibC: add free function for FixedWidthAllocator
I have to rework the syscall API and allocators in process. For
now this works well enough :)
2023-05-07 01:21:50 +03:00
Bananymous bcfd838131 Kernel: Add basic fixed width allocator for userspace
We have to move process stacks to the general heap and maybe map
kernel to higher half.
2023-05-06 19:58:08 +03:00
Bananymous 79812b34b0 LibC: fread() now does a single syscall 2023-04-25 12:38:08 +03:00
Bananymous dc1b7cf08f LibC: syscalls have now proper argument order 2023-04-22 15:29:15 +03:00
Bananymous 3f9d6f0311 LibC: add needed stubs to build executables with our compiler 2023-04-12 17:53:02 +03:00
Bananymous a5830c5424 LibC: add stubs for a lot of functions 2023-04-05 23:58:40 +03:00