Commit Graph

112 Commits

Author SHA1 Message Date
Bananymous 89c4abc07a Kernel: Cleanup AML device initialization
_STA and _INI are now properly called on call devices
2024-04-12 02:00:30 +03:00
Bananymous 0184e5beb5 Kernel: AML tries to initialize processors when entering ACPI mode
I had forgotten that Processors used to be a different definition
in AML.

I also implemented reads/writes for FieldElement/IndexFieldElement
that fit in 64 bits. Reads and writes to buffer are still a TODO.
2024-04-11 01:48:46 +03:00
Bananymous cdbdc1a822 Kernel: Remove lai as a dependecy
I don't think lai is needed anymore, since my own AML interpreter
can do ACPI poweroff which was all that lai was used for.
2024-04-10 04:39:48 +03:00
Bananymous b16e65168f Kernel: Rewrite whole AML parser
Now AML parsing is actually done while respecting namespaces and
scopes. I implemented the minimal functionality to parse qemu's AML.

Next step is to implement AML interpreting and then we can drop lai
as a dependency.
2024-04-09 01:16:07 +03:00
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 e0011d22f2 Kernel: Move ACPI to its own directory and namespace 2024-04-04 15:00:13 +03:00
Bananymous 1943c3e7a1 Kernel: Unify IDT and GDT code between x86_64 and x86_32
The code is pretty much the same, so there are just couple macros
differiating initialization.
2024-03-26 16:42:02 +02:00
Bananymous 99e30a4d7d Kernel: Replace i386 with i686
I don't really want to be working with i386 since it doesn't support
compare exchange instruction
2024-03-26 02:48:26 +02:00
Bananymous 097d9a6479 Kernel: Implement dummy IDT and GDT for i386 2024-03-26 00:10:42 +02:00
Bananymous 26585bb1d9 Kernel: Implement signal trampoline for i386 2024-03-22 15:41:15 +02:00
Bananymous 0d92719433 Kernel: Remove old i386 spinlock code 2024-03-22 15:41:15 +02:00
Bananymous 1ab2722850 Kernel: Add PageTable stub to progress linking 2024-03-22 15:41:15 +02:00
Bananymous 0424082e7b Kernel: Only compile lai for x86_64 targets
I will be dropping lai entirely soon. Once I get to writing AML
interpreter.
2024-03-22 15:41:15 +02:00
Bananymous 45cea14165 Kernel: Move sys_fork trampolines to kernel/arch/ directory 2024-03-22 12:48:54 +02:00
Bananymous 26ed689d30 Kernel: Remove old GDT, IDT and MMU code from i386
It will be easier to just rewrite them
2024-03-22 12:47:34 +02:00
Bananymous f0105cb7fb Kernel: Move Interruptable from InterruptController.h to its own file 2024-03-06 00:47:02 +02:00
Bananymous 418bc54f2b Kernel: Move SpinLock definition to header and fix Scheduler locking
This patch allows inlining of spinlocks :)
2024-03-04 22:36:41 +02:00
Bananymous 9c36d7c338 BAN/Kernel: Rework assertion/panic system
BAN/Assert.h does not need any includes meaning it can be included
anywhere without problems.
2024-03-04 11:41:54 +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 d94f6388b7 Kernel: Fix all broken locks from new mutexes 2024-02-28 22:45:34 +02:00
Bananymous 198dde8365 Kernel: Add klibc for kernel
Now building same source as libc is not needed and libc doesn't
have to do hacks to allow kernel compilation
2024-02-14 15:00:04 +02:00
Bananymous 435636a655 Kernel: Implement super simple TCP stack
No SACK support and windows are fixed size
2024-02-12 04:45:42 +02:00
Bananymous b45d27593f Kernel: Implement super simple PRNG 2024-02-12 04:25:06 +02:00
Bananymous e7dd03e551 Kernel: Implement basic connection-mode unix domain sockets 2024-02-08 02:28:19 +02:00
Bananymous 5da59c9151 Kernel: Make better abstractions for networking 2024-02-06 16:45:39 +02:00
Bananymous 692cec8458 Kernel/Userspace/LibC: Implement basic dprintln for userspace 2024-02-05 01:24:09 +02:00
Bananymous a0138955cd Kernel: Implement barebones arp table 2024-02-03 01:50:10 +02:00
Bananymous ec2f21bb9f Kernel/LibC: Implement SYS_SENDTO 2024-02-02 03:16:01 +02:00
Bananymous 99eed9c37a Kernel: Start work on network stack 2024-02-01 23:38:06 +02:00
Bananymous f4e86028d0 Kernel: Write simple working E1000 and E1000E drivers 2024-02-01 22:08:59 +02:00
Bananymous 54a92293da Kernel: Implement NVMe driver
I'm  actually able to boot this os fine on own laptop now!
2024-01-17 08:26:58 +01:00
Bananymous 8f89519bcf Kernel: Keymaps can now be loaded from files 2024-01-10 14:43:19 +02:00
Bananymous 961ab9768a Kernel: KeyEvent is now well known keycode
Keycodes are easier to handle as you need only one keyboard layout
for keycodes. Otherwise you would need to implement keyboard layout
for every keyboard driver in every language.
2024-01-10 12:51:24 +02:00
Bananymous e45b544a39 Kernel: Implement PS/2 mouse driver
This is realtively simple driver that queries extensions (scroll +
extra buttons) from mouse and reads mouse packages.
2024-01-04 12:17:55 +02:00
Bananymous d4191c0d94 Kernel: Reorganize PS/2 files to their own directory 2024-01-04 12:04:45 +02:00
Bananymous 891ced4da2 Kernel: Move PS2Device to its own file 2024-01-04 12:04:45 +02:00
Bananymous 9fa13079f2 Kernel: Implement supplementary groups
This code has very ugly file parsing code. I have to create API
for reading files line by line in kernel space...

This allows users to open framebuffer/input files without root.

Mounting has to be moved to userspace soon. It makes no sense to
hard code permissions for every (device) file.
2024-01-02 23:24:32 +02:00
Bananymous 9b841cb823 BuildSystem/Kernel: Enable -Wextra and -Werror in kernel
Only needed to fix some unused variable bugs
2023-12-01 01:22:53 +02:00
Bananymous c1cac43f28 BuildSystem: Don't build lai with -Wstack-usage
Lai has two functions that trigger warnings on gcc. There isn't
really anything I can do about it, so just disable the warning
2023-12-01 01:22:53 +02:00
Bananymous ab9954fe73 Kernel: Delete the now obsolete VesaTerminalDriver 2023-11-22 21:59:11 +02:00
Bananymous fd18071975 Kernel: Implement TerminalDriver for Framebuffer device
Use this new FramebufferTerminalDriver for terminal instead of the
old VesaTerminalDriver. Only drawback with this is that framebuffer
device can only be intialized after DevFS is initialized.
2023-11-22 21:57:17 +02:00
Bananymous cdf53f33f6 Kernel: Implement basic framebuffer device
This allows exposing framebuffer to userspace
2023-11-22 20:34:41 +02:00
Bananymous 6a068fb9f9 Kernel: Move Partition to its own file 2023-11-21 15:16:04 +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 d6ae1bcf36 Kernel: Remove now obsolete RamFS
Everything is using now the better TmpFS which uses physical pages
for page allocation instead of the static kmalloc memory.
2023-11-07 16:07:11 +02:00
Bananymous 99d7b0917d Kernel: Start work on proper TmpFS in Heap instead of kmalloc memory 2023-11-04 18:18:45 +02:00
Bananymous f6c312a6b3 BuildSystem: using sysroot doesn't need root privileges anymore!
Sysroot is now created with fakeroot. This allows root access to be
only needed for disk image creation, since it uses loopback devices.
2023-11-04 17:50:43 +02:00
Bananymous 6e676ee8c5 Kernel: Remove GeneralAllocator since it was not used 2023-10-30 18:13:17 +02:00
Bananymous 066fb44105 Kernel: Allow offsetof with packed fields
This is not standard C++ but should be fine with my toolchain.
2023-10-30 17:51:18 +02:00
Bananymous 0b5fcb3f88 Kernel/LibC: Add crt* files to LibC and remove crt0 from kernel
There was no reason for libc get crt0 from kernel.
2023-10-30 11:06:13 +02:00