summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2024-06-25kernel: interrupt: create a generic interrupt APIDanny Holman
Create a generic interface for drivers to make use of interrupt vectors. This API should be platform-agnostic enough to allow any driver to make use of virtually any interrupt vector on any CPU. On x86, the first 32 interrupts are set aside for CPU exceptions, and interrupt 128 is set aside for system calls. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-05-29kernel: sched: implement the round-robin schedulerDanny Holman
Implement a basic round-robin scheduler and tie it to the PIT timer interrupt on x86. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-05-29include: kernel: input: add in keyboard.hDanny Holman
Add in a missing header file that allows the AT keyboard driver to be used. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-05-27arch: i386: update all files to use the new libkDanny Holman
Update all the files under arch to make use of the new libk implementation. Most of these changes are simply path changes in include directives. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-05-27arch: i386: add a spinlock implementationDanny Holman
Add two functions to control thread-local spinlocks. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-05-27libk: create a subset libc for kernel useDanny Holman
Create a subset of the C library for use inside the kernel. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-03-28kernel: add a basic thread schedulerDanny Holman
Add a basic thread scheduler. This should allow the kernel to schedule threads according to the round robin algorithm. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-03-28arch: i386: kernel: implement a kmalloc functionDanny Holman
Add a basic kmalloc implementation. This allows the kernel to allocate blocks smaller than a whole page. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-03-28arch: i386: kernel: add mostly finished PFA and paging systemDanny Holman
Add the mostly finished physical memory allocator and expose its functions to the paging system. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-24kernel: string: add a strcpy functionDanny Holman
Add an implmentation of strcpy. This function is used in several places in the kernel to copy strings between memory addresses. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-24arch: i386: cleanup everything and reorganizeDanny Holman
Clean up everything in the i386 arch directory. This code has been in dire need of refactoring for a long while. All the inline assembly functions and the data structures related to the architecture should be placed into their own header file. Now the scheduler can access registers and ISRs without having to deal with arch-specific code. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16kernel: mem: kmalloc should not call page allocationDanny Holman
Strip the code calling for the memory manager to allocate pages to kmalloc. The function should just return a raw pointer while a page fault will allocate the required memory. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16kernel: add a panic functionDanny Holman
Add a panic function that stops the current CPU and prints an error message into the ring buffer. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16include: kernel: add the container_of.h fileDanny Holman
Add the container_of.h file that defines the container_of macro. This macro allows the kernel to get the parent struct of a pointer with an offset. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16kernel: string: add more functions to string libraryDanny Holman
Add more functions to the string library to process buffers and strings. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16arch: i386: put framebuffer ops in own fileDanny Holman
Move all operations related to the x86 framebuffer into its own set of files. This makes the TTY layer more architecture agnostic. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16arch: i386: kernel: the serial driver should be more POSIX-yDanny Holman
Make the serial driver behave more like a standard POSIX call. It should have write and read functions that call architecture specific functions. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16kernel: make kprintf print to a ring bufferDanny Holman
The function kprintf should print to an internal ringbuffer instead of directly to the framebuffer. This reduces dependence on the existence of a framebuffer in the first place. Signed-off-by: Danny Holman <dholman@gymli.org>
2024-02-16include: kernel: move list.h to a data struct directoryDanny Holman
Move list.h into a designated directory for data structure definitions. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26kernel: list: add a linked-list implementationDanny Holman
Add a linked-list implementation using the kmalloc system. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26kernel: mem: add a simple kmalloc implementationDanny Holman
Add a simple implementation of kmalloc. This system only works on x86-based processors at the time of commit. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: serial.c: make serial_writestring staticDanny Holman
Make the function serial_writestring static. This is an optimization specifically for small functions such as this one. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-03-22arch: i386: make serial_writestring inlineDanny Holman
The serial_writestring function is small enough and platform-agnostic, and therefore it should be moved into the main serial header and marked as inline. Signed-off-by: Danny Holman <dholman@gymli.org>
2021-07-20io: prefix a 'k' to print functionsDanny Holman
Add a 'k' prefix to the kernel versions of the printf family.
2021-01-20serial: add serial_writestring as a functionDanny Holman
Add a function in the serial interface that writes an entire string to the serial line. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-20serial: don't declare serial_init as staticDanny Holman
The function serial_init should not be declared as static. This function could change under a different architecture and should be defined with the target architecture. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-20i386: add serial port supportDanny Holman
Add support for serial communication in the i386 architecture. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-20include: append "_H" to include guardsDanny Holman
Add a "_H" to the end of the include guards in tty.h. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-17include: remove an include to the tty layer in ioDanny Holman
Remove the include to the tty layer in io.h. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-17kernel: implement a basic printf functionDanny Holman
Implement a basic printf function using primitives from the TTY library. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-17include: create basic C library functionsDanny Holman
Create the basic C library functions for use inside the kernel. Signed-off-by: Danny Holman <dholman@gymli.xyz>