Commit graph vbos/include/kernel
Author SHA1 Message Date
Michael Shaw
2fe0b0068b sched: begin scheduling module 2023-11-13 22:23:06 -05:00
Michael Shaw
06b02fc9a6 kmalloc: add fallback for failed DMA allocations 2023-11-03 14:43:53 -04:00
Michael Shaw
36c6f7b92c boot: print list of block devices on mount fail 2023-11-01 19:55:44 -04:00
Michael Shaw
e7ceff19ec gdt: increase GDT size 2023-11-01 17:47:09 -04:00
Michael Shaw
2c88b77edd init: correct TSS impl, generalize stack loading 2023-11-01 17:43:27 -04:00
Michael Shaw
c2daea8b18 gdt: add TSS entries for application processors 2023-11-01 15:55:29 -04:00
Michael Shaw
1cf54c7fd3 panic: add panic function
also remove print messages from APIC driver
2023-10-27 22:41:10 -04:00
Michael Shaw
4dc4f07dc6 mem: improve device memory mapping
MMIO ports will no longer directly map to HHDM addresses and will need
to be searched for in the memory mapping tree
2023-10-24 22:16:33 -04:00
Michael Shaw
0029621ada cmd: add initial commands ls and help 2023-10-20 23:56:01 -04:00
Michael Shaw
ecf517d7b5 mem: add genrw to mem.h 2023-10-20 13:35:43 -04:00
Michael Shaw
25a828437a fs: move fs init into kernel cmdline
Previously, any partition with an ext2 filesystem would be mounted by
the gpt header parser. With this patch, the kernel cmdline `root=val` is
responsible for mounting the root filesystem.
2023-10-19 11:08:54 -04:00
Michael Shaw
aeb2781baf common: add errno to common include 2023-10-18 20:39:02 -04:00
Michael Shaw
f8ea51441e add error checking for ext2 superblock read 2023-10-18 13:44:05 -04:00
Michael Shaw
f8124e4b78 ext2: add ability to read inodes 2023-06-26 00:11:39 -04:00
Michael Shaw
21e2540243 block: replace block_part with independent block devices
this also removes the fat32 support for now, as the virtual filesystem
needs more work
2023-05-27 17:32:39 -04:00
Michael Shaw
db5990cc97 mem: add locks to kernel memory management structures 2023-05-27 02:11:27 -04:00
Michael Shaw
8e6d0d4fbc kernel: add support for basic type spinlock_t
A spinlock is the most basic type of lock. It will attempt to acquire,
and upon failure, will continue attempting indefinitely until it is
successful.
2023-05-27 01:44:33 -04:00
Michael Shaw
13437a219e page: do not invalidate kernel TLB entries
set the PAGE_GLOBAL attr for kernel pages
2023-05-23 23:23:10 -04:00
Michael Shaw
29a0435cf6 slab: replace struct slab with slab_t
This type should never be modified by the user, and only passed into the
functions in slab.c. Using a typedef to notifies the user semantically
of this fact
2023-05-19 16:49:34 -04:00
Michael Shaw
05c528f64c block: read GPT header from block devices on init 2023-05-13 23:04:15 -04:00
Michael Shaw
82c32011b4 rbtree: fix previously flawed implementation
got book'd up

Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-05-11 12:51:14 -04:00
Michael Shaw
ea1c1b337d rbt: remove verify function 2023-05-10 21:57:40 -04:00
Michael Shaw
c712f0a7d6 kmalloc: add consistency test when KDEBUG is defined 2023-05-10 21:41:25 -04:00
Michael Shaw
4e36cfd90b lib: add rbtree data structure
This also switches the kmalloc allocator over to the new rbtree
structure. As a balanced binary search tree, it is much more efficient
than the previous method
2023-05-10 21:24:19 -04:00
Michael Shaw
d3e9b728dc slab: no longer automatically allocate slab cache sizes 2023-05-10 13:18:37 -04:00
Michael Shaw
b90946e1f8 mem: adjust MMIO addresses 2023-05-10 01:14:33 -04:00
Michael Shaw
0b81c6cccc ahci: fix bug with block read and write 2023-05-10 00:40:14 -04:00
Michael Shaw
03eb0b0048 fs: begin basic block driver
This just makes the API for accessing drives generic, instead of
relying solely on the corresponding driver code
2023-05-09 21:52:35 -04:00
Michael Shaw
8544efe1ab slab: upgrade kmalloc to allow DMA regions
these DMA regions are only meant to comply with certain AHCI
requirements, and are not yet general purpose
2023-05-08 01:14:11 -04:00
Michael Shaw
69ee1fd79c ahci: complete read/write sectors function 2023-05-07 15:21:04 -04:00
Michael Shaw
aa3eb7805d continue ahci development 2023-05-06 21:30:05 -04:00
Michael Shaw
b8b67aadc9 irq: make IRQs dynamically mappable 2023-05-04 22:10:23 -04:00
Michael Shaw
87146087ca begin ahci driver 2023-05-04 21:47:48 -04:00
Michael Shaw
47edaa8512 slab: add kzalloc 2023-05-04 15:26:40 -04:00
Michael Shaw
39c778d2f0 add some asserts 2023-05-04 02:02:17 -04:00
Michael Shaw
605507a688 pci: add simple pci driver
this driver only prints devices on the pci bus.
2023-05-03 23:55:54 -04:00
Michael Shaw
e1108b3493 mem: improve slabbing to include flags 2023-04-29 16:54:12 -04:00
Michael Shaw
9222a373fc buddy: replace free-lists with binary tree
before this patch, the buddy allocator used a hybrid bitmap-freelist
approach where free would use the bitmap to determine size, but all
other operations we O(n) traversals of the free-list.

now, both alloc and free use the bitmap exclusively for allocation.
2023-04-29 00:15:50 -04:00
Michael Shaw
22762339f9 irq: begin moving away from 8259
8259 PIC was used for interrupts for bootstrap development while the memory manager was being constructed. now that this is complete, a transition to the apic will begin

this patch fixes memory mapping issues with the reserved regions that caused page faults before.
2023-04-22 13:01:46 -04:00
Michael Shaw
794c328809 mem: update slab allocator
the slab allocator will now free slabs if they are not the first slab
for a given size and they are empty
2023-04-20 19:22:07 -04:00
Michael Shaw
577779f8ae mem: add kmalloc and kfree 2023-04-20 17:03:10 -04:00
Michael Shaw
74a58d6641 mem: add basic slab allocator 2023-04-20 16:06:49 -04:00
Michael Shaw
4595f35e4f mem: rename mem_region_header to buddy_region_header 2023-04-14 12:47:30 -04:00
Michael Shaw
59509f4448 mem.h: remove incorrect HHDM_START macro 2023-04-14 12:39:44 -04:00
Michael Shaw
b8fa30c8ed mem: change buddy allocator api
the buddy allocator now returns HHDM addresses as void* rather than
zero-based adddresses as paddr_t. it also automatically searches regions
now, rather than requiring a (struct mem_region_header *) for each
alloc/free
2023-04-13 17:36:04 -04:00
Michael Shaw
4f4af0946d mem: implement buddy allocator 2023-04-12 13:58:22 -04:00
Michael Shaw
9a4ff385bd pic: enable legacy pic serial interrupts 2023-03-14 04:25:06 -04:00
Michael Shaw
d5f388208c mem: formatting fix 2023-03-09 01:59:21 -05:00
Michael Shaw
84b40e3eda mem: add type paddr_t 2023-03-05 17:10:08 -05:00
Michael Shaw
bb76bcac6c Modify to allow unmapping easily 2023-03-05 17:02:02 -05:00