Commit Graph

94 Commits

Author SHA1 Message Date
108e04a8f0 Page fault handler now allocates new page tables
Rather than contantly checking if a page table exists before access, the fault handler will automatically allocate them as needed.
2023-11-07 12:44:23 -06:00
091830e508 Added constructor to x86 context 2023-11-07 12:37:33 -06:00
a5ce86147d Created small static library to wrap system call ABI 2023-09-07 00:58:57 -05:00
e258bfcc9f Moved kernel base 4MiB lower 2023-09-07 00:56:40 -05:00
5cf5edd589 Rewrote heap.c to use libmalloc 2023-03-03 04:55:31 -06:00
14415fae9f set_pte_type now correctly sets flags
Previously it erroneously set all flags regardless to `flags` argument
2023-03-03 04:54:54 -06:00
035960f4d3 Added new linker symbol pointing to end of read-only data 2023-03-03 04:52:58 -06:00
f8cfca588e Fixed inline assembly constraints in msr.c 2023-03-03 04:51:20 -06:00
60775ee007 x86 putc() now copies chars to COM1 2023-01-10 05:37:14 -06:00
6af84b247f Page allocation uses new external library, libmalloc 2023-01-09 01:56:09 -06:00
c069866bc7 Buncha changes and fixes 2022-12-30 17:11:42 -06:00
166841da51 Added usermode interrupt handling 2022-12-21 11:37:13 -06:00
bacedbea86 Rewrote physical memory allocator
The physical memory allocator now uses a buddy allocator instead of a stack.

Also moved some of the platform-independent context code to kernel.c.
2022-08-23 13:00:26 -05:00
c36f65ce97 Various renaming and refactoring 2022-08-19 22:34:45 -05:00
0ae4f7995d Added basic IPC syscalls 2022-08-17 02:47:41 -05:00
bfb56fcbb3 Added functions to portably manipulate process context 2022-08-17 01:41:59 -05:00
958b717751 Fixed state save after process preemption 2022-07-05 15:19:20 -05:00
5c7d002bbf Moved PCB for each process to kernel heap 2022-07-03 13:17:06 -05:00
a52f06f81e Massive backlog of changes 2022-06-15 15:59:31 -05:00
c962a83ff0 WIP on kernel syscalls 2021-05-01 17:09:50 -05:00
7caf49065d page stack constructor takes stack base as argument
initialize() calls new constructors and fills in syscall table
2021-04-19 06:58:02 -05:00
8605f08405 Changed DPL of syscall interrupt to 3 2021-04-19 06:57:05 -05:00
a68503538b putc() advances lines when screen is full 2021-04-19 06:56:49 -05:00
470e39e8e8 Added support for page types in mmgr 2021-04-19 06:55:27 -05:00
755f2a3d69 Wrote syscall interrupt handler in assembly 2021-04-19 06:53:39 -05:00
5efc389935 Finished basic task switching mechansim
PCB is local to a process's address space.
Context switches are written in assembly.
Moved x86 headers to include/x86
2021-04-19 03:40:33 -05:00
40da57e233 APIC enabled after running kernel state constructors 2021-04-18 02:10:56 -05:00
c39cbb79cd Task contexts now load segment registers correctly
Interrupt enable bit set in saved EFLAGS register
2021-04-18 02:10:03 -05:00
1171aa2ca3 Spurious interrupt vector set to 0xFF 2021-04-18 02:07:45 -05:00
0b84658a61 TSS is created and TR loaded in initialize_gdt() 2021-04-18 02:07:00 -05:00
b615a8d286 More process in initialize()
Function now constructs kernel state and enters a process
2021-04-17 06:27:55 -05:00
461194fdfd Fixed initialize_context()
Function did not take 'popal' instruction into account when initializing stack
2021-04-17 06:26:56 -05:00
7c0c5cd8ce Fixed calculation of kernel binary size in initialize() 2021-04-17 04:57:12 -05:00
55c5db056e Fixed crash in initialize_context()
Function tried to dereference a physical address, causing page fault
2021-04-17 04:56:22 -05:00
5c4a756176 Fixed fatal error while loading modules
strcpy() was called with a char instead of a char*, obviously causing a crash
2021-04-17 04:24:23 -05:00
961139df9e Improved kernel memory usage
Moved base linear address to 0xFF800000
Kernel only reserves the page frames it actually needs
Memory for multiboot2 headers is freed
Video memory and APIC registers are dynamically mapped into linear addresses
2021-04-17 03:45:45 -05:00
b582c39ff8 Started work on process management 2021-04-17 01:00:28 -05:00
ce6371f0c3 Added ISR for preemption of processes 2021-04-17 00:59:15 -05:00
2d6fa0d163 Added functions to create and load process contexts 2021-04-17 00:55:05 -05:00
fdcdb9acab Updated virtual memory manager
Added page flags
Added function current_address_space()
Fixed create_address_space()
Renamed some fields in page_table_entry_t to fit naming scheme
2021-04-17 00:52:16 -05:00
6138766c49 Added sequence to remap PIC
Wrote GDT code in C
Added routines to initialize GDT and IDT
2021-04-16 01:45:40 -05:00
8e6589b472 Added some test code to setup a timer 2021-04-15 07:23:19 -05:00
3e73c7c0ac Fixed APIC register mapping 2021-04-15 07:22:58 -05:00
0c5d18ddc0 Added enum for timer interrupt vector 2021-04-15 07:22:26 -05:00
50fcaa2673 Added timer ISR 2021-04-15 07:22:01 -05:00
3229f55164 Added some code in initialize() to test interrupts 2021-04-15 05:49:40 -05:00
c5e38801f3 Fixed the idt_info_t struct and lidt()
Info was not loaded properly, causing crash
2021-04-15 05:49:11 -05:00
923057ee1c Removed 'interrupt' attribute from isr_ap_start()
Added message to division by 0 exception
2021-04-15 04:55:28 -05:00
ac0e5261ba Implemented apic_send_ipi() 2021-04-15 04:51:57 -05:00
d2617e4488 Wrote new ISR for AP entry 2021-04-15 04:51:23 -05:00