Commit Graph

147 Commits

Author SHA1 Message Date
e676fb8299
libc: Add a wide range of time manipulation functions, including reentrant variants 2023-01-13 21:06:27 +01:00
2d2db300b0
libc: Add malloc(), calloc(), realloc() and free()
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-13 20:00:20 +01:00
d864bda751
libc: Add (de)allocate_memory wrappers located in sys/mman.h 2023-01-13 19:08:02 +01:00
586ca19b62
Add a VERY BASIC and hacky way of allocating memory from userspace
All checks were successful
continuous-integration/drone/push Build is passing
Only supports one-page allocations and doesn't have libc wrappers, which means it has to be invoked using syscall().
2023-01-11 23:02:42 +01:00
c82ed5df01
Enable -Os on all targets 2023-01-10 18:13:21 +01:00
7e377ef712
Implement printf()
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-07 01:49:26 +01:00
7fb2807d0c
libc: Implement time() using clock_gettime().
All checks were successful
continuous-integration/drone/push Build is passing
The cool POSIX kids use clock_gettime() now because it has NANOSECONDS (and different clocks!),
but ANSI C prefers this function.

We can still implement it based on clock_gettime(), we just have to discard the NANOSECONDS.
2023-01-07 00:27:23 +01:00
a8a64863c8
kernel, libc: Add clock_gettime() 2023-01-07 00:21:08 +01:00
80f5c790f8
Implement string formatting into libc :)
All checks were successful
continuous-integration/drone/push Build is passing
Of course, using <luna/Format.h> makes it so simple. No need for duplicate code!
2023-01-06 20:15:43 +01:00
c3653cd4e6
More stdlib.h implementation + commenting + atexit()
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-06 19:40:25 +01:00
30555f8e5a
Skip these because CI needed a toolchain rebuild
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-06 15:00:49 +01:00
71414c0653
Explicitly set the link path to make it build on CI
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-06 14:28:53 +01:00
db1941140c
Explicitly include system headers to make it build on CI
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-06 13:40:53 +01:00
129e3c434a
Switch to C for userspace, with a very bare-bones libc!!
Some checks failed
continuous-integration/drone/push Build is failing
2023-01-06 13:31:14 +01:00
fd8a0175d9
Add a syscall infrastructure (our baby program can print to the console now!)
All checks were successful
continuous-integration/drone/push Build is passing
2023-01-05 22:39:56 +01:00
0ea9974512
First user process!
All checks were successful
continuous-integration/drone/push Build is passing
Putting it all together, we have a user process that successfully calls sys_exit() w/o crashing.
2023-01-05 21:55:21 +01:00
f2cc797599
Add a simple ELF loader
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-23 13:09:21 +01:00
cf758fdfdc Initial commit :) 2022-11-13 10:09:09 +01:00
42efc21110 Start implementing read and write support in tmpfs
write seems to work fine, read just hangs there, waiting.
2022-11-12 20:11:26 +01:00
bde9a97db5 sh: Add a sleep command 2022-11-12 17:44:13 +01:00
16e6fba2d0 Add a bit more C++ stuff to the C++ app 2022-11-12 13:12:51 +01:00
bf1d3d3f05 mkdir: Print newline after usage 2022-11-12 12:53:33 +01:00
5a1d15d2b5 Show only short names of apps when installing 2022-11-10 17:55:41 +01:00
d1dea3f1d6 apps: Add support for C++ apps alongside C ones 2022-11-09 12:01:48 +01:00
033c41cbd7 Kernel: Rework the uid/gid system to make it compliant 2022-11-09 09:54:07 +01:00
98da473fdc Run clang-format 2022-11-08 19:07:43 +01:00
054d5a8bb4 Build system: Prettify build 2022-11-08 18:03:43 +01:00
00f9981f51 Userspace: Enable dead code stripping 2022-11-08 17:39:34 +01:00
88011fc162 init: Use fread() properly 2022-11-06 14:52:50 +01:00
7afbff08b6 apps: Add a little screen utility
It tells you the resolution of your screen :)
2022-11-02 21:00:23 +01:00
497a52dd82 apps: add a little mkdir utility 2022-10-31 09:53:52 +01:00
a7e4f2bdd2 sh: Make it much more versatile
This commit implements:
Argument matching, to show help and version
Support for running scripts
Support for parsing and running commands (via -c)

This is the first step to implementing the system() libc function.
2022-10-30 19:09:18 +01:00
e58aa361c8 sh: Show message when child called abort() 2022-10-30 18:36:52 +01:00
00f90246c8 Kernel: Implement very basic escape sequences for TextRenderer 2022-10-30 18:34:40 +01:00
4c096bd36c uptime: break time down into more understandable units
80 seconds -> 1 minute, 20 seconds for example
647 seconds would be 10 minutes, 47 seconds
and more...
2022-10-30 10:31:59 +01:00
6df5b8a703 Make backspace work 2022-10-30 10:08:52 +01:00
e640c6e245 Kernel, libc, userspace: Add file timestamps (atime,ctime,mtime) 2022-10-30 09:57:17 +01:00
e705810af3 apps: Add a new date utility
This program tells you the current date and time :)
2022-10-30 09:09:24 +01:00
e2b5c1bfdd uptime: Use clock_gettime instead of reading from /dev/uptime 2022-10-30 09:09:03 +01:00
a9da58421f su: do not pass out-of-bounds argv to execv when argc is 1 2022-10-29 20:13:40 +02:00
8395eb16f6 session: endpwent on exit 2022-10-29 10:18:39 +02:00
33ed6e5c17 su: endpwent on exit 2022-10-29 10:01:51 +02:00
8375701bf6 session, su: Split password-collecting logic into a separate function 2022-10-29 10:01:44 +02:00
3e052c72a0 init: don't wait before executing the session binary 2022-10-29 10:01:17 +02:00
e9092ab235 sh: Display username instead of shell's PID in prompt 2022-10-28 21:57:07 +02:00
0b838572e1 apps: Add a new session program which manages user login 2022-10-28 21:56:52 +02:00
91470851cd stat: Show username of file owner 2022-10-28 21:00:33 +02:00
5aba1c5f15 su: Make it setuid root, ask for a password, and accept a username
It asks for a password only if you are not root, obviously.
2022-10-28 20:57:13 +02:00
477af66cdc ps: Show usernames of processes, using getpwuid() 2022-10-28 20:55:39 +02:00
b8296eb92d su: Also set group ID 2022-10-28 17:55:56 +02:00