Age | Commit message (Collapse) | Author |
|
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>
|
|
Add two functions to control thread-local spinlocks.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Create a subset of the C library for use inside the kernel.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
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>
|
|
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>
|
|
Add the mostly finished physical memory allocator and expose its
functions to the paging system.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Add more functions to the string library to process buffers and strings.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Move list.h into a designated directory for data structure definitions.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a linked-list implementation using the kmalloc system.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
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>
|
|
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>
|
|
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>
|
|
Add a 'k' prefix to the kernel versions of the printf family.
|
|
Add a function in the serial interface that writes an entire string to
the serial line.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
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>
|
|
Add support for serial communication in the i386 architecture.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Add a "_H" to the end of the include guards in tty.h.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Remove the include to the tty layer in io.h.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Implement a basic printf function using primitives from the TTY library.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Create the basic C library functions for use inside the kernel.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|