8e1a0d0e13
libos+LICENSE: Update copyright year
...
Build and test / build (push) Failing after 1m37s
Happy new year!
2025-01-06 16:10:00 +01:00
773cd576d1
tools: Print clang-format version
Build and test / build (push) Failing after 1m41s
2024-12-23 23:12:57 +01:00
498c371547
tools: Show format violations
Build and test / build (push) Failing after 1m40s
2024-12-23 23:10:11 +01:00
b0be170b41
CI: Automatically check formatting
Build and test / build (push) Failing after 1m40s
2024-12-23 23:05:04 +01:00
5cb4b8b1fe
docs: Add clang-format dependency
Build and test / build (push) Successful in 1m41s
2024-12-23 22:59:57 +01:00
d9713723c9
tools: Update sources list and run clang-format
2024-12-23 22:56:56 +01:00
c0cf952113
docs: Clarify the wording in dependencies.md
Build and test / build (push) Successful in 1m31s
2024-12-22 19:27:11 +01:00
22766a6724
docs: Correct a few details in boot_process.md
Build and test / build (push) Successful in 1m35s
2024-12-21 13:40:53 +01:00
abdaad5ea4
docs: Update boot_process.md
Build and test / build (push) Successful in 1m39s
2024-12-21 10:30:33 +01:00
f116afd59d
docs: Fix relative source path
Build and test / build (push) Successful in 1m30s
2024-12-19 21:17:27 +01:00
1b80111938
Fix a couple of Markdown links
Build and test / build (push) Successful in 1m37s
2024-12-19 21:15:22 +01:00
f91800f5e1
docs: Add dependency information separately
Build and test / build (push) Successful in 1m41s
2024-12-19 21:12:49 +01:00
6dcdc43dc2
gui+su+base: Store hashed passwords and use those to log in
...
Build and test / build (push) Successful in 1m34s
Unsalted SHA256 passwords are still a long way from being secure, but at least we're not storing plaintext anymore.
2024-12-14 12:48:13 +01:00
00382421b2
libluna: Add move versions of value_or
2024-12-14 12:46:36 +01:00
5d5c85a022
gui/InputField: Calculate correct length for the returned StringView
2024-12-14 12:46:14 +01:00
48ee803e58
init: Avoid "No child processes" error spam
Build and test / build (push) Successful in 1m41s
2024-12-14 12:19:13 +01:00
984200ca9a
loginui: Pledge unix
2024-12-14 12:18:59 +01:00
ac260d0397
wind+libui: Add "pledge" functionality to access special features for system programs
...
Build and test / build (push) Successful in 1m42s
This segments privileges more, making it so that any app connecting to wsys.sock can't just always access every single advanced feature in wind if they don't need to.
Of course, apps have to restrict themselves, which is why only privileged apps have access to this feature in the first place.
Normal apps' pledges are all empty and can't be changed.
An example: taskbar uses the "ExtendedLayers" pledge to move its window to the background, but relinquishes it afterwards, and doesn't need any other advanced feature for now.
If a pledge-capable app tries to use a pledge-protected function without having pledged anything, it can't. Pledges are mandatory if you want to access certain functionality, unlike the kernel's pledges which make every syscall available if you don't use pledge().
2024-12-13 23:47:53 +01:00
fb3333a086
wind: Remove special window attributes and add different window layers.
...
Build and test / build (push) Successful in 1m38s
Two layers are accessible to all apps: global and global_top (for popups and similar windows).
Three other layers are accessible to privileged clients (background, system and lock), for things that need to be on a different level than user apps, like the taskbar, system popups, menus and the lock screen.
2024-12-13 21:53:12 +01:00
ccef3e2069
ports: Add cbench to the ports list
...
Build and test / build (push) Successful in 1m41s
This was missed when adding the original cbench port.
2024-12-13 21:39:47 +01:00
ad3cea7e78
gui: Rename "launch" to "execd"
Build and test / build (push) Successful in 1m42s
2024-12-11 20:34:47 +01:00
865a913502
wind: Fix help message when unprivileged
...
wind --user=<NAME> is not supported anymore. We'll setuid() and setgid() to wind:wind on our own.
2024-12-11 20:30:40 +01:00
499bf6dd19
gui+system: Add pledges to loginui and startui
Build and test / build (push) Successful in 1m46s
2024-12-11 19:56:40 +01:00
94e7dde8af
kernel/waitpid: fix a panic-causing extraneous exclamation mark
...
Big oof moment.
Thankfully kernel panics sometimes just give you the exact source of the problem :P
"-- KERNEL PANIC: Check failed at kernel/src/sys/waitpid.cpp:67, in sys_waitpid: !target->dead() --"
2024-12-11 19:56:24 +01:00
f38c9e68c1
wind: Remove unneeded pledges
...
wind doesn't spawn child processes anymore, startui does.
2024-12-11 19:45:04 +01:00
3b8aabce0f
kernel: Add debug.cmake include to config.cmake template
Build and test / build (push) Successful in 1m32s
2024-12-11 19:28:22 +01:00
5f56e4b63a
kernel: Disable UBSAN in debug.cmake
...
Build and test / build (push) Successful in 1m42s
UBSAN seems to bloat the kernel too much, so let's make debug.cmake actually usable for debugging by commenting it out.
2024-12-11 19:19:36 +01:00
24b886b0d1
kernel: Log each thread's instruction pointer when dumping scheduler stats
2024-12-11 19:18:25 +01:00
d8e4489079
kernel: Make Thread::ip() and sp() const-friendly
2024-12-11 19:17:04 +01:00
2868fd8122
kernel: Add a way to lookup specific threads
2024-12-11 19:16:45 +01:00
56a2b607b5
kernel: Fix some debug-only log strings after the process rework
2024-12-11 19:16:22 +01:00
ec6ceb4c8d
init: Fix infinite wait loop
...
Build and test / build (push) Successful in 1m51s
Since waitpid always sends a SIGCHLD now, we'd handle a SIGCHLD after returning from waitpid, which would trigger another wait, looping forever and not actually handling the wait.
2024-12-11 19:13:12 +01:00
d05d6fad0b
kernel: Interrupt waitpid (even when SIGCHLD is pending) when other signals are also pending
...
Build and test / build (push) Successful in 1m36s
This fixes init not receiving the kill signal when running tests.
2024-12-07 13:15:58 +01:00
42afef5ccb
kernel: Leave reaping to the reap thread
...
Build and test / build (push) Has been cancelled
This seems to fix previous problems. Apparently reaping a thread somewhat corrupts/replaces the calling thread's address space.
I should've known there's a reason we do it in a separate kernel thread...
2024-12-07 13:05:38 +01:00
853a6d7b38
kernel/x86_64: Dump the process address space ranges on exception
2024-12-07 13:02:25 +01:00
8e30e0e19d
base: Revert loginui.conf change
...
Build and test / build (push) Failing after 3h10m29s
Oops, was using this for loginui testing, it should be turned off by default.
2024-12-06 21:38:29 +01:00
dc766e1da7
kernel: Rework VFS access checking + add processes
...
Build and test / build (push) Has been cancelled
VFS functions now accept a single Process* pointer instead of credentials and groups.
There is now a distinction between processes and threads
Now to fix all the bugs... waitpid crashes the process with an NX error...
2024-12-06 21:35:59 +01:00
6fc49a0be5
init: Let's not forget to unhook our notifiers
Build and test / build (push) Successful in 1m42s
2024-12-04 22:54:01 +01:00
7761a8a41f
kernel+launch: Always send SIGCHLD when a child exits
...
Build and test / build (push) Successful in 1m44s
POSIX says so. I thought it was only when the parent wasn't actively waiting, to signal it, but it turns out it's always sent.
2024-12-04 22:44:16 +01:00
0ca6c5f814
taskbar: Remove sigchld handler
...
We are not launching child processes from taskbar anymore, that job is left to /bin/launch.
2024-12-04 22:42:59 +01:00
3032415bc0
kernel: Move "push_mem_on_stack" and "pop_mem_from_stack" to MemoryManager
Build and test / build (push) Successful in 1m52s
2024-11-23 20:03:04 +01:00
7b2977a036
kernel: Use a mutex to allocate new posix timers for a thread
2024-11-23 20:02:34 +01:00
9e65131452
editor: Avoid showing an error dialog when pressing Ctrl+S
Build and test / build (push) Successful in 1m52s
2024-10-26 14:00:57 +02:00
d908ccea6b
wind: Move some stuff from String to RefString
2024-10-26 14:00:26 +02:00
e3613d1653
loginui+2048: Replace String with RefString
2024-10-26 13:43:20 +02:00
53f8a583dc
libluna+libos+libui: Move Action to libluna and make it usable in the kernel
...
Build and test / build (push) Failing after 1m21s
This commit adds an error-propagating constructor for Action and Function, which makes them usable in the kernel.
2024-10-19 21:25:17 +02:00
c21fc2a297
ports: Add cbench port
Build and test / build (push) Failing after 1m37s
2024-09-23 19:51:42 +02:00
fd26f40938
editor: Add "Save file as..." and error dialogs
Build and test / build (push) Failing after 1m32s
2024-09-19 18:27:16 +02:00
fd2fe16538
libui: Add Dialog
2024-09-19 18:26:58 +02:00
38fcd8e3e1
libos: Stop timers in the destructor if needed
...
Fixes some bug in InputField causing a crash.
2024-09-19 18:26:42 +02:00
05bf792dbd
libui: Make InputField final
Build and test / build (push) Failing after 1m31s
2024-09-18 21:48:15 +02:00
b95cfac3ec
libui: Fix crashes when closing non-main windows
...
Build and test / build (push) Has been cancelled
This fix moves the actual closing of the window to after all the events are processed.
2024-09-18 21:47:31 +02:00
17a31e5ea9
libos: Add more constructor variants for Action/Function
2024-09-18 21:44:46 +02:00
1f0286c9c7
base: Add taskbar entry for the editor
Build and test / build (push) Successful in 1m51s
2024-09-14 15:40:27 +02:00
ffd1c73b0f
base: Start a welcome message instead of a terminal on login
Build and test / build (push) Successful in 1m44s
2024-09-14 15:31:42 +02:00
12ab71ee40
libos: Support comments in config files
Build and test / build (push) Successful in 1m45s
2024-09-14 15:12:36 +02:00
4cf39c14a1
base+gui: Move autologin configuration to /etc/loginui.conf
Build and test / build (push) Successful in 1m45s
2024-09-14 15:05:05 +02:00
bbe1eca711
utils: Add a hackish "logout" command
Build and test / build (push) Successful in 1m45s
2024-09-07 17:40:39 +02:00
e7d361ca51
startui: Remove /tmp/launch.sock as root
...
Build and test / build (push) Successful in 1m51s
Fixes #47 .
This avoids permission errors.
2024-09-07 17:33:38 +02:00
bb6759986e
libos/LocalServer: Clean up socket file on exit
...
This doesn't work if the process is killed by an unhandled signal.
2024-09-07 17:33:01 +02:00
4cc8a44ec7
all: Update release to 0.7.0 "Pulsar"
Build and test / build (push) Successful in 1m57s
2024-09-07 17:17:08 +02:00
0a9578c1ec
libui/Font: Use RefString
Build and test / build (push) Successful in 1m54s
2024-09-07 16:52:48 +02:00
1fc2da4fb0
taskbar: Use os::ConfigFile instead of manually parsing app files
2024-09-07 16:52:31 +02:00
9c4f20790f
CI: Undo artifact stuff
...
Build and test / build (push) Successful in 1m55s
Doesn't seem to be really supported on Gitea for now.
2024-09-07 16:35:59 +02:00
0a143e8729
CI: Use different artifact provider
Build and test / build (push) Failing after 1m52s
2024-09-01 14:17:22 +02:00
d4237d10a0
CI: Fix actions syntax
Build and test / build (push) Failing after 2m6s
2024-09-01 14:12:45 +02:00
b24aa1821c
CI: Upload built ISOs
Build and test / build (push) Failing after 0s
2024-09-01 14:11:54 +02:00
7c0ff8c75a
libos+init: Add a standard API for config file access
Build and test / build (push) Successful in 1m50s
2024-09-01 12:40:37 +02:00
a11aa7a2d0
libluna: Add a reference-counted immutable string type
2024-09-01 12:40:20 +02:00
0abd9153ae
tools+libluna: Make new and delete weak to avoid conflicts with libstdc++
...
Wasn't causing problems earlier, but when trying to rebuild the toolchain, it failed because of this.
2024-09-01 12:39:55 +02:00
abbfd5825f
kernel: Make StorageCache have a reference to its parent BlockDevice
...
Build and test / build (push) Successful in 2m10s
This will make it easier to implement sync later on.
2024-08-09 18:52:56 +02:00
bfb45c7d4a
gui: Add a login UI and support the os::IPC::Notifier API
Build and test / build (push) Successful in 3m2s
2024-07-31 19:50:20 +02:00
d3fbddb191
taskbar: Use SIGQUIT to restart
...
Whenever a GUI session ends, SIGHUP is sent to all GUI processes. Previously, taskbar would catch this signal and wrongly restart.
Now, taskbar correctly dies alongside everyone else.
2024-07-31 19:46:02 +02:00
0ab8efd405
libos+init: Add a Notifier API to know when child processes have finished initialization
...
init now supports the "WaitUntilReady" key, which will wait until the child calls os::IPC::notify_parent().
2024-07-31 19:43:09 +02:00
2aefbdc4ee
libos: Fix Action
2024-07-31 19:32:47 +02:00
15dc71e8e1
libui/InputField: Fix a few bugs and add a clear() method
2024-07-31 19:32:22 +02:00
140910763e
all: Reorder directory structure
...
Build and test / build (push) Successful in 1m56s
Why are command-line utilities stored in "apps"?
And why are apps like "editor" or "terminal" top-level directories?
Command-line utilities now go in "utils".
GUI stuff now goes in "gui".
This includes: libui -> gui/libui, wind -> gui/wind, GUI apps -> gui/apps, editor&terminal -> gui/apps...
System services go in "system".
2024-07-21 13:24:46 +02:00
829f455129
apps: Add arch
Build and test / build (push) Successful in 2m16s
2024-07-21 13:07:51 +02:00
d10cb10404
libluna/SHA: Reuse the m_message buffer to avoid duplicating the data to hash
...
Build and test / build (push) Successful in 2m14s
This change is almost insignificant in most cases, but it avoids using 4GB of memory to hash a 2GB file.
2024-07-21 12:52:12 +02:00
c97876bba0
kernel/ATA: Avoid assuming endianness
2024-07-21 12:51:06 +02:00
31c36b9b83
tests: Add tests for SHA256
Build and test / build (push) Successful in 2m22s
2024-07-20 16:34:31 +02:00
5fe0507ab1
libc+libluna: Add endianness-dependent functions and use them in SHA256
Build and test / build (push) Successful in 2m18s
2024-07-20 16:26:06 +02:00
e1c287a45b
libluna: Return a new Digest structure instead of a Buffer from SHA256
Build and test / build (push) Successful in 2m30s
2024-07-20 16:12:43 +02:00
db2f91b1fb
libluna+apps: Add a SHA256 hash implementation
Build and test / build (push) Successful in 2m26s
2024-07-20 15:50:59 +02:00
7345a952ca
libluna: Implement hash table iteration
Build and test / build (push) Successful in 1m47s
2024-07-02 20:51:28 +02:00
903dcfa52c
libc: Partially implement freopen() when a null pathname is provided
...
Build and test / build (push) Successful in 2m1s
The specification says "It is implementation-defined which changes of mode are permitted (if any)", so we can comply by not permitting any mode changes, at least for now.
2024-07-02 12:44:43 +02:00
2ce2d57eff
kernel: Prevent kernel threads from calling exit_and_signal_parent()
...
Build and test / build (push) Successful in 1m53s
Kernel threads are supposed to use kernel_exit() instead, so it makes no sense to have an extra branch for them.
2024-06-23 22:53:30 +02:00
907049c405
kernel: Signal the reap thread when a kernel thread exits via exit_and_signal_parent()
...
Build and test / build (push) Successful in 1m54s
This shouldn't happen, but just in case.
2024-05-02 10:58:34 +02:00
450ef2ce27
docs: Add boot_process.md
2024-05-02 10:57:46 +02:00
01dcb954e5
cp: Show an error message when attempting to copy a directory into a file
Build and test / build (push) Successful in 2m12s
2024-05-01 18:55:34 +02:00
04649fce8a
base: Change ownership of skeleton files when copying them to the home folder
2024-05-01 18:55:18 +02:00
66983ce17c
base: Correct description for the login service
2024-05-01 18:54:53 +02:00
0a46cfc80c
libui: Remove the server->client message "WindowCloseRequest"
...
Build and test / build (push) Waiting to run
This is no longer used as the client manages its own close buttons.
2024-05-01 18:19:34 +02:00
fb52c67f16
kernel/x86_64: Map kernel-side pages as global to avoid TLB flushes
...
Build and test / build (push) Waiting to run
Fixes #34 .
2024-05-01 18:14:43 +02:00
ab70a72434
kernel: Fix extra qualification in Thread.h
...
Build and test / build (push) Failing after 12m15s
Forgot to build after writing the previous commit, but CI caught it anyway.
2024-05-01 10:54:59 +02:00
1d0f18cab9
kernel: Move stack checking and expansion into an architecture-independent file
Build and test / build (push) Failing after 1m45s
2024-05-01 10:52:08 +02:00
de6f5c38d8
kernel: Try to grow the stack on stack overflows, up to a maximum of 8MB
...
Build and test / build (push) Successful in 1m49s
This helps keep GCC happy when compiling slightly complex programs :)
2024-04-28 16:27:18 +02:00
e0ed4be0db
libos: Change the year in the default ArgumentParser copyright message
...
Build and test / build (push) Failing after 12m48s
Almost four months into 2024, I finally remembered that I had to change this.
2024-04-20 17:24:26 +02:00
6293aeea58
shell: Split code into multiple files, add the "echo" builtin, and add support for a .shellrc file
Build and test / build (push) Successful in 1m46s
2024-04-20 17:17:31 +02:00
646a15d295
Update README
Build and test / build (push) Successful in 1m38s
2024-04-20 15:57:01 +02:00
b59a787b9e
kernel: Properly initialize the shebang read buffer with zeros
...
Build and test / build (push) Failing after 11m23s
Before this patch, a shebang line that was too long could have left the buffer without a null terminator, allowing some other stack contents to pass into the m_interpreter_cmdline.
2024-04-18 21:55:16 +02:00
e2ff0ad273
libc: Propagate errors correctly in shadow functions
Build and test / build (push) Successful in 2m58s
2024-04-18 21:25:36 +02:00
62cb53069c
libc: Close all pipe file descriptors in popen() after dup2() is called
2024-04-18 21:25:13 +02:00
fe302f5967
libc: Clean up stdio.h a bit
2024-04-18 21:24:34 +02:00
69f3e28f2c
editor: Use window->add_keyboard_shortcut to handle Ctrl+S
Build and test / build (push) Failing after 13m5s
2024-04-15 19:34:09 +02:00
2f56a52489
libui: Add support for keyboard shortcuts natively
2024-04-15 19:33:32 +02:00
1176e64a7c
editor: Fix creation of new files
...
Build and test / build (push) Successful in 1m44s
The editor is supposed to create files if they don't exist, however before this commit stat() would fail and exit load_file() before we even got to File::open_or_create().
2024-04-15 17:06:04 +00:00
e7780b04ee
editor: Display only the basename of the current file in the window title
2024-04-15 17:06:04 +00:00
6ded7247e0
terminal: Use widget->window() instead of the App's main window
2024-04-15 17:06:04 +00:00
8b3755873b
editor: Use TextInput as a base class
2024-04-15 17:06:04 +00:00
489d54c531
libui: Add a TextInput base class to handle most input fields and add an InputField class for single-line inputs
2024-04-15 17:06:04 +00:00
eb3af60497
editor: Refuse to load non-regular file types
2024-04-15 17:06:04 +00:00
aee100753d
editor: Remove insert mode and use the arrow keys to navigate, plus Ctrl+S to save
2024-04-15 17:06:04 +00:00
0be6a896bb
editor: Add basic loading and saving
2024-04-15 17:06:04 +00:00
7d738433ed
editor: Add a basic text editor
2024-04-15 17:06:04 +00:00
701dc30221
base+su+libc: Add support for a shadow file and use it by default
Build and test / build (push) Successful in 1m39s
2024-04-10 22:37:36 +02:00
6968961d5c
tools: Use the correct architecture in make-package.sh
Build and test / build (push) Waiting to run
2024-04-10 21:53:20 +02:00
d8914b3efa
base: Add taskbar entry for 2048
Build and test / build (push) Successful in 1m32s
2024-04-10 21:44:04 +02:00
82985d691d
taskbar: Make taskbar entries configurable
2024-04-10 21:42:21 +02:00
ff10e5f3b2
Remove the build status badge
...
Build and test / build (push) Failing after 14m33s
It links to drone, which we have phased out in favor of Gitea Actions.
2024-04-01 18:42:34 +02:00
71df91b4a0
libc: Add a _POSIX_VERSION define
Build and test / build (push) Successful in 1m39s
2024-04-01 14:18:46 +02:00
7dc4b17d46
libc: Implement strtoll and strtoull as functions
2024-04-01 14:18:34 +02:00
332976dde9
tools: Make luna-pkg-config executable
2024-04-01 14:18:15 +02:00
5b94217316
ports: Add doomgeneric port
Build and test / build (push) Successful in 1m34s
2024-03-31 13:40:43 +02:00
7205020bac
ports: Add libwind port
2024-03-31 13:40:01 +02:00
898eb43360
tools: Add new files to diff as well
2024-03-31 13:38:56 +02:00
a863b17746
wind+libui: Ignore alpha bits in the window buffer
2024-03-31 13:38:39 +02:00
5087b6db30
wind: Show which IPC function was called with an invalid window id
2024-03-31 13:38:08 +02:00
7d69ac56e2
apps+libos+shell+wind: Correct a bunch of format strings
Build and test / build (push) Successful in 1m41s
2024-03-29 14:42:38 +01:00
f9b39c5ff3
libos: Add ways to format output to a File
2024-03-29 14:41:45 +01:00
d70effd1db
libos: Clarify requirements for File::write
2024-03-29 14:25:14 +01:00
59713279a0
kernel: Add a hexdump() method to log binary data for debugging
Build and test / build (push) Successful in 1m33s
2024-03-29 12:12:56 +01:00
6443ec77f8
kernel/ATA: Add support for regular ATA drives (non-ATAPI)
...
Don't know why this took so long to figure out, I just had to pass the right value to select().
2024-03-29 12:11:39 +01:00
86372a3893
Update README.md
2024-03-28 22:37:16 +01:00
3dc2c24ec5
apps: Add run
...
Build and test / build (push) Failing after 1m43s
This utility lets you run a process detached from the shell, using the magic of the launch server.
2024-03-20 19:58:45 +01:00
06b8a41d2f
launch: Add support for PATH searching
2024-03-20 19:57:43 +01:00
eab44307f0
run-tests: Avoid starting a shell to spawn test processes
Build and test / build (push) Successful in 2m9s
2024-03-14 12:37:59 +01:00
cdab3dea90
libluna: Assert some unreachable conditions
Build and test / build (push) Successful in 1m48s
2024-03-07 23:10:35 +01:00
2780ee2ebc
ports: Build gcc without --enable-checking
...
Build and test / build (push) Successful in 1m54s
Now that gcc works, we don't need to bloat the binary with asserts.
2024-03-07 22:33:17 +01:00
70c63572b2
2048: Use the arrow keys and the Home key as input
Build and test / build (push) Successful in 1m53s
2024-03-06 20:34:13 +01:00
fc37634a18
kernel: Add much-needed support for extended keyboard scancodes
2024-03-06 20:33:54 +01:00
f05fea441c
libluna: Add LinkedList tags
Build and test / build (push) Successful in 1m51s
2024-03-03 14:52:23 +01:00
5975e58b4a
libluna: Add typename to some stuff in TypeTraits
...
Build and test / build (push) Successful in 1m52s
G++ on Luna was complaining about this.
2024-02-11 19:26:40 +01:00
d385e01796
ports: Fix mpfr download url
Build and test / build (push) Successful in 1m48s
2024-02-11 18:26:46 +01:00
4dc060e0b3
libluna: Fix String::from_string_view construction for inline strings
...
Build and test / build (push) Successful in 1m41s
Before, this method failed to add a null terminator if the source string did not have one, which was possible.
2024-02-11 17:09:37 +01:00
644614cdd8
libluna: Fix memmove when dest > src
...
Really? A crucial component of the libc was broken? No wonder some ports did not work very well...
2024-02-11 17:08:36 +01:00
1070c85922
CI: Don't install fakeroot as a dependency
...
Build and test / build (push) Successful in 1m43s
We install as root directly.
2024-02-11 13:45:20 +01:00
8d5f598488
tools: Allow building as root for CI
Build and test / build (push) Successful in 1m45s
2024-02-11 13:39:51 +01:00
8efcf6d852
Run apt as sudo
Build and test / build (push) Has been cancelled
2024-02-10 11:55:34 +01:00
7165ff7683
Add fakeroot dependency
Build and test / build (push) Failing after 6s
2024-02-10 11:50:01 +01:00
0847a2cda0
ports: Update README.md
...
Build and test / build (push) Failing after 2m25s
This changes a few occurrences of "if using CMake" to the more correct "if the port uses CMake"
2024-02-10 11:37:52 +01:00
42a7c7af5f
Check glibc version
Build and test / build (push) Failing after 2m1s
2024-02-06 22:46:05 +01:00
49f84c9dda
Set ubuntu version to latest
Build and test / build (push) Failing after 2m3s
2024-02-06 22:43:28 +01:00
f5c0e724d5
Update ubuntu version to 22.04
Build and test / build (push) Failing after 2m0s
2024-02-06 22:40:38 +01:00
ac3175cf26
Remove old drone.yml
...
Build and test / build (push) Has been cancelled
Now that we use Gitea Actions, this is no longer needed.
2024-02-06 22:38:27 +01:00
a78620a7d2
Update workflow
Build and test / build (push) Failing after 2m25s
2024-02-06 21:32:27 +01:00
fcd8c1d583
Update workflow
Build and test / build (push) Failing after 2m20s
2024-02-04 14:40:07 +01:00
e1c2dfb9ba
Update workflow
Build and test / build (push) Failing after 9s
2024-02-04 14:39:31 +01:00
7fcc0659c8
Update workflow
Build and test / build (push) Failing after 7s
2024-02-04 14:39:07 +01:00
3fc5f2b836
Update workflow
Build and test / build (push) Failing after 0s
2024-02-04 14:38:34 +01:00
64965cd322
Update workflow
2024-02-04 14:38:01 +01:00
d0ad103e3d
Update workflow
Build and test / build (push) Failing after 0s
2024-02-04 14:36:48 +01:00
3728558b13
Update workflow
Build and test / build (push) Failing after 9s
2024-02-04 14:33:30 +01:00
7cd6e9b12a
Update workflow
Build and test / build (push) Failing after 7s
2024-02-04 14:30:30 +01:00
e02dee1f41
Update workflow
Build and test / build (push) Failing after 50s
2024-02-04 14:27:20 +01:00
ab2700ef5d
Update workflow
Build and test / build (push) Failing after 2s
2024-02-04 14:25:59 +01:00
bb18749d5b
Update build workflow
2024-02-04 14:24:22 +01:00
d4b368b078
Update build workflow
2024-02-04 14:18:51 +01:00
7f2a65f6d6
Add basic actions file
Build and test / build (push) Has been cancelled
2024-02-04 14:16:01 +01:00
02f8102d38
wind+libui+taskbar: Add a request for setting special window attributes
...
This lets the taskbar window stay unfocused even when it's clicked.
2024-02-04 13:35:50 +01:00
9bb66716a4
libui: Move WindowType from ipc/Server.h to Window.h as it is no longer used in IPC
2024-02-04 13:16:50 +01:00
b9ccda132a
wind+libui: Rename SetTitlebarRect to SetTitlebarHeight
...
We only need the height to be customizable.
2024-02-04 13:13:21 +01:00
b8470f753b
startui: Move socket file checking around a bit
2024-02-03 19:35:40 +01:00
909d0ed289
libos+wind+apps: Make IPC code object-oriented and add functionality for properly receiving messages
...
This functionality previously had to be repeated across all server programs using the IPC API.
2024-02-03 19:16:39 +01:00
6bdf3169d2
kernel: Handle aborted connections instead of crashing
2024-02-03 19:15:19 +01:00
75d0d12b71
apps: Add a background launcher service
...
This service is used only by taskbar, for now, to launch apps with regular privileges instead of inheriting the special group 'wsys'.
2024-02-01 21:58:44 +01:00
a7ff298852
wind: Add a second unix socket for privileged clients which need to be in a different group
2024-02-01 21:57:40 +01:00
ca5b4de2d8
libui+apps: Change ui::App::init() to take the socket path directly instead of command-line arguments
2024-02-01 21:15:31 +01:00
f8a39ffeec
startui: Change mismatched parameter name
2024-01-31 22:45:11 +01:00
d440559d54
startui: Fix typo
2024-01-31 22:43:40 +01:00
443d8957f3
apps: Add startui
...
This service starts a complete UI session (wind, components, and init --user), all with their respective privileges.
This lets us move that responsibility away from wind and let it be only a window manager.
2024-01-31 22:42:24 +01:00
ea14dab7d7
wind: Stop using magic numbers for user and group IDs
2024-01-30 20:26:54 +01:00
16223b2f53
init: Add a (user) prefix to logs when not running as system init
2024-01-19 21:21:07 +01:00
9c36ef6e9e
terminal: Stop setting the pty to nonblocking mode when it's not needed
2024-01-19 21:18:01 +01:00
63f785563d
terminal: Use proper lambda functions when registering a fd listener for the pseudoterminal
2024-01-19 21:11:03 +01:00
1cd355a8e8
libos: Add Function<Args...> and use that to make EventLoop callbacks more versatile
2024-01-18 20:52:36 +01:00
d4d748e153
terminal: Remove m_cursor_timer->restart() from tick_cursor()
...
Since the timer was created as a repeating timer, it is already restarted after the function.
2024-01-13 16:26:37 +01:00
cee677b1f7
libui: Make App::process_events() private
...
Previously this was public as some applications (mainly terminal) needed to run some code in-between events, but this is no longer needed, due to the EventLoop providing these services (timers and file descriptor notifiers)
2024-01-08 19:13:47 +01:00
e4c9211edc
terminal: Use os::Timer and EventLoop::register_fd_listener
2024-01-08 19:04:04 +01:00
6bf8225f63
libos: Add Timer::reset, restart and stop
2024-01-08 19:01:59 +01:00
1223c6c20b
libos: Add FIXME to EventLoop
2024-01-08 19:01:39 +01:00
fd402083d7
kernel: Fix kernel panic when adding a timer before another one
...
This was caused because add_to_timer_queue() did not set active_clock when inserting a timer before the end, making disarm() a no-op.
Therefore, the clock would continue to use the timer after it had been freed.
2024-01-06 18:12:25 +01:00
4019cf90cf
kernel: Unify panic messages
2024-01-06 17:44:56 +01:00
1f2f676ea4
Update gitignore rules
2024-01-06 17:31:00 +01:00
075ed83764
Add about icon to git
...
Apparently, I had skipped this one, I really need to improve these
gitignore rules.
2024-01-06 17:23:14 +01:00
7f6863c093
apps: Use os::Timer instead of os::EventLoop::register_timer
2024-01-05 22:18:12 +01:00
a9c339939a
libos: Move timer handling to a separate class and use POSIX timers
2024-01-05 22:16:50 +01:00
3231a1296d
libc: Add support for POSIX timers
2024-01-05 22:15:06 +01:00
17b44a8ce6
kernel: Reenable stack tracing in kernel-mode exceptions
...
Stack tracing in user-mode exceptions was moved to when a signal kills the process, but this isn't done for kernel-mode exceptions so there was no stack trace anymore.
2024-01-05 22:14:31 +01:00
41c90aa436
kernel: Add POSIX timer support
2024-01-05 22:12:58 +01:00
f8cc093e17
tools: Add useful script to develop ports
2024-01-04 21:04:58 +01:00
64a941dc18
ports: Use --enable-initfini-array in gcc and binutils ports
2024-01-04 21:04:45 +01:00
2a85a7473a
kernel: Show stacktraces on all signal terminations
2024-01-04 21:04:24 +01:00
e34395915d
libc+tests+tools: Call global constructors in userspace code
2024-01-04 21:02:51 +01:00
d9899f1c3d
Update LICENSE
2024-01-04 11:24:48 +01:00
c24d0da5f0
ports/gcc: Fix --with-build-sysroot and enable asserts
2024-01-04 11:15:14 +01:00
1208d94b37
kernel: Add stack diagnostics to userspace fault reporting
2024-01-04 11:14:19 +01:00
f34dd56375
wind+libui: Implement client side decorations
2023-12-27 12:56:40 +01:00
5188def9e5
stat: Recognize sockets properly
continuous-integration/drone/push Build is failing
2023-12-04 20:42:31 +01:00
9b01b5a5db
kernel: Correctly register file times for more file systems and file types
2023-12-04 20:42:17 +01:00
b619f717c8
kernel+libc: Implement pause() and sigsuspend()
continuous-integration/drone/push Build is passing
2023-12-04 20:26:01 +01:00
92ab403687
terminal: Use forkpty()
continuous-integration/drone/push Build is passing
2023-11-25 12:18:48 +01:00
5bb4321134
libc: Add login_tty() and forkpty()
2023-11-25 12:18:25 +01:00
3a5924be64
kernel: Set the initial foreground process group when acquiring a controlling terminal
2023-11-25 12:18:04 +01:00
99dc819bca
terminal: Stop killing child process manually when exiting
...
continuous-integration/drone/push Build is passing
This is already handled by the pty subsystem.
2023-11-22 21:35:26 +01:00
73a7d4f2a1
wind+libui: Run wind as a separate user
continuous-integration/drone/push Build is passing
2023-11-22 21:31:08 +01:00
efeab5699e
su: Allow disabled passwords
2023-11-22 21:31:08 +01:00
1005305d5a
su: Support supplementary groups
2023-11-22 21:31:08 +01:00
8a90db837b
kernel+libc: Add support for supplementary groups (2/2)
...
Adds system calls for setting and getting groups, along with libc wrappers.
2023-11-22 21:31:07 +01:00
3ad23eab21
kernel: Add support for supplementary groups (1/2)
...
Adds support for supplementary groups internally in the kernel.
No userspace support.
2023-11-22 18:49:40 +01:00
e97b61ef16
gol: Use EventLoop timers
continuous-integration/drone/push Build is passing
2023-11-16 22:02:31 +01:00
d1d53c6891
kernel: Remove signal debug messages
2023-11-16 22:02:17 +01:00
8a57d8a9b7
libos: Use setitimer() for millisecond precision
2023-11-16 21:58:45 +01:00
678121c3ed
kernel+libc: Add setitimer()
continuous-integration/drone/push Build is passing
2023-11-16 21:48:18 +01:00
c4d2847da1
kernel: Rework the entire time system to use modular clocks
continuous-integration/drone/push Build is passing
2023-11-15 23:50:04 +01:00
e28e1c682c
kernel: Tweak some timer code
continuous-integration/drone/push Build is passing
2023-11-04 10:47:41 +01:00
dfebdce689
kernel: Add a timer queue with more versatility than simple alarm()
continuous-integration/drone/push Build is passing
2023-11-03 19:53:34 +01:00
54ec441000
libluna: Add LinkedList::add_before() to mirror add_after()
...
Need this for later.
2023-11-03 19:52:36 +01:00
e1d5b7e7b4
kernel: Implement thread stopping and continuing
continuous-integration/drone/push Build is failing
2023-10-28 15:15:32 +02:00
69771cbd85
kernel: Show symbols correctly when at the beginning of a function
continuous-integration/drone/push Build is passing
2023-10-25 20:02:15 +02:00
4d5feb0f3b
libos: Add File::seek() and File::tell()
continuous-integration/drone/push Build is passing
2023-10-24 20:02:09 +02:00
cea1b030ff
kernel: Add locking to BinaryFormat and DeviceRegistry
continuous-integration/drone/push Build is passing
2023-10-23 22:48:04 +02:00
9c65dba412
kernel: Add a registry for file system implementations
2023-10-23 22:47:49 +02:00
ba4e807f8e
kernel: Fix off-by-one error in symbol lookup and add locking
...
This resulted in very weird backtraces.
2023-10-23 22:47:20 +02:00
b3cbbea9d6
kernel: Move file descriptors into their own separate file
2023-10-23 20:13:11 +02:00
8476ea0dc9
ports: Port gcc =D
...
continuous-integration/drone/push Build is passing
The main compiler (cc1) crashes in some obscure null dereference that I'll have to investigate.
However, it compiles fine, and the preprocessor seems to work...
2023-10-15 13:13:11 +02:00
2134dcc5ec
libc: Add madvise stub
2023-10-15 13:09:56 +02:00
7db6e0163a
libc: Add unused WUNTRACED define for gcc
2023-10-15 13:09:46 +02:00
bd0fb8fe5b
libc: Add pclose definition
...
The function was already implemented, but no definition in the header...
2023-10-15 13:09:22 +02:00
15d5f00cd3
libc: Add ctermid
continuous-integration/drone/push Build is passing
2023-10-15 11:09:08 +02:00
56eb0c8130
su: Read password from /dev/tty instead of stdin
continuous-integration/drone/push Build is passing
2023-10-14 20:47:56 +02:00
c323a812a5
kernel+libc+terminal+wind: Add support for POSIX sessions
...
continuous-integration/drone/push Build is passing
Fixes #42 .
2023-10-14 20:41:34 +02:00
81131ad3a8
init: Handle SIGCHLD signals
2023-10-14 20:40:18 +02:00
5f0830cd41
kernel: Add /dev/tty
continuous-integration/drone/push Build is passing
2023-10-14 19:00:10 +02:00
9097400c32
wind: Return more errors to the client when creating windows
continuous-integration/drone/push Build is passing
2023-10-13 22:33:36 +02:00
3ca31770e7
initrd: Remove unused stray script file
continuous-integration/drone/push Build is passing
2023-10-13 22:12:18 +02:00
c75dbc0cbb
kernel: Lookup and print symbols for addresses in backtraces
2023-10-13 22:11:52 +02:00
37e046d766
libui: Make Label initialization step-by-step instead of setting everything in the constructor
continuous-integration/drone/push Build is passing
2023-10-11 22:56:14 +02:00
7812a4a44a
apps+libui: Make app.run() call window->draw() automatically
continuous-integration/drone/push Build is passing
2023-10-10 22:24:11 +02:00
e18ca9bfe0
libos: Document Action.h
2023-10-10 22:11:12 +02:00
d3a347e432
taskbar: Handle SIGCHLD as part of the event loop
continuous-integration/drone/push Build is passing
2023-10-09 22:14:34 +02:00
3e5bdc8c80
apps: Add clock
continuous-integration/drone/push Build is passing
2023-10-09 22:05:30 +02:00
0824ba7e23
libos: Add timers to event loops
...
Only second precision for now, as alarm() is used to control the timers. Hopefully setitimer() or timer_create() can be added to the kernel soon to benefit from more precision.
2023-10-09 22:00:15 +02:00
0b2a835336
libui+libos: Move Action to libos
2023-10-07 15:31:50 +02:00
945cfab3eb
libos: Add signal handling to event loops
continuous-integration/drone/push Build is passing
2023-10-07 14:26:35 +02:00
5892a6bf09
libos+libui: Add event loops
continuous-integration/drone/push Build is passing
2023-10-06 22:06:34 +02:00
f5aed95b8b
kernel: Fix inode link counting in tmpfs
continuous-integration/drone/push Build is passing
2023-10-04 20:58:40 +02:00
db2963d7bf
apps: Add 2048 prototype
continuous-integration/drone/push Build is passing
2023-09-28 21:38:42 +02:00
b3dc027ba0
taskbar: Add Game of Life to taskbar
continuous-integration/drone/push Build is passing
2023-09-27 19:03:49 +02:00
041d15a547
libui+taskbar: Make Buttons use Actions and clean up taskbar code
2023-09-27 18:52:17 +02:00
3d46e56386
libui: Add Margins to layouts
2023-09-27 18:51:54 +02:00
d4e834f734
libui: Add Actions
...
This allows components like Buttons to take in capturing lambdas
2023-09-27 18:51:38 +02:00
54afd7c2b0
libluna: Add OwnedPtr::leak()
2023-09-27 18:50:56 +02:00
9a9c7e577a
wind+libui+taskbar: Add various window types and never focus the taskbar
continuous-integration/drone/push Build is passing
2023-09-27 18:14:32 +02:00
f0844c9f69
cp: Support the -R flag and add better verbose messages
continuous-integration/drone/push Build is passing
2023-09-25 21:31:14 +02:00
eeb69c923c
kernel: Rename Scheduler::new_userspace_thread to clarify that it's only meant for init
continuous-integration/drone/push Build is passing
2023-09-25 19:34:02 +02:00
5626083aad
init: Add support for WorkingDirectory keys
continuous-integration/drone/push Build is passing
2023-09-25 19:26:05 +02:00
7ff5096083
kernel: Avoid page faults when reading from a slave pseudoterminal after the master is destroyed
continuous-integration/drone/push Build is passing
2023-09-23 12:57:03 +02:00
a47321a228
libc: Implement openpty()
continuous-integration/drone/push Build is passing
2023-09-22 23:02:33 +02:00
ffdcc843eb
kernel+terminal: Move pseudoterminal input processing to kernel-space
continuous-integration/drone/push Build is passing
2023-09-22 22:45:35 +02:00
441e04076a
kernel: Do not allow sending signals to dying threads
...
This was causing a kernel panic when closing the terminal by directly exiting the shell (either EOF or the exit command)
2023-09-22 22:40:24 +02:00
36fad85396
kernel+init+preinit+wind: Remove the kernel TTY and support only userspace terminals
...
continuous-integration/drone/push Build is passing
Still allow printing text to the console, but without text input or ANSI escape fancy stuff.
2023-09-21 19:31:54 +02:00
b52f96ab64
kernel: Schedule cache clears only on certain checkpoints
continuous-integration/drone/push Build is passing
2023-09-21 19:14:13 +02:00
14f0c93175
kernel: Allow mapping the framebuffer even if its size is not page-aligned
continuous-integration/drone/push Build is passing
2023-09-20 22:41:48 +02:00
b4a9ea3857
terminal: Avoid doing too many redraws + support non-canonical mode
continuous-integration/drone/push Build is passing
2023-09-20 22:01:26 +02:00
9636b5d8da
Update README.md
continuous-integration/drone/push Build is passing
2023-09-20 21:07:37 +02:00
36bd556406
all: Bump release version to 0.6.0 and start calling it "Andromeda"
...
continuous-integration/drone/push Build is passing
I changed my mind, some alpha releases can have unique names now.
2023-09-20 20:56:59 +02:00
b09226b8ba
gol: Use the windowing system
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-09-20 20:17:11 +02:00
52b04bd33b
kernel: Increase the OOM threshold to 4 MiB free
continuous-integration/drone/pr Build is passing
2023-09-20 19:58:26 +02:00
b42497e05e
kernel: Start clearing caches when free memory is lower than 1MiB
...
continuous-integration/drone/pr Build is passing
This is done to avoid returning ENOMEM errors when cache memory can still be reclaimed.
2023-09-20 19:49:13 +02:00
b370a99aa6
libui: Allow specifying the color of Labels, and use that in about
2023-09-20 19:45:19 +02:00
9fd4fc7e91
wind+taskbar: Improve the dark color scheme
2023-09-20 19:45:01 +02:00
bc14b01bf8
terminal: Fix certain keys being incorrectly inputted
2023-09-20 19:43:53 +02:00
0cb21c2e90
terminal: Send signals on ^C and ^\
continuous-integration/drone/pr Build is failing
2023-09-20 07:06:01 +02:00
3540033dd3
wind: Translate Ctrl-key presses correctly
2023-09-20 07:06:01 +02:00
c5227d585c
kernel: Allow sending signals to process groups from userspace
2023-09-20 07:06:01 +02:00
d93e9f6b4b
kernel: Fix sending signals to threads that are in a long syscall
2023-09-20 07:06:00 +02:00
7631b81681
libui: Allow not filling the window with a background color every time
2023-09-20 07:06:00 +02:00
7f23931028
terminal: Draw directly onto the window canvas
2023-09-20 07:06:00 +02:00
945dc6c732
terminal: Add cursor support
2023-09-20 07:06:00 +02:00
dd3359b09b
libui: Properly request redraws from the server
...
Before this, the call to update() was always skipped.
2023-09-20 07:06:00 +02:00
9b1e19ef72
terminal: Use pseudoterminals and add keyboard support
2023-09-20 07:06:00 +02:00
75ea81bfbc
libc: Add pseudoterminal-related functions
2023-09-20 07:06:00 +02:00
29a341d8f3
init: Mount /dev/pts on startup
2023-09-20 07:05:59 +02:00
a93626fc41
kernel: Add pseudoterminals and a /dev/pts filesystem
2023-09-20 07:05:59 +02:00
ab738772b9
wind: Stop tracking windows after they're closed
2023-09-20 07:05:59 +02:00
e2a1cb0d34
wind+libui: Add support for keyboard events
2023-09-20 07:05:59 +02:00
1b633212f6
apps: Remove gclient
2023-09-20 07:05:59 +02:00
5a49e97483
taskbar: Add a button to open terminal instead of gclient
2023-09-20 07:05:59 +02:00
a4b5e68e1b
kernel: Allow performing extra actions when opening an inode
2023-09-20 07:05:58 +02:00
835c39bc47
apps: Add basic terminal app
2023-09-20 07:05:58 +02:00
0e8183d2bb
shell: Allow running as interactive even if not running in a TTY
2023-09-20 07:05:58 +02:00
bb5d726fe8
libui: Add option to run event processing in a loop instead of in app.run()
2023-09-20 07:05:58 +02:00
08b56319c7
libui: Reduce redraw calls by doing them only when events are actually handled
2023-09-20 07:05:58 +02:00
a5790d0fb1
apps: Add about
2023-09-20 07:05:58 +02:00
4cf0fac16e
libui: Add a basic Label component
2023-09-20 07:05:58 +02:00
67eac983b5
libui: Clarify that Font is only used for low-level glyph rendering
2023-09-20 07:05:57 +02:00
2643f050eb
libui: Zero-initialize counter variables in Layout
2023-09-20 07:05:57 +02:00
669e2747a7
wind: Move more fallible operations before window creation
2023-09-20 07:05:57 +02:00
06f3affc71
wind: Make sure stdin is always a TTY
2023-09-20 07:05:57 +02:00
5db1c3722c
libui+wind+libos: Move shared memory handling code to os::SharedMemory
2023-09-20 07:05:57 +02:00
17248e4ccc
libui: Add default handlers for events in Widget
2023-09-20 07:05:57 +02:00
5908b07ee2
libui: Propagate Container events only if they are in the child widget's rect
2023-09-20 07:05:57 +02:00
a023811c26
libui+wind: Handle mouse leave events when the mouse leaves a window
2023-09-20 07:05:57 +02:00
5385b1c337
wind: Stop using the removed 'signal' pledge
2023-09-20 07:05:57 +02:00
5bd2b3d81d
libui: Install the built library into the system root
2023-09-20 07:05:56 +02:00
ad001b4ee7
wind: Show memory usage in debug output
2023-09-20 07:05:56 +02:00
88a202ba33
wind: Handle ftruncate() and mmap() errors properly
2023-09-20 07:05:56 +02:00
b656ceedfe
wind: Fix client references being out-of-date in windows when disconnecting other clients
...
Classic "keeping a pointer to an element inside a vector after the vector is updated" bug, ah yes.
2023-09-20 07:05:56 +02:00
d43d06604d
taskbar: Wait for terminated child windows
2023-09-20 07:05:56 +02:00
6375fb965a
wind: Add debug keybind
2023-09-20 07:05:56 +02:00
7e7f0a96f5
wind+libos+libui: Handle interrupted reads properly
2023-09-20 07:05:55 +02:00
8c4e9dff96
base: Actually add the start icon to source control
2023-09-20 07:05:55 +02:00
345cf5cae3
libui: Add Buttons
2023-09-20 07:05:55 +02:00
d6f63c0a5d
libui: Handle other mouse events
2023-09-20 07:05:55 +02:00
35c7011997
libui: Add aligned items using Containers, ImageWidget
2023-09-20 07:05:55 +02:00
f657ee9ba9
libui: Add VerticalLayout
2023-09-20 07:05:55 +02:00
5703faf50f
wind+libui+taskbar: Add GetScreenRect IPC, non-decorated windows, taskbar
2023-09-20 07:05:54 +02:00
4d068beaaf
libui: Actually fill window backgrounds with the correct color
2023-09-20 07:05:54 +02:00
819baa0cd5
libui: Add basic widget and layout system =D
2023-09-20 07:05:54 +02:00
69bb22095f
ui+wind: Send mouse move events through IPC
2023-09-20 07:05:54 +02:00
062b09e20c
wind+libui: Add protocol for window close requests
2023-09-20 07:05:54 +02:00
2328987d81
libos+libui+wind: Use uppercase for static struct IDs to avoid confusion with fields
2023-09-20 07:05:54 +02:00
820b1ae2ba
libui+gclient: Add basic OOP wrappers around the IPC protocol
2023-09-20 07:05:53 +02:00
0fb47d90a7
wind+gclient: Add SetWindowTitle and support shm buffers
2023-09-20 07:05:53 +02:00
0127068177
gclient: Create two example windows
2023-09-20 07:05:53 +02:00
d3dd257dc1
wind: Handle CreateWindow IPC messages
2023-09-20 07:05:53 +02:00
1eb00eabfa
libui: Add CreateWindow IPC message definitions
2023-09-20 07:05:53 +02:00
9125561cab
libos: Add basic IPC message framework
2023-09-20 07:05:53 +02:00
3d90d7f98e
kernel: Fix poll syscall
2023-09-20 07:05:52 +02:00
e931d11ae1
wind: Monitor data on client connections
2023-09-20 07:05:52 +02:00
6a35cad8d5
kernel: Add POLLHUP and store it when a polled socket's peer disconnects
2023-09-20 07:05:52 +02:00
5e6ce50c70
libui: Add copyright/author text
2023-09-20 07:05:52 +02:00
02b9dc579b
libos: Add copyright/author comments to LocalServer and LocalClient
2023-09-20 07:05:52 +02:00
774177ba1f
wind: Use init --user and pledge()
2023-09-20 07:05:52 +02:00
7d883fe33b
Update .gitignore
2023-09-20 07:05:52 +02:00
1c50d5133f
libos: Remove some shared pointers and change them to owned/live on the stack
2023-09-20 07:05:52 +02:00
6cf5fa3097
wind: Spawn a new client process after startup
...
Also, create the socket after dropping privileges.
2023-09-20 07:05:52 +02:00
60c3bcb3a9
apps: Add gclient
2023-09-20 07:05:51 +02:00
03096680ae
libos: Add os::LocalClient
2023-09-20 07:05:51 +02:00
639eb30c7b
libui: Change 'into' to 'onto'
2023-09-20 07:05:51 +02:00
0bb96985bf
libui: Document ui::Font
2023-09-20 07:05:51 +02:00
fbb66a9fc3
libui+wind: Move some static variables inside functions
2023-09-20 07:05:51 +02:00
3fefb74710
wind: Generate random windows on keypresses
2023-09-20 07:05:51 +02:00
11e0025a5b
wind: Make sure windows have a minimum size to fit the titlebar
2023-09-20 07:05:51 +02:00
98aaf1f7ff
libui: Properly cut off the last drawn character if necessary
2023-09-20 07:05:51 +02:00
c0ada40e2c
libui: Add Rect::contains(Rect)
2023-09-20 07:05:50 +02:00
35d2bd6931
libui: Render font characters properly with no spacing, matching the width calculations
2023-09-20 07:05:50 +02:00
25ad2b17aa
wind: Render an actual TGA mouse cursor
2023-09-20 07:05:50 +02:00
6d78fc64f9
wind: Add a close button to windows using a TGA icon
2023-09-20 07:05:50 +02:00
dc91d047de
libui: Add support for TGA image loading
2023-09-20 07:05:50 +02:00
916b19825d
libui: Add an interface to fill a Canvas with an array of pixels
2023-09-20 07:05:50 +02:00
f6ef79e759
wind: Add window titlebars using ui::Font
2023-09-20 07:05:50 +02:00
23f7210a87
libui: Add PSF font loading and rendering
2023-09-20 07:05:50 +02:00
c6c32f34f2
libui: Add Color::GRAY
2023-09-20 07:05:50 +02:00
16fa55899e
libui: Rename Rect::absolute to normalized and add a new absolute function
2023-09-20 07:05:50 +02:00
7ab0c6b72b
libluna: Add assignment operators to Buffer
2023-09-20 07:05:49 +02:00
277953065a
wind: Reorder drag sequence
2023-09-20 07:05:49 +02:00
2b3e9b778a
libui: Add Rect::relative
2023-09-20 07:05:49 +02:00
7441e396b3
libui: Remove redundant statement
2023-09-20 07:05:49 +02:00
07dc7064f8
libui: Add getters for separate color values
2023-09-20 07:05:49 +02:00
01da7be57c
libui: Remove unnecessary stuff
2023-09-20 07:05:49 +02:00
b6c85595be
base: Remove startup items not necessary for GUI startup
2023-09-20 07:05:49 +02:00
8859fc3d6a
libui+wind: (Draggable) windows
2023-09-20 07:05:49 +02:00
335911c287
wind: Create a local server object
2023-09-20 07:05:49 +02:00
b6fe96e364
libos: Add a new LocalServer class for local domain sockets
2023-09-20 07:05:49 +02:00
15192837c0
kernel: Support listening sockets in poll()
2023-09-20 07:05:48 +02:00
5b89fccb6a
base: Start wind on startup instead of the shell
2023-09-20 07:05:48 +02:00
36cc84c50d
wind: Add a simple display server skeleton using libui
...
No client functionality yet, but it's a start.
2023-09-20 07:05:48 +02:00
9df88bac3e
libui: Add a GUI and graphics library
2023-09-20 07:05:48 +02:00
4af337e92d
kernel: Improve the mutex system
continuous-integration/drone/push Build is running
2023-09-20 07:05:33 +02:00
3e896b0f62
kernel:Remove unused legacy variable from sys_mmap()
continuous-integration/drone/push Build is passing
2023-09-12 22:07:17 +02:00
66e3d71dbc
kernel/ATA: Fix sector number calculation for ATA drives
continuous-integration/drone/push Build is passing
2023-09-07 11:28:46 +02:00
6065b63801
kernel/ext2: Add support for files larger than 4MB
continuous-integration/drone/push Build is passing
2023-09-06 09:56:24 +02:00
e029679fba
kernel: Fix negative movement in the PS/2 mouse driver
continuous-integration/drone/push Build is passing
2023-09-05 10:46:05 +02:00
15f4f7c72f
apps: Remove pivot_root
...
continuous-integration/drone/push Build is passing
This functionality is intended to be used only by preinit, so it doesn't make sense to make it a command-line utility.
2023-09-04 13:12:55 +02:00
0002c2314c
kernel: Handle tab properly in the terminal
2023-09-04 13:12:08 +02:00
27eacac19c
kernel: Add a blinking cursor to the terminal
continuous-integration/drone/push Build is passing
2023-09-04 11:44:35 +02:00
c5e11bb6cf
apps+base+libc: Use /usr/bin paths instead of /bin everywhere
2023-09-04 11:44:10 +02:00
3c9b2c49aa
init: Fix wrong log message
2023-09-04 11:43:36 +02:00
1528c772fd
kernel: Store the full command line of a process
2023-09-04 11:43:11 +02:00
39ba4c9087
ls: Add colors to output
continuous-integration/drone/push Build is passing
2023-09-02 20:01:10 +02:00
c524dc8d58
libluna+kernel: Basic ANSI escape sequences
2023-09-02 19:35:42 +02:00
e76a91d5d0
libc+libluna: Move the scanf implementation from libc to libluna
2023-09-02 15:48:58 +02:00
cb0d5cb6a1
rm: Add the -v flag
continuous-integration/drone/push Build is passing
2023-09-02 14:46:14 +02:00
06aa7725a1
libos: Stop using syscalls directly and proxy to libc
2023-09-02 14:27:04 +02:00
64f9e9dcde
libluna: Document Check.h
continuous-integration/drone/push Build is passing
2023-08-28 12:27:41 +02:00
9c912ddc51
libluna: Document Heap.h
2023-08-28 12:20:42 +02:00
419604a4d2
libluna: Document Buffer
continuous-integration/drone/push Build is passing
2023-08-28 11:10:04 +02:00
97037b06cb
libluna: Document Ignore.h and ImplPOSIX.cpp
2023-08-27 20:50:53 +02:00
c2f173f584
libc: Call __builtin_trap() in abort() if all else fails
2023-08-27 20:49:18 +02:00
a772d92e6f
libluna: Fix initial allocation for HashTable
2023-08-27 20:48:50 +02:00
6f3ed70363
kernel+libluna: Avoid scrubbing when the memory is going to be overwritten anyway
...
This is the case for objects with constructors and temporary memory which is filled afterwards.
2023-08-27 20:48:33 +02:00
d48142f163
libluna: Document HashMap and HashTable
2023-08-26 20:50:12 +02:00
cbea66c533
libos+libluna: Fix misspellings of "succeeded"
2023-08-26 20:49:57 +02:00
c6d817a0fd
libluna: Document Hash.h
2023-08-26 20:31:16 +02:00
55c362eecf
libluna: Document Format
continuous-integration/drone/push Build is passing
2023-08-26 12:59:22 +02:00
9fd8b10b3f
libluna: Document CString, CType and DebugLog
2023-08-26 12:43:44 +02:00
516d6bc65e
libluna: Document CircularQueue, CPath and CRC32
2023-08-26 12:33:12 +02:00
4becb2e427
init: Log requested exits
continuous-integration/drone/push Build is passing
2023-08-24 15:28:20 +02:00
3e174337ab
init: Hostname validation
2023-08-24 15:28:08 +02:00
0f377e7289
libluna: Fix off-by-one size calculation in Base64::decode_string()
continuous-integration/drone/push Build is passing
2023-08-24 12:06:01 +02:00
798a6d63aa
libluna: Document Bitset.h
2023-08-23 14:45:53 +02:00
3f1e6fc2ff
libluna+kernel: Move luna/Syscall.h to the kernel API directory
...
continuous-integration/drone/push Build is failing
A kernel-specific header has nothing to do in libluna.
2023-08-23 14:35:21 +02:00
b8ae61b7c7
libluna: Document Bitmap
continuous-integration/drone/push Build is failing
2023-08-23 13:50:45 +02:00
1449e966ab
libluna: Document Base64.h
2023-08-23 13:34:14 +02:00
24f9dd22ec
libluna: Document Attributes.h and Badge.h
2023-08-23 13:24:28 +02:00
b8e70996c3
libluna: Document Atomic.h
2023-08-23 13:04:47 +02:00
6058a69182
libluna: Document Alloc.h
2023-08-23 11:08:18 +02:00
e247310ded
libluna: Document Alignment.h
2023-08-23 11:04:05 +02:00
a35ca0b367
libluna+kernel: Add Bitset and use it for signals
continuous-integration/drone/push Build is passing
2023-08-23 10:51:02 +02:00
d144a818d8
kernel: Completely prevent sending signals to kernel threads
continuous-integration/drone/push Build is passing
2023-08-22 15:25:05 +02:00
33c1a9c92b
init: Add a configurable service directory
continuous-integration/drone/push Build is passing
2023-08-22 15:23:06 +02:00
65834ff491
edit: Make it more user-friendly
2023-08-22 15:17:13 +02:00
5c2718545f
base+tools: Add a welcome file and store the license inside the OS
2023-08-22 15:08:07 +02:00
e5905a33e1
init: Stop using the removed 'signal' pledge
continuous-integration/drone/push Build is passing
2023-08-22 13:36:33 +02:00
993e94cc76
kernel: Remove the 'signal' promise and make signal functions require stdio instead
...
continuous-integration/drone/push Build is failing
This follows OpenBSD and makes it so stdio is sufficient for an abort() call.
2023-08-22 13:34:30 +02:00
746834e2d9
kernel: Silently ignore TTY writes in graphical mode
continuous-integration/drone/push Build is passing
2023-08-22 13:31:31 +02:00
ce3542e2bd
apps+base: Remove many legacy test apps
continuous-integration/drone/push Build is passing
2023-08-22 13:29:52 +02:00
e72bc55c6f
tools: Maybe, this finally works for CI...
continuous-integration/drone/push Build is passing
2023-08-22 10:19:17 +00:00
2abb43d709
kernel+libos: Call Vector::try_reserve where it is appropriate
continuous-integration/drone/push Build is failing
2023-08-22 11:54:00 +02:00
70a232cfcd
libluna: Make Vector grow exponentially
2023-08-22 11:53:42 +02:00
30ff704342
libluna+libos: Install built libraries into the system root
...
continuous-integration/drone/push Build is failing
This is less important for libluna, as it is built into libc, but is needed to link programs compiled inside Luna with libos.
2023-08-21 14:06:32 +02:00
6e69d37d62
tools: Fix building ports from git repository
continuous-integration/drone/push Build is failing
2023-08-19 19:54:37 +02:00
f2a5c9ad3f
apps: Add free
continuous-integration/drone/push Build is failing
2023-08-17 20:15:39 +02:00
95a33c484e
kernel+libc: Add a memstat() syscall
...
We can finally show memory usage in userspace.
This could have been done using sysfs, but I'm lazy and don't want to implement that. Maybe in the next release?
2023-08-17 20:15:32 +02:00
4a654bf093
kernel: Handle OOMs better and without deadlocking
...
Use a separate task to do it.
Also fix a bug where the init thread would get no kernel stack ever since 5f698b477
.
2023-08-17 20:14:33 +02:00
d43590e68c
kernel: Improve Your Disk IO performance by 500% with this One Trick!
...
continuous-integration/drone/push Build is failing
The trick being caching lol.
2023-08-16 14:54:13 +02:00
c1f4997448
all: Start calling this release 0.5.0
continuous-integration/drone/push Build is failing
2023-08-16 09:57:38 +02:00
7b88b9cea3
kernel/ext2: Replace a manually allocated buffer with Buffer
continuous-integration/drone/push Build is failing
2023-08-16 09:15:29 +02:00
54cc80f649
kernel/ATA: Replace a manually allocated buffer with Buffer
...
This also lets us keep it empty unless it is used, in which case we resize it (if it wasn't already resized).
2023-08-16 09:15:00 +02:00
b8f81502b8
kernel: Fix some debug messages that are not shown by default
2023-08-16 09:03:25 +02:00
e8e05159c1
libluna+kernel: Make CRC32 a class
2023-08-15 19:27:09 +02:00
49a6c39c38
libc: Implement popen() and pclose()
2023-08-15 19:21:25 +02:00
706752d6b9
kernel: Return SIGPIPE/EPIPE when writing to a pipe with no more readers
2023-08-15 19:08:37 +02:00
1e68ac7312
Finally a working toolchain?
continuous-integration/drone/push Build is failing
2023-08-15 15:40:44 +02:00
6761b3fcaf
tools: Finally a proper autoconf build?
continuous-integration/drone/push Build is failing
2023-08-14 11:54:11 +02:00
71d1084be2
tools: Place autoconf in the correct path
continuous-integration/drone/push Build is failing
2023-08-14 09:34:36 +00:00
f65deb727a
tools: Fix filename in setup-autoconf.sh
continuous-integration/drone/push Build is failing
2023-08-14 11:27:47 +02:00
d07f592306
tools: Fix message printing in setup-autoconf.sh
continuous-integration/drone/push Build is failing
2023-08-14 11:26:18 +02:00
cad0bd8c48
tools: Build autoconf if needed and use it to patch libstdc++
continuous-integration/drone/push Build is failing
2023-08-14 11:18:53 +02:00
db3151d93b
init: Add some missing pledges
continuous-integration/drone/push Build is failing
2023-08-14 11:08:19 +02:00
ba3e32917e
init: Support starting services as a separate user
continuous-integration/drone/push Build is failing
2023-08-14 10:46:45 +02:00
cfb60fad25
init: Use pledge and support init --user
2023-08-14 10:46:28 +02:00
9954fc1658
libos: Add a pledge wrapper
2023-08-14 10:45:00 +02:00
a98df9e743
kernel: Return EACCES when trying to apply execpromises to a setuid program
...
Closes #41 .
2023-08-14 09:50:52 +02:00
e2a77bb3da
kernel+libc: Add pledge support
continuous-integration/drone/push Build is failing
2023-08-12 21:38:25 +02:00
0ae409ae22
ports: Some enhancements in make-package.sh
continuous-integration/drone/push Build is failing
2023-08-11 18:25:07 +02:00
181b4c151b
tools: Build libstdc++
2023-08-11 18:24:38 +02:00
0c64b6e040
libc: Add some stub network-related header files
2023-08-11 18:09:45 +02:00
fb3c31907d
fix
2023-08-11 18:09:28 +02:00
52064e0317
libc+kernel: Add alarm() and getpagesize()
2023-08-11 18:09:12 +02:00
ec3c1132d2
libc: Fix constness of some socket functions
2023-08-11 18:00:15 +02:00
5ea73197ad
libluna: Add a bunch more errno definitions
2023-08-11 17:59:41 +02:00
5a1adcb2a6
libc: Add putenv
2023-08-11 17:59:04 +02:00
c4f6191e24
libc: Implement some simple stuff needed for gcc
2023-08-08 22:06:11 +02:00
39e4fbd112
libc: Provide a bunch of math functions wrapped around compiler builtins
2023-08-08 20:38:38 +02:00
32fd6889b9
ports: Add pkg-config wrapper
continuous-integration/drone/push Build is passing
2023-08-08 20:28:11 +02:00
c6a5a81a7a
ports: Port required libraries to build GCC
continuous-integration/drone/push Build is passing
2023-08-08 19:51:45 +02:00
3f55a70f6e
ports: Auto-strip binaries, remove libtool .la files, add dependencies
2023-08-08 19:46:04 +02:00
b1e164f360
libc. Add basic wchar.h
2023-08-08 19:43:23 +02:00
ed8b210639
kernel: Detect some other cases of non-DMA support
continuous-integration/drone/push Build is passing
2023-08-08 18:23:13 +02:00
16590dbb02
ports: Avoid using two separate directories for port packages
continuous-integration/drone/push Build is passing
2023-08-08 17:43:27 +02:00
919c71ff85
README: More features
continuous-integration/drone/push Build is passing
2023-08-08 16:19:38 +02:00
1caa2c0888
Update README.md
continuous-integration/drone/push Build is passing
2023-08-08 16:04:10 +02:00
8748364b7e
ports: Add a binutils port =D
...
continuous-integration/drone/push Build is passing
I can't believe the fact that there is a working gas and ld on Luna. At least, for a hello world program anyway :)
objdump seems to have some problems with stack size in some cases, but apart from that, no crashes.
And that can easily be solved with either more stack preallocation or stack resizing in the kernel on page faults.
2023-08-08 16:00:31 +02:00
49662b6069
tools: Calculate the needed fs size dynamically
2023-08-08 15:43:20 +02:00
d96ff92461
libc: Add borrowed strtod implementation
2023-08-08 15:17:25 +02:00
bfb76b5625
kernel: Properly expose block device sizes with the new metadata API
2023-08-08 15:17:08 +02:00
8c13513bf4
libc: Add strcoll()
continuous-integration/drone/push Build is passing
2023-08-08 14:40:14 +02:00
37e9b25b62
apps: Add touch
continuous-integration/drone/push Build is passing
2023-08-08 14:34:58 +02:00
a92077d311
kernel+libc: Add all variants of utime
continuous-integration/drone/push Build is passing
2023-08-08 14:14:35 +02:00
1481a4736a
tmpfs: Update mtime on writes
continuous-integration/drone/push Build is passing
2023-08-08 13:36:25 +02:00
4195e7f206
kernel+libc+stat: Add support for file times
...
continuous-integration/drone/push Build is passing
The modification time is not updated though.
2023-08-08 13:33:40 +02:00
159c05c064
libluna: Add max() and min()
continuous-integration/drone/push Build is passing
2023-08-08 12:39:03 +02:00
b63a8ff245
libluna: Move get_blocks_from_size to a new header and call it ceil_div instead
continuous-integration/drone/push Build is passing
2023-08-08 11:58:33 +02:00
917203ef11
kernel: Run the init function in a separate block to free everything before kernel_exit is called
continuous-integration/drone/push Build is passing
2023-08-08 10:44:18 +02:00
826be882a9
kernel: Interrupt syscalls before exiting because of a signal
...
Closes #40 .
2023-08-08 10:41:46 +02:00
198935eb30
libc: Reset the read buffer even when read() returns an error
...
This fixes the same data being read multiple times if an error was returned
2023-08-08 10:39:15 +02:00
7c254e5e15
kernel: Properly check memory bounds in strdup_from_user()
...
continuous-integration/drone/push Build is passing
Missed this one in 097353e779
.
2023-08-08 10:27:19 +02:00
2e63b93e48
libos: Remove debug statements from Process::spawn()
continuous-integration/drone/push Build is passing
2023-08-07 22:53:37 +02:00
77ebdda2e0
libos: Add Process::spawn()
continuous-integration/drone/push Build is passing
2023-08-07 22:49:12 +02:00
097353e779
kernel: Properly check memory bounds while touching user memory
...
Before this patch, one byte of each page was being accessed without checking the page's permissions.
2023-08-07 22:49:00 +02:00
10c892d606
kernel: Allow null envp in execve()
...
As far as I know, this is not standard, but I'm doing this as a convenience for programs using exec() right after clearenv().
2023-08-07 22:48:21 +02:00
f45734c61d
kernel/ATA: Stop storing ATA::Drive in a separate shared pointer
continuous-integration/drone/push Build is passing
2023-08-07 19:22:57 +02:00
bc20e1a31b
kernel: Store FD_CLOEXEC in the file descriptor itself
...
continuous-integration/drone/push Build is passing
Closes #39 .
2023-08-03 17:47:18 +02:00
b01aa72f17
libc+init+shmem-test: Add POSIX shared memory objects
continuous-integration/drone/push Build is passing
2023-08-03 10:32:52 +02:00
d41fb85466
libluna/SharedPtr: Count references with separately created objects properly
2023-08-03 10:32:22 +02:00
5aa042a5f2
kernel: Add constructors to SharedMemory
2023-08-03 10:31:58 +02:00
f150425222
kernel: Create a new shared memory object if the old one was lost
2023-08-03 10:31:29 +02:00
842b212685
kernel: Set a SharedMemory object's prot value
2023-08-03 10:30:43 +02:00
641b65da0f
kernel: Take devices into account in SharedMemory::free()
2023-08-03 09:33:10 +02:00
bfcca3a220
gol: Use memory-mapped IO
continuous-integration/drone/push Build is passing
2023-08-03 09:26:35 +02:00
b5d146b492
kernel/mmap: Fix some parameters
2023-08-03 09:26:21 +02:00
b447c1a261
kernel: Set the shmem->inode field in query_shared_memory
2023-08-03 09:25:56 +02:00
f8e86b3b01
fix
2023-08-03 09:25:38 +02:00
d8f6af99b8
kernel: Let devices use shared memory
2023-08-03 09:25:23 +02:00
c5e24e478f
kernel+libc: Add truncate and ftruncate
continuous-integration/drone/push Build is passing
2023-08-03 08:47:37 +02:00
53d9f5c6fc
libc: Add msync wrapper
continuous-integration/drone/push Build is passing
2023-08-02 22:44:54 +02:00
84c1ac4cee
kernel: Add msync
continuous-integration/drone/push Build is passing
2023-08-02 22:39:07 +02:00
7293d47bf0
apps: Add shmem-test
continuous-integration/drone/push Build is passing
2023-08-02 22:20:05 +02:00
f66b0497cf
libc: Add support for mmap()'s new syscall format
2023-08-02 22:20:05 +02:00
2572695c8d
kernel: Support mapping shared memory using mmap()
2023-08-02 22:20:05 +02:00
9443551d71
kernel: Add shared memory
2023-08-02 22:20:05 +02:00
b4527786d4
kernel/MMU: Don't copy pages on clone and allow manipulating other page directories
2023-08-02 22:17:32 +02:00
3aaf1c5d84
apps: Rename mouse to input, read keyboard packets as well
continuous-integration/drone/push Build is passing
2023-08-02 17:20:26 +02:00
4794d0dfef
kernel: Add a keyboard device for graphical session
2023-08-02 17:20:13 +02:00
9c1e275f34
kernel: Make /dev/mouse read-write only for root
2023-08-02 17:19:37 +02:00
6593f9241b
libc: Add wrapper for poll()
2023-08-02 17:19:16 +02:00
df4227eab8
kernel: Make the poll() system call actually work
2023-08-02 17:18:38 +02:00
f8cb6e03df
kernel: Allow turning off the TTY by setting it to graphical mode
continuous-integration/drone/push Build is passing
2023-08-02 15:16:10 +02:00
207d901de8
kernel+libc: Add the poll() syscall
continuous-integration/drone/push Build is passing
2023-08-02 14:48:20 +02:00
df77fc8de8
libluna: Remove make_array() and destroy_array()
...
Placement new on arrays is a bit unreliable and could cause out-of-bounds data accesses.
2023-08-02 14:47:58 +02:00
b1fb6dee8a
login: Create a new process group to log in
2023-08-02 14:47:13 +02:00
aac8280e8a
libc+libos: Properly propagate errors through fgetc() and File::getchar()
...
This restores proper ^C behavior in the shell.
2023-08-02 14:46:47 +02:00
d0ceec6952
mouse: Show textual description of buttons
continuous-integration/drone/push Build is passing
2023-08-02 13:58:17 +02:00
7983d63b8e
libos: Add documentation for os::File::BufferingMode
continuous-integration/drone/push Build is passing
2023-08-02 13:15:51 +02:00
2198dedb96
apps: Add mouse
...
continuous-integration/drone/push Build is passing
A simple mouse packet reader.
2023-08-02 11:56:12 +02:00
cd9219df52
tools: Install kernel API headers into /usr/include/moon
2023-08-02 11:56:00 +02:00
e8f3dd4cf9
kernel: Add a PS/2 mouse driver
2023-08-02 11:55:45 +02:00
6c26236167
libluna: Add CircularQueue::is_empty()
2023-08-02 11:55:08 +02:00
b17793134e
libos: Let users change the buffering mode of a File
2023-08-02 11:54:47 +02:00
dc35c42371
kernel/VFS: Rework the metadata system so that there is a single metadata struct
continuous-integration/drone/push Build is passing
2023-08-01 17:20:28 +02:00
4c87d72b44
kernel/binfmt: Add documentation + support script interpreters being scripts themselves
continuous-integration/drone/push Build is passing
2023-07-31 20:41:18 +02:00
d01087362e
libc: Set the close-on-exec flag for directories opened using opendir()
...
This is apparently mandated by POSIX.
2023-07-31 10:58:06 +02:00
3598dacbed
init: Remove support for 'Script' parameters
...
continuous-integration/drone/push Build is passing
This can now be changed to good old 'Command', putting a shebang into the script,
thanks to the new shebang support in the kernel.
2023-07-30 18:47:38 +02:00
3638d3da46
kernel: Add binary format for shebang scripts
2023-07-30 18:46:19 +02:00
1c76675e40
kernel: Add a framework to add more executable formats, possibly from userspace
...
This lets us implement shebangs and possibly an interface similar to Linux's binfmt_misc.
2023-07-30 18:25:44 +02:00
6e269c6bc4
preinit: Search for init in several directories
continuous-integration/drone/push Build is passing
2023-07-30 13:08:53 +02:00
43fa128e29
Update README.md
continuous-integration/drone/push Build is passing
2023-07-30 11:55:20 +02:00
8475a3aad9
socket-client: Send a user-provided message to the server
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-07-30 11:46:53 +02:00
187f0ff83e
kernel: Rename Inode::blocking() to Inode::will_block_if_read()
continuous-integration/drone/pr Build is passing
2023-07-30 11:41:53 +02:00
0c873923e8
kernel: Make OpenFileDescription shareable
continuous-integration/drone/pr Build is passing
2023-07-30 11:33:46 +02:00
63745565db
apps: Add socket client
continuous-integration/drone/pr Build is failing
2023-07-30 11:33:06 +02:00
7b24a4d1c6
libc: Add wrappers for listen(), connect(), and accept()
2023-07-30 11:33:06 +02:00
8d3b3aaf05
libluna: Add a few more network-related errno codes
2023-07-30 11:33:06 +02:00
bb3127c212
kernel: Implement listen(), connect() and accept()
2023-07-30 11:33:06 +02:00
cca806f088
libluna: Add a variant of CircularQueue that dynamically allocates its buffer at runtime
...
This is needed to implement the backlog queue for listening sockets.
2023-07-30 11:33:06 +02:00
7a7ae086f5
kernel: Use a did_close callback for UnixSockets
2023-07-30 11:33:06 +02:00
fb08594a18
kernel: Separate FileDescriptors and OpenFileDescription
...
Also, add a did_close() callback for OpenFileDescriptions losing all their references.
2023-07-30 11:33:06 +02:00
9303c44269
apps: Add socket-test
2023-07-30 11:33:06 +02:00
a12b018b03
kernel+libc: Add basic Unix sockets (creation and binding)
2023-07-30 11:33:06 +02:00
c4e30c3029
kernel: Add functionality to allow external inodes (such as sockets) to acquire an inode number from a file system
...
This is only implemented in tmpfs.
2023-07-30 11:33:06 +02:00
c1d08b904e
kernel+libluna: Add Buffer::dequeue_data()
2023-07-30 11:33:05 +02:00
200bb6c240
kernel+libc+libos: Add inode type for sockets
2023-07-30 11:33:05 +02:00
6b0bc66fd2
libluna: Add new socket-related errno codes
2023-07-30 11:33:05 +02:00
4ed7ec5e93
libluna: Store SharedPtr's ref count in the object itself
continuous-integration/drone/push Build is passing
2023-07-30 11:32:46 +02:00
28cc4b2306
kernel: Add default action for SIGWINCH
continuous-integration/drone/push Build is passing
2023-07-27 14:00:30 +02:00
11df5a2ec3
kernel: Use pid_t internally for process IDs
...
continuous-integration/drone/push Build is passing
This removes a bunch of casts between pid_t and u64, and makes more sense since pid_t is literally the data type for process IDs.
2023-07-26 21:32:00 +02:00
5aad7d3154
kernel/x86_64: Fail on invalid interrupts instead of calling FIXME_UNHANDLED_INTERRUPT
...
continuous-integration/drone/push Build is passing
A FIXME is something that should be changed later,
this is a check for something that should never happen.
2023-07-25 18:23:33 +02:00
58fa297068
libluna: Wrap around when iterating through a HashTable's buckets array
...
continuous-integration/drone/push Build is passing
Why am I so dumb?
2023-07-25 18:19:45 +02:00
28dd8194af
kernel: Include waited-for grandchildren in RUSAGE_CHILDREN's times
continuous-integration/drone/push Build is passing
2023-07-25 17:50:15 +02:00
b88da4811f
kernel: Remove debug message in readlink
continuous-integration/drone/push Build is passing
2023-07-25 17:30:56 +02:00
7f990b161b
libluna: Fix comparison of StringViews without null termination
...
continuous-integration/drone/push Build is passing
This regressed in de7e58c274
, and made value arguments pretty much unusable.
This really needs a test...
2023-07-25 17:25:18 +02:00
9bb3fed611
libluna: Use the right unsigned integer type for wcscmp()'s return type
2023-07-25 17:23:27 +02:00
105ed79f8f
kernel: Reenable userspace stack tracing, but hidden behind a config flag
...
continuous-integration/drone/push Build is passing
Sometimes this is needed for userspace program debugging (such as ports),
but sometimes it can crash, so we leave it off by default.
2023-07-25 17:02:09 +02:00
905e71527e
libc: Actually implement sigsetjmp() and siglongjmp()
2023-07-24 19:39:22 +02:00
c6d91c89cd
stat: Change program description
continuous-integration/drone/push Build is passing
2023-07-24 19:17:36 +02:00
2e2b87b714
ports+tools: Add bc port
...
continuous-integration/drone/push Build is passing
It segfaults when writing "about", but oh well...
2023-07-24 19:14:22 +02:00
b12f42cfe2
libc: Add SIGWINCH
...
Not used for anything at the moment, I guess if a user program wants to send it...
Required by bc.
2023-07-24 19:11:06 +02:00
c70790bf62
ports: Add some defaults for CMake projects as well
continuous-integration/drone/push Build is passing
2023-07-24 18:50:51 +02:00
a990cc145e
ports: Add initial documentation to the port system
continuous-integration/drone/push Build is passing
2023-07-24 18:29:44 +02:00
b0d7870ec6
ports: Add minitar (with examples!)
continuous-integration/drone/push Build is passing
2023-07-24 17:20:54 +02:00
9a00b29304
ports: Basic ports system + nasm port
continuous-integration/drone/push Build is passing
2023-07-24 17:07:49 +02:00
033aff4f6c
all: Error out on bidirectional characters (CVE-2021-42574)
continuous-integration/drone/push Build is passing
2023-07-24 15:06:48 +02:00
c5af1bcef9
libc: Fix typo in fopen description
continuous-integration/drone/push Build is passing
2023-07-24 11:57:47 +02:00
b3c478f19e
init: Make the log stream line-buffered
...
continuous-integration/drone/push Build is passing
Looks like log output stopped showing after buffering was implemented, since the log was not flushed properly.
2023-07-24 11:54:49 +02:00
ad3f3bf4db
kernel: Log the release name and build date in the boot log
2023-07-24 11:48:01 +02:00
01359af288
tools: Make the Ext2 partition bigger (32M)
continuous-integration/drone/push Build is passing
2023-07-22 16:11:34 +02:00
eeb9e16a74
libos: Make os::File a wrapper around stdio's FILE
...
continuous-integration/drone/push Build is passing
This way, os::File benefits from the same buffering as stdio.h does.
2023-07-22 12:40:02 +02:00
358493a7bc
kernel: Add a system for release names in uname(), call alpha releases "Mercury"
continuous-integration/drone/push Build is passing
2023-07-22 12:21:01 +02:00
5110d740b8
all: Update the version number to 0.4.0
continuous-integration/drone/push Build is passing
2023-07-22 12:11:02 +02:00
759fb4fe0e
tools: Make replace-stdint.sh replace types only if they're followed by a space
...
continuous-integration/drone/push Build is passing
Otherwise, size_to_read -> usizeo_read.
2023-07-22 11:59:41 +02:00
098109f16b
tools: Make sure formatting scripts cover all sources
2023-07-22 11:59:02 +02:00
9ef09cfc88
libc+libluna: Add case-insensitive string comparison functions
2023-07-22 11:58:28 +02:00
c17e1a5802
Update README.md
continuous-integration/drone/push Build is passing
2023-07-22 11:45:35 +02:00
085d2895e8
libc: Implement setbuf(), setbuffer(), and setlinebuf()
...
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
These are all simple wrappers around setvbuf().
2023-07-22 11:36:20 +02:00
77022abafd
libc: Implement ungetc
continuous-integration/drone/pr Build is passing
2023-07-22 11:25:20 +02:00
19b4aa9f81
libc: Flush buffers before dealing with file positions
2023-07-22 11:19:48 +02:00
420270ebd4
libc: Implement read buffering =D
2023-07-22 11:17:51 +02:00
d60ad184f1
libc: A bit of nice refactoring
2023-07-22 10:58:34 +02:00
a3ed950be8
libc: Basic write buffers
continuous-integration/drone/pr Build is passing
2023-07-22 00:04:27 +02:00
cfb0ead2d9
libc: Flush all open streams on exit
...
This does nothing for now, but prepares for buffering.
2023-07-21 22:56:03 +02:00
5458286309
libos: Add Process::exit()
continuous-integration/drone/push Build is passing
2023-07-21 21:21:08 +02:00
c72c6312d4
sh: Use input_file instead of hardcoding stdin everywhere in tcsetpgrp()
continuous-integration/drone/push Build is passing
2023-07-21 21:08:27 +02:00
7a4d3ba495
sh: Add a few more shell builtins
continuous-integration/drone/push Build is passing
2023-07-21 21:06:10 +02:00
16b385fc7b
libluna: Some fixes so that HashTable collisions work properly
2023-07-21 21:04:25 +02:00
4439ef8ec6
sh: Add a system to easily add flexible shell builtins
continuous-integration/drone/push Build is passing
2023-07-21 20:44:01 +02:00
ff9e01641e
apps: Add a Game of Life implementation
continuous-integration/drone/push Build is passing
2023-07-21 15:51:21 +02:00
36a74fd8d6
kernel/x86_64: Provide an alternate kernel stack for exceptions
...
continuous-integration/drone/push Build is passing
This avoids stack-related triple faults, hopefully.
Closes #33 .
2023-07-21 15:14:52 +02:00
310b325af8
kernel: Avoid some more -Wconversion errors in TextConsole
2023-07-21 15:14:05 +02:00
0d924f89d3
tools: Avoid making the tests interfere with the main build directory
continuous-integration/drone/push Build is passing
2023-07-21 14:49:59 +02:00
de7e58c274
StringView: Fix equality operator
continuous-integration/drone/push Build is passing
2023-07-21 14:26:54 +02:00
c24a261233
tools: Do not use KVM when it's not supported
continuous-integration/drone/push Build is passing
2023-07-21 14:17:14 +02:00
edeb420d0d
Update drone.yml
continuous-integration/drone/push Build is failing
2023-07-21 14:11:44 +02:00
cd6bf745a7
tests+kernel+init: Run tests automatically in a headless way
continuous-integration/drone/push Build is failing
2023-07-21 14:09:37 +02:00
bcfee628cb
kernel: Remove outdated FIXME
continuous-integration/drone/push Build is passing
2023-07-15 13:19:47 +02:00
0d41e1f7b6
kernel/ext2: Change outdated FIXME
continuous-integration/drone/push Build is passing
2023-07-15 13:17:58 +02:00
f9003d7a58
kernel: Mask away unsafe bits in rflags when restoring state after a signal
continuous-integration/drone/push Build is passing
2023-07-15 11:54:48 +02:00
89786d8be2
kernel: Save/restore the SSE/FPU state when executing signal handlers
2023-07-15 11:53:50 +02:00
de6fe7f7c2
kernel+libc+sh: Make the TTY device actually follow termios rules
...
continuous-integration/drone/push Build is passing
Like, so much more termios compatibility!
2023-07-13 20:33:20 +02:00
efd5bae7a5
kernel: Implement querying the terminal window size
continuous-integration/drone/push Build is failing
2023-07-12 22:09:28 +02:00
78ea5dc352
base: Rename selene-home.sh to mount-home.sh
...
continuous-integration/drone/push Build is passing
This makes its purpose clearer.
2023-07-12 19:47:45 +02:00
6c3ab3b27d
init+base: Allow 'Description' fields in service files
2023-07-12 19:46:53 +02:00
95cce6d592
base: Rename /etc/init/00-selene to 00-home
...
continuous-integration/drone/push Build is passing
This makes its purpose a little bit clearer.
2023-07-12 19:40:42 +02:00
192621eac5
base: Mount the user's home directory before showing the MOTD
...
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
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
continuous-integration/drone/push Build is passing
2023-07-12 19:23:06 +02:00
2951d6d112
libc+tests: Check for manual modifications of environ
...
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()
...
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
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
...
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
continuous-integration/drone/push Build is passing
2023-07-12 11:24:54 +02:00
9cf35f761f
libc: Fix another conversion error
continuous-integration/drone/push Build is passing
2023-07-11 12:45:55 +02:00
a51fb6a428
libc: Fix conversion error in isatty()
continuous-integration/drone/push Build is failing
2023-07-11 12:45:08 +02:00
69f9701097
kernel+libc: Implement isatty()
continuous-integration/drone/push Build is failing
2023-07-11 12:05:09 +02:00
7328cfe734
kernel: Add basic process groups
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
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()
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
continuous-integration/drone/pr Build is passing
2023-07-10 21:39:22 +02:00
e0b5acb2ab
libc: Make struct sigaction C-compatible
continuous-integration/drone/pr Build is passing
2023-07-10 21:19:43 +02:00
66365e15a7
libc: Block and ignore appropriate signals in system()
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
continuous-integration/drone/pr Build is passing
2023-07-10 21:09:12 +02:00
3df40beaf2
libc: Rewrite abort() using the new signals
continuous-integration/drone/pr Build is failing
2023-07-10 21:08:23 +02:00
8066e8f1d8
kernel+libc: Implement sigprocmask() and friends
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
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()
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
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
...
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
continuous-integration/drone/push Build is passing
2023-07-09 20:43:03 +02:00
c599251d2a
kernel: Rename UserVM to AddressSpace
...
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
continuous-integration/drone/push Build is passing
2023-07-08 18:30:39 +02:00
6d9ba8deb4
libos+apps: Make the vector argument more flexible
continuous-integration/drone/push Build is passing
2023-07-08 16:44:02 +02:00
af26dce038
kernel: Zero physical frames instead of virtual pages
...
continuous-integration/drone/push Build is passing
The memset() happens a bit earlier, and we don't have to remap the
mapped virtual memory.
2023-07-04 00:49:26 +02:00
3b1219ecf2
kernel/ext2: Make the inner extended superblock struct packed as well
continuous-integration/drone/push Build is passing
2023-07-02 19:50:27 +02:00
bd757d204e
kernel+libos+libluna: Avoid copying and reallocation when creating Strings
...
continuous-integration/drone/push Build is passing
This is done by reusing the existing buffers in Vector and Buffer instances.
2023-07-02 19:30:25 +02:00
498e20561f
libluna: Add release_data() overloads to Buffer and Vector
...
This can be used to transfer the underlying data to a String object without copying.
2023-07-02 19:29:04 +02:00
d363d5e915
kernel/ext2: Make sure we don't crash when accessing the last inode
continuous-integration/drone/push Build is passing
2023-07-02 17:30:14 +02:00
f0a7098470
apps: Add cp
continuous-integration/drone/push Build is passing
2023-07-02 16:38:24 +02:00
6db0a2649c
libluna: Add a variant of PathParser::join() for relative paths
2023-07-02 16:38:12 +02:00
dd914b16d1
kernel: Stop showing memory stats at boot
...
continuous-integration/drone/push Build is passing
No userspace interface yet, but this can be shown using Shift+Ctrl+M.
2023-07-02 16:02:38 +02:00
f8dc7c62e2
Update README.md
continuous-integration/drone/push Build is passing
2023-07-01 17:40:44 +02:00
21d093b1fa
initrd: Rename test-ext2fs to mount-ext2fs
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-06-25 20:54:37 +02:00
e9e7b22323
kernel: Separate a thread's page directory into two
...
continuous-integration/drone/pr Build is passing
The self directory, and the active directory. The active directory is the one the thread is currently using,
and the self directory is the one the thread owns.
This lets us keep track of both, which fixes ext2 executables crashing the system.
2023-06-25 20:35:40 +02:00
5f4103251a
kernel: Preserve the new page directory while exec() is running
2023-06-25 20:35:40 +02:00
491416ddaf
tools: Bump up the ext2 filesystem size
2023-06-25 20:35:39 +02:00
da689dd1a7
kernel/ext2: Allow reading up to 4 MB of data from files
...
This is done by scanning the singly indirect pointer of the inode.
2023-06-25 20:35:39 +02:00
41f578aa18
kernel/ext2: Add support for symbolic links
2023-06-25 20:35:38 +02:00
34e1ef36b1
kernel: Make pivot_root() reset the parent entry of the new root directory
...
Otherwise it would just be pointing to the old parent fs, and we don't want that.
2023-06-25 20:35:38 +02:00
a62265b504
kernel/ext2: Implement directory traversal
2023-06-25 20:35:37 +02:00
d7486326bf
tools: Generate the Ext2 filesystem using genext2fs instead
...
mkbootimg's filenames have some kind of bug...
2023-06-25 20:35:37 +02:00
4fe6c506ec
kernel/ext2: Implement Inode::read()
2023-06-25 20:35:37 +02:00
77686b26f8
kernel/Ext2: Read the root inode metadata from the disk
2023-06-25 20:35:36 +02:00
2aa7056e11
mount: Put the source argument first
2023-06-25 20:35:36 +02:00
a9460469d9
kernel+libc+apps: Add a source parameter to the mount() system call
2023-06-25 20:35:35 +02:00
707f64acb5
kernel: Add an Ext2 filesystem skeleton
2023-06-25 20:35:35 +02:00
ddf63471a8
kernel: Add missing debug flag to debug.cmake
continuous-integration/drone/push Build is passing
2023-06-25 20:35:15 +02:00
3b6f5b28fc
kernel: Make the configurable filename restrictions actually compile
continuous-integration/drone/push Build is passing
2023-06-22 20:24:33 +02:00
fdf2bb2501
kernel: Make the filename restrictions configurable
continuous-integration/drone/push Build is passing
2023-06-22 20:22:43 +02:00
3d157b760c
kernel: Make the stack and loaded program code regions persistent
...
continuous-integration/drone/push Build is passing
This way, they can't be modified by mmap() or munmap().
2023-06-19 12:44:49 +02:00
54a1998d42
kernel: Also move children's parent to PID 1 in the common thread exit function
continuous-integration/drone/push Build is passing
2023-06-19 12:35:31 +02:00
e60b2a3d2f
kernel: Move thread exit code into a separate common function
continuous-integration/drone/push Build is passing
2023-06-19 12:33:25 +02:00
f052d8630d
libos: Use Vector::shallow_copy() in ArgumentParser
continuous-integration/drone/push Build is passing
2023-06-19 12:23:56 +02:00
8542cf7cbf
libluna: Fix Vector::shallow_copy()
2023-06-19 12:23:39 +02:00
d50ea76bdc
libc: Make tmpfile() create files in /tmp's filesystem
continuous-integration/drone/push Build is passing
2023-06-19 11:52:38 +02:00
2edb0a3f3a
all: Update minor version number to 0.3.0 pre-release
...
continuous-integration/drone/push Build is passing
Not a release yet, but we can give it the version number for it.
2023-06-19 11:41:10 +02:00
b4a6e4d56d
libluna/PathParser: Make dirname() and basename() static functions
...
continuous-integration/drone/push Build is passing
This avoids creating a PathParser to use them, which allocates memory that won't be used.
2023-06-19 11:21:58 +02:00
f22689fcf5
libc: Add stubs for fflush() and ungetc()
continuous-integration/drone/push Build is passing
2023-06-19 10:48:02 +02:00
6bfc7483bc
libc: Add a definition for FILENAME_MAX
2023-06-19 10:47:43 +02:00
acfad51ac0
libc: Add freopen()
2023-06-19 10:46:08 +02:00
7efc3a6ea1
kernel: Show stack traces on page faults + crash the process instead of the whole system on GPFs
2023-06-19 10:45:08 +02:00
0b553cadc0
libluna: Do not fault if vstring_format() is called with buf=nullptr
...
Instead, just discard the output and return the number of bytes formatted, as mandated by the C standard.
2023-06-19 10:44:33 +02:00
ae01a31104
kernel: Make sure the stack is 16-byte aligned on program startup
...
This is required by the System V ABI and fixes some movaps-related GPFs in ndisasm.
2023-06-19 10:41:32 +02:00
795b0ca8d4
libc/scanf: Some refactoring
continuous-integration/drone/push Build is passing
2023-06-19 01:05:32 +02:00
21cc7e3729
libluna: Rename parse_length() to parse_type() in Format.cpp
continuous-integration/drone/push Build is passing
2023-06-19 01:00:05 +02:00
55d147841f
libc+tests: Add type modifiers and integer conversion specifiers to scanf()
2023-06-19 00:59:42 +02:00
a2c081f219
libluna: Allow passing a base to scan_(un)signed_integer()
2023-06-19 00:58:02 +02:00
8c2348c425
libc/scanf: Skip whitespace before %%
continuous-integration/drone/push Build is passing
2023-06-18 23:51:44 +02:00
25e9187826
libc+tests: Add basic support for the scanf family of functions
continuous-integration/drone/push Build is passing
2023-06-18 23:44:30 +02:00
36e6787415
kernel: Make sure addresses allocated by mmap() are ALWAYS page-aligned
...
continuous-integration/drone/push Build is passing
Fixes a kernel crash. Thanks a lot, sysfuzz!
2023-06-18 20:29:32 +02:00
04322d9ff7
kernel: Add a customizable configuration file system
continuous-integration/drone/push Build is passing
2023-06-18 20:18:19 +02:00
b7bdec9ece
kernel: Add a bunch more config definitions and hide debug messages behind them
2023-06-18 20:18:00 +02:00
ec34937f14
tests: Add tests for libluna/CPath.h
2023-06-18 20:15:18 +02:00
08997007f2
libluna: Stop checking initialization status on every bitmap method call
...
continuous-integration/drone/push Build is passing
Since our asserts (expect()) are enabled on release as well, this is kinda expensive.
It's up to the caller, if they receive a null pointer dereference it's
their fault for not initializing their bitmap :)
We do still assert out-of-range indexing and stuff like that.
2023-06-18 19:28:28 +02:00
148c1c7341
libluna: Add the clear_data() method to Vector and use it to optimize Base64::decode
...
continuous-integration/drone/push Build is passing
This method clears the Vector's data without deallocating the
backing buffer, so that it can be reused without reallocation.
2023-06-18 19:24:26 +02:00
d45e9e2a8c
libluna: Simplify the API for Utf8StateDecoder by splitting it into multiple methods
continuous-integration/drone/push Build is passing
2023-06-18 18:38:01 +02:00
27d9cd0e87
kernel: Move TmpFS::*Inode into a separate file
continuous-integration/drone/push Build is passing
2023-06-18 11:33:40 +02:00
3a3473b9c2
kernel: Use memcpy() when cloning UserVM
...
continuous-integration/drone/push Build is passing
This way, any future fields in VMRegion get copied automatically.
2023-06-18 01:54:29 +02:00
67ed18629d
kernel: Update the VM allocator for userspace to use a linked list
...
continuous-integration/drone/push Build is passing
This can cover the entire address space at once in a more memory-efficient way.
Stress-tested using 'base64 /bin/ls' which allocates enough contiguous
virtual memory to store the entirety of /bin/ls :)
A couple of bugs and fixes later, here we are!
2023-06-18 01:48:48 +02:00
2f08e0f5b0
libos: Make long value arguments use '=' and make value arguments' values always required
continuous-integration/drone/push Build is passing
2023-06-17 20:58:54 +02:00
266fa4a0d4
kernel: Start counting partition numbers at 1
...
continuous-integration/drone/push Build is passing
This makes more sense for the end user.
2023-06-17 19:50:58 +02:00
8ace83f2ae
tools: Create an ext2 partition with the sysroot data in the disk image
continuous-integration/drone/push Build is passing
2023-06-17 19:49:04 +02:00
7cace9a0d7
kernel: Provide more meaningful panic messages for critical failures
2023-06-17 19:43:25 +02:00
e79d4297ea
kernel: Make the root inode be a mountpoint as well + add pivot_root()
continuous-integration/drone/push Build is passing
2023-06-17 17:27:22 +02:00
a6330eaffc
libluna: Add a #pragma once to Types.h
2023-06-17 12:04:47 +02:00
b7a82fd895
kernel: Do not error out on zero-length reads/writes to bad addresses
2023-06-17 12:04:34 +02:00
592558d7ad
kernel: Add GUID partition table support
2023-06-17 12:03:37 +02:00
2be4880278
kernel: Name the scoped lock in ATADevice::read()
...
continuous-integration/drone/push Build is passing
Is that supposed to work without a name? Looks like it did!
2023-06-17 09:46:28 +02:00
7a78609a85
kernel: Preserve kernel threads' page directories when they differ from the regular kernel page directory
continuous-integration/drone/push Build is passing
2023-06-17 00:49:31 +02:00
c2cdb861c9
kernel/ATA: Fix buffer overflow in ATADevice::read() with small sizes and unaligned offsets
2023-06-17 00:48:53 +02:00
27b26f389c
kernel: Lock ATADevice::read_lba() using ATA::Channel's KMutex
continuous-integration/drone/push Build is passing
2023-06-17 00:22:38 +02:00
4f86cd9f08
libluna: Add a so very basic HashMap
continuous-integration/drone/push Build is passing
2023-06-17 00:07:43 +02:00
32d2e0e6b7
kernel: Remove register_special_device()'s name parameter
...
continuous-integration/drone/push Build is passing
This is now duplicate information that can be queried using device->device_path().
2023-06-16 21:46:51 +02:00
ba46399bbd
kernel/ATA: Remove debug messages
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-06-16 21:34:36 +02:00
738b218a49
kernel/ATA+MBR: Dynamically generate device names + create devices for MBR partitions
continuous-integration/drone/pr Build is passing
2023-06-16 21:30:50 +02:00
72b8ebe02c
kernel: Make the MBR code read from a device instead of an inode
continuous-integration/drone/pr Build is failing
2023-06-16 21:10:33 +02:00
72e798cedb
kernel: Do not automatically read the MBR partition table from /dev/cdrom
...
Since ff952cfe16
made /dev mounted from userspace, /dev/cdrom does not exist when ATA drives are scanned.
2023-06-16 21:10:33 +02:00
7593947c33
kernel/ATA: Route interrupts to the correct drive
2023-06-16 21:10:33 +02:00
93922932fa
kernel: Start reading the MBR partition table from the ATAPI drive
2023-06-16 21:10:33 +02:00
a3beaa4d53
ATA: Mark the CDROM as a block device
2023-06-16 21:10:33 +02:00
bb0db450b3
kernel/ATA: Pass extra information to DeviceRegistry
...
This is needed since merging e7d482e
from main.
2023-06-16 21:10:33 +02:00
a0fa1f2cfd
kernel+init: Create a device node in /dev to access the CDROM from userspace!
...
Still using PIO, though.
2023-06-16 21:10:33 +02:00
2fa11a5ae3
kernel/ATA: Read the CDROM's first sector using ATAPI PIO!!
...
Sadly, for some reason, DMA is not working right now.
This is a problem, as PIO is inconvenient. But hey, it works for now!
2023-06-16 21:10:32 +02:00
cc8450751c
kernel/x86_64: Implement writing to PCI fields
2023-06-16 21:10:32 +02:00
3762d3f959
kernel/PCI: Add bit enum for the Command field
2023-06-16 21:10:32 +02:00
a99c5e325d
kernel: Actually register interrupt handlers properly
2023-06-16 21:10:32 +02:00
82db0e39ea
kernel/ATA: Calculate block sizes for ATA devices as well
2023-06-16 21:10:32 +02:00
46c45068e0
kernel/ATA: Send a READ CAPACITY packet to an ATA drive on initialization
2023-06-16 21:10:32 +02:00
cfcde5af55
kernel/ATA: Read the PCI Busmaster registers and start preparing for DMA
2023-06-16 21:10:31 +02:00
268252c89e
kernel/ATA: Read the Busmaster base port and verify it
2023-06-16 21:10:31 +02:00
5d16754632
kernel: Handle device BARs properly
2023-06-16 21:10:31 +02:00
6307b01689
kernel/ATA: Read ATA strings properly instead of backwards
...
Now we can see the model string. What does it say...
"QEMU DVD-ROM". Let's go!
2023-06-16 21:10:31 +02:00
e118c9ea0d
kernel/ATA: Implement enough to send an IDENTIFY command and read the model number :)
2023-06-16 21:10:31 +02:00
ee691bbb0f
kernel/ATA: Handle drive IRQs in compatibility mode
2023-06-16 21:10:31 +02:00
739950e8f0
kernel/CPU: Allow passing arbitrary data to interrupt handlers
2023-06-16 21:10:31 +02:00
3a84127fd6
kernel/ATA: Start reading/writing registers and detecting drives
2023-06-16 21:10:30 +02:00
e8507d23ee
kernel: Warn if no ATA controller is found
2023-06-16 21:10:30 +02:00
d9a1e8a980
kernel: Add a KMutex class and use that for ATA::Controller locking
2023-06-16 21:10:30 +02:00
7efc6dc985
kernel/x86_64: Add basic ATA controller and channel identification
2023-06-16 21:10:30 +02:00
beeafb73e6
kernel/PCI: Add more PCI field types
2023-06-16 21:10:30 +02:00
f0caf010bf
kernel/x86_64: Add a way to register IRQ handlers from other kernel subsystems
2023-06-16 21:10:26 +02:00
d589834eb7
libluna: Add HashTable
continuous-integration/drone/push Build is passing
2023-06-15 15:50:04 +02:00
da1439126a
libos: Correct wrong manpage section for execve()
continuous-integration/drone/push Build is passing
2023-06-09 23:35:23 +02:00
e4e501ecfe
libos: Add Process::wait()
continuous-integration/drone/push Build is passing
2023-06-09 23:12:31 +02:00
a1bf4dafbe
libluna: Remove implicit vector copying and add an explicit way to do it
...
continuous-integration/drone/push Build is passing
Closes #28 .
2023-06-09 22:54:22 +02:00
bc07cc94cb
libos: Document it entirely using Doxygen comments =D
...
continuous-integration/drone/push Build is passing
Also, add copyright information to individual files. This is going to be a hassle to do for EVERY file.
2023-06-09 22:45:06 +02:00
5f5b58a2c0
apps: Add a syscall fuzzer
continuous-integration/drone/push Build is passing
2023-06-08 19:58:00 +02:00
d0b65674e6
kernel: Fix 0-delay sleeps blocking the thread forever
2023-06-08 19:57:38 +02:00
85896214ba
libos: Make File::read_all() read chunked blocks instead of one character at a time
...
continuous-integration/drone/push Build is passing
This results in a speedup of 0.23s -> 0.13s for Base64 encoding of /bin/ls.
2023-06-04 00:23:06 +02:00
3283991ec6
kernel: Keep the old Timer::ticks_ms() API.
...
continuous-integration/drone/push Build is passing
Removing this API broke the ATA branch.
2023-06-03 21:02:18 +02:00
e10cc2d954
libc: Add the internal TRY_OR_SET_ERRNO macro
...
continuous-integration/drone/push Build is passing
Similar mechanism to TRY(), but propagating C-like errors instead of Results on failure.
2023-06-03 20:20:01 +02:00
6b4d41529e
libc: Fix execvp() calling the shell after an ENOEXEC
continuous-integration/drone/push Build is passing
2023-06-03 17:00:24 +02:00
6ad7491300
sh: Skip comments (and shebangs!)
2023-06-03 16:59:18 +02:00
8bcec00a9d
kernel: Change the timer subsystem to use timespecs natively
continuous-integration/drone/push Build is passing
2023-06-03 13:15:10 +02:00
d2334a67dd
apps: Add mktemp
continuous-integration/drone/push Build is passing
2023-06-03 12:15:57 +02:00
fd62de6474
libluna: Do not sort empty arrays; avoids a segfault
continuous-integration/drone/push Build is passing
2023-06-03 11:55:46 +02:00
1090815c8d
kernel: Honor the sticky bit
2023-06-03 11:55:10 +02:00
89d7866abb
libos: Show the sticky bit on symbolic modes
2023-06-03 11:35:13 +02:00
0540879959
init+initrd: Create /tmp and mount it on boot
2023-06-03 11:34:53 +02:00
cc72a1655d
libc+libluna: Move libluna hooks out of libc and into a central place in libluna
continuous-integration/drone/push Build is passing
2023-06-03 11:18:52 +02:00
ff952cfe16
kernel+init: Let userspace control devfs mountpoints
continuous-integration/drone/push Build is passing
2023-06-02 21:45:31 +02:00
dcb8ab569a
libc: Add basic sys/param.h for programs that want it
continuous-integration/drone/push Build is passing
2023-05-31 22:15:22 +02:00
d467f6257d
libc: Define EXIT_* macros and strto(u)ll in stdlib.h
2023-05-31 22:15:05 +02:00
5c68d50070
libc: Add a very bare-bones locale.h
2023-05-31 22:12:50 +02:00
d40654a00c
libos+ls: Allow calling ArgumentParser::short_usage() directly
continuous-integration/drone/push Build is passing
2023-05-28 21:57:04 +02:00
51a5727c8d
libluna: Fix a crash in quicksort
continuous-integration/drone/push Build is passing
2023-05-28 21:51:50 +02:00
069f1c0f97
ls: Sort displayed entries
2023-05-28 21:51:50 +02:00
e864ef2d36
libos: Add a way to also list entry sizes, modes and mtimes
2023-05-28 21:51:50 +02:00
11a4f8cc90
kernel: Wake the parent process when a child exits because of a page fault
2023-05-28 21:50:13 +02:00
30e4ef970e
all: Minor version bump up to 0.2.0
continuous-integration/drone/push Build is passing
2023-05-27 19:32:59 +02:00
d572d56460
libc: Add dummy time fields to struct stat
continuous-integration/drone/push Build is passing
2023-05-27 12:22:06 +02:00
18115ca04a
libc: Add alloca.h
continuous-integration/drone/push Build is passing
2023-05-27 12:11:51 +02:00
8d90d146b2
libc: Fix including sys/time.h
continuous-integration/drone/push Build is passing
2023-05-27 12:06:00 +02:00
88d1da59e8
kernel+libc: Add access()
continuous-integration/drone/push Build is passing
2023-05-27 12:04:27 +02:00
bd8aaa917f
kernel+libc+ln: Add support for userspace hard link creation
continuous-integration/drone/push Build is passing
2023-05-27 11:32:40 +02:00
a98e9e8009
kernel: Add /dev/full
continuous-integration/drone/push Build is passing
2023-05-27 10:42:45 +02:00
b0506bf88f
kernel: Add umask
continuous-integration/drone/push Build is passing
2023-05-26 22:27:49 +02:00
d89a823924
kernel: Return EACCES when trying to chdir to an unaccessible directory
2023-05-26 20:49:13 +02:00
cba0a23db9
kernel: Make the framebuffer a block device
continuous-integration/drone/push Build is passing
2023-05-26 20:36:35 +02:00
7cdb967730
kernel: compilation fix
continuous-integration/drone/push Build is passing
2023-05-26 20:30:39 +02:00
62e14e7580
kernel+libos+apps: Support block devices and disallow seeking character devices or pipes
continuous-integration/drone/push Build is failing
2023-05-26 20:27:47 +02:00
38fae0c97b
ls: Show file modes visually
continuous-integration/drone/push Build is passing
2023-05-26 18:22:50 +02:00
4dcee8f828
sh: Print "exit" on EOF only when the shell is in interactive mode
continuous-integration/drone/push Build is passing
2023-05-26 17:29:41 +02:00
84c1871d30
libc: Check if a shell is available if system()'s command argument is NULL
2023-05-26 17:27:37 +02:00
3a51807fa6
kernel+stat: Handle pipes correctly in stat()
continuous-integration/drone/push Build is passing
2023-05-23 20:54:25 +02:00
9cdfdbc6f9
kernel: Handle unnamed pipes in stat()
continuous-integration/drone/push Build is failing
2023-05-23 20:49:26 +02:00
1094042a7d
kernel: Implement st_dev and st_rdev
continuous-integration/drone/push Build is failing
2023-05-23 20:45:24 +02:00
1a6ad11462
kernel+libc+libos+ls: Add readlink()
continuous-integration/drone/push Build is passing
2023-05-23 15:42:38 +02:00
b61307e5cb
ls: Add -1 and --directory
continuous-integration/drone/push Build is passing
2023-05-23 14:53:38 +02:00
04d074538f
ls: Don't do caching now that password/group file reading is more reasonable
continuous-integration/drone/push Build is passing
2023-05-20 22:10:01 +02:00
2c798b8bf0
Update README to match repository description
continuous-integration/drone/push Build is passing
2023-05-20 22:00:52 +02:00
597aada09e
ls+stat: Handle symbolic links properly
continuous-integration/drone/push Build is passing
2023-05-20 21:49:25 +02:00
4ec1af5e51
apps: Add ln
2023-05-20 21:49:25 +02:00
7a8ef52408
libos: Support not following symlinks
2023-05-20 21:49:25 +02:00
cb205c851c
libc: Add symlink(), symlinkat(), and lstat()
2023-05-20 21:49:25 +02:00
67a9d130e2
kernel: Add initial support for symbolic links :D
2023-05-20 21:49:24 +02:00
b75bd4cd14
libluna: Add PathParser::has_next()
2023-05-20 16:39:18 +02:00
9bb5371e8c
libluna+libc: Add strtok_r()
2023-05-20 16:37:07 +02:00
47d505dcbb
libc: Add getline() and getdelim()
continuous-integration/drone/push Build is passing
2023-05-20 15:36:30 +02:00
5117b410db
apps: Add time
continuous-integration/drone/push Build is passing
2023-05-20 12:48:25 +02:00
6de90b3c93
libc: Add getrusage()
2023-05-20 12:48:17 +02:00
01111442d3
kernel: Add the getrusage() system call
2023-05-20 12:48:07 +02:00
1fa8aeecce
libos: Allow Process::exec to take a slice of StringViews instead of Strings as arguments
2023-05-20 12:47:10 +02:00
30d1dad149
libluna: Let String::join take a vector of StringViews instead of Strings
2023-05-20 12:46:33 +02:00
1db60b5a82
sh: Print a message on exit
continuous-integration/drone/push Build is passing
2023-05-20 12:07:56 +02:00
a7c6163e7c
libc: Add gettimeofday()
2023-05-20 12:05:22 +02:00
dc169124cc
libc: Add fchown, fchmod, and some POSIX feature test macros
continuous-integration/drone/push Build is passing
2023-05-19 19:59:20 +02:00
3db0c4fed2
apps: Add ps
continuous-integration/drone/push Build is passing
2023-05-18 21:59:38 +02:00
1506331872
kernel+libc: Add the pstat() system call
...
Luna-specific, but I like it.
2023-05-18 21:48:47 +02:00
0dbfbe6395
libc+apps: Avoid calling endpwent() and endgrent() after every call to get{pw,gr}{nam,uid,gid}
2023-05-18 21:47:46 +02:00
84bed3ceb3
kernel+libc: Remove mknod()
...
continuous-integration/drone/push Build is passing
Now that we automatically create files in /dev, mknod() is not needed anymore.
2023-05-18 19:42:14 +02:00
d7c563aebd
kernel: Add reference counting for mounts
...
continuous-integration/drone/push Build is passing
This will make sure we cannot unmount a file system while there is another one mounted inside it.
2023-05-18 16:22:31 +02:00
3a73d49aa1
kernel: Remove a mount from the mountpoint list after unmounting it
2023-05-18 16:18:09 +02:00
8f6bd29da3
kernel: Make file system reference counting work for current directories
...
continuous-integration/drone/push Build is passing
Also, make pipes usable again.
2023-05-17 20:37:01 +02:00
1f4c4928cc
kernel+libc+apps: Add mount and umount syscalls, libc wrappers, and utilities
continuous-integration/drone/push Build is passing
2023-05-17 20:30:15 +02:00
29174ca228
kernel/VFS: Add a way to unmount file systems
2023-05-17 19:52:26 +02:00
e7d482e78a
kernel+init: Add a VFS mount system and auto-populate the devfs
2023-05-17 19:40:37 +02:00
4d106b6b8c
libos: Add error handling to vector argument usage
continuous-integration/drone/push Build is passing
2023-05-13 13:22:49 +02:00
65d3195caa
libos: Allow ArgumentParser users to specify they want leftover arguments
continuous-integration/drone/push Build is passing
2023-05-13 13:22:10 +02:00
dc7e503342
tests: Test character formatting
continuous-integration/drone/push Build is passing
2023-05-13 12:50:10 +02:00
e481ce45d0
tests: Add way more tests to TestFormat now that formatting is fixed
2023-05-13 12:45:14 +02:00
e098a3269a
libluna: Treat a negative precision as if precision was omitted
2023-05-13 12:40:03 +02:00
38541e22e9
libluna: Fix flag shenanigans in cstyle_format
...
Finally, zero-pad and left-align work properly!
2023-05-13 12:39:31 +02:00
5911b052dc
libluna: Add more options to to_dynamic_unit()
...
continuous-integration/drone/push Build is passing
Also, make the output look more like how it is on linux.
2023-05-13 12:01:09 +02:00
a5ad8e16de
ls: Add the --human-readable flag
2023-05-13 11:15:28 +02:00
300d68088b
libos: Add FileSystem::stat()
continuous-integration/drone/push Build is passing
2023-05-12 23:47:20 +02:00
64d0f30bd9
kernel: Disallow write-related flags when opening a directory, not only when the directory flag is set
...
continuous-integration/drone/push Build is passing
Also return EISDIR instead of EINVAL as that is what Dr. POSIX mandates.
2023-05-11 21:29:49 +02:00
1035b91a3d
su: Do not change directory/set variables by default, instead add a --login option
continuous-integration/drone/push Build is passing
2023-05-11 20:11:09 +02:00
a935039e78
sh: Prioritize /etc/passwd over the USER environment variable
2023-05-11 20:10:10 +02:00
18130847c1
libc: Fix some environment-related bugs
2023-05-11 20:09:46 +02:00
411c6c40cd
kernel: Add the fchmodat() and fchownat() system calls
continuous-integration/drone/push Build is passing
2023-05-11 19:49:03 +02:00
4a3a92e9d4
libc: Move chmod from unistd.h to sys/stat.h
...
continuous-integration/drone/push Build is passing
Apparently that's where it's supposed to be.
2023-05-11 19:40:34 +02:00
4a764bc315
tests+libluna: Start testing Format.cpp
continuous-integration/drone/push Build is passing
2023-05-11 16:56:28 +02:00
e203772488
README: Update broken link to ELF loader
...
continuous-integration/drone/push Build is passing
The ELF loader was moved into the thread/ subdirectory in 0c1d33f2ec
.
2023-05-10 22:58:37 +02:00
efc6d03f23
kernel+libc: Add support for unnamed pipes
continuous-integration/drone/push Build is passing
2023-05-10 22:48:31 +02:00
1a2fce5316
kernel+libc: Add the O_TMPFILE open flag and the tmpfile() function
continuous-integration/drone/push Build is passing
2023-05-09 22:04:34 +02:00
4753e80583
kernel: Make DeviceRegistry store the created devices instead of creating them when requested
continuous-integration/drone/push Build is passing
2023-05-09 18:31:27 +02:00
35b1b36599
tools+tests: Add a system to run all tests at once automatically
continuous-integration/drone/push Build is passing
2023-05-07 23:04:24 +02:00
916a73ca95
kernel: Rework the timer subsystem to count in microseconds
continuous-integration/drone/push Build is passing
2023-05-07 21:51:36 +02:00
9bab4c62a1
kernel: Compilation fixes
continuous-integration/drone/push Build is passing
2023-05-07 21:42:03 +02:00
72dadc6706
kernel: Define a constant to check for default memory access
continuous-integration/drone/push Build is failing
2023-05-07 21:38:38 +02:00
b25e212880
kernel: Make a generic function for checking memory flags
continuous-integration/drone/push Build is failing
2023-05-07 21:37:01 +02:00
88180b34bd
initrd: Show default credentials in the motd
continuous-integration/drone/push Build is passing
2023-05-06 22:12:06 +02:00
b08ebdc3cb
libos: Show "Options:" label even if --help and --version are the only
...
options
2023-05-06 22:05:08 +02:00
cd86d1d6d0
apps+initrd: Add a login utility and make it run at startup
2023-05-06 22:03:50 +02:00
b742a08cbe
su: Set the USER and SHELL variables
continuous-integration/drone/push Build is passing
2023-05-06 12:19:54 +02:00
77560bbc3e
kernel+tools: Allow loading files with different owners + add a more dynamic install script
continuous-integration/drone/push Build is passing
2023-05-06 12:11:35 +02:00
d7fee26aa2
initrd+libc: Add /etc/group and grp.h
2023-05-06 12:01:47 +02:00
9184bbfef6
kernel: Disallow passing O_WRONLY and O_DIRECTORY at the same time
continuous-integration/drone/push Build is passing
2023-05-05 18:53:50 +02:00
349ba0acb1
libc: Add syscall wrappers for unlinkat() and openat()
continuous-integration/drone/push Build is passing
2023-05-05 18:50:35 +02:00
d9d8f7cdc7
kernel: Remove unused headers from main.cpp
continuous-integration/drone/push Build is passing
2023-05-04 23:59:46 +02:00
293a992133
kernel: Add a kernel_wait_for_event() function to avoid weird calls to kernel_wait in kthreads
continuous-integration/drone/push Build is passing
2023-05-04 23:43:00 +02:00
4a7f68b989
kernel: Add a convenience wake_up() function
2023-05-04 23:35:54 +02:00
3a1c22bb93
kernel: Add keyboard combinations for debug information dumps
...
Ctrl+Alt+E: Dump threads
Ctrl+Alt+M: Dump memory usage
Ctrl+Alt+H: Dump heap state
2023-05-04 23:32:48 +02:00
3ed9e578c7
kernel/x86_64: Wake the IO thread up only when there is an IO event, instead of polling every 10 ms
2023-05-04 23:07:09 +02:00
96f3d29d37
kernel: Tell the reap thread to run when it's needed, instead of checking every 200 ms
2023-05-04 23:06:00 +02:00
42eb0a1d74
kernel: Freeze waitpid()'s calling thread until a child tells us it's done, instead of polling it every 10 ms
2023-05-04 23:03:31 +02:00
4616997f5b
kernel: Store a thread's parent directly instead of its parent's PID
2023-05-04 22:58:04 +02:00
58eb2d7703
libc: Print failed assertions to stderr instead of stdout
...
continuous-integration/drone/push Build is passing
This removes two FIXMEs from the time there was no stderr.
2023-05-04 16:37:13 +02:00
44e4ca804a
kernel: Make sure argument vectors passed to execve() are not too big
2023-05-04 16:36:24 +02:00
3eb78aa5f3
libos+init: Add a new Path class to handle both file descriptors and file paths
continuous-integration/drone/push Build is passing
2023-05-03 17:37:26 +02:00
abaf24d0da
kernel/CPU: Move some stuff to StringView
2023-05-03 17:35:46 +02:00
1215c38d75
libc: Add mkdtemp() and mkstemp()
...
continuous-integration/drone/push Build is passing
No mktemp() though, as it has race conditions and was removed in POSIX.1-2008.
2023-05-03 16:43:30 +02:00
a0b45a51de
libc: Add rand() + srand()
...
continuous-integration/drone/push Build is passing
Very basic random number generator, but that's what rand() is.
If you want secure numbers then use arc4random() or something idk
2023-05-02 21:20:24 +02:00
d9b7e8edc0
init: Read and launch service files in order using sort()
continuous-integration/drone/push Build is passing
2023-05-02 20:56:28 +02:00
3628464284
libc: Fix some naming inconsistencies
2023-05-02 20:56:28 +02:00
d1801d484c
libc: Add qsort()
2023-05-02 20:56:27 +02:00
dcd93cce3a
libluna: Add a sort() function
2023-05-02 20:56:27 +02:00
6beea7f817
ls: Avoid printing an empty line when a directory is empty
continuous-integration/drone/push Build is passing
2023-05-02 11:00:28 +02:00
0fad179485
apps+libc+libos: Remove _LUNA_SYSTEM_ERROR_EXTENSIONS and reorder headers
...
continuous-integration/drone/push Build is passing
libluna/libos headers can now go after errno.h, so there's no reason to keep them separate.
2023-05-02 10:51:53 +02:00
052ae4902e
libluna: Remove EFIXME and make others declare error_string() and error_name()
...
Closes #26 .
2023-05-02 10:51:53 +02:00
7058ec945a
libluna: Use a String for name and handle prefix correctly in TarStream
2023-05-02 10:51:53 +02:00
6982a8c07e
libluna: Make String::from_string_view handle non-null-terminated strings properly
2023-05-02 10:51:52 +02:00
1444cbb3df
libluna: Allow constructing a StringView from a string that might not be null-terminated
2023-05-02 10:51:52 +02:00
1d6a39c924
libluna: Make String::split() inline
continuous-integration/drone/push Build is passing
2023-05-01 20:05:10 +02:00
376247ba8a
libluna: Add String::from_string_view()
continuous-integration/drone/push Build is passing
2023-05-01 20:03:16 +02:00
53ec448e33
ls: Add the -l flag
2023-05-01 20:01:05 +02:00
2572d5b238
libc: Add wrapper for the fstatat() system call
2023-05-01 20:00:43 +02:00
458e0a87cc
libc: Fix S_IS* macros
2023-05-01 20:00:10 +02:00
48df90e636
libos+apps: Use os::*print* instead of (f)printf
continuous-integration/drone/push Build is passing
2023-05-01 19:32:00 +02:00
a2303665fc
libos: Add os:: print(), println(), eprint(), and eprintln()
2023-05-01 19:31:15 +02:00
df590f4e26
libluna: Add String::join()
2023-05-01 19:29:17 +02:00
7fbc644753
libc: Add clearenv
continuous-integration/drone/push Build is passing
2023-05-01 19:06:31 +02:00
967758d464
libc: Implement setenv() and unsetenv()
continuous-integration/drone/push Build is passing
2023-04-30 14:46:34 +02:00
ac4bbd135b
libos: Add Directory::list()
continuous-integration/drone/push Build is passing
2023-04-28 22:41:44 +02:00
6c5d6aaf00
libos: Make remove_tree_at use os::Directory
continuous-integration/drone/push Build is passing
2023-04-28 21:16:44 +02:00
3e277b5d6f
libos: Introduce os::Directory
2023-04-28 21:16:43 +02:00
8adfb6fdb9
libluna: Leave String in a valid state when moved
2023-04-28 21:16:43 +02:00
ae7c841fff
tests: Make building tests optional, although with no option to toggle them on for now
continuous-integration/drone/push Build is passing
2023-04-28 20:02:49 +02:00
b34f2149ee
tests: Test libluna's UTF-8 suite
2023-04-28 20:01:45 +02:00
c5a867d81c
libluna: Add wcscmp
2023-04-28 20:00:26 +02:00
15dcd6ad15
libluna: Check the whole string in Utf8StringDecoder::code_points()
2023-04-28 20:00:14 +02:00
b4a5aff071
libluna: Fix UTF-8 encoding
2023-04-28 19:59:40 +02:00
80914f0bb9
ArgumentParser: Add support for version information
continuous-integration/drone/push Build is passing
2023-04-28 16:33:05 +02:00
0c1d33f2ec
kernel: Move some files into subdirectories
continuous-integration/drone/push Build is passing
2023-04-28 15:55:06 +02:00
52ce4b28aa
Scheduler: Remove redundant check in for_each_child
continuous-integration/drone/push Build is passing
2023-04-28 15:22:16 +02:00
7b4cfd52cd
Scheduler: Don't search threads spawned before the current thread to find children
...
continuous-integration/drone/push Build is passing
Children will always be spawned later (and thus have a higher PID) than their parent.
2023-04-28 15:19:01 +02:00
bcdec62f51
kernel: Allow returning early from Scheduler::for_each_child
2023-04-28 15:13:53 +02:00
f3ffdd32d4
libluna: Add support for range-based iteration to LinkedList
2023-04-28 15:12:21 +02:00
77dcfab5ef
kernel: Run the initialization process in a thread
...
continuous-integration/drone/push Build is passing
This way we can give it more stack and also reclaim it later!
2023-04-28 13:23:07 +02:00
b1e400d795
libluna: Allow callers to optimize heap allocations by telling us they won't resize the returned memory
...
continuous-integration/drone/push Build is passing
strdup() now does this. If someone resizes strdup()-ed memory, nothing bad will happen, they will just take a small performance hit the first time.
But I think realloc-ing strdup()-ed memory is rare, that's why I did this.
2023-04-27 17:36:25 +02:00
f0fc3ec7ca
Remove old note from README
continuous-integration/drone/push Build is passing
2023-04-26 22:49:43 +02:00
7c8f195088
base64: Rename --allow-garbage to --ignore-garbage
continuous-integration/drone/push Build is passing
2023-04-26 22:37:55 +02:00
e1ac9473a2
libluna: If allowing garbage chars while decoding Base64, skip them after the padding instead of erroring out
2023-04-26 22:32:24 +02:00
fb22e14524
tests: Add tests for Base64
continuous-integration/drone/push Build is passing
2023-04-26 21:17:09 +02:00
9d33e22ae0
apps: Add base64
2023-04-26 20:58:04 +02:00
b48d1024a8
libluna: Add Base64 encoding and decoding code
2023-04-26 20:57:48 +02:00
24f4ce9669
kernel: Only allow Ctrl+D on an empty line
2023-04-26 20:42:26 +02:00
099f6131d1
kernel: Avoid printing control characters that we don't have a special meaning for
2023-04-26 20:42:08 +02:00
36bc217056
libluna: Allow constructing a Slice from another one with a different pointer type
2023-04-26 20:41:24 +02:00
cb28e2a385
libos: Add a convenience function for opening a file or standard input
2023-04-26 20:41:03 +02:00
fb09eb97ce
libos: Add File::read_all() and File::read_all_as_string()
2023-04-26 20:34:09 +02:00
5b69ce554c
init: Add a few more configuration options for services
...
continuous-integration/drone/push Build is passing
Notably, redirecting a service's standard streams and waiting for a service to finish before continuing boot.
2023-04-25 21:00:12 +02:00
97e9fceaa4
kernel+libc: Add dup2()
continuous-integration/drone/push Build is passing
2023-04-25 20:37:30 +02:00
188a97cf54
libc: Add execlp
continuous-integration/drone/push Build is passing
2023-04-25 20:25:51 +02:00
89fd57dea4
libc: Propagate all errors in execl() and execvpe() + add execle().
continuous-integration/drone/push Build is passing
2023-04-25 17:43:11 +02:00
b8ca749a6c
su: Default to root if no username is provided
continuous-integration/drone/push Build is passing
2023-04-24 22:24:07 +02:00
919c9dd3cf
sh: Build a more elaborate prompt using the system hostname and username
continuous-integration/drone/push Build is passing
2023-04-24 22:13:06 +02:00
403b0f6b94
kernel+libc+init: Add a way to modify the system hostname
continuous-integration/drone/push Build is passing
2023-04-24 21:20:44 +02:00
cfb4baab4b
apps: Add uname
continuous-integration/drone/push Build is passing
2023-04-24 21:02:04 +02:00
9eab0886b6
kernel+libc: Add uname()
continuous-integration/drone/push Build is passing
2023-04-24 20:34:44 +02:00
a99a0e5a54
tests: Start testing libluna
...
continuous-integration/drone/push Build is passing
Hooray!!
2023-04-23 21:52:28 +02:00
cf8a8c145a
init: Remove redundant continue statement
continuous-integration/drone/push Build is passing
2023-04-23 21:15:23 +02:00
de25338d6c
libluna: Remove redundant return statements in Result<void>
2023-04-23 21:15:00 +02:00
37547ec640
libluna: Run lint scripts
continuous-integration/drone/push Build is passing
2023-04-23 10:53:48 +02:00
2f2b45758e
tools: Update some of the lint scripts with a better system to find source files
2023-04-23 10:53:34 +02:00
e378d8ee2f
Revert "libos: Make File::read_line optionally strip the ending newline"
...
continuous-integration/drone/push Build is passing
This should be done by the caller, as making libos do it will not return a different value if the line was empty or was EOF.
Fortunately, we now have String::trim.
2023-04-22 15:21:04 +02:00
c075aa77b9
init: Allow empty lines in service files
2023-04-22 15:19:37 +02:00
dcc6bbf055
libluna: Add String::trim
2023-04-22 15:19:07 +02:00
257c2ffd0a
init: Add a configurable service system instead of always starting /bin/sh
continuous-integration/drone/push Build is passing
2023-04-22 13:56:08 +02:00
63a2df112d
libos: Make File::read_line optionally strip the ending newline
2023-04-22 13:55:07 +02:00
e654ed6415
libos: Allow passing environment to Process::exec
2023-04-22 13:54:47 +02:00
5d56638851
kernel: Ignore all non-bootstrap processors
continuous-integration/drone/push Build is passing
2023-04-22 12:25:43 +02:00
60694f651f
kernel/ELF: Remove unused include
continuous-integration/drone/push Build is passing
2023-04-22 12:20:30 +02:00
2acd2ed75d
kernel/ELF: Avoid zeroing out memory twice
continuous-integration/drone/push Build is passing
2023-04-22 12:19:22 +02:00
4f6e020196
kernel+libc: Add framebuffer ioctls
continuous-integration/drone/push Build is passing
2023-04-21 18:25:53 +02:00
841fc25137
kernel+init: Add a framebuffer special device file
continuous-integration/drone/push Build is passing
2023-04-21 18:18:15 +02:00
58dc23e4d9
apps: Add stat
continuous-integration/drone/push Build is passing
2023-04-21 18:04:17 +02:00
15b76f94f4
chown: Parse the owner and group properly
continuous-integration/drone/push Build is passing
2023-04-20 20:08:49 +02:00
fb79e12248
StringView: Add split_once and to_uint
2023-04-20 20:08:49 +02:00
eb58b4acc8
libos: Add support for --help to ArgumentParser
continuous-integration/drone/push Build is passing
2023-04-19 19:16:45 +02:00
0058df9f01
libluna: Handle * characters correctly in cstyle_format
2023-04-19 19:05:09 +02:00
d56e8baca5
libos+rm: Add recursive removal of directories
continuous-integration/drone/push Build is passing
2023-04-19 18:20:44 +02:00
05144f65d1
libos: Remove unused include
continuous-integration/drone/push Build is passing
2023-04-19 18:19:22 +02:00
2ecb1e7c90
Vector: Call destructors on reassignment and call element copy constructors
continuous-integration/drone/push Build is passing
2023-04-18 20:17:05 +02:00
02f8a50b9d
kernel: Replace unlink() with unlinkat()
continuous-integration/drone/push Build is passing
2023-04-18 19:36:29 +02:00
259ea86c20
libluna: Fix compilation
continuous-integration/drone/push Build is passing
2023-04-18 18:49:55 +02:00
8560918931
libluna: Add Result<void>::from_syscall
continuous-integration/drone/push Build is failing
2023-04-18 18:49:24 +02:00
67e9543675
os: Add FileSystem::change_directory
continuous-integration/drone/push Build is passing
2023-04-18 18:46:19 +02:00
b7a0ad8ffb
sh: Remove stray variable
continuous-integration/drone/push Build is passing
2023-04-18 18:43:50 +02:00
00832163d4
libos: Add Process::exec
continuous-integration/drone/push Build is passing
2023-04-18 18:39:37 +02:00
6ce125d286
libos: Add a Process class
continuous-integration/drone/push Build is passing
2023-04-18 18:16:24 +02:00
fbb7de7156
sh: Do not leak memory when using cd
continuous-integration/drone/push Build is passing
2023-04-18 16:49:05 +02:00
4baee3a91f
sh: Close script file on exec
2023-04-18 16:42:43 +02:00
407e81b107
cat: Read into buffers instead of lines
2023-04-18 16:41:58 +02:00
fe11b04832
File: Add methods to read/write using buffers
2023-04-18 16:41:17 +02:00
51eedf2b16
Buffer: Add an is_empty() method
2023-04-18 16:40:37 +02:00
e466c51e9f
kernel: Also zero out mmap-ed pages
continuous-integration/drone/push Build is passing
2023-04-17 22:16:27 +02:00
95659639e5
kernel: Zero out allocated memory for userspace to avoid leaking sensitive data
continuous-integration/drone/push Build is passing
2023-04-17 20:11:07 +02:00
b2fe1f45ef
libc: Define NULL in stdio.h
continuous-integration/drone/push Build is passing
2023-04-16 22:00:41 +02:00
949321932f
kernel: Do not forbid filenames starting with a hyphen
...
continuous-integration/drone/push Build is passing
Some programs on Linux seem to use those, better be careful.
2023-04-16 11:33:35 +02:00
3b4214c8be
dirname: Parse one-character paths properly
continuous-integration/drone/push Build is passing
2023-04-16 11:25:47 +02:00
e6954d2e49
kernel: Disallow problematic characters, control characters and invalid UTF-8 in filenames
2023-04-16 11:25:32 +02:00
82e7b0e860
kernel: Introduce *at() syscall framework, add openat() and fstatat()
continuous-integration/drone/push Build is passing
2023-04-15 20:26:15 +02:00
df95126ccd
kernel: Remove unneeded debug logs & random cleanups
continuous-integration/drone/push Build is passing
2023-04-14 21:10:38 +02:00
8c4ead0c0f
libc: Add more conversion specifiers to strftime
2023-04-14 21:08:50 +02:00
b7df596f8a
libc: Add strftime()
continuous-integration/drone/push Build is passing
2023-04-13 21:09:27 +02:00
1733fc810d
mkdir: Use os::FileSystem and add -p flag
continuous-integration/drone/push Build is passing
2023-04-13 18:33:56 +02:00
fb3430c56a
apps: Use os::FileSystem
2023-04-13 18:33:43 +02:00
5df16a9bff
libos: Add FileSystem
2023-04-13 18:33:04 +02:00
bd60c65e17
kernel: Make chown() search in the process's current directory
2023-04-13 18:20:07 +02:00
60c6e764a4
libos+apps: Add some missing functionality to File and eliminate any trace of C from cat and edit
continuous-integration/drone/push Build is passing
2023-04-13 17:31:21 +02:00
26ff964ec1
libos: Add a new main() function
2023-04-13 17:04:59 +02:00
d97bf991d1
libos: Add a very bare-bones C++ RAII File class
2023-04-12 21:46:10 +02:00
193d63c81b
libluna+libc: Add strpbrk()
continuous-integration/drone/push Build is passing
2023-04-12 18:42:25 +02:00
3618a41bcd
apps: Add rm
continuous-integration/drone/push Build is passing
2023-04-12 18:11:43 +02:00
417e505750
kernel+libc: Add unlink(), rmdir(), remove()
2023-04-12 18:11:36 +02:00
1b4f48b92c
sh: Display the working directory as part of the prompt
continuous-integration/drone/push Build is passing
2023-04-11 22:45:33 +02:00
427662d5f1
kernel+libc: Add getcwd()
2023-04-11 22:45:13 +02:00
7db215819e
exec: Respect the program's working directory
2023-04-11 22:44:25 +02:00
3a45f4af53
su: Change the current directory to the user's home on login
continuous-integration/drone/push Build is passing
2023-04-11 22:15:46 +02:00
2a967f4b8b
kernel+libc: Add chdir()
2023-04-11 22:15:21 +02:00
2d30935fdb
kernel: Give each thread a working directory
2023-04-11 22:14:57 +02:00
dfce93c18f
ls: List the current directory by default instead of the root directory
2023-04-11 22:13:54 +02:00
79a96bf5af
kernel/ELF: Remove old FIXME
continuous-integration/drone/push Build is passing
2023-04-11 21:24:11 +02:00
13c9caa856
kernel+libc: Add stat() + fstat()
continuous-integration/drone/push Build is passing
2023-04-10 19:56:03 +02:00
66c2896652
su: Use termios ioctls to turn off echoing and read a password
continuous-integration/drone/push Build is passing
2023-04-09 11:24:34 +02:00
3e5957f9fc
libc: Add ioctl() syscall wrapper
2023-04-09 11:24:13 +02:00
fee33e7a14
kernel: Add ioctls() for termios stuff to ConsoleDevice
...
Only handles echoing for now.
2023-04-09 11:23:57 +02:00
76eb8cd129
kernel: Add an ioctl() system call
2023-04-09 11:22:57 +02:00
e5a3bbcbbc
libc: Allow empty fields in the password file
continuous-integration/drone/push Build is passing
2023-04-08 22:19:51 +02:00
46be0bd458
apps: Install su as setuid
continuous-integration/drone/push Build is passing
2023-04-08 17:01:26 +02:00
3887b98a7d
kernel: Support setuid binaries
...
continuous-integration/drone/push Build is passing
You still have to run "chmod 4755 /bin/su" as root inside Luna for now, as this is not done by the install scripts.
2023-04-08 16:32:56 +02:00
8b45766aaa
su: Use user names and read from the password file instead of using raw user IDs
2023-04-08 16:31:33 +02:00
7667f49d62
libc: Add a password file and pwd.h
2023-04-08 16:30:18 +02:00
3867a29a10
apps: Add mkdir, chown and chmod
continuous-integration/drone/push Build is passing
2023-04-08 14:47:58 +02:00
46ee0eb937
sh: Show hashtag on root's prompt
2023-04-08 14:47:50 +02:00
059c2bfa3f
kernel+libc: Add chown and chmod
2023-04-08 14:47:34 +02:00
0f8a46ab67
Vector: Copy the right amount in try_dequeue()
...
I always forget to multiply by sizeof(T)...
2023-04-08 14:46:58 +02:00
3da1849c99
kernel+libc: Add set* and get* syscalls for UIDs and GIDs
2023-04-08 13:50:18 +02:00
f6f9254eb4
kernel: Add process and filesystem UIDs and GIDs
2023-04-08 13:12:49 +02:00
208fdd64ac
execvpe: Execute a shell if errno == ENOEXEC
continuous-integration/drone/push Build is passing
2023-04-08 12:28:26 +02:00
eb3fb04734
libc: Add system()
continuous-integration/drone/push Build is passing
2023-04-08 12:18:52 +02:00
95a93a7f66
sh: Parse arguments
2023-04-08 12:09:43 +02:00
0eab03848c
sh: Remove unused include
continuous-integration/drone/push Build is passing
2023-04-07 15:41:37 +02:00
9bb1720cca
libc: Add execvp() and execvpe()
continuous-integration/drone/push Build is passing
2023-04-07 15:39:10 +02:00
fe348d56c0
String+StringView: Add split()
2023-04-07 15:14:46 +02:00
3a28771520
kernel+libc+apps: Add support for environment variables
2023-04-07 15:03:38 +02:00
3ef484b3f3
kernel: Add missing include
2023-04-07 14:37:06 +02:00
3a70accdeb
kernel: Move copy_string_vector_to_userspace to ThreadImage
2023-04-07 14:36:24 +02:00
b22bea84ec
kernel: Copy process name on fork()
continuous-integration/drone/push Build is passing
2023-04-07 14:02:36 +02:00
0f678f845c
String: Add operator=
continuous-integration/drone/push Build is passing
2023-04-07 12:14:21 +02:00
4cac49038c
sh: Use StringBuilder instead of C-like manual joining
2023-04-07 12:11:28 +02:00
7b8260f3f6
all: Enable/disable debug symbols/optimization in COMMON_FLAGS
2023-04-07 12:07:08 +02:00
d07b00a892
all: Move all warning flags to a common CMake variable
2023-04-07 12:02:49 +02:00
4e48d024d9
libluna: Add StringBuilder
2023-04-07 11:53:52 +02:00
4c0dff9b32
libos: Remove a stray os-freestanding from the CMakeLists
2023-04-07 11:53:41 +02:00
a9b5cf99f7
UBSAN: Add __ubsan_handle_nonnull_arg
2023-04-07 11:53:19 +02:00
8e8706be27
sh: Use try_move instead of try_set
...
Looks like Vector does not like being copied. I'll have to look into that later...
2023-04-07 11:52:59 +02:00
1210d2b7da
libluna: Add/remove some const qualifiers
2023-04-07 11:52:20 +02:00
1c6fd95a70
Result: Add from_syscall()
2023-04-07 10:56:49 +02:00
cb67b41a39
libc: Set errno in mbstowcs() and wcstombs()
2023-04-07 10:55:22 +02:00
1f0e185904
kernel: Use try_set_value(_or_error) in various places
2023-04-07 10:55:04 +02:00
baa2296aed
Result: Add try_{set,move}_value_or_error
2023-04-07 10:43:29 +02:00
c752b2b343
libos: Put everything under the os namespace
2023-04-07 10:40:46 +02:00
f1e2937528
ArgumentParser: Parse short value arguments
2023-04-07 10:37:15 +02:00
9b8996adeb
libluna: Add String::format
2023-04-07 10:37:00 +02:00
e6c4ceb18f
Add clause about Unix to README.md
continuous-integration/drone/push Build is passing
2023-04-04 20:57:55 +00:00
1ec2f39747
Update README.md
continuous-integration/drone/push Build is passing
2023-04-04 20:52:28 +00:00
ed0727332b
x86_64/CPU: Assign a proper IRQ number to the keyboard interrupt
...
continuous-integration/drone/push Build is passing
Ah, the dangers of copy-and-paste...
2023-04-04 12:13:34 +00:00
e241c70aad
Vector: Call destructors on deallocation
...
continuous-integration/drone/push Build is passing
I hate the Gitea web editor on a phone.
2023-04-01 08:56:21 +00:00
e99ba4df36
date: Make the --date option require a value
continuous-integration/drone/push Build is passing
2023-03-30 21:39:42 +02:00
429e4c9f61
libc: Disable -pedantic
...
continuous-integration/drone/push Build is passing
It does not like TRY().
2023-03-30 21:31:35 +02:00
47ee52dc0a
libc: Add execl()
continuous-integration/drone/push Build is failing
2023-03-30 21:28:39 +02:00
64bca780a7
kernel: Add /dev/zero
continuous-integration/drone/push Build is passing
2023-03-30 21:19:16 +02:00
2fbc6105d7
kernel+libc: Add O_DIRECTORY and use it in opendir()
continuous-integration/drone/push Build is passing
2023-03-29 22:23:52 +02:00
61f969c60c
ls: Explicitly initialize booleans to false
2023-03-29 22:19:53 +02:00
43f90c4f88
cat: Use ArgumentParser
continuous-integration/drone/push Build is passing
2023-03-29 22:10:51 +02:00
e6645ed607
StringView+apps: Add a _sv literal suffix to not confuse function overloads
...
C++ was being naughty and implicitly casting our fallback const char* to a boolean.
2023-03-29 22:10:01 +02:00
e1c03150f8
ArgumentParser: Return leftover arguments from parse()
2023-03-29 22:07:42 +02:00
75c48e996a
ArgumentParser+date: Add value arguments
continuous-integration/drone/push Build is passing
2023-03-29 21:46:07 +02:00
d68f6bd76b
ArgumentParser+ls: Add switch arguments
continuous-integration/drone/push Build is passing
2023-03-29 19:25:11 +02:00
a164dcc160
libos: Add libos + very basic ArgumentParser
...
continuous-integration/drone/push Build is passing
libluna but for stuff that interests only userspace, like an argument parser or files or stuff like that.
2023-03-29 18:27:02 +02:00
724dab636c
apps: Switch to C++
continuous-integration/drone/push Build is passing
2023-03-29 17:56:56 +02:00
ef01f187c3
libluna: Add StringView
continuous-integration/drone/push Build is passing
2023-03-29 17:43:10 +02:00
01813ff0dd
String: Rename from_string_literal to from_cstring
2023-03-29 17:34:30 +02:00
ee60ab78b3
String: is_empty + proper initialization
2023-03-29 17:32:53 +02:00
b6c35124d6
libluna: OwnedStringView -> String
...
Also with inline storage!
2023-03-29 17:28:22 +02:00
7b0b3dabc4
apps: Add ls
continuous-integration/drone/push Build is passing
2023-03-29 01:07:58 +02:00
3e30f0a88c
libc: Add opendir, readdir and closedir
2023-03-29 01:06:57 +02:00
5623f3c699
tmpfs: Set the mode of the root directory on creation
2023-03-29 01:06:26 +02:00
0320ffb485
Vector: Fix operator[]
...
Istg Vector has a curse or something, the annoying and inexplicable bugs always end up in Vector.
2023-03-29 01:05:30 +02:00
0847cfcb65
kernel: Add a getdents() syscall
continuous-integration/drone/push Build is passing
2023-03-28 21:28:56 +02:00
8eb4d693ac
VFS: Add virtual method get() for getdents() and make existence checking occur in add_entry()
2023-03-28 21:15:26 +02:00
0d54d0ece1
libc: Check for a compatible mode in fdopen()
continuous-integration/drone/push Build is passing
2023-03-28 20:56:00 +02:00
6239ed83c7
kernel+libc: Add F_GETFD, F_SETFD, F_GETFL and F_SETFL to fcntl
2023-03-28 20:55:38 +02:00
df10544e84
libc: Add libgen.h
continuous-integration/drone/push Build is passing
2023-03-28 19:47:47 +02:00
d00ca0d3ed
libc: Add setjmp.h
...
continuous-integration/drone/push Build is passing
Partially taken from pre-rewrite Luna, converted setjmp.asm to GNU assembly.
2023-03-28 19:40:48 +02:00
b8b8d20f5b
Vector: Let realloc do its job and thus avoid a UAF (a particularly nasty one)
...
continuous-integration/drone/push Build is passing
Who even thought that copying from an old pointer passed to realloc() was a good idea?
Me, apparently.
Additionally, the entire point of this memcpy() was to copy the data over from the old buffer (which is already freed btw) to the new buffer, which is already done by realloc.
That's the entire point of realloc. The data is copied over by realloc already.
And even if the old pointer is not unmapped, we scrub freed memory with useless data, so the memcpy sets the vector's buffer to that useless data as well.
I don't even know how I managed to introduce so many bugs into Vector.
At least it should work properly now.
2023-03-28 18:37:12 +02:00
d41e5b7b74
libc: Add signal.h and inttypes.h
continuous-integration/drone/push Build is passing
2023-03-24 22:15:28 +01:00
a43550fb9a
apps: Add date
continuous-integration/drone/push Build is passing
2023-03-24 21:48:43 +01:00
1635eaf992
kernel: Eliminate the splash screen
...
Userspace is free to show a splash if it wants, but the kernel shouldn't force it upon us.
2023-03-24 21:48:32 +01:00
770286a19d
kernel+libc: Implement fcntl() for F_DUPFD and F_DUPFD_CLOEXEC
continuous-integration/drone/push Build is passing
2023-03-24 21:33:20 +01:00
0de41410c6
kernel: Use path as the new process name instead of argv[0]
2023-03-24 21:26:45 +01:00
8b712b04c2
kernel: Build with optimizations only in debug mode
2023-03-24 21:25:26 +01:00
36e48b2ad2
kernel: Do not attempt to close non-existent FDs on exec()
2023-03-24 21:21:13 +01:00
374a9ff7b8
kernel+libc: Implement O_CLOEXEC
2023-03-24 21:19:24 +01:00
d48d0efb07
kernel: Add names to threads
continuous-integration/drone/push Build is passing
2023-03-24 21:05:38 +01:00
4d3050eaab
kernel: Retrieve all thread information before marking it as dead in waitpid()
...
continuous-integration/drone/push Build is passing
In case we get interrupted by the reaper thread.
2023-03-24 20:59:07 +01:00
54a4ebe5bb
sh+edit: Miscellaneous fixes
continuous-integration/drone/push Build is passing
2023-03-24 20:53:53 +01:00
e76ccd6c4c
kernel+libc+init: Add getppid() and wait()
continuous-integration/drone/push Build is passing
2023-03-24 17:39:55 +01:00
7efcc06090
kernel+init+sh: Implement parent processes and waitpid(-1, ...)
continuous-integration/drone/push Build is passing
2023-03-24 17:37:04 +01:00
f084b57f39
kernel+sh: Allow using Ctrl+D to send EOF
continuous-integration/drone/push Build is failing
2023-03-24 17:21:21 +01:00
a18e50ff34
apps: Add cat and edit
continuous-integration/drone/push Build is passing
2023-03-24 00:52:26 +01:00
d63c8abbfd
kernel/x86_64: Terminate page faults in a waitpid-friendly way
2023-03-24 00:52:17 +01:00
e2eb9a92cb
sh: Don't do anything if Enter is pressed with no command
2023-03-24 00:51:42 +01:00
b6fb5f3dfe
kernel+libc: Implement waitpid()
continuous-integration/drone/push Build is passing
2023-03-23 22:42:24 +01:00
41c7e3780d
kernel: Add support for exit codes and start preparing for waitpid()
2023-03-23 22:25:56 +01:00
355dd6c32b
apps: Add sh
continuous-integration/drone/push Build is passing
2023-03-23 22:19:54 +01:00
767dbf521c
Vector: Fix crash when trying to use vector after a call to clear()
2023-03-23 22:19:43 +01:00
00672c4b22
apps/hello: Demo fgets
continuous-integration/drone/push Build is passing
2023-03-23 21:35:21 +01:00
0e9890901f
libc: Add (f)getc, getchar, and fgets
2023-03-23 21:35:09 +01:00
937802964c
kernel: Invert O_NONBLOCK to check whether a thread should block
2023-03-23 21:34:38 +01:00
95e884db97
kernel: Fix compilation
2023-03-23 21:34:09 +01:00
03adaa356c
kernel: Avoid printing keypresses twice
2023-03-23 21:33:50 +01:00
cda036ce70
ConsoleDevice: Use a temporary buffer for backspace handling
continuous-integration/drone/push Build is failing
2023-03-23 21:22:12 +01:00
83492339ec
Buffer: Add an append_data() method
2023-03-23 21:20:57 +01:00
89ad6869a4
Vector: Add a clear() method
2023-03-23 21:20:41 +01:00
6f14bf553f
libc: Add missing header to fcntl.h
continuous-integration/drone/push Build is passing
2023-03-23 19:24:47 +01:00
bab9600be5
libc: Add creat()
continuous-integration/drone/push Build is failing
2023-03-19 19:21:36 +01:00
31ef96ebfc
libc: Add stdin
2023-03-19 19:19:20 +01:00
d33fccc66f
kernel: Implement reading from /dev/console
2023-03-19 19:15:19 +01:00
51f0bdff0e
kernel+libc: Add O_NONBLOCK
continuous-integration/drone/push Build is passing
2023-03-19 11:25:14 +01:00
41514d9ad2
kernel: Add support for blocking reads
2023-03-19 11:21:50 +01:00
cd00e41f59
arch/x86_64: Decode keyboard scancodes
continuous-integration/drone/push Build is passing
2023-03-19 11:17:43 +01:00
40f01c825d
libc: Add fork()
continuous-integration/drone/push Build is passing
2023-03-18 23:58:56 +01:00
54f2d35416
kernel: Add the fork() system call
2023-03-18 23:45:48 +01:00
e664af4c2b
libc: Add execv()
continuous-integration/drone/push Build is passing
2023-03-18 22:31:16 +01:00
a4ac3c85ed
kernel+libc: Copy argv to userspace
continuous-integration/drone/push Build is passing
2023-03-18 22:25:19 +01:00
0b00dc3fe4
kernel/exec: Rename item to string_addr
continuous-integration/drone/push Build is passing
2023-03-18 21:56:34 +01:00
7f50893786
kernel/exec: Copy argv from userspace
continuous-integration/drone/push Build is passing
2023-03-18 21:55:16 +01:00
49952320d6
kernel+libluna: Remove console_write entirely
continuous-integration/drone/push Build is passing
2023-03-18 20:12:59 +01:00
cb1ef3e404
libc: Add (v)fprintf and make (v)printf use that
...
continuous-integration/drone/push Build is passing
Let's free libc of console_write!
2023-03-18 20:11:19 +01:00
6a6a56a8b4
kernel: Make /dev/console actually respect the length parameter instead of trusting userspace's null terminators
2023-03-18 20:10:00 +01:00
d01ba20749
kernel/TextConsole: Add a write() function that accepts a fixed-size buffer instead of relying on null terminators
2023-03-18 20:09:10 +01:00
629ed9e43b
libc: Start switching to /dev/console for console IO and add a proper init
2023-03-18 19:23:18 +01:00
8c831a6906
libc: Add mknod()
continuous-integration/drone/push Build is passing
2023-03-18 09:13:31 +01:00
7173c05a22
kernel: Add support for special device files and add a mknod() syscall
2023-03-18 09:10:33 +01:00
d86da05bea
libluna/TarStream: Remove unused functionality
continuous-integration/drone/push Build is passing
2023-03-17 00:00:27 +01:00
b9e8030aac
kernel: Free the initial ramdisk memory after copying everything into the VFS
continuous-integration/drone/push Build is passing
2023-03-16 23:02:53 +01:00
59838f1225
kernel: Replace some raw divisions with get_blocks_from_size()
2023-03-16 23:01:35 +01:00
8c72e9a49a
kernel: Add an exec() system call
...
continuous-integration/drone/push Build is passing
Doesn't support arguments or environment for now.
2023-03-16 22:44:58 +01:00
08c888eaae
kernel+libc: Remove (de)allocate_memory and replace it with POSIX mmap
continuous-integration/drone/push Build is passing
2023-03-14 20:43:15 +01:00
80a897fbc5
libc: Add fileno()
continuous-integration/drone/push Build is passing
2023-03-12 17:38:35 +01:00
3cc2e4b2a4
app: Use C FILE instead of POSIX fd, and switch back to /etc/motd
continuous-integration/drone/push Build is passing
2023-03-12 17:36:56 +01:00
9e9f268562
libc: Make fopen() parse the mode string
2023-03-12 17:36:04 +01:00
d66506256d
kernel/VFS+libc: Introduce modes
continuous-integration/drone/push Build is passing
2023-03-12 16:55:46 +01:00
02dbcbbfa1
kernel: Add strdup_from_user()
continuous-integration/drone/push Build is passing
2023-03-12 16:30:36 +01:00
682d3c753e
kernel+libc: Add mkdir()
continuous-integration/drone/push Build is passing
2023-03-12 15:32:09 +01:00
d2049567c8
libluna+libc: Add strncmp, strncat and strncpy
continuous-integration/drone/push Build is passing
2023-03-12 15:20:44 +01:00
354ffd033c
VFS: Add a size() method to inodes to implement seeking to the end of a file
continuous-integration/drone/push Build is passing
2023-03-12 14:49:21 +01:00
b54a7f3a80
kernel+libc: Add O_* flags and parse them in open()
...
continuous-integration/drone/push Build is passing
O_RDONLY, O_WRONLY, O_RDWR, O_TRUNC, O_CREAT and O_EXCL are fully implemented.
O_APPEND is partially implemented.
Other flags are not here yet.
2023-03-12 14:43:58 +01:00
bd572473ad
kernel: Remove FileDescriptorTable and add a helper to resolve fds to FileDescriptors
2023-03-12 13:57:38 +01:00
7e655e320a
kernel+libc: Add the lseek() syscall, and fseek, ftell, rewind, fsetpos, and fgetpos
continuous-integration/drone/push Build is passing
2023-03-12 13:15:24 +01:00
292433dc39
kernel+libc: Add the write() system call, and fwrite()
2023-03-12 11:37:41 +01:00
92dbe58729
libc: Unify function descriptions
continuous-integration/drone/push Build is passing
2023-03-12 11:15:45 +01:00
36e0a1e970
libc: Add definitions for strnlen, strndup and strlcpy to string.h
continuous-integration/drone/push Build is passing
2023-03-12 11:10:18 +01:00
377b8bea43
libc: Adjust comment in string.cpp
continuous-integration/drone/push Build is passing
2023-03-12 10:45:21 +01:00
3b03e19489
libc: Replace usize with size_t in string.h
continuous-integration/drone/push Build is passing
2023-03-12 10:43:13 +01:00
12bc59ead5
libc: Add strspn, strcspn, and strtok declarations to string.h
continuous-integration/drone/push Build is failing
2023-03-12 10:39:38 +01:00
af0cb83a58
libluna+kernel: Get rid of nullcpy()
continuous-integration/drone/push Build is passing
2023-03-12 10:28:50 +01:00
7649b44aab
libc: Add declaration for strrchr (already implemented)
2023-03-12 10:27:07 +01:00
5c0104111d
libc: Implement fopen, fclose, fread, feof, ferror, and clearerr
continuous-integration/drone/push Build is passing
2023-03-12 10:23:08 +01:00
c0a7f6776f
kernel+libc: Add getpid()
continuous-integration/drone/push Build is passing
2023-03-11 22:19:58 +01:00
8fa72f3cf0
kernel+libc: Implement read()
continuous-integration/drone/push Build is passing
2023-03-11 18:02:50 +01:00
810c4bc257
kernel+libc: Start interfacing with the VFS from userspace (open & close)
...
This commit adds open and close syscalls to the kernel, and adds matching wrappers to libc.
No read/write support, so file descriptors are kind of useless for now.
2023-03-11 17:45:20 +01:00
831973c39a
Option: Allow direct access to the underlying value via operator->
...
Crashes if the Option is empty.
2023-03-11 17:41:11 +01:00
30deed2820
libluna/CPath: Replace size_t with usize
continuous-integration/drone/push Build is passing
2023-03-11 10:39:42 +01:00
0c07e66c4f
Update all files from luna/ paths to libluna/
continuous-integration/drone/push Build is passing
2023-03-11 10:38:34 +01:00
28028d229f
README: Update luna/ links to point to libluna/
2023-03-11 10:37:38 +01:00
dcf4444d0d
Update README.md
continuous-integration/drone/push Build is passing
2023-03-11 10:35:54 +01:00
ff468db675
kernel/ELF+Scheduler: Use VFS instead of TarStream
continuous-integration/drone/push Build is passing
2023-03-11 10:34:08 +01:00
c6aa2fe4ad
VFS: Populate the initial filesystem based on the initial ramdisk
2023-03-11 10:23:46 +01:00
ac304073b4
tmpfs: Disallow creating files/folders with already used names
2023-03-11 10:14:42 +01:00
d95ef110c9
vfs: Add support for creating directories given a full path
2023-03-11 01:13:44 +01:00
6fd28379a9
TarStream: Add a direct pointer to entry data in the Entry struct
2023-03-11 00:55:26 +01:00
e5a41d2d52
tmpfs: Implement FileInode read() and write()
2023-03-11 00:52:39 +01:00
89bea931cd
libluna: Add a very simple Buffer class, to help implement tmpfs files
continuous-integration/drone/push Build is passing
2023-03-11 00:27:08 +01:00
6fbf97292a
VFS: Implement resolve_path() using PathParser
...
continuous-integration/drone/push Build is passing
Already works better than old luna (handles .. correctly)
2023-03-10 22:18:48 +01:00
4c66017807
libluna: Add PathParser, a C++-style way of iterating over path sections
...
Still uses strtok under the hood, though.
2023-03-10 22:17:16 +01:00
5a9da55e05
libluna/CString: Implement strspn and strcspn, and using those implement strtok
2023-03-10 21:32:18 +01:00
6512e9549e
tools: Make replace-stdint.sh search in libluna/ instead of luna/
2023-03-10 21:30:59 +01:00
ff770b7328
VFS+TmpFS: Add support for creating subdirectories (mkdir)
continuous-integration/drone/push Build is passing
2023-03-10 21:09:08 +01:00
41203df472
libluna/Vector: Use bytes instead of count in resize()
...
This fixes a bug that was causing the heap linked list to become quite corrupted.
2023-03-10 21:07:08 +01:00
e8a401efc2
libluna/Heap: Crash the kernel (but not userspace) on invalid frees
...
This makes them way easier to catch and forces us to get those out of the way.
2023-03-10 21:02:09 +01:00
c376477080
libluna/StaticString: Rename OSize to OtherSize
continuous-integration/drone/push Build is passing
2023-03-08 16:41:09 +01:00
c51b119eb4
StaticString: Add a constructor that takes in another StaticString
2023-03-07 22:18:34 +01:00
abdd460525
tmpfs: use adopt_shared_if_nonnull instead of plain adopt_shared in FileSystem::create()
2023-03-07 22:16:52 +01:00
293be2c75a
tools: Use libluna instead of luna in run-clang-format.sh
2023-03-07 21:08:05 +01:00
e30eec4213
kernel/x86_64: Avoid kernel panics when a page fault occurs in a userspace thread
2023-03-07 21:08:05 +01:00
ca85a69442
kernel: Save floating-point environment when switching in and out of userspace threads
2023-03-07 20:59:11 +01:00
7d045e45c1
libluna/Heap: Zero out newly created heap blocks
2023-03-07 20:45:30 +01:00
eaed109fe9
libluna: Let Alignment.h functions take non-powers-of-two
...
Since the alignment must be known at compile-time, the compiler will optimize for powers of two and leave an inefficient implementation for other values.
2023-03-07 20:37:30 +01:00
80492f6ad3
luna: Add error_name, similar to strerrorname_np from glibc
...
continuous-integration/drone/push Build is passing
man strerrorname_np(3)
2023-03-07 13:14:21 +01:00
3a2e5b7ce0
luna: Adjust cstyle_format's description
continuous-integration/drone/push Build is passing
2023-03-02 13:40:42 +01:00
de38eb6877
luna: Remove pure_cstyle_format
...
continuous-integration/drone/push Build is passing
It was causing a lot of code duplication. If someone doesn't have errors, just return {} from the callback and unwrap the Result.
2023-03-02 13:38:21 +01:00
a595a77421
kernel: Print percentage in splash screen
continuous-integration/drone/push Build is passing
2023-02-27 16:27:59 +01:00
b978d02cfb
luna: Fix %% skipping a character
2023-02-27 16:27:45 +01:00
9afff7c544
kernel: Add a fun splash screen during boot :)
...
continuous-integration/drone/push Build is passing
Mostly for fun.
Has a lot of delay in order to see the actual splash screen.
2023-02-27 16:23:51 +01:00
517ef70214
luna: Add UBSAN.cpp to CMakeLists
continuous-integration/drone/push Build is passing
2023-02-27 15:25:20 +01:00
77887eed80
luna -> libluna
continuous-integration/drone/push Build is passing
2023-02-27 15:22:39 +01:00
65dd3cd7fb
TmpFS: Use StaticString<128> instead of char[128]
2023-02-27 15:22:39 +01:00
5a9d31c2be
luna: Add StaticString, an OOP char[]
2023-02-27 15:22:39 +01:00
8ba571a30e
TmpFS: Use a fixed char array in DirInode's Entry instead of OwnedStringView
2023-02-27 15:22:39 +01:00
f88dc050a9
luna: Add strlcpy()
2023-02-27 15:22:38 +01:00
4fc16915d3
Vector: Fix try_append (hopefully)
...
Still doesn't work with OwnedStringViews inside of structs.
2023-02-27 15:22:38 +01:00
01b6294f76
kernel: Implement creating file inodes in tmpfs directories
2023-02-27 15:22:38 +01:00
a65f4311aa
tmpfs: make the root inode a DirInode instead of a FileInode
2023-02-27 15:22:38 +01:00
dd2f31d8d0
tmpfs: add DirInode skeleton
2023-02-27 15:22:38 +01:00
5fb292bc0e
tmpfs: rename tmpfs::Inode to tmpfs::FileInode
2023-02-27 15:22:37 +01:00
d3bda46325
tmpfs: Make m_next_inode_number atomic
2023-02-27 15:22:37 +01:00
ba9d725481
kernel: Rename FileSystem::root() to root_inode() and add a shortcut for the root filesystem's root inode
2023-02-27 15:22:37 +01:00
3a2b8bcfd7
kernel: Make a factory function for filesystem creation of inodes, and add inode numbers
...
Now every filesystem must provide fs->create_file_inode() for new inodes :)
2023-02-27 15:22:37 +01:00
a49555addc
kernel: Add a subclass of VFS::Inode to make it easier to implement file inodes
2023-02-27 15:22:36 +01:00
529b84cd1e
kernel, luna: Port non-VFS changes over from pull request #22
...
OwnedPtr, SharedPtr: Add operator bool
Option, Result: Make try_move_value() non-const since it modifies the Option
kernel: Switch to a stack we control for the main task as soon as we leave early boot
Heap: Fix GPF caused when making many small allocations
Heap: Avoid accessing a block after it's potentially deleted
luna: Skip UBSAN.cpp in CMakeLists as that's not implemented yet
luna: Use spinlocks in the heap implementation
kernel, luna: Move Spinlock.h to luna
Option: Use __builtin_launder to ensure that the compiler doesn't label this as UB
SharedPtr: Implement make_shared using adopt_shared
SharedPtr: Delete ptr on failure in all adopt_shared* functions
2023-02-27 15:22:36 +01:00
b9fb4c1ce6
SharedPtr: Implement make_shared using adopt_shared
2023-02-27 15:22:36 +01:00
be408c4cdb
SharedPtr: Delete ptr on failure in all adopt_shared* functions
2023-02-27 15:22:36 +01:00
38f0d3a4e6
luna: Skip UBSAN.cpp in CMakeLists as that's not implemented yet
2023-02-27 15:22:24 +01:00
9274ad0404
kernel, luna: Move Spinlock.h to luna
2023-02-27 15:22:24 +01:00
c422d11682
kernel: Start working on a VFS implementation using OOP and SharedPtr
2023-02-27 15:22:24 +01:00
71b981175e
InitRD: Use MMU::translate_physical_address instead of allocating VM
...
continuous-integration/drone/push Build is passing
This one is a perfect candidate, since we're just mapping a fixed continuous range of physical memory to virtual memory.
2023-02-27 13:27:21 +01:00
f0a3f99cf9
MemoryManager: Initialize KernelVM at the end of init()
...
KernelVM is not needed for MMU's init process anymore.
2023-02-27 13:24:58 +01:00
519aa347dd
x86_64: Remove recursive mapping related things from MMU.h
continuous-integration/drone/push Build is passing
2023-02-27 13:07:52 +01:00
3ec54fafde
x86_64/MMU: Do not allocate level 1 page tables for huge page entries
...
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
This would leak memory, since we would never end up using them.
2023-02-27 12:55:15 +01:00
752dfdbf1c
MemoryManager: Reuse the existing mapping of physical memory that MMU has
continuous-integration/drone/pr Build is passing
2023-02-27 12:51:29 +01:00
8df441064f
x86_64/MMU: Map the physical address space using huge pages
2023-02-27 12:47:17 +01:00
426f6e4da8
x86_64: Allow mapping huge pages, but don't do it yet
2023-02-27 12:41:28 +01:00
837d483e0b
x86_64/MMU: Copy from the mapped kernel directory instead of the physical version
continuous-integration/drone/pr Build is passing
2023-02-27 12:30:52 +01:00
995d1bc36e
x86_64/MMU: Map all physical memory into the higher half instead of using recursive mapping
...
continuous-integration/drone/pr Build is passing
This still has a few problems. Notably, we are not using huge pages for this mapping, which would be a lot more efficient.
Right now, used memory is 8.1 MiB at boot for a 256MiB system.
But after improving it, this system will be much better than recursive mapping.
fork() will be MUCH easier to implement, for example.
2023-02-27 12:24:21 +01:00
7dd8e85554
Update README.md with realism
2023-02-25 18:20:06 +01:00
0985b75057
kernel: Add a guard page to the bootstrap stack so that we can catch more stack overflows
continuous-integration/drone/push Build is passing
2023-02-25 17:42:32 +01:00
4fd871fdaa
luna: Introduce fail(...), a replacement for expect(false, ...)
continuous-integration/drone/push Build is passing
2023-02-25 17:41:28 +01:00
8352df5ee8
kernel: Enable UBSAN when building in debug mode
continuous-integration/drone/push Build is passing
2023-02-25 17:37:50 +01:00
da436b3856
luna: Add UB sanitizer, for both kernel-space and userspace
2023-02-25 17:37:38 +01:00
03ed2c3e12
libc: Make dbgln() also print a newline in userspace
...
Previously, dbgln() only printed a newline in kernel-space.
2023-02-25 17:36:03 +01:00
794567327f
kernel, luna: Port non-VFS changes over from pull request #22
...
continuous-integration/drone/push Build is passing
OwnedPtr, SharedPtr: Add operator bool
Option, Result: Make try_move_value() non-const since it modifies the Option
kernel: Switch to a stack we control for the main task as soon as we leave early boot
Heap: Fix GPF caused when making many small allocations
Heap: Avoid accessing a block after it's potentially deleted
luna: Skip UBSAN.cpp in CMakeLists as that's not implemented yet
luna: Use spinlocks in the heap implementation
kernel, luna: Move Spinlock.h to luna
Option: Use __builtin_launder to ensure that the compiler doesn't label this as UB
SharedPtr: Implement make_shared using adopt_shared
SharedPtr: Delete ptr on failure in all adopt_shared* functions
2023-02-25 17:09:03 +01:00
89958fbc74
kernel: Show a more technical message on failure to remap kernel data sections
continuous-integration/drone/push Build is passing
2023-02-02 21:26:07 +01:00
c05a87c7ff
kernel: Reenable the text console on panic
continuous-integration/drone/push Build is passing
2023-02-01 22:58:31 +01:00
e9a009478f
SharedPtr: Fixes and support for casting to other SharedPtr types
continuous-integration/drone/push Build is passing
2023-01-31 19:59:06 +01:00
3a84e4998c
kernel/Thread: Add FIXME
continuous-integration/drone/push Build is passing
2023-01-31 17:02:49 +01:00
35501407c1
kernel: Stop shouting when creating threads
continuous-integration/drone/push Build is passing
2023-01-25 21:25:34 +01:00
fd0e29ede5
kernel: Add FIXME in copy_to_user()/copy_from_user()
continuous-integration/drone/push Build is passing
2023-01-25 21:22:14 +01:00
8098ff0616
tools: Avoid rebuilding libc and friends every single time
...
continuous-integration/drone/push Build is passing
We do this by preserving timestamps when copying headers so CMake doesn't think they have changed.
2023-01-25 21:16:20 +01:00
635437a4a4
luna: Add a new idiomatic way to mark unused parameters as used while keeping their names
...
Just call ignore(...)
2023-01-25 21:14:44 +01:00
39042cbbd4
kernel: PCI constness updates
continuous-integration/drone/push Build is passing
2023-01-25 21:01:45 +01:00
fa29d6e9b9
kernel: Rename PCI::callback_t to PCI::Callback
continuous-integration/drone/push Build is passing
2023-01-25 20:58:59 +01:00
15c89a3592
kernel: Implement filtered PCI scans
continuous-integration/drone/push Build is passing
2023-01-23 21:24:05 +01:00
3a4ca73df7
kernel: Sync log output
continuous-integration/drone/push Build is passing
2023-01-23 20:42:34 +01:00
6677c643a5
kernel: Start scanning the PCI bus for devices
continuous-integration/drone/push Build is passing
2023-01-23 20:07:17 +01:00
de04c094e7
x86_64: Skip enabling WP for now until I find how to check for its availability
2023-01-23 20:06:45 +01:00
8cb9c14b1e
luna/Format: Make output_(pure_)integer_data take a const reference to vstate
continuous-integration/drone/push Build is passing
2023-01-22 17:36:02 +01:00
7f8a8cdcaf
kernel, libc: Add an usleep() system call and use that to implement usleep() and sleep() in libc
continuous-integration/drone/push Build is passing
2023-01-22 15:00:20 +01:00
d5b1d72396
x86_64/MMU: Map the kernel page directory to virtual memory
...
This avoids depending on the kernel address space to create a new userspace one,
since there is no physical memory access.
This was fine for a single process, since its address space was created from the kernel one
and no more address spaces were created,
but for two or more, this started to become problematic, since we would create one address space
while being in another process's address space, which has no direct mapping of physical memory.
2023-01-22 14:46:03 +01:00
a7a38d3433
Bitmap: Add a fallible variant of match_region() that does not crash if arguments are out of range
...
continuous-integration/drone/push Build is passing
This lets us call deallocate_memory() with any address and it will not crash.
2023-01-22 14:25:51 +01:00
cb59a4e0e3
libc: Add assert.h
continuous-integration/drone/push Build is passing
2023-01-22 12:51:30 +01:00
34a9b35037
Option, Result: Propagate caller locations when erroring out
continuous-integration/drone/push Build is passing
2023-01-22 12:00:52 +01:00
0126a8fb6e
luna: Add a new SourceLocation class and use that in check() and expect()
2023-01-22 11:43:48 +01:00
129297a0b0
CString: Fix compilation in strnlen()
2023-01-22 11:43:10 +01:00
cf8d3c6ff9
OwnedStringView: Add a method to extract a substring
continuous-integration/drone/push Build is failing
2023-01-22 11:27:54 +01:00
12d2039f68
CString: Add strnlen() and strndup()
2023-01-22 11:27:37 +01:00
944d32de36
Bitmap: Introduce new malloc-aware initialization functions
...
continuous-integration/drone/push Build is passing
Lets us call resize(new_size) instead of initialize(realloc(location, new_size), new_size)
2023-01-21 23:16:50 +01:00
0e607c2fef
Bitmap: Declare more variables as const
...
I miss Rust's immutability-by-default...
2023-01-21 23:04:21 +01:00
a6974b605e
tools+CMake: Prefix all environment variables with LUNA_
continuous-integration/drone/push Build is passing
2023-01-21 22:44:16 +01:00
a3d0fa7d0a
UserVM: Validate the entire range when freeing multiple VM pages
continuous-integration/drone/push Build is passing
2023-01-16 21:16:38 +01:00
631cdd0204
x86_64/CPU: Skip null instruction pointers on stack trace generation
continuous-integration/drone/push Build is passing
2023-01-16 20:44:45 +01:00
c374c25523
Convert some FIXMEs into NOTES
continuous-integration/drone/push Build is passing
2023-01-16 20:30:35 +01:00
1d92784608
luna, kernel: Replace some uses of char by truly 1-byte wide types
continuous-integration/drone/push Build is passing
2023-01-16 19:52:34 +01:00
329e8ab182
luna/Heap: Scrub reallocations properly
2023-01-16 19:50:35 +01:00
1b807a4e06
arch/Timer: Make sure ARCH_TIMER_FREQ is a power of two
...
(avoid division and modulo, division is slow)
Fortunately, GCC will optimize divisions by powers of two to simple bitwise shifts :)
2023-01-16 19:43:05 +01:00
d0600f5714
luna: Make Utf8StringEncoder short-circuit instead of failing when hitting the length limit
continuous-integration/drone/push Build is passing
2023-01-14 12:07:08 +01:00
e3ef29e80d
libc: Implement wcstombs()
continuous-integration/drone/push Build is passing
2023-01-14 11:59:08 +01:00
00ee8314b3
luna: Make Utf8String{De,En}coders return the number of bytes written
...
This means we can avoid a call to code_points() in mbstowcs(),
which would parse a string twice.
2023-01-14 11:55:19 +01:00
da805eec83
Describe what check() and expect() are
continuous-integration/drone/push Build is passing
2023-01-14 10:59:30 +01:00
eb35abfa52
Vector: Assigment, copy&move constructors, and destructor
2023-01-14 10:50:28 +01:00
3b4b750cbf
luna: Vector is here!!
continuous-integration/drone/push Build is passing
2023-01-13 22:28:03 +01:00
28bde216c4
libc: Implement perror()
continuous-integration/drone/push Build is passing
2023-01-13 21:08:10 +01:00
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()
continuous-integration/drone/push Build is passing
2023-01-13 20:00:20 +01:00
5fb2ff09c7
kernel, luna, libc: Move the heap code to a common zone, to be used by both kernel and userspace
2023-01-13 19:27:53 +01:00
d864bda751
libc: Add (de)allocate_memory wrappers located in sys/mman.h
2023-01-13 19:08:02 +01:00
139c0b5eb1
Kernel: Make a UserVM wrapper around Bitmap and use that to allocate user VM
...
This lets us allocate more than one page of memory from the user side.
2023-01-13 19:05:20 +01:00
7462b764d8
Kernel: Add __cxa_atexit iomplementation
2023-01-13 18:56:05 +01:00
09dc8bd522
Bitmap: Add find_region() and find_and_toggle_region()
2023-01-13 18:55:31 +01:00
59db656f25
size_t -> usize
2023-01-13 18:55:05 +01:00
16a62552db
SharedPtr: Add a nullptr constructor
2023-01-13 18:54:39 +01:00
445aeed80d
OwnedPtr: Implement assignment operators
2023-01-13 18:54:25 +01:00
9454b65682
allocate_memory: Respect PROT_NONE
2023-01-12 17:59:17 +01:00
586ca19b62
Add a VERY BASIC and hacky way of allocating memory from userspace
...
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
0e1e15e85a
Result: Construct a Result from an Option using from_option()
2023-01-11 23:02:42 +01:00
79a5b98d65
Kernel: Keep the user pointer const through copy_from_user()
continuous-integration/drone/push Build is passing
2023-01-11 19:26:53 +01:00
6e4cd6300d
Kernel: Add copy_from_user() and copy_from_user_typed()
continuous-integration/drone/push Build is passing
2023-01-11 19:25:28 +01:00
73ddd0b0c5
tools: Be more arch-agnostic
continuous-integration/drone/push Build is passing
2023-01-11 19:14:35 +01:00
d150c55143
TarStream: Support mode
continuous-integration/drone/push Build is passing
2023-01-11 18:42:50 +01:00
82b555cf5c
TarStream: Refactor the API to get rid of that awful method in Result
...
continuous-integration/drone/push Build is passing
That method being try_set_value_with_specific_error()
2023-01-11 17:30:53 +01:00
6cf042e65e
Result: Remove m_has_value, rely on Option::has_value()
continuous-integration/drone/push Build is passing
2023-01-11 17:09:32 +01:00
67ebb00bd3
Option, Result: Introduce try_move_value(), which is the release_value() equivalent of try_set_value()
2023-01-11 17:06:17 +01:00
84c82a4e75
luna, kernel: More constness
continuous-integration/drone/push Build is passing
2023-01-10 19:31:41 +01:00
5aa667c776
luna: Make OwnedStringView::clone() just call from_string_literal()
continuous-integration/drone/push Build is passing
2023-01-10 19:03:00 +01:00
3ac3d54788
luna: Make check() and expect() output errors in userspace
2023-01-10 19:02:16 +01:00
c82ed5df01
Enable -Os on all targets
2023-01-10 18:13:21 +01:00
feaf9ed19b
Update README.md
continuous-integration/drone/push Build is passing
2023-01-09 18:16:39 +01:00
c83f6c03b5
Bitmap: Add a 'find_and_toggle' method
...
continuous-integration/drone/push Build is passing
Just like find(), but toggles the value when finding it.
Avoids doing this manually in MemoryManager and KernelVM.
2023-01-09 18:08:50 +01:00
4287ec6cb0
Bitmap: Introduce a new method 'find' and use it in MM and KernelVM
...
continuous-integration/drone/push Build is passing
This method looks for the first bit with a value, optionally from a starting index, and returns its index.
This should be (haven't benchmarked) way faster than the manual way,
AKA what MM and KernelVM were doing.
This is due to this method using bit and byte manipulation tricks instead of just calling get() until getting the desired result :)
2023-01-09 17:59:52 +01:00
31ee97b7de
Remove restart from CI configuration
continuous-integration/drone/push Build is passing
2023-01-08 15:55:26 +01:00
15c5b80dc9
Rewrite README.md now that restart is gone
2023-01-08 15:55:01 +01:00
afe9a01bbf
Merge branch 'restart' into main
...
continuous-integration/drone/push Build is passing
Reviewed-on: #21
2023-01-08 15:45:56 +01:00
1f135261e7
Revert "Kernel: Make readdir() available in created InitRD directories"
...
This reverts commit 511bb7a8c1
.
2023-01-08 15:42:48 +01:00
49d1e4f011
Revert "mprotect(): Validate the entire range to protect is in userspace memory"
...
This reverts commit 4ef764e62e
.
2023-01-08 15:41:53 +01:00
401a807551
Revert "Update README.md"
...
This reverts commit 1f4c4f1a0c
.
2023-01-08 15:41:39 +01:00
b0e5d02c9a
kernel: Turn off console logging before starting the init process
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2023-01-08 15:32:59 +01:00
a620b00b18
Unify libc header descriptions
2023-01-08 15:29:30 +01:00
8de59138ef
We are platform-agnostic now (kind of)
...
continuous-integration/drone/push Build is passing
Still tied to x86_64, but because there's no other platform implemented.
Also making this commit just to test CI with the new toolchain.
2023-01-07 21:42:57 +01:00
0c5a84f932
toolchain: Update to binutils 2.39
...
continuous-integration/drone/push Build is failing
CI will fail, it's normal. Wait for me to build a new toolchain for it.
2023-01-07 21:23:01 +01:00
0c73d69a70
Kernel: Fix shadow 12GiB reserved entry when running QEMU without KVM on
...
continuous-integration/drone/push Build is passing
Fix inspired by: https://github.com/serenityos/serenity/pull/16345
2023-01-07 20:58:12 +01:00
c97f588d44
Fix TRY() with Option
2023-01-07 20:53:23 +01:00
fde1727218
KernelVM: Expand the available VM range
continuous-integration/drone/push Build is passing
2023-01-07 12:33:00 +01:00
8ee634d19b
Kernel/Scheduler: Display addresses starting with 0x when creating threads
continuous-integration/drone/push Build is passing
2023-01-07 12:02:14 +01:00
471103e4f3
Remove the word 'header' from libc header descriptions
continuous-integration/drone/push Build is passing
2023-01-07 11:39:15 +01:00
12dc96b4a5
Fix comment typo
...
continuous-integration/drone/push Build is passing
My bad :(
2023-01-07 11:31:08 +01:00
b70bbc0ba6
More libc commenting
continuous-integration/drone/push Build is passing
2023-01-07 11:21:53 +01:00
7e377ef712
Implement printf()
continuous-integration/drone/push Build is passing
2023-01-07 01:49:26 +01:00
29bd8a69fa
MemoryManager: Add helper functions to validate arbitrary ranges of userspace memory
2023-01-07 01:39:33 +01:00
7fb2807d0c
libc: Implement time() using clock_gettime().
...
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
6e9b4491a6
MemoryManager: Add copy_to_user() and copy_to_user_typed()
2023-01-07 00:17:16 +01:00
b851dcf9b9
libc: Implement mbstowcs() using Utf8StringDecoder
continuous-integration/drone/push Build is failing
2023-01-06 21:01:37 +01:00
8891304509
libc: Add ctype.h
2023-01-06 20:48:08 +01:00
80f5c790f8
Implement string formatting into libc :)
...
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
367a2ce521
libc: header documentation for supported functions
continuous-integration/drone/push Build is passing
2023-01-06 20:02:07 +01:00
c3653cd4e6
More stdlib.h implementation + commenting + atexit()
continuous-integration/drone/push Build is passing
2023-01-06 19:40:25 +01:00
50509baea6
More c_cpp_properties.json
continuous-integration/drone/push Build is passing
2023-01-06 19:06:47 +01:00
65d2f1c041
Update c_cpp_properties.json
continuous-integration/drone/push Build is passing
2023-01-06 19:03:35 +01:00
0a472000be
Fix CI by providing a host C++ compiler
continuous-integration/drone/push Build is passing
2023-01-06 19:00:32 +01:00
83651b4b90
CMake: Respect the ARCH env variable
continuous-integration/drone/push Build is failing
2023-01-06 18:59:59 +01:00
bdfe7dac17
libc: Remove crti.o and crtn.o
...
continuous-integration/drone/push Build is failing
Looks like these are now provided by the compiler.
2023-01-06 17:59:54 +01:00
8838e2cf22
Bring back the OS-Specific Toolchain on restart :^)
continuous-integration/drone/push Build is failing
2023-01-06 17:35:07 +01:00
e37280b0e5
ELFLoader: Set both the read-write and execute flags if the section has both
...
Not good for W^X, but the compiler decides to squash everything into a single program header :(
2023-01-06 17:34:24 +01:00
87a4bc91d8
arch/x86_64: Nicer display for page faults that shows a human-readable version of the error code
2023-01-06 17:31:22 +01:00
a01b56ed39
CString: Support strcpy(), strcat() and strchr()
2023-01-06 16:20:35 +01:00
30555f8e5a
Skip these because CI needed a toolchain rebuild
continuous-integration/drone/push Build is passing
2023-01-06 15:00:49 +01:00
7acef24494
Make libc depend on crt{0,i,n}.o
continuous-integration/drone/push Build is failing
2023-01-06 14:32:38 +01:00
71414c0653
Explicitly set the link path to make it build on CI
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
continuous-integration/drone/push Build is failing
2023-01-06 13:40:53 +01:00
08608d2344
Depend on libc headers
continuous-integration/drone/push Build is failing
2023-01-06 13:38:48 +01:00
f1923ce5bd
Install headers before compilation
continuous-integration/drone/push Build is failing
2023-01-06 13:35:57 +01:00
129e3c434a
Switch to C for userspace, with a very bare-bones libc!!
continuous-integration/drone/push Build is failing
2023-01-06 13:31:14 +01:00
b27cefb9c5
SystemError: Define _LUNA_SYSTEM_ERROR_EXTENSIONS to compile properly in hosted envs
2023-01-06 13:30:49 +01:00
293b979e75
ELFLoader: Do not crash on non-page-aligned sections
2023-01-06 13:30:17 +01:00
fd8a0175d9
Add a syscall infrastructure (our baby program can print to the console now!)
continuous-integration/drone/push Build is passing
2023-01-05 22:39:56 +01:00
caa3fe8c45
MemoryManager: Add validate_userspace_string()
...
A bit crude, should be replaced by a strdup_from_user() helper to avoid touching userspace memory directly.
But it'll do for now.
2023-01-05 22:39:09 +01:00
0ea9974512
First user process!
...
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
0aac6c888d
x86_64: Basic exit() syscall!
...
User processes need to do something, amirite?
2023-01-05 21:53:48 +01:00
a33a72915e
Scheduler: Creation, destruction and switching of userspace tasks :))
...
From a TarStream. Not optimal, but OK for the moment.
2023-01-05 21:52:26 +01:00
ea89b92675
Store a bit more stuff in a thread :)
2023-01-05 21:50:53 +01:00
31ea030c7f
MMU: Add functions to create and delete userspace page directories
2023-01-05 21:50:26 +01:00
c53bba0392
MemoryManager: Add an unmap_weak_and_free_vm() helper function
...
This function mirrors unmap_owned_and_free_vm(), but using weak unmapping (does not free the underlying physical memory)
2023-01-05 21:50:06 +01:00
d3c414af4e
ELFLoader: Do not keep track of segments
...
This reduces calls to kmalloc() since segment data is heap-allocated, and the segments loaded will be deleted when deleting the page directory.
2023-01-05 21:46:03 +01:00
f0e14cf7e9
Update year range in LICENSE :)
continuous-integration/drone/push Build is passing
2023-01-02 13:08:42 +01:00
5854e5e530
Add newlines at end-of-file
2023-01-02 13:07:29 +01:00
aab3a0a840
Update settings.json
2023-01-02 13:07:13 +01:00
3442970678
Add vscode configuration
2023-01-02 13:00:22 +01:00
4ef764e62e
mprotect(): Validate the entire range to protect is in userspace memory
...
Before this patch, sys_mprotect() only validated the starting address.
This was as bad as it sounds, in fact it let me write a fun exploit
using it.
Now, this exploit is no longer possible.
This patch is probably not relevant, since this branch will be gone in
the future, as soon as restart gets merged into main.
I made it anyways :^)
2023-01-02 11:51:08 +01:00
df8f9c6cf6
SharedPtr: adopt_shared_from_owned
continuous-integration/drone/push Build is passing
2022-12-31 12:02:15 +01:00
831711ab7e
TypeTraits: Remove const, volatile, and reference
continuous-integration/drone/push Build is passing
2022-12-31 11:50:30 +01:00
e2e21923d7
Result: Implement operator=()
continuous-integration/drone/push Build is passing
2022-12-30 19:06:47 +01:00
4081186b27
Heap: Rewrite kmalloc to use Option<HeapBlock*> instead of nullable pointers to iterate over the heap
...
continuous-integration/drone/push Build is passing
At some point, this should be done inside LinkedList itself, but we have no such thing as break in for_each().
It's iterate over everything or nothing.
This also requires operator= in Option, might be also added to Result in the future.
2022-12-30 19:02:25 +01:00
3a3968b268
Result: Add nonnull_or_error()
2022-12-30 18:46:27 +01:00
973e39a255
LinkedList: Move nonnull_or_empty_option to Option.h so everyone can use it
2022-12-30 18:46:18 +01:00
28f53f9ccf
LinkedList: Rename the nonnull_or_error() helper to a more accurate nonnull_or_empty_option()
2022-12-30 18:44:37 +01:00
1f36ecd044
LinkedList: Make expect_first() and expect_last() show a more accurate error description on panic
...
Instead of showing a generic "Option::value() called on an empty Option" with no useful source location,
you will get something like "check failed: m_start_node at LinkedList.h:139"
2022-12-30 18:43:39 +01:00
24773fbece
kernel/main: Remove reference to 'extern const BOOTBOOT bootboot'
2022-12-30 18:38:50 +01:00
74aa30a44f
Init: Call efficient_halt() on magic number mismatch instead of busy-looping
2022-12-30 18:36:22 +01:00
9569385691
Remove unused include
2022-12-30 18:32:44 +01:00
400d0395a2
Result: Avoid double-checking when calling through to the underlying Option
continuous-integration/drone/push Build is passing
2022-12-30 15:00:02 +01:00
8e59a0a79f
CMakeLists improvements
continuous-integration/drone/push Build is passing
2022-12-30 11:48:18 +01:00
7952d1d8a0
x86_64: Add basic keyboard support with an ASYNC DRIVER
continuous-integration/drone/push Build is passing
2022-12-26 19:59:18 +01:00
ed34009b50
Heap: Log more details of blocks
continuous-integration/drone/push Build is passing
2022-12-26 16:17:24 +01:00
2af3997456
LinkedList: Fixed some boogs, LinkedList is now boog-free :)
2022-12-26 15:54:29 +01:00
1c70ab5a1a
Heap: Avoid combines with blocks outside a range
2022-12-26 15:20:56 +01:00
a1eca479d5
x86_64: Add a getter for the initial page directory
continuous-integration/drone/push Build is passing
2022-12-26 12:57:25 +01:00
2600acc96c
Thread: Add init_regs_user()
2022-12-26 12:46:07 +01:00
7efb79dd26
LinkedList: Check for nullptrs in detach_from_list()
2022-12-26 12:45:49 +01:00
7e62ee66be
Change heap.first().has_value() to the cheaper heap.count()
continuous-integration/drone/push Build is passing
2022-12-26 12:24:39 +01:00
73c58bd902
Init: Move platform_init() before MemoryManager::init()
...
continuous-integration/drone/push Build is passing
This enables NX before we actually use it.
Wasn't causing problems with KVM on, but crashed with KVM off with a 'reserved bit set' page fault.
2022-12-26 12:12:55 +01:00
0054777e7d
x86_64: Warn if NX is not supported
2022-12-26 12:11:10 +01:00
08984e1673
x86_64: Create a has_flag() helper function and remove redundant clearing of reserved bits
2022-12-26 12:10:47 +01:00
59d69f684f
x86_64: Add general protection fault handler
continuous-integration/drone/push Build is passing
2022-12-24 11:49:47 +01:00
f71ccde833
Add an overload for aligned deletes which just calls the normal operator delete
2022-12-24 11:49:12 +01:00
f2cc797599
Add a simple ELF loader
continuous-integration/drone/push Build is passing
2022-12-23 13:09:21 +01:00
e5ae2b0435
TarStream: Make read_contents and friends const
2022-12-23 13:08:31 +01:00
ad0f6546d7
Add a global initrd TarStream to make the initial ramdisk accessible everywhere
...
continuous-integration/drone/push Build is passing
It's also mapped into virtual memory instead of directly going into the physical location!!
2022-12-23 11:33:23 +01:00
6ff92b1714
MemoryManager: Add get_kernel_mapping_for_frames()
...
This function allocates a continuous range of VM and maps the physical frames passed to said VM range.
2022-12-23 11:30:49 +01:00
74235c2c99
Update README.md
continuous-integration/drone/push Build is passing
2022-12-23 11:06:59 +01:00
e6384ae90d
Use the new toolchain location
continuous-integration/drone/push Build is passing
2022-12-23 11:06:37 +01:00
575752eb23
Update drone config to pull toolchain from a new purpose-built toolchain archive for CI
2022-12-23 11:04:50 +01:00
c39e54b7c6
Make TarStream::read_contents take any pointer as output
2022-12-23 10:51:55 +01:00
34e6c05cef
Fix it up a bit more
continuous-integration/drone/push Build is passing
2022-12-23 10:48:00 +01:00
913b13b380
Fix up the header install script
continuous-integration/drone/push Build is passing
2022-12-23 10:46:44 +01:00
4fa33a9689
SharedPtr: Add operator=
continuous-integration/drone/push Build is passing
2022-12-23 10:31:48 +01:00
bd4b05e534
Add OwnedPtr and SharedPtr
continuous-integration/drone/push Build is passing
2022-12-23 10:23:13 +01:00
9afaad8fed
Add dbgln() for the luna library
continuous-integration/drone/push Build is passing
2022-12-22 18:00:35 +01:00
a3595e71a9
Update .clang-format
continuous-integration/drone/push Build is passing
2022-12-21 20:22:44 +01:00
96135ff808
Use limits.h for the standard definition of WCHAR_MAX
continuous-integration/drone/push Build is passing
2022-12-21 20:11:00 +01:00
16bf8b38ea
UTF-8 decoder: Error out on overlong encodings
continuous-integration/drone/push Build is passing
2022-12-21 20:08:43 +01:00
fcefab4383
TextConsole: Add wide-character overloads for print() and println()
...
continuous-integration/drone/push Build is passing
These can't fail from UTF-8 decoding errors.
2022-12-21 19:41:13 +01:00
293b7b0f11
TextConsole: Propagate UTF-8 decoding errors
continuous-integration/drone/push Build is passing
2022-12-21 17:38:19 +01:00
2e8ea724a0
arch/x86_64: Refactor the stack tracing code to remove duplicate code
continuous-integration/drone/push Build is passing
2022-12-21 17:21:01 +01:00
7a2cb28475
Make sure isize matches ssize_t on most cases
continuous-integration/drone/push Build is passing
2022-12-20 17:12:44 +01:00
e2a6cba3c6
Log: Update formatting to make ANSI weirdness more sensible
continuous-integration/drone/push Build is passing
2022-12-19 21:42:53 +01:00
703c3f44fb
Add two FIXMEs
continuous-integration/drone/push Build is passing
2022-12-19 21:41:27 +01:00
042f999677
Heap: SCRUB IT ALL
...
continuous-integration/drone/push Build is passing
If your memory is all 0xacacacac there is a big probability you haven't initialized it.
2022-12-19 13:20:38 +01:00
a11a5dec1f
DoublyLinkedList -> LinkedList
continuous-integration/drone/push Build is passing
2022-12-19 12:43:23 +01:00
1269a045bd
LinkedList: Add a convenience delayed_for_each() method.
...
This is a special way of iterating over the list which permits removing items while iterating.
2022-12-19 12:41:25 +01:00
5b72144fac
Add a handy consume() method to LinkedList
continuous-integration/drone/push Build is passing
2022-12-19 12:35:08 +01:00
92a7004c2f
Move the reaping logic to Scheduler
2022-12-19 12:24:15 +01:00
31ee901e01
TarStream: Add a variant of read_contents() returning an OwnedStringView
2022-12-19 12:21:17 +01:00
9eb829f3a2
CString: Add strcmp()
2022-12-19 12:20:56 +01:00
60520dff4c
Make MemoryManager's scope guards more robust
continuous-integration/drone/push Build is passing
2022-12-19 11:55:53 +01:00
0bdbffe0ca
Spinlock+LockedValue: Add try_lock() methods
...
continuous-integration/drone/push Build is passing
For when you want to lock a resource if possible but not get blocked if it is locked by another thread.
2022-12-18 20:37:26 +01:00
283e641ece
Spinlock+LockedValue: Remove init() functions
...
Let's set the default (unlocked) value of Spinlock's underlying atomic to 0, so even if the constructor is not called it stays like that.
2022-12-18 20:36:15 +01:00
a63146a798
Show the date and time of build :)
continuous-integration/drone/push Build is passing
2022-12-18 18:51:25 +01:00
751377de0a
Scheduler: Make it possible for a thread to stop existing
continuous-integration/drone/push Build is passing
2022-12-18 18:43:34 +01:00
1b92fe36b4
Store the stack inside a thread
2022-12-18 18:43:17 +01:00
00cf267ac7
Lock EFIXME and error_string() behind a #define
continuous-integration/drone/push Build is passing
2022-12-18 18:14:48 +01:00
a08310ff5e
Add some more errno definitions
continuous-integration/drone/push Build is passing
2022-12-18 18:09:52 +01:00
cda0d49a4e
Add todo()
continuous-integration/drone/push Build is passing
2022-12-18 17:15:42 +01:00
4a7e48ed5d
Make sure wchar_t is wide enough to hold all Unicode code-points
...
continuous-integration/drone/push Build is passing
Too bad if it isn't.
2022-12-18 17:14:12 +01:00
6c3b7672a0
Kernel: Demo the initrd using TarStream
...
continuous-integration/drone/push Build is passing
Yes, we're using the physical address. Not optimal, this is only for demo purposes.
2022-12-18 16:39:35 +01:00
1d6092341a
Add a generic TarStream class
...
As long as it's in memory, we can use it :)
2022-12-18 16:38:47 +01:00
eadca3d25b
Add nullcpy()
...
Invented function to memcpy() with a specific size, but add a null terminator.
2022-12-18 16:31:02 +01:00
0d65f188f0
Alignment.h: Include the Types
2022-12-18 16:30:27 +01:00
730d0682ee
Result: Add try_set_value_with_specific_error()
2022-12-18 16:30:09 +01:00
b01878cd3c
Update README.md
continuous-integration/drone/push Build is passing
2022-12-18 14:55:04 +01:00
ffd3385d0d
TextConsole: decoder -> utf8_decoder
continuous-integration/drone/push Build is passing
2022-12-18 14:42:53 +01:00
6389099808
UTF-8 part 2: Encoding wide-character strings into UTF-8
...
continuous-integration/drone/push Build is passing
We now have Utf8StringEncoder and Utf8Encoder (no state this time)
2022-12-18 14:34:50 +01:00
9c1c6bb320
Add wcslen()
...
I think this can go in CString.h, no need to create a separate CWChar.h or something
2022-12-18 14:33:13 +01:00
36179155e1
Add UTF-8 support to TextConsole!!
...
continuous-integration/drone/push Build is passing
Not much support, since the font only covers codepoints from U+0000 to U+00FF,
(Basic Latin & Latin Extended-A), but unprintable code-points are rendered as ONE box per code-point,
instead of multiple garbage characters.
So it's Unicode-aware, even if it can't print most characters.
2022-12-18 13:09:37 +01:00
75ba14a3ad
Add UTF-8 decoder support!!
2022-12-18 13:04:40 +01:00
23d405bbda
Add an unreachable() macro function that panics if reached
2022-12-18 12:40:28 +01:00
a89ae9bed7
Run include-what-you-use
continuous-integration/drone/push Build is passing
2022-12-17 15:51:19 +01:00
1b867151bd
MemoryManager: Run include-what-you-use
continuous-integration/drone/push Build is passing
2022-12-17 15:47:35 +01:00
95b0091622
Split off arch/x86_64/CPU.cpp into various files
continuous-integration/drone/push Build is passing
2022-12-17 15:45:06 +01:00
799a02c883
Remove unnecessary std:: prefix from inside std
continuous-integration/drone/push Build is passing
2022-12-17 15:33:47 +01:00
d5b9ff1569
Remove unused function definition
continuous-integration/drone/push Build is passing
2022-12-17 15:30:57 +01:00
e4b971f09c
Make LinkedList::prepend() also set the element as the last one if we have no elements
continuous-integration/drone/push Build is passing
2022-12-17 15:28:18 +01:00
f5de9c5589
LinkedList: Add a prepend() method
continuous-integration/drone/push Build is passing
2022-12-17 15:27:16 +01:00
c5220cbf64
LinkedList: Rename append_after to add_after
2022-12-17 15:27:00 +01:00
2bc6398d3e
TRY(): Call release_value() instead of expect_release_value()
continuous-integration/drone/push Build is passing
2022-12-17 15:15:27 +01:00
34c738116c
Result: Make some member functions const
2022-12-17 15:15:00 +01:00
90bd4a83c0
Result, Option: Move member initialization to constructors
2022-12-17 15:14:27 +01:00
ee6387e7b5
Refactor NumberParsing.cpp + a lot of comments
2022-12-17 15:00:19 +01:00
97cb57d521
Check for overflow/underflow in parse_signed_integer
continuous-integration/drone/push Build is passing
2022-12-17 14:42:56 +01:00
59c9d8f119
asm -> asm volatile
continuous-integration/drone/push Build is passing
2022-12-17 14:32:24 +01:00
acb0ab1cd7
Use TypeTraits in Alignment.h to make static assertions more readable
continuous-integration/drone/push Build is passing
2022-12-17 13:50:27 +01:00
ace674e518
LinkedList: Make sure the contained type inherits from DoublyLinkedListNode<T>
2022-12-17 13:49:47 +01:00
2cbc9fa385
Add some nice TypeTraits
2022-12-17 13:48:55 +01:00
f77126768f
Improve message
2022-12-17 13:48:22 +01:00
16954695dd
Tell the compiler that string_format is a printf-style function
continuous-integration/drone/push Build is passing
2022-12-17 12:45:26 +01:00
16e00bada0
Add comments to Format.h
continuous-integration/drone/push Build is passing
2022-12-17 12:43:29 +01:00
abbed13f27
Add a 'pure' variant of cstyle_format which is infallible
...
If we cannot fail to output, it doesn't make sense to propagate errors. So if you're SURE there are no errors, use pure_cstyle_format().
If, however, output can fail, use cstyle_format().
This has a drawback of adding quite a bit of code duplication to Format.cpp.
Some of it is dealt using templates, but some code still remains duplicate.
2022-12-17 12:38:22 +01:00
48fcb8734a
Give number parsing functions more meaningful names
2022-12-17 12:12:58 +01:00
cf3b2176f0
Implement OwnedStringView::from_string_literal
continuous-integration/drone/push Build is passing
2022-12-17 11:36:16 +01:00
df9a13cbfb
KernelVM: Make g_used_vm atomic and g_kernelvm_bitmap a LockedValue
continuous-integration/drone/push Build is passing
2022-12-17 10:56:24 +01:00
132963070b
MemoryManager: Make some variables atomic and the frame bitmap a LockedValue
2022-12-17 10:56:24 +01:00
f97515bd7e
Kernel: Add Spinlock and LockedValue<T>
2022-12-17 10:55:54 +01:00
6e5d2b5335
Thread: Make g_next_id atomic
2022-12-17 10:50:49 +01:00
14461c6fe8
Atomic: Add operators += and -=
2022-12-17 10:49:19 +01:00
9d6235e109
CPU: Add a pause() method
2022-12-17 10:45:55 +01:00
a16f357ab9
Add an Atomic class
continuous-integration/drone/push Build is passing
2022-12-16 21:15:22 +01:00
b316e3b3b7
Print stack trace on assertion fail
continuous-integration/drone/push Build is passing
2022-12-16 20:49:09 +01:00
da39ba33a9
Move OwnedStringView::operator[] out of line
2022-12-16 20:48:58 +01:00
59765aa334
Rename String.h -> CString.h
...
continuous-integration/drone/push Build is passing
Let's not confuse String.h with a managed string class, it's in fact the equivalent of the C stdlib's <string.h>
2022-12-16 20:40:04 +01:00
42a2c2af49
Add strdup()
2022-12-16 20:37:57 +01:00
e56075fb46
Use nothrow in raw_malloc
2022-12-16 20:36:43 +01:00
345e13965e
Add missing include
...
continuous-integration/drone/push Build is passing
No one was noticing because everyone using OwnedStringView included Result.h before it
2022-12-16 20:27:44 +01:00
4a6c59d519
Make all methods in OwnedStringView const
continuous-integration/drone/push Build is passing
2022-12-16 19:48:22 +01:00
2e24e09146
Convert MemoryMapIterator to Option
continuous-integration/drone/push Build is passing
2022-12-16 19:47:20 +01:00
a32590ff8a
Call expect_value more
2022-12-16 19:44:33 +01:00
cedcfa9c63
Improve cleanup on MemoryManager failure + add methods that use KernelVM
continuous-integration/drone/push Build is passing
2022-12-16 19:36:38 +01:00
814672c771
Remove some redundant error propagation
...
continuous-integration/drone/push Build is passing
Why can printing to the serial port or format onto a string fail?
Even if cstyle_format returns Result<usize>, we shouldn't always follow suit.
2022-12-16 18:32:29 +01:00
41b3c8adb2
Convert to_dynamic_unit to OwnedStringView and rename the old variant to to_dynamic_unit_cstr
continuous-integration/drone/push Build is passing
2022-12-16 18:18:24 +01:00
be22cf6267
Introduce OwnedStringView
...
A managed String which uses RAII to free its contents. It's not a proper string though, since it's read-only.
So it's a StringView... but an owned one.
Can't be copied automatically, must be either moved or copied manually by calling clone() on it.
2022-12-16 18:17:15 +01:00
d759058b80
Introduce std::nothrow
...
Let's make sure we explicitly tell new that we don't want exceptions
2022-12-16 18:14:48 +01:00
32c8869973
Option: Simplify release_value
...
This avoids copying + we don't need to destroy the item if we move it, since it either gets emptied by moving it or doesn't have anything to destroy.
2022-12-16 18:13:40 +01:00
19a4e2ab58
Result, Option: Make sure everything is properly moved
2022-12-16 18:11:17 +01:00
e729c38200
Merge pull request 'Add an Option type and get rid of ENONE' ( #19 ) from optionals-and-empty-errors into restart
...
continuous-integration/drone/push Build is passing
Reviewed-on: #19
2022-12-08 15:13:24 +00:00
b9f3d3c349
Remove ENONE
...
continuous-integration/drone/pr Build is passing
If you want to return an error without meaning, use Option.
2022-12-08 16:09:33 +01:00
da104c87cb
Heap: Return Option in split()
2022-12-08 16:09:12 +01:00
b6173e2b67
LinkedList: Return Option instead of ENONE if no value
2022-12-08 16:09:04 +01:00
406af68a54
Result: Use Option as backend
2022-12-08 16:08:18 +01:00
b58eba63f1
Add a new Option class which behaves like Result, but has no error number, just a value or no value
2022-12-08 16:08:02 +01:00
6cee208e62
Kernel: Enable -Wsign-conversion
...
continuous-integration/drone/push Build is passing
For real this time, turns out me, being dumb, added it to Luna instead of the kernel.
2022-12-08 15:09:32 +01:00
779fda307a
More scope guards!!
continuous-integration/drone/push Build is passing
2022-12-08 15:01:04 +01:00
1d5d1daa57
Add scope guards
2022-12-08 14:56:11 +01:00
6de7753b4c
Add malloc wrappers
continuous-integration/drone/push Build is passing
2022-12-07 18:17:49 +01:00
c8302a4fef
Add convenience functions to print the stack trace directly
continuous-integration/drone/push Build is passing
2022-12-07 18:11:24 +01:00
0d437cfcca
Add support for stack traces
continuous-integration/drone/push Build is passing
2022-12-07 17:39:59 +01:00
416e96c4d5
Merge pull request 'Add a basic scheduler with threads' ( #18 ) from threads into restart
...
continuous-integration/drone/push Build is passing
Reviewed-on: #18
2022-12-07 16:11:59 +00:00
d93d95f23c
Add sleeping mechanism
2022-12-07 16:11:59 +00:00
757cee4693
Add accessors for when you're sure a linked list is not empty
2022-12-07 16:11:59 +00:00
70497c37fb
Check for runnable threads
2022-12-07 16:11:59 +00:00
57517252d8
Add a state to Thread
2022-12-07 16:11:59 +00:00
f169718a4b
Initialize and demo the scheduler
2022-12-07 16:11:59 +00:00
c907e16311
x86_64: Invoke the scheduler every millisecond
2022-12-07 16:11:59 +00:00
13f5d09cfd
Add a Scheduler!!
2022-12-07 16:11:59 +00:00
12aa014a3d
Add a Thread class which can be part of a DoublyLinkedList
2022-12-07 16:11:59 +00:00
fbd290c01b
KernelVM: clean up a bit
2022-12-07 16:11:59 +00:00
8da5521273
Add a Stack convenience class
2022-12-07 16:11:59 +00:00
0bbd026660
CPU.h: pragma once
2022-12-07 16:11:59 +00:00
5d988c088f
Make idle_loop noreturn
2022-12-07 16:11:59 +00:00
f65ed465c4
Bitmap: Fix crash by attempting to memset -1 bits (UINT64_MAX)
2022-12-07 16:11:59 +00:00
d3458f2f0f
Bitmap: short circuit on 0-byte clears
2022-12-07 16:11:59 +00:00
4fdd1d57f5
Make build-debug.sh also add debug symbols to luna
2022-12-07 16:11:59 +00:00
c657b302c9
Timer: add raw_ticks
2022-12-07 16:11:59 +00:00
fd6a74e61c
CPU: Add an idle_loop method
2022-12-07 16:11:59 +00:00
287c4ab060
Run clang-format
2022-12-07 16:11:59 +00:00
bbfaa4645a
Add a should_invoke_scheduler method
2022-12-07 16:11:59 +00:00
986aa01948
size_t -> usize
continuous-integration/drone/push Build is passing
2022-12-07 17:06:29 +01:00
beab3454b5
kernel: Enable -Wsign-conversion and -Wcast-align
continuous-integration/drone/push Build is passing
2022-12-07 11:47:46 +01:00
1badc40a4a
Run include-what-you-use everywhere
2022-12-07 11:40:02 +01:00
c2927de191
Remove unused includes
continuous-integration/drone/push Build is passing
2022-12-07 11:22:34 +01:00
a3b69a0cfa
Update README.md
continuous-integration/drone/push Build is passing
2022-12-07 11:13:16 +01:00
ee276a3a35
Add the nodiscard attribute to make and make_array
continuous-integration/drone/push Build is passing
2022-12-07 11:01:45 +01:00
dad95a8160
Map the page bitmap to virtual memory
2022-12-07 10:58:59 +01:00
1ebd892c16
Convert uses of u64 to usize
...
Not all of them, but if you're measuring a size it's more appropriate to use usize than u64.
2022-12-07 10:55:47 +01:00
8598b1e8fc
Replace the _noreturn macro with the C++ native attribute [[noreturn]]
continuous-integration/drone/push Build is passing
2022-12-06 19:40:35 +01:00
c099877c35
Remove unnecessary error propagation in Log.cpp
...
continuous-integration/drone/push Build is passing
Serial and TextConsole always succeed, no need to act as if they could fail
2022-12-06 19:35:34 +01:00
314acbfe21
Change the serial log to display only milliseconds
continuous-integration/drone/push Build is passing
2022-12-06 19:31:41 +01:00
39b310b6b9
Make alignment a template parameter to help the compiler optimize
continuous-integration/drone/push Build is passing
2022-12-06 19:27:58 +01:00
d48eb85d1d
Heap: Avoid magic numbers
continuous-integration/drone/push Build is passing
2022-12-06 19:05:00 +01:00
b5c6ae253d
Make LinkedList a lot better
continuous-integration/drone/push Build is passing
2022-12-06 18:41:35 +01:00
09e447d9d2
Heap: Use LinkedList instead of doing things manually
2022-12-06 18:28:04 +01:00
d8f75f1d3c
LinkedList: Add an append_after() method
...
Can be used to append an item after another one instead of at the end of the list.
With doubly linked lists, this is extremely easy to achieve (O(1)).
2022-12-06 18:25:08 +01:00
146da13e43
LinkedList: Make sure to explicitly mark the first node's next and last nodes as nullptr
2022-12-06 18:23:19 +01:00
07e6ebd3cc
LinkedList: Fix nonnull_or_error
2022-12-06 18:22:45 +01:00
2734353a5d
Heap: Just align it on a 16-byte boundary if it's not aligned
2022-12-06 18:21:19 +01:00
cccf89dd16
Heap: Remove outdated FIXME
2022-12-06 18:20:18 +01:00
87fb195202
Add DoublyLinkedList data structure
continuous-integration/drone/push Build is passing
2022-12-06 17:37:43 +01:00
dd29156c85
Alloc: make() now takes variadic arguments, to forward to the constructor
2022-12-06 17:36:20 +01:00
eef74e2897
Add a generic error code (ENONE)
2022-12-06 17:35:38 +01:00
a021e7a309
Move make and destroy to luna
continuous-integration/drone/push Build is passing
2022-12-06 16:41:22 +01:00
1fa99f4f64
Make {add,sub,mul}_will_overflow more compiler-independent
continuous-integration/drone/push Build is passing
2022-12-06 15:53:06 +01:00
26b44e651d
Change safe_{sub,add,mul} so they perform the operation only once
continuous-integration/drone/push Build is passing
2022-12-06 15:47:59 +01:00
b338126854
Heap: Use safe_mul in kcalloc()
2022-12-06 15:44:21 +01:00
e91c04b1d1
luna: Introduce safe arithmetic operations, which return an error if an operation would overflow
2022-12-06 15:40:18 +01:00
8ff9cb4b96
x86_64: Add a friendlier handler for page faults
continuous-integration/drone/push Build is passing
2022-12-05 21:02:21 +01:00
1d0dd8fa93
Use KernelVM in kmalloc() and friends
...
Much better now!!
2022-12-05 21:02:05 +01:00
ba758bcef8
Initialize the KernelVM
2022-12-05 21:01:18 +01:00
6c3024d4ee
Heap: Count the heap blocks' size in the size required for an allocation
2022-12-05 21:01:06 +01:00
0edabd6d87
Heap: Add a new block to the end of the linked list
...
*facepalm*
This was causing page faults when having two blocks and the first one (oldest one) being freed first.
2022-12-05 21:00:21 +01:00
d445b29477
Add a virtual memory allocator for the kernel
2022-12-05 20:36:24 +01:00
a8fb4ca739
Move CI badge
2022-12-05 19:57:41 +01:00
eaf8a8aafe
Make sure the OS used in CI is Linux
continuous-integration/drone/push Build is passing
2022-12-05 19:26:27 +01:00
bf7bcd7d56
Rename CI pipeline
continuous-integration/drone/push Build is passing
2022-12-05 19:19:50 +01:00
20eeecb3e1
Run CI on push
continuous-integration/drone/push Build is passing
2022-12-05 19:16:58 +01:00
4ec6442ba0
Add build status badge
2022-12-05 19:16:11 +01:00
2677fca5b7
Remove formatting step
2022-12-05 19:09:33 +01:00
f767d98037
Please work
2022-12-05 19:07:01 +01:00
adf6844d49
Update drone.yml
2022-12-05 19:03:06 +01:00
999d90d588
Update check-formatting.sh
2022-12-05 19:02:23 +01:00
62e4ed824d
Update drone.yml
2022-12-05 18:50:01 +01:00
ac2da14319
Update config for CI
2022-12-05 18:48:40 +01:00
bd7b9ad237
Update drone.yml
2022-12-05 18:44:44 +01:00
ca0e47b8e4
Update drone.yml
2022-12-05 18:26:31 +01:00
744d39c27b
Update drone.yml
2022-12-05 18:24:34 +01:00
0c9b822304
Update drone.yml
2022-12-05 18:22:52 +01:00
f21d153077
Update drone.yml
2022-12-05 18:21:30 +01:00
82eda5d6aa
Update drone.yml
2022-12-05 18:19:55 +01:00
d8a3d74779
Actual steps
2022-12-05 18:13:12 +01:00
08b4c078dd
Will it work now?
2022-12-05 18:11:22 +01:00
8f3e80ae47
Try to get it right?
2022-12-05 18:08:50 +01:00
4074835185
Update drone.yml
2022-12-05 18:06:30 +01:00
e6c56172d3
Try adding a drone.yml
2022-12-05 18:00:05 +01:00
95d969ed25
Add message to inform of prebuilt toolchains
2022-12-05 17:48:26 +01:00
762131a425
Make more constexpr
2022-12-05 16:43:52 +01:00
2eaa458555
Remove release_value call
2022-12-05 16:41:39 +01:00
1e3706ac01
Make ARCH_PAGE_SIZE and ARCH_TIMER_FREQ known at compile-time
2022-12-05 16:36:41 +01:00
4f183958e3
General constness + [[gnu::packed]] everywhere
2022-12-05 16:13:38 +01:00
a63a8b32b5
Make new and delete noexcept and return nullptr on failure
2022-12-05 13:45:32 +01:00
891320f7d3
Heap: Make const
2022-12-05 13:41:58 +01:00
7cc139c3f7
Make expect and check use unlikely
2022-12-05 13:35:33 +01:00
ea7893ba71
Make CHECK_PAGE_ALIGNED use expect() instead of check()
2022-12-05 13:28:36 +01:00
55a30ac487
Make CHECK_PAGE_ALIGNED use expect() instead of check()
2022-12-05 13:26:50 +01:00
bfd4647467
Rename largest_free -> largest_free_entry
2022-12-05 13:26:09 +01:00
d9fc50f1ea
Make MemoryMapEntry have private fields with public getters
2022-12-05 13:23:01 +01:00
ec1354fc8d
const in TextConsole
2022-12-05 13:06:12 +01:00
58ecf11424
Make all refs to the bootboot structure const
2022-12-05 13:04:01 +01:00
54ce511f1d
More const
2022-12-05 13:00:41 +01:00
792642dd6f
MORE CONST
2022-12-05 12:58:59 +01:00
86a12f301e
Make value_byte a helper
2022-12-05 12:53:16 +01:00
004e13a5f3
Make bitmap methods const if not modifying the bitmap
2022-12-05 12:50:30 +01:00
3b77ba6b04
EVERYTHING IS CONSTANT IN THIS UNIVERSE
...
Here's one advantage of Rust over C++:
Immutability by default. In Rust, you have to mark a variable as mutable, whereas in C++ you have to mark it as immutable.
What's the problem here? Usually, most variables don't need mutability. Thus we end up with const all over the place.
2022-12-05 12:49:01 +01:00
af96db3641
Remove bootboot declaration from MemoryManager now that it's MemoryMapIterator's job to walk the mmap
2022-12-04 15:56:25 +01:00
77e64d74a0
Remove unused header
2022-12-04 15:55:52 +01:00
0a296413e6
It's not worth it aborting when failing to determine CPU name
2022-12-04 15:55:12 +01:00
766804b3a0
Use get_blocks_from_size instead of +1
2022-12-04 15:52:56 +01:00
0d10c98477
SImplify init_physical_frame_allocator() even more
2022-12-04 15:50:21 +01:00
5f6c48bd12
Use a friendlier way of iterating over the memory map
2022-12-04 15:45:13 +01:00
5aa2d1fa18
Add a Bitmap class to provide common functionality and use that in the MemoryManager
2022-12-04 15:14:07 +01:00
ee76bdf84d
Add sanity check
2022-12-04 13:41:14 +01:00
bde3d55eb2
Remove escape from comment
2022-12-04 13:38:48 +01:00
f8120e01c0
Panic in delete as well
2022-12-04 12:58:37 +01:00
22019ac6b2
Print the error instead
2022-12-04 12:57:43 +01:00
96b32f5a93
Please use make<T> and destroy<T> instead of new and delete
...
Those are there only for common stuff (in the Luna library) that needs an environment-agnostic way of allocating memory.
new and delete are standard, thus we should use those.
2022-12-04 12:55:32 +01:00
adb2c2ab41
Add kernel-side new and delete
2022-12-04 12:52:49 +01:00
b8239698db
Add descriptions in CMakeLists
2022-12-04 12:47:08 +01:00
c7ab6bc2d3
Reorganize the luna/ directory so that headers aren't in the top level include path
2022-12-04 12:42:43 +01:00
cdbed6970a
Result: Add expect_ variants of value() and release_value()
2022-12-04 12:32:34 +01:00
bed29e71af
Replace some uses of check() with expect()
2022-12-04 12:25:16 +01:00
bb92480aa3
Add a variant of check() that accepts an error message
2022-12-04 12:19:17 +01:00
a0c4bbe6f3
Make sure to clean CMake cache when rebuilding
2022-12-04 11:55:47 +01:00
5d9c50eb12
Make build-debug.sh work
2022-12-04 10:27:25 +01:00
9a6d0d1bae
Update README.md
2022-12-04 10:07:56 +01:00
37a41f3d2c
Add warning message
2022-12-03 17:53:47 +01:00
d72478de29
Update README.md
2022-12-03 17:51:39 +01:00
1f4c4f1a0c
Update README.md
2022-12-03 17:49:42 +01:00
bbc5470ae4
Update symlink location
2022-12-03 17:39:22 +01:00
e440df58c9
cleanup: remove unused scripts
2022-12-03 17:37:12 +01:00
505dde35ac
Make GDB source .gdbconf relative to the root directory
2022-12-03 17:34:36 +01:00
dcd5a82073
Make GDB use the correct kernel file
2022-12-03 17:34:14 +01:00
1d7b9260c3
Add config.h for version information
2022-12-03 17:25:25 +01:00
bdc9747f9e
Set a project version
2022-12-03 17:18:25 +01:00
3740309427
Check for STRINGIZE_VALUE_OF before defining it
2022-12-03 17:18:16 +01:00
9c9cb6a05a
oopsie
2022-11-30 17:29:18 +01:00
2bc99f2e6e
Make log __attribute__(format), so the compiler can warn us of bad format strings
2022-11-30 17:28:46 +01:00
3f40ccd703
Indicate the log level in the serial console
2022-11-30 17:26:33 +01:00
985d45ddfb
Switch to logging functions everywhere
2022-11-30 17:16:36 +01:00
d2856d8812
Provide meaningful error numbers
2022-11-30 17:13:59 +01:00
29dad5651d
Move __check_failed to Log.cpp so it can be logged across all backends
2022-11-30 17:12:06 +01:00
1d51935d43
Make Result able to return an error string
2022-11-30 17:10:43 +01:00
fc0779a2f9
Add a SystemError module for errno values :)
2022-11-30 17:10:30 +01:00
fe47e0d5cb
Clean init() up
2022-11-30 16:30:42 +01:00
f8ed74fda5
Improve unit representation code
2022-11-30 14:41:35 +01:00
9f5fb547f7
Add logging system :)
2022-11-30 13:29:28 +01:00
f1756e6f58
Add unit formatting
2022-11-30 12:42:11 +01:00
552186ad51
Add string_format and vstring_format
2022-11-30 12:36:21 +01:00
1ed51d11cb
Do not push unused values
2022-11-23 19:37:25 +01:00
82893fa3a4
Introduce a kernel_yield function to use once a scheduler is implemented
2022-11-23 19:34:04 +01:00
88681bdc74
Default to ninja
2022-11-23 19:01:28 +01:00
7230eceb4d
x86_64/Timer: Show explanatory message on static assertion fail
2022-11-23 18:58:39 +01:00
9934719f6b
Use a more reliable signed 64-bit type than "long"
2022-11-23 18:05:01 +01:00
88f588a0c5
Make ARCH_TIMER_FREQ less frequent so it is more accurate (I hope)
2022-11-23 18:00:09 +01:00
3b2dc5db55
PlacementNew.h: Use Types.h
2022-11-23 17:22:16 +01:00
46cad14052
Print "All files OK" when all files are using correct types
2022-11-20 18:57:22 +01:00
f982152caa
Add a script to manually check files with stdint.h types
2022-11-20 18:54:39 +01:00
2df0bc4238
Convert one tiny type to Types.h in Format.cpp
2022-11-20 18:31:55 +01:00
43e26e583c
Calculate the boot timestamp in UNIX time for further usage
2022-11-20 18:30:40 +01:00
459e1ed653
luna/String.h: Convert to Types.h
2022-11-20 18:29:23 +01:00
1f2901d41a
Add convenience script to replace stdint.h types with Types.h types
2022-11-20 18:28:46 +01:00
285c3cc411
Add Luna sources to list of sources to be formatted
2022-11-20 18:28:16 +01:00
ff952fa2e4
Confirm alignment when calculating an offset to split at
2022-11-20 18:04:29 +01:00
35b7194fb7
Move initialization into an init() function returning Result<void> so we can use TRY
...
And remove a lot of testing code as well.
2022-11-20 17:56:07 +01:00
a58b60d0cf
Add a framebuffer text renderer
2022-11-20 17:55:22 +01:00
29defdf54d
Add a debug function to dump heap usage
2022-11-20 16:33:54 +01:00
d54c882c63
Add new/delete-like functions but with Results
2022-11-20 15:48:08 +01:00
caf6d1563c
Kernel: Add a heap memory allocator
...
This is the first time I've actually dropped liballoc in favor of writing my own implementation.
Usually, malloc() and such looked so complicated that I preferred to let a nice external library do the job.
But I've decided to try writing my own allocator, and now we have heap memory without any 3rd party code!
2022-11-20 15:15:26 +01:00
3815f9aa9f
Introduce an offset_ptr function to avoid quirky C pointer arithmetic
2022-11-20 15:12:18 +01:00
cb88630d86
Bugfix: Make alloc_at return the start of the virtual memory range instead of the end
2022-11-20 15:11:53 +01:00
33876dcda4
Use _strto{i,u} in _atou and _atos
2022-11-20 09:28:17 +01:00
bde5de68ca
Simplify is_valid_digit_for_base by reaching out to parse_digit_unchecked
2022-11-20 09:24:21 +01:00
44f44aedca
Make _strtoi call _strtou, to deduplicate code
2022-11-19 22:52:08 +01:00
30a7d760ae
Move a few repeated lambdas into their own functions
2022-11-19 22:48:20 +01:00
af267772f0
Rename MemoryManager::map to map_frames_at
...
To make it clearer that this API is only intented for mapping contiguous frames of physical memory (for MMIO perhaps?)
2022-11-19 22:32:48 +01:00
1b41a3e9cf
Introduce a few helpers to allocate/map/unmap several pages, which wrap around the MMU functionality
2022-11-19 22:28:45 +01:00
c886669d56
Break down operations to make protect_kernel_sections() more readable
2022-11-19 22:27:59 +01:00
d96cb73995
Rename physical "pages" to "frames"
...
AFAIK, this is the proper naming scheme. "Pages" are virtual, and "frames" physical.
2022-11-19 22:27:08 +01:00
847f2b4f4c
Replace more usage of stdint.h types with Luna's Types.h
2022-11-19 22:25:03 +01:00
83bcac7a16
Kernel: Introduce a timer interface
2022-11-19 20:01:01 +01:00
047f445651
Kernel: Add helpers to validate memory addresses
2022-11-19 18:38:47 +01:00
424b069d55
Kernel: Start the call stack with a null RBP on x86_64
2022-11-19 18:38:32 +01:00
db3e34b2ba
Result: Add try_set_value()
...
This helper returns true if the Result contains a value, or false if it doesn't.
Additionally, if it has a value, it sets the passed reference to it.
2022-11-19 18:38:01 +01:00
883a1da0d7
More indentation in CMakeLists.txt
2022-11-19 18:00:45 +01:00
70c6b78e35
Organize source tree
2022-11-19 17:59:49 +01:00
a44e2f41fe
Cleanup kernel/CMakeLists.txt
2022-11-19 17:59:39 +01:00
102eabcb4b
Do some more formatted logging
2022-11-19 17:52:24 +01:00
83e6bd1322
Make the build system more platform-agnostic
2022-11-19 17:46:53 +01:00
8cae20a82c
Move __check_failed out of line so anyone can implement it
2022-11-19 17:20:10 +01:00
2b9bdf560e
Move include to .cpp file
2022-11-19 17:19:25 +01:00
b8c136eeb4
Make a common header for attribute shorthands
2022-11-19 17:18:51 +01:00
648bd3fb61
Switch format.h to use Result
2022-11-19 16:13:25 +01:00
31673c0ac9
Introduce format attribute
2022-11-19 15:53:58 +01:00
3cdf224b90
Remove useless files now that functions are out of line
2022-11-19 15:46:46 +01:00
dadc3e570b
Move a few functions out of line
2022-11-19 15:43:09 +01:00
56c2ca3381
Add _strtoi and _strtou
2022-11-19 15:27:55 +01:00
bad856afe0
Add %p and %% to cstyle_format
2022-11-19 15:26:29 +01:00
88af7a915b
Start padding and alternate forms for integers
2022-11-19 13:59:06 +01:00
c48203997a
Move output_integer into a function that accepts value arguments
2022-11-19 13:21:21 +01:00
4ebf244d3b
Support printing some integers in output_integer
2022-11-19 13:15:13 +01:00
603ff46d8c
Add a format implementation
2022-11-19 12:30:36 +01:00
be2e915d0d
Use the standard names for ctype functions if inside moon or _LUNA_OVERRIDE_STDC is defined
2022-11-18 21:17:26 +01:00
1b3243a80c
Add ctype.h functions to the Luna library
2022-11-18 21:12:54 +01:00
762ca844d8
Add CPU::platform_string
2022-11-18 21:04:53 +01:00
109de54822
Provide stubbed handlers for many more x86 exceptions
...
I am now officially a big-boy OS developer, I read the Intel manuals for this!! (Not that the OSDev wiki doesn't have the information, but it was missing descriptions for some more obscure exceptions)
2022-11-18 20:51:25 +01:00
860f13cd7e
Rename align_base to alignment
2022-11-18 18:02:38 +01:00
2e2656a02f
Add static assertions to constexpr functions
2022-11-18 17:59:19 +01:00
9d318d50aa
Use TRY in MMU.cpp
2022-11-16 20:37:41 +01:00
2c9329928c
Replace page_size (function) with ARCH_PAGE_SIZE (constant)
2022-11-16 20:37:32 +01:00
30ac95bcf8
Use usize/isize instead of (s)size_t
...
Since we're using Rust-style integer types already, why not go all in?
2022-11-16 20:30:34 +01:00
7fc5a6b753
Make kernel rodata and data not executable
2022-11-16 20:02:04 +01:00
7f15ba0ac5
Add some interrupt handling
2022-11-16 17:37:18 +01:00
df8666fd73
Remove unneeded label
2022-11-15 20:47:50 +01:00
bb46cd890b
Add GDT and IDT setup and loading + NX if supported
2022-11-15 20:41:59 +01:00
c9feb11366
Introduce a check() method (like assert() but always on)
2022-11-15 19:36:50 +01:00
c319336e3d
Add a CPU interface
2022-11-15 19:10:32 +01:00
e16324887f
MMU: Properly clear flags
2022-11-15 19:10:19 +01:00
3358454833
Add getters for free, used and reserved memory
2022-11-13 16:56:03 +01:00
6a7097c9ec
Add variables for the future
2022-11-13 16:54:07 +01:00
ae235e5538
MMU: unmap and remap for x86_64
2022-11-13 16:51:21 +01:00
ba1bf72e1b
Remove unused include
2022-11-13 16:32:28 +01:00
d6c56fb512
Mapping finally works!!
2022-11-13 16:31:32 +01:00
4c4f72b865
More MMU stuff, but writing still fails
2022-11-13 15:33:53 +01:00
d148e0aff7
Initialize MemoryManager instead of MMU directly
2022-11-13 14:29:59 +01:00
705c2747de
Add memory manager
2022-11-13 14:29:15 +01:00
6b95307b54
Add init
2022-11-13 12:20:53 +01:00
ffbe5260a5
Add Framebuffer stuff
2022-11-13 11:25:15 +01:00
82c2381ac9
Serial printing!!
2022-11-13 10:30:10 +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
046065c533
Fix tmpfs
2022-11-12 19:05:47 +01:00
37fe95b128
Remove FIXME
2022-11-12 18:15:32 +01:00
3451d50a37
Try building a tmpfs, but weird stuff happens
2022-11-12 18:13:41 +01:00
000ffd1fae
Scheduler: Handle weird cases when the task we're iterating on is null
2022-11-12 18:12:42 +01:00
37bb3273ce
Kernel: Add a C interface to the logging system
2022-11-12 18:12:18 +01:00
511bb7a8c1
Kernel: Make readdir() available in created InitRD directories
2022-11-12 18:11:58 +01:00
bde9a97db5
sh: Add a sleep command
2022-11-12 17:44:13 +01:00
fa325072ac
Kernel: Add __cxa_atexit and __cxa_finalize
2022-11-12 17:43:57 +01:00
e54f033578
libc: Add wcslen (with a test) and wcscat
2022-11-12 14:16:00 +01:00
35829a6998
libc: Remove unnecessary casts in strcat() and strncat()
2022-11-12 14:15:38 +01:00
6ab246a05e
libc: Add a basic implementation of pathconf()
2022-11-12 14:15:21 +01:00
9e8a57cec7
libc: Add getdtablesize()
...
No system call for this, since the limit is fixed right now
2022-11-12 14:15:02 +01:00
f46831f459
libc: Define PATH_MAX
...
This restriction is actually not enforced by the kernel. It should be.
2022-11-12 14:13:28 +01:00
5fa8569ff9
libc: Add creat()
2022-11-12 14:12:49 +01:00
a3896c2546
libc: Define MB_CUR_MAX
2022-11-12 13:24:04 +01:00
3f867b936e
libc: Implement stpcpy
...
This function is unsafe so it is marked as deprecated, but if programs need it they can use it.
2022-11-12 13:20:28 +01:00
16e6fba2d0
Add a bit more C++ stuff to the C++ app
2022-11-12 13:12:51 +01:00
de2451e553
Kernel: Change up the logging in the kernel's PRNG
2022-11-12 12:56:13 +01:00
11ee01f269
Kernel: Remove "checkpoint logging" in main.cpp
2022-11-12 12:55:47 +01:00
bf1d3d3f05
mkdir: Print newline after usage
2022-11-12 12:53:33 +01:00
5c51b82f6a
Kernel: Remove obtain_user_ref and add copy_typed_to and from_user
2022-11-12 12:08:26 +01:00
58fb422161
Kernel: Return a Result in MemoryManager and strdup_from_user
2022-11-12 11:56:40 +01:00
662afad426
Kernel: Add a Result class
2022-11-12 11:30:28 +01:00
a3465c2f5e
tools: Make buildstep exit on error
2022-11-12 11:30:17 +01:00
559d074ce4
Kernel: Make a more convenient wrapper for basename() and dirname()
2022-11-12 10:39:25 +01:00
5a1d15d2b5
Show only short names of apps when installing
2022-11-10 17:55:41 +01:00
4aa3bd3107
Next version!
2022-11-09 17:25:05 +01:00