Commit graph

122 commits

Author SHA1 Message Date
Michael Shaw
c623f4a9fb mem: rename function 2023-05-07 15:28:52 -04:00
Michael Shaw
17addbb55c ahci: remove unwanted auto-include 2023-05-07 15:23:26 -04:00
Michael Shaw
69ee1fd79c ahci: complete read/write sectors function 2023-05-07 15:21:04 -04:00
Michael Shaw
7db20603f6 ahci: add ahci_read_sectors function 2023-05-06 23:50:14 -04:00
Michael Shaw
0c7c542eb5 ahci: parse devices and add them to list 2023-05-06 22:25:07 -04:00
Michael Shaw
637c9b2d71 pci: add func field to struct pci_device 2023-05-06 22:01:38 -04:00
Michael Shaw
ca0835028f pci: fix pci implementation 2023-05-06 21:57:35 -04:00
Michael Shaw
aa3eb7805d continue ahci development 2023-05-06 21:30:05 -04:00
Michael Shaw
970b34de9a ahci: enumerate ahci bus 2023-05-06 20:48:23 -04:00
Michael Shaw
9ac63f29dd improve pci driver 2023-05-06 17:59:46 -04:00
Michael Shaw
adfa24dd1e ahci: complete hbafis_t struct 2023-05-06 17:27:52 -04:00
Michael Shaw
54ccb27ef0 irq: remove useless function 2023-05-04 22:17:59 -04:00
Michael Shaw
b8b67aadc9 irq: make IRQs dynamically mappable 2023-05-04 22:10:23 -04:00
Michael Shaw
4b813d7c86 remove old idt.c 2023-05-04 21:49:10 -04:00
Michael Shaw
87146087ca begin ahci driver 2023-05-04 21:47:48 -04:00
Michael Shaw
ce430f490d pci: change messages to debug prints
this also disables interrupts during ISRs
2023-05-04 16:25:43 -04:00
Michael Shaw
805650c7b1 acpi: switch to debug logging 2023-05-04 15:39:47 -04:00
Michael Shaw
1799cb5abf stdio: add LOG_DEBUG 2023-05-04 15:36:54 -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
2c9e239c65 mem: remove unused kmalloc_slab 2023-05-03 18:51:12 -04:00
Michael Shaw
c870c31774 slab: change how kmalloc slabs are tracked and freed 2023-05-03 13:15:58 -04:00
Michael Shaw
1abb003952 acpi: fix parsing errors 2023-04-30 12:16:17 -04:00
Michael Shaw
75d156c4e3 stack_init: fix bug 2023-04-30 01:11:07 -04:00
Michael Shaw
a2f1ff984c main: reorganize kmain 2023-04-30 01:09:34 -04:00
Michael Shaw
dcf299fada console: add ready message 2023-04-30 01:09:23 -04:00
Michael Shaw
e1108b3493 mem: improve slabbing to include flags 2023-04-29 16:54:12 -04:00
Michael Shaw
1fe7b002cf Makefile: O0->O2 2023-04-29 15:17:11 -04:00
Michael Shaw
aaeabe7b49 mem: switch kmap to slab allocation
allocating individual pages en-masse for kmap with the buddy allocator
is way too slow, especially with the new method of buddy allocation that
is noticeably slower to start, but scales more efficiently.

the slab allocator is extremely fast and is perfect for this purpose
2023-04-29 14:51:57 -04:00
Michael Shaw
281fb8ef9d string: optimize memset 2023-04-29 00:44:11 -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
9cf4b71559 revert apic change
this is now on its own branch and will be worked on separately from the
main focus of this project, which is to get a VFS and into userspace as
soon as possible
2023-04-22 14:47:46 -04:00
Michael Shaw
c78085373c mem: clean up mem_early_init
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-04-22 14:15:18 -04:00
Michael Shaw
2e59620395 mem: fix bug with kmap
the `next_level` function was calling `alloc_page_early` directly
instead of using the pointer `alloc_page`, causing the mapping to work
inconsistently.
2023-04-22 13:58:39 -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
7bddf838fd mem: initialize the stacks
the stacks will now no longer be overwritten by the buddy allocator and
have a fixed size macro `KSTACK_SIZE`
2023-04-21 17:56:06 -04:00
Michael Shaw
159ceec0a2 mem: move slab min size to macro
Signed-off-by: Michael Shaw <spencershawiscool@gmail.com>
2023-04-21 12:02:02 -04:00
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