summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-11-26arch: i386: paging: add a proper paging APIDanny Holman
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>
2023-11-26arch: i386: alloc: add a physical memory managerDanny Holman
Add a simple, bitmap-based physical memory management system. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: add multiboot supportDanny Holman
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>
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>
2023-11-26arch: i386: tty.c: remove unneeded local variableDanny Holman
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>
2023-11-26arch: i386: syscall.c: replace function calls with single switchDanny Holman
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>
2023-11-26arch: i386: pic.c: finish implementing functions from pic.hDanny Holman
Finish implementing pic_eoi and similar. This allows standardized communication with the x86 PIC chip. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: syscall.h: define some example system callsDanny Holman
Define a few standard Unix system calls. These may change based on future needs. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: pic.h: make register_irq_handler accessibleDanny Holman
Make the register_irq_function accessible from files including pic.h. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: pic.h: change all chars into uint8_tDanny Holman
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>
2023-11-26arch: i386: idt.h: remove extern functionsDanny Holman
Remove references to extern functions. All the necessary functionality for this file is already contained. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: isr.s: create the irq stubsDanny Holman
Create the ISR stubs for use by IRQ handlers. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: idt.c: install the ISR handlersDanny Holman
Actually install the ISR handlers to the IDT. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: idt.c: remove the irq number from handlerDanny Holman
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>
2023-11-26arch: i386: idt.c: call the page fault handlerDanny Holman
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>
2023-11-26arch: i386: idt.c: add a stopgap to halt_catch_fireDanny Holman
Add a infinite while loop just in case the "hlt" instruction fails. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: idt.c: remove unneeded define macrosDanny Holman
Remove several preprocessor macros that serve no purpose and pollute the source file. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: gdt.c: init the TSS before loading itDanny Holman
Perform some initialization routines on the TSS structure before loading its address. Signed-off-by: Danny Holman <dholman@gymli.org>
2023-11-26arch: i386: boot.s: define functions for page managementDanny Holman
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>
2023-11-26arch: i386: boot.s: move C entry point to fileDanny Holman
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>
2023-11-26arch: i386: boot: boot.sDanny Holman
Fix several small bugs in assembler. 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>
2022-03-22arch: i386: refactor the system call APIDanny Holman
The x86 system call/interrupt handlers should be refactored to be more readable. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-03-22Makefile: explicitly define CC variableDanny Holman
The CC variable is already defined by the make program, so use "CC:=" instead of "CC?=". This makes sure the proper cross compiler is in use. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-01-21arch: i386: move non-critial files out of bootDanny Holman
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>
2022-01-15arch: i386: fix coding style issueDanny Holman
Make the inline assembly calls consistent across different i386 files. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-01-15arch: i386: add support for IRQs and system callsDanny Holman
Add support for rudementary system calls and IRQ interrupts. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-01-15arch: i386: simplifiy GDT setupDanny Holman
Simplify the setup and definitions of GDT/TSS entries. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-01-15Makefile: add dry run and debug targetsDanny Holman
Add targets to perform a test run and debug run inside a VM. Signed-off-by: Danny Holman <dholman@gymli.org>
2022-01-15arch: i386: simplify IDT setupDanny Holman
Simplify the interrupt descriptor table setup and frame assembly. Signed-off-by: Danny Holman <dholman@gymli.org>
2021-11-29arch: i386: add support for tab charactersDanny Holman
Add support for the tab character in the virtual terminal. Signed-off-by: Danny Holman <dholman@gymli.org>
2021-10-09arch: i386: rename the GDT array pointerDanny Holman
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>
2021-10-09arch: i386: include more information in IDTDanny Holman
Include information about the current stack frame in the IDT handler(s). Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-09-28arch: i386: add PIC register supportDanny Holman
Add functions that let the OS read the internal state registers of the 8259 PIC. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-09-28arch: i386: fix IDT exception handlerDanny Holman
Fix the i386's general exception handler to actually work. Fix provided by Jon Sanderson (jjs295356@gmail.com). Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-09-28arch: i386: fix GDT segment mismatchDanny Holman
Fix a bug in which the size of the main GDT array and the actual number of descriptors are different values. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-09-28arch: i386: add support for 8259 PICDanny Holman
Add support for the 8259 programmable interrupt controller. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-08-30i386: create idt.c and isr.sDanny Holman
Create files that add IDT support for i386. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-08-30git: stop ignoring assembly filesDanny Holman
Remove the '*.s' line from .gitignore. There are important assembler files that should be in a distribution. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-08-30doc: add the Developer's Certificate of OriginDanny Holman
Add the Developer's Certificate of Origin to the documentation directory. This allows developers to keep their own copyright. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-08-27arch: i386: add ring-3 descriptors to the GDTDanny Holman
Add two ring-3 segment discriptors to the GDT during gdt_install. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-07-25arch: i386: surround GDT macros with parensDanny Holman
Add parenthesis around the GDT setup macros. This is done to prevent having to do it when using them. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-07-24arch: i386: add GDT setup routinesDanny Holman
Add a set of routines that setup the x86's global descriptor table. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-07-20arch: i386: move the kernel to high memoryDanny Holman
Move the start of the kernel image to the "higher half" of memory. This also enables paging.
2021-07-20io: prefix a 'k' to print functionsDanny Holman
Add a 'k' prefix to the kernel versions of the printf family.
2021-06-04Makefile: clean up targetsDanny Holman
Clean up the Makefile to be more clear and readable. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-03-09Makefile: include dependency filesDanny Holman
Add an include directive in the main Makefile that includes the dependency files generated by GCC. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-03-09README: fix improper formattingDanny Holman
Fix wrong formatting in the project README file. Lists should have an empty line proceeding them, otherwise the first element is italicized. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-03-09Makefile: fix wrong -I directive to compilerDanny Holman
Fix a bug in which the architecture specific include directories are not properly included in the main Makefile. Signed-off-by: Danny Holman <dholman@gymli.xyz>
2021-01-28README: add project README fileDanny Holman
Add a README to the root of the project. This will act as a point of information to new users/developers. Signed-off-by: Danny Holman <dholman@gymli.xyz>