summaryrefslogtreecommitdiff
path: root/arch (follow)
Commit message (Collapse)AuthorAgeFilesLines
* arch: i386: alloc: add a physical memory managerDanny Holman2023-11-262-0/+56
| | | | | | Add a simple, bitmap-based physical memory management system. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: add multiboot supportDanny Holman2023-11-262-0/+127
| | | | | | | | 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>
* arch: i386: tty.c: remove unneeded local variableDanny Holman2023-11-261-3/+4
| | | | | | | 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>
* arch: i386: syscall.c: replace function calls with single switchDanny Holman2023-11-261-21/+9
| | | | | | | | 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>
* arch: i386: pic.c: finish implementing functions from pic.hDanny Holman2023-11-261-1/+3
| | | | | | | Finish implementing pic_eoi and similar. This allows standardized communication with the x86 PIC chip. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: syscall.h: define some example system callsDanny Holman2023-11-261-5/+22
| | | | | | | Define a few standard Unix system calls. These may change based on future needs. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: pic.h: make register_irq_handler accessibleDanny Holman2023-11-261-0/+2
| | | | | | Make the register_irq_function accessible from files including pic.h. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: pic.h: change all chars into uint8_tDanny Holman2023-11-261-1/+2
| | | | | | | 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>
* arch: i386: idt.h: remove extern functionsDanny Holman2023-11-261-4/+1
| | | | | | | Remove references to extern functions. All the necessary functionality for this file is already contained. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: isr.s: create the irq stubsDanny Holman2023-11-261-3/+21
| | | | | | Create the ISR stubs for use by IRQ handlers. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: idt.c: install the ISR handlersDanny Holman2023-11-261-47/+62
| | | | | | Actually install the ISR handlers to the IDT. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: idt.c: remove the irq number from handlerDanny Holman2023-11-261-1/+2
| | | | | | | 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>
* arch: i386: idt.c: call the page fault handlerDanny Holman2023-11-261-3/+1
| | | | | | | 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>
* arch: i386: idt.c: add a stopgap to halt_catch_fireDanny Holman2023-11-261-0/+1
| | | | | | Add a infinite while loop just in case the "hlt" instruction fails. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: idt.c: remove unneeded define macrosDanny Holman2023-11-261-23/+1
| | | | | | | Remove several preprocessor macros that serve no purpose and pollute the source file. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: gdt.c: init the TSS before loading itDanny Holman2023-11-261-2/+5
| | | | | | | Perform some initialization routines on the TSS structure before loading its address. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: boot.s: define functions for page managementDanny Holman2023-11-261-0/+27
| | | | | | | | 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>
* arch: i386: boot.s: move C entry point to fileDanny Holman2023-11-261-10/+3
| | | | | | | 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>
* arch: i386: boot: boot.sDanny Holman2023-11-261-8/+4
| | | | | | Fix several small bugs in assembler. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: make serial_writestring inlineDanny Holman2022-03-222-19/+8
| | | | | | | | 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>
* arch: i386: refactor the system call APIDanny Holman2022-03-225-11/+4
| | | | | | | The x86 system call/interrupt handlers should be refactored to be more readable. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: move non-critial files out of bootDanny Holman2022-01-219-91/+52
| | | | | | | 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>
* arch: i386: fix coding style issueDanny Holman2022-01-151-2/+2
| | | | | | Make the inline assembly calls consistent across different i386 files. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: add support for IRQs and system callsDanny Holman2022-01-157-3/+61
| | | | | | Add support for rudementary system calls and IRQ interrupts. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: simplifiy GDT setupDanny Holman2022-01-154-68/+176
| | | | | | Simplify the setup and definitions of GDT/TSS entries. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: simplify IDT setupDanny Holman2022-01-155-31/+128
| | | | | | Simplify the interrupt descriptor table setup and frame assembly. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: add support for tab charactersDanny Holman2021-11-291-0/+10
| | | | | | Add support for the tab character in the virtual terminal. Signed-off-by: Danny Holman <dholman@gymli.org>
* arch: i386: rename the GDT array pointerDanny Holman2021-10-091-7/+7
| | | | | | | 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>
* arch: i386: include more information in IDTDanny Holman2021-10-094-73/+129
| | | | | | Include information about the current stack frame in the IDT handler(s). Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: add PIC register supportDanny Holman2021-09-282-0/+19
| | | | | | | Add functions that let the OS read the internal state registers of the 8259 PIC. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: fix IDT exception handlerDanny Holman2021-09-284-45/+145
| | | | | | | 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>
* arch: i386: fix GDT segment mismatchDanny Holman2021-09-281-1/+1
| | | | | | | 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>
* arch: i386: add support for 8259 PICDanny Holman2021-09-286-18/+102
| | | | | | Add support for the 8259 programmable interrupt controller. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* i386: create idt.c and isr.sDanny Holman2021-08-304-1/+117
| | | | | | Create files that add IDT support for i386. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: add ring-3 descriptors to the GDTDanny Holman2021-08-271-1/+3
| | | | | | Add two ring-3 segment discriptors to the GDT during gdt_install. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: surround GDT macros with parensDanny Holman2021-07-251-15/+14
| | | | | | | 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>
* arch: i386: add GDT setup routinesDanny Holman2021-07-244-69/+98
| | | | | | Add a set of routines that setup the x86's global descriptor table. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: move the kernel to high memoryDanny Holman2021-07-203-13/+66
| | | | | Move the start of the kernel image to the "higher half" of memory. This also enables paging.
* Makefile: fix wrong -I directive to compilerDanny Holman2021-03-091-2/+2
| | | | | | | 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>
* i386: create terminal_scroll functionDanny Holman2021-01-281-10/+25
| | | | | | Add support for scrolling the terminal at the end of the VGA buffer. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* i386: add support for newlinesDanny Holman2021-01-251-0/+7
| | | | | | Add support for the newline character in the TTY layer. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* x86: reorganize the i386 directoryDanny Holman2021-01-249-3/+73
| | | | | | Add structure to the internals of the x86 directory. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* serial: add serial_writestring as a functionDanny Holman2021-01-201-0/+7
| | | | | | | 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-203-0/+57
| | | | | | Add support for serial communication in the i386 architecture. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* arch: i386: add support for x86 processorsDanny Holman2021-01-175-0/+142
| | | | | | Add support for 32-bit x86 processors, i.e. the 80386 and above. Signed-off-by: Danny Holman <dholman@gymli.xyz>
* Initial commitDanny Holman2021-01-172-0/+25
Signed-off-by: Danny Holman <dholman@gymli.xyz>