summaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* arch: i386: kernel: add mostly finished PFA and paging systemDanny Holman2024-03-281-8/+0
| | | | | | | Add the mostly finished physical memory allocator and expose its functions to the paging system. Signed-off-by: Danny Holman <dholman@gymli.org>
* kernel: string: add a strcpy functionDanny Holman2024-02-241-0/+1
| | | | | | | 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>
* arch: i386: cleanup everything and reorganizeDanny Holman2024-02-242-1/+6
| | | | | | | | | | 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>
* kernel: mem: kmalloc should not call page allocationDanny Holman2024-02-161-2/+2
| | | | | | | | 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>
* kernel: add a panic functionDanny Holman2024-02-161-0/+6
| | | | | | | 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>
* include: kernel: add the container_of.h fileDanny Holman2024-02-161-0/+10
| | | | | | | | 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>
* kernel: string: add more functions to string libraryDanny Holman2024-02-161-0/+5
| | | | | | Add more functions to the string library to process buffers and strings. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: put framebuffer ops in own fileDanny Holman2024-02-161-11/+0
| | | | | | | 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>
* arch: i386: kernel: the serial driver should be more POSIX-yDanny Holman2024-02-161-8/+14
| | | | | | | 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>
* kernel: make kprintf print to a ring bufferDanny Holman2024-02-162-2/+52
| | | | | | | | 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>
* include: kernel: move list.h to a data struct directoryDanny Holman2024-02-161-7/+8
| | | | | | Move list.h into a designated directory for data structure definitions. Signed-off-by: Danny Holman <dholman@gymli.org>
* kernel: list: add a linked-list implementationDanny Holman2023-11-261-0/+31
| | | | | | Add a linked-list implementation using the kmalloc system. Signed-off-by: Danny Holman <dholman@gymli.org>
* kernel: mem: add a simple kmalloc implementationDanny Holman2023-11-261-0/+9
| | | | | | | 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>
* arch: i386: serial.c: make serial_writestring staticDanny Holman2023-11-261-1/+1
| | | | | | | 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>
* arch: i386: make serial_writestring inlineDanny Holman2022-03-221-1/+7
| | | | | | | | 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>
* io: prefix a 'k' to print functionsDanny Holman2021-07-201-2/+2
| | | | Add a 'k' prefix to the kernel versions of the printf family.
* serial: add serial_writestring as a functionDanny Holman2021-01-201-0/+1
| | | | | | | Add a function in the serial interface that writes an entire string to the serial line. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* serial: don't declare serial_init as staticDanny Holman2021-01-201-1/+1
| | | | | | | | 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>
* i386: add serial port supportDanny Holman2021-01-201-0/+8
| | | | | | Add support for serial communication in the i386 architecture. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* include: append "_H" to include guardsDanny Holman2021-01-201-2/+2
| | | | | | Add a "_H" to the end of the include guards in tty.h. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* include: remove an include to the tty layer in ioDanny Holman2021-01-171-1/+0
| | | | | | Remove the include to the tty layer in io.h. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* kernel: implement a basic printf functionDanny Holman2021-01-171-0/+10
| | | | | | Implement a basic printf function using primitives from the TTY library. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* include: create basic C library functionsDanny Holman2021-01-172-0/+23
Create the basic C library functions for use inside the kernel. Signed-off-by: Danny Holman <dholman@gymli.xyz>