522d74b65d
Add is_user_address and is_kernel_address functions
2022-09-29 19:30:42 +02:00
f25014a8ed
refine syscalls
2022-09-29 19:17:43 +02:00
46f459337c
Interrupts: Remove ensure_handler and use a more reliable way of detecting if we are in a handler
2022-09-29 18:35:51 +02:00
07d6fe388d
Fix naming
2022-09-25 21:43:28 +02:00
f1a7138568
User mode (with a few syscalls)
...
IT ACTUALLY WORKS NOW.
Why wasn't it working? Oh, because I was not setting already present page tables's permissions to user mode. Just a little bug. THAT I SPENT DAYS TRYING TO FIND
Anyways, it works now. Such a relief...
2022-09-25 20:35:05 +02:00
19dff40ee2
Scheduler: track total CPU time of tasks
2022-09-25 17:49:51 +02:00
3fd1b6773d
Panic: Only dump stack trace if InitRD is initialized
2022-09-25 17:41:34 +02:00
a078a11dde
Move PMM and VMM initialization into MemoryManager::init
2022-09-25 17:38:17 +02:00
4e62566c48
Add with_value_of and with_value to MSR
2022-09-25 17:28:38 +02:00
aee4e55fdd
add a proper kernel panic
2022-09-25 16:56:00 +02:00
704a23d0ad
Sanity checks
2022-09-24 23:09:39 +02:00
6bd3529f32
Port liballoc to get proper kmalloc/kcalloc/krealloc/kfree functions.
...
Yes, that's not completely-from-scratch.
But let's be honest, am I going to do everything from scratch? Probably not. I'm not making my own bootloader.
And making a proper smaller-than-4-KB allocator is not something I want to do.
Plus, liballoc works perfectly in this rewrite, seeing as the MM code actually works, instead of leaking all your poor memory
And liballoc_{lock, unlock} can be actually defined, since we have spinlocks here!
2022-09-24 22:40:59 +02:00
3891d0c52e
Rename KernelMemoryManager to MemoryManager
...
Kind of a more catchy name, isn't it?
2022-09-24 21:45:13 +02:00
46b7dab847
Remove RangeAllocator and make a PMM namespace
2022-09-24 21:27:45 +02:00
198f4196c4
Add an MSR utility struct
2022-09-24 20:48:27 +02:00
7b8d30aacd
Add a Device class to PCI and a PCITypes file for string names for PCI device types
2022-09-23 18:01:07 +02:00
8a93c53277
Add a Device class to PCI
2022-09-23 17:24:45 +02:00
c3e5251687
Some more userland and font failing
2022-09-23 16:41:43 +02:00
11dd165a8e
Scheduler: add proper support for user tasks (still faults though)
2022-09-22 08:14:04 +02:00
543fe2885f
Add support for user pages
2022-09-22 07:57:30 +02:00
ec01dc2927
Scheduler: Change fixed Task array for (highly inefficient) memory allocation, add userspace task support (which as memory is mapped kernel-only instantly crashes), and support for exiting a task (marking it as exited and reaping it later)
2022-09-21 21:06:00 +02:00
ee49caa6d3
Interrupts: ensure is_in_handler is true if we know we are in a handler
2022-09-21 21:03:49 +02:00
4401b31440
Remove ds from context, no need for it in x86_64, use ss instead
2022-09-21 21:03:24 +02:00
d54ed0dc8b
Make ASSERT, PANIC and TODO show a backtrace and scheduler tid if initialized
2022-09-21 20:56:40 +02:00
af8e5aca64
Add basic PCI driver
2022-09-21 17:57:02 +02:00
49ddb47ad4
Reorganize structure
2022-09-21 17:56:53 +02:00
1c12cf016e
Add a Scheduler.
...
Finally.
Just Round Robin with sleeping, but it's still awesome. I think this can finish v0.3, with a few adjustments.
2022-09-20 19:58:04 +02:00
e6c6a1677a
Rename "SavedContext" to "Context"
...
Seemed like a more appropriate name.
2022-09-20 19:56:43 +02:00
d0d2d4381c
Add a is_in_handler function to validate being in an interrupt handler
2022-09-20 17:16:07 +02:00
1c1aa96293
Add a moon_version function that returns the full version string
2022-09-20 16:34:24 +02:00
6967fa9117
Update config.h to use a .cpp file that will be recompiled when it changes
2022-09-20 16:30:34 +02:00
15883c2dd3
Guard MOON_SUFFIX in config.h
2022-09-20 16:22:03 +02:00
7f1731ca2c
Moon 0.3-dev
2022-09-19 21:13:45 +02:00
ee8c2759a6
Got a stack tracer working!!
2022-09-19 21:11:43 +02:00
9d3030763b
We can fetch a symbol's name from its address!!
2022-09-19 20:54:05 +02:00
d8bfb76eef
Try to make TextRenderer work... still failing
...
I can now safely call try_initialize() in early_init though
2022-09-19 20:17:37 +02:00
31460fe148
I.... think I fixed the initrd code?
2022-09-19 17:06:08 +02:00
d4a982306f
Add spinlocks
2022-09-18 20:15:19 +02:00
be31f2c017
Moon 0.2-dev
2022-09-18 17:16:44 +02:00
783af21a7e
We are not using C
2022-09-18 09:43:29 +02:00
9d19765b0e
Add the ability to toggle loglevels in KernelLog
2022-09-15 18:42:38 +02:00
18140a55ec
Make strstr take a const char* as a needle instead of a char*
2022-09-15 18:42:18 +02:00
efb28d3258
Randomness and stack protection!!
2022-09-14 18:54:40 +02:00
f98a45aefe
Updated InitRD to use virtual mappings
2022-09-10 22:15:19 +02:00
4aeada05d3
Remove unused drawing files
2022-09-10 18:44:14 +02:00
6a0cf7cf98
New framebuffer class!!
2022-09-10 18:42:40 +02:00
e3e2952661
Consistent naming
2022-09-10 18:06:46 +02:00
1ab0f7291b
Add kdbg and kdbgln
2022-09-08 17:02:40 +02:00
9de9eacb1d
add strstr
2022-09-08 17:02:16 +02:00
276d20a33d
Remove log/Address.h, since Log.h has variadic functions now
2022-09-08 16:26:24 +02:00