Commit Graph

1360 Commits

Author SHA1 Message Date
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-03-02 13:40:42 +01:00
de38eb6877
luna: Remove pure_cstyle_format
All checks were successful
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
All checks were successful
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 :)
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-27 15:25:20 +01:00
77887eed80
luna -> libluna
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
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
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-25 17:42:32 +01:00
4fd871fdaa
luna: Introduce fail(...), a replacement for expect(false, ...)
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-25 17:41:28 +01:00
8352df5ee8
kernel: Enable UBSAN when building in debug mode
All checks were successful
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
All checks were successful
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