Commit Graph

24 Commits

Author SHA1 Message Date
Bananymous e7ef7a9e55 Kernel: Implement barebones AML parser
This implements only parsing for AML in qemu. InvokeMethods are not
parsed since number of arguments to Methods is not yet known.

Parsing AML uses multiple kilobytes of stack space, so I increased
boot stack size by a lot :D

I am not sure where my own AML is going, but this is good start if
I decide to implement full ACPI on my own.

This code is very much just ugly macro expansion.

Qemu has 2 DefPackage elements that I am not able to parse. Package
data ends while there should be still multiple elements.
2024-04-07 17:03:30 +03:00
Bananymous d2df55b1ac Kernel: Allow booting with multiple processors on i686
Also remove unnecessary ds clearing in x86_64.
2024-04-03 02:30:38 +03:00
Bananymous 29fd682672 Kernel: Store current processor pointer in IA32_GS_BASE
This allows easier access to processors fields
2024-03-07 16:05:29 +02:00
Bananymous 8141b9977d Kernel: Per processor information is now stored in class Processor
This allows us to allocate processor stacks, and other per processor
structures dynamically in runtime. Giving processor stack to
ap_trampoline feels super hacky, but it works for now.
2024-03-03 22:30:06 +02:00
Bananymous c035d3c82c Kernel: Start all processors on kernel boot
Processors don't do anything, except print hello message and halt.
2024-03-03 02:19:43 +02:00
Bananymous 284a012509 Kernel: Add framebuffer information to kernel image 2023-12-09 17:33:58 +02:00
Bananymous 84040e64b8 Kernel: Don't use multiboot2 explicitly. Parse it to common structure
This allows support of multiple different bootloaders
2023-11-17 18:54:59 +02:00
Bananymous c17cdb39d5 Kernel: Map multiboot2 memory in PageTable initialization
It cannot be assumed that multiboot data lies between kernel_end
and 2 GiB mark, so I properly allocate virtual address space for it.
2023-10-17 01:15:08 +03:00
Bananymous 69a39b7077 Kernel: Start using multiboot2 instead of multiboot
This allows better compatibility with (U)EFI and gives RSDP location
instead of me having to scan ram to find it.
2023-10-17 01:06:24 +03:00
Bananymous 921d95d18f All: Clear lines with only whitspace in them 2023-09-10 00:31:42 +03:00
Bananymous f75adab9d8 Kernel: Move structures in boot.S to .data section 2023-08-11 00:26:12 +03:00
Bananymous 68691faca1 Kernel: boot.S is back to 2 MiB pages
bochs doesn't seem to support 1 GiB pages
2023-06-03 18:53:36 +03:00
Bananymous dcb23f686f Kernel: boot.S maps GiB as single pdpte 2023-05-31 00:51:15 +03:00
Bananymous 81cf389754 Kernel: Booting with higher half kernel gets to Heap initialization 2023-05-30 22:21:12 +03:00
Bananymous 0907965dc5 Kernel: start work on higher half kernel 2023-05-30 08:00:17 +03:00
Bananymous 210d90ec79 Kernel: We now identity map full GiB in boot.S
The paging structure is pre-built so no unnecessary calculations are done
2023-05-30 00:08:52 +03:00
Bananymous 6a3b3213cf Kernel: Kmalloc now has its memory statically allocated
We don't use the memory map given by bootloader since this automatically
maps the memory to a available space.
2023-04-18 10:18:15 +03:00
Bananymous df8811fc1a Kernel: Remove "a" from .section .text 2023-03-07 01:57:09 +02:00
Bananymous 06db890d49 Kernel: Add ubsan
My brain has been melting since I'm getting very random bugs.
I hope I can debug them better with ubsan :)
2023-03-06 23:38:05 +02:00
Bananymous 7fcbb869e1 Kernel: Initialize GDT in kernel code
We dont use the boot GDT only while booting
2023-03-01 21:21:56 +02:00
Bananymous 7f8cad83b1 Kernel: x86_64 boot script now makes GDT with null, kernel code and data 2023-03-01 21:21:56 +02:00
Bananymous cb3b62d665 Kernel: Only allocate single GDT entry during boot.S
When we need more, we should probably initialize rest of them
in cpp code
2023-01-31 18:43:09 +02:00
Bananymous 6418d7cfc3 Kernel: Add Other GDT entries to x86_64 2023-01-26 12:53:04 +02:00
Bananymous b315fdc27f Kernel: Finally managed to get 64-bit working
I had weird problems with interrupts but everything should work now
2023-01-25 19:19:28 +02:00