55b430a4fd
TmpFS: Use a fixed char array in DirInode's Entry instead of OwnedStringView
continuous-integration/drone/pr Build is passing
2023-02-27 15:04:29 +01:00
7f1884213a
InitRD: Use MMU::translate_physical_address instead of allocating VM
...
continuous-integration/drone/pr Build was killed
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:31:36 +01:00
3654cc5bee
MemoryManager: Initialize KernelVM at the end of init()
...
KernelVM is not needed for MMU's init process anymore.
2023-02-27 13:31:36 +01:00
a0252e42a4
x86_64: Remove recursive mapping related things from MMU.h
2023-02-27 13:31:36 +01:00
2038ee1929
x86_64/MMU: Do not allocate level 1 page tables for huge page entries
...
This would leak memory, since we would never end up using them.
2023-02-27 13:31:36 +01:00
9af6a3f30f
MemoryManager: Reuse the existing mapping of physical memory that MMU has
2023-02-27 13:31:36 +01:00
ff01f49b41
x86_64/MMU: Map the physical address space using huge pages
2023-02-27 13:31:35 +01:00
efdd64736f
x86_64: Allow mapping huge pages, but don't do it yet
2023-02-27 13:31:35 +01:00
9da5204079
x86_64/MMU: Copy from the mapped kernel directory instead of the physical version
2023-02-27 13:31:35 +01:00
78cea0a47e
x86_64/MMU: Map all physical memory into the higher half instead of using recursive mapping
...
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 13:31:35 +01:00
5b43345b7d
kernel: Implement creating file inodes in tmpfs directories
continuous-integration/drone/pr Build is passing
2023-02-25 19:22:05 +01:00
9248a5b3cc
tmpfs: make the root inode a DirInode instead of a FileInode
2023-02-25 19:08:55 +01:00
cca4743a51
tmpfs: add DirInode skeleton
2023-02-25 19:06:50 +01:00
b71d899b52
tmpfs: rename tmpfs::Inode to tmpfs::FileInode
continuous-integration/drone/pr Build is passing
2023-02-25 18:11:39 +01:00
05b627d037
tmpfs: Make m_next_inode_number atomic
2023-02-25 18:06:23 +01:00
6daad7787a
kernel: Rename FileSystem::root() to root_inode() and add a shortcut for the root filesystem's root inode
2023-02-25 18:05:25 +01:00
ddc4692671
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-25 18:03:11 +01:00
5edd316198
kernel: Add a subclass of VFS::Inode to make it easier to implement file inodes
2023-02-25 17:54:01 +01:00
32ada00b72
kernel: Add a guard page to the bootstrap stack so that we can catch more stack overflows
2023-02-25 17:45:41 +01:00
5f6a659fa1
kernel: Enable UBSAN when building in debug mode
2023-02-25 17:45:40 +01:00
d842443869
kernel: Switch to a stack we control for the main task as soon as we leave early boot
...
continuous-integration/drone/pr Build is passing
This is probably pointless as the main task only exists up until the point where the Scheduler starts running, but some init code was running into a stack overflow due to the fact that we only had one bootloader-provided page of stack.
This should probably be changed afterwards.
2023-02-18 00:18:42 +01:00
4e88a7482c
kernel, luna: Move Spinlock.h to luna
2023-02-14 20:05:00 +01:00
cb4246b98d
kernel: Start working on a VFS implementation using OOP and SharedPtr
continuous-integration/drone/pr Build is passing
2023-02-03 22:20:00 +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
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
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
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
0126a8fb6e
luna: Add a new SourceLocation class and use that in check() and expect()
2023-01-22 11:43:48 +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
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
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
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
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
9454b65682
allocate_memory: Respect PROT_NONE
2023-01-12 17:59:17 +01:00