Commit graph

84 commits

Author SHA1 Message Date
Michael Shaw
addf96aae7 mem: fix bug with slab_create
before this would overwrite into the next region, which would cause an
error at `buddy_alloc_helper` as the region overridden was the `len`
field of a `struct buddy_free_list`
2023-04-20 21:43:43 -04:00
Michael Shaw
4db95954a3 change SLAB_MIN_COUNT to 64 2023-04-20 19:31:25 -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
d7ed4bd777 main: move pic stuff into _pic_init 2023-04-20 17:18:44 -04:00
Michael Shaw
c1628a90d0 Makefile: change O0 to O2 2023-04-20 17:05:23 -04:00
Michael Shaw
f1f81a876c mem: make slab_range static inline 2023-04-20 17:04:42 -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
4239ca1b7e mem: replace mem_initialized bool with function pointer 2023-04-20 15:41:19 -04:00
Michael Shaw
43d36f8703 math: add SPDX-License-Identifiers
Add the GPL-2.0-only license identifier to the top of these source files
2023-04-19 17:37:56 -04:00
Michael Shaw
7303bcc3e2 mem.c: cleanup 2023-04-19 17:37:18 -04:00
Michael Shaw
5b79d54440 mem: fix next_level function
add the OR hhdm_start to the return address since this returns a
(uint64_t *) and not a paddr_t
2023-04-19 17:35:21 -04:00
Michael Shaw
035bffc092 apic: remove erroneous line in header file 2023-04-18 14:13:22 -04:00
Michael Shaw
fc08269219 mem: clarify comments on buddy allocator 2023-04-18 14:12:21 -04:00
Michael Shaw
a08a7dd1a4 mem: set buddy_alloc_helper minimum size to 0x1000 bytes 2023-04-14 12:56:11 -04:00
Michael Shaw
a1329f092b mem: add comment explaining buddy allocator concept 2023-04-14 12:50:56 -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
98c99b1780 mem: reorganize buddy.c 2023-04-14 09:03:01 -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
a506cc481e mem: removed unncessary messages and allocation 2023-04-13 13:12:21 -04:00
Michael Shaw
a089d09322 add todo lol 2023-04-12 19:10:39 -04:00
Michael Shaw
758d120903 mem: remove non-compliant section 2023-04-12 19:09:20 -04:00
Michael Shaw
062d14bde3 mem: remove buddy_alloc tests 2023-04-12 18:23:24 -04:00
Michael Shaw
8d538db27d mem: add buddy_free 2023-04-12 18:21:16 -04:00
Michael Shaw
bd0ded5d61 buddy_alloc: fix problem with splitting pages 2023-04-12 16:46:15 -04:00
Michael Shaw
4f4af0946d mem: implement buddy allocator 2023-04-12 13:58:22 -04:00
Michael Shaw
fe93196a01 remove atoi test 2023-03-24 03:45:11 -04:00
Michael Shaw
2694098d62 printf: mv lib/printf.c lib/stdio.c 2023-03-15 03:35:17 -04:00
Michael Shaw
3215605b2d add console 2023-03-15 03:33:03 -04:00
Michael Shaw
f001be171c console: add console_resize() 2023-03-15 03:32:47 -04:00
Michael Shaw
9a4ff385bd pic: enable legacy pic serial interrupts 2023-03-14 04:25:06 -04:00
Michael Shaw
667d01e418 serial.h: change type of serial_init to int 2023-03-13 18:16:02 -04:00
Michael Shaw
3b203fa698 serial.c: include serial.h 2023-03-13 18:15:14 -04:00
Michael Shaw
bb6de2047e serial: move COM1 to serial.h 2023-03-13 18:10:19 -04:00
Michael Shaw
04805857c4 apic.h: add apic redirection entry struct 2023-03-13 17:53:17 -04:00
Michael Shaw
894916b407 mem: add print for memory region types 2023-03-13 04:50:37 -04:00
Michael Shaw
f761328163 init: fix msr hex 2023-03-11 20:51:40 -05:00
Michael Shaw
957e56e959 init: remove stack frames from msr asm functions
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-03-11 20:49:44 -05:00
Michael Shaw
48e24085f6 stdio.h: shortened LOG_ prefixes 2023-03-11 20:43:40 -05:00
Michael Shaw
90e099aedf acpi: Fixed RSDT printf 2023-03-11 20:41:08 -05:00
Michael Shaw
df048d9f11 Actually remove the line 2023-03-10 21:35:10 -05:00
Michael Shaw
eb5a22a0d0 Remove currently unused variable 2023-03-10 21:34:44 -05:00
Michael Shaw
806ece61f9 mem: mv mem/pfa.c -> mem/early.c 2023-03-09 02:00:07 -05: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
Michael Shaw
e1fa7736a1 common.h: add bitwise.h 2023-03-05 04:59:15 -05:00
Michael Shaw
c278665916 mv README -> README.md 2023-03-05 04:54:27 -05:00
Michael Shaw
6bcbf1eb56 Add readme 2023-03-05 04:53:55 -05:00