Commit Graph

1406 Commits

Author SHA1 Message Date
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-14 20:43:15 +01:00
80a897fbc5
libc: Add fileno()
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 16:55:46 +01:00
02dbcbbfa1
kernel: Add strdup_from_user()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 16:30:36 +01:00
682d3c753e
kernel+libc: Add mkdir()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 15:32:09 +01:00
d2049567c8
libluna+libc: Add strncmp, strncat and strncpy
All checks were successful
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
All checks were successful
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()
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 11:10:18 +01:00
377b8bea43
libc: Adjust comment in string.cpp
All checks were successful
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
All checks were successful
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
Some checks failed
continuous-integration/drone/push Build is failing
2023-03-12 10:39:38 +01:00
af0cb83a58
libluna+kernel: Get rid of nullcpy()
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-12 10:23:08 +01:00
c0a7f6776f
kernel+libc: Add getpid()
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-11 22:19:58 +01:00
8fa72f3cf0
kernel+libc: Implement read()
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-11 10:39:42 +01:00
0c07e66c4f
Update all files from luna/ paths to libluna/
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-11 10:35:54 +01:00
ff468db675
kernel/ELF+Scheduler: Use VFS instead of TarStream
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-11 00:27:08 +01:00
6fbf97292a
VFS: Implement resolve_path() using PathParser
All checks were successful
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)
All checks were successful
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
All checks were successful
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