Age | Commit message (Collapse) | Author |
|
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>
|
|
Move the function that jumps to ring 3 to its own assembly file.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a basic driver for the PS/2 keyboard. This driver just prints
whatever it receives back out to the framebuffer.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
The VMM should control the physical memory as well as paging. This
allows the VMM to grab frames as it sees fit.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move all the data structures required for operation of the GDT to their
own header file.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move all the architecture-specific initialization calls to this file.
This frees up the main function to initialize other parts of the kernel.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move all the functions that control IRQ lines to the PIC driver. This
allows the IDT controller to handle only raw interrupts no matter where
they come from.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move simple assembly calls to their own header. All one or two line
assembly calls should be defined in a single place.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add functions to the syscall handlers that dump registers and stack in
case of catastrophic failure.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Fix a bug in the GDT that prevented the kernel from jumping to userspace
correctly.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
The code that constructs an isr_frame struct should not push ESP to the
stack. In addition, the kernel should set its own copy of ESP into a
function defined elsewhere for scheduling purposes.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a set of functions that control the programmable interrupt timer.
This will be used as the primary means of preemption on this
architecture.
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>
|
|
Remove an inline assembly instruction that was placed for debugging
purposes.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add new source files to the x86 architecture build configuration.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add references to the PMM bitmap to the linker script.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a proper page control API. These functions allow the kernel to
directly map and unmap pages in the logical address space.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a simple, bitmap-based physical memory management system.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add support for the multiboot specification. These files will allow the
kernel to read the multiboot header information as well as the provided
memory map.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Remove an unused local variable from tty_putchar. Instead, just cast the
signed char to unsigned as needed.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Replace individual function calls with a single switch-case structure
for system calls. The new function, handle_syscall, will construct and
call the interrupt without input from the programmer.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Finish implementing pic_eoi and similar. This allows standardized
communication with the x86 PIC chip.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Define a few standard Unix system calls. These may change based on
future needs.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Make the register_irq_function accessible from files including pic.h.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Make all variables with char or char* type into uint8_t. This makes the
system more consistent and issues fewer compiler warnings.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Remove references to extern functions. All the necessary functionality
for this file is already contained.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Create the ISR stubs for use by IRQ handlers.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Actually install the ISR handlers to the IDT.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Remove the irq number from the irq handler. This information is already
stored in the ISR frame structure.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Call the page fault handler when a page fault occurs instead of just
dumping the registers and halting.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add a infinite while loop just in case the "hlt" instruction fails.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Remove several preprocessor macros that serve no purpose and pollute the
source file.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Perform some initialization routines on the TSS structure before loading
its address.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Define the load_page_dir and enable_paging functions in assembly. This
allows normal C code to initialize the CR3 register and control paging
without using inline assembler.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move the initial C entry-point to its own file. Call all the i386
specific initialization routines from the new i386_entry function.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Fix several small bugs in assembler.
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>
|
|
The x86 system call/interrupt handlers should be refactored to be more
readable.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Move all files not needed for the bootstrap process out of boot and into
the main x86 source directory.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Make the inline assembly calls consistent across different i386 files.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add support for rudementary system calls and IRQ interrupts.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Simplify the setup and definitions of GDT/TSS entries.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Simplify the interrupt descriptor table setup and frame assembly.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Add support for the tab character in the virtual terminal.
Signed-off-by: Danny Holman <dholman@gymli.org>
|
|
Rename the array/pointer to the GDT array in gdt.c pointer to be a bit
clearer.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Include information about the current stack frame in the IDT handler(s).
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|
|
Add functions that let the OS read the internal state registers of the
8259 PIC.
Signed-off-by: Danny Holman <dholman@gymli.xyz>
|