Commit graph

87 commits

Author SHA1 Message Date
fef
14630c86bf
x86: remove unnecessary standalone port functions 2021-11-09 22:14:20 +01:00
fef
a3941b6dc4
mm: minor page management refactor
This seems like a huge commit but it's really just
renaming a bunch of symbols.  The entire mm
subsystem is probably gonna have to go through
some major changes in the near future, so it's
best to start off with something that is not too
chaotic i guess.
2021-11-09 20:34:35 +01:00
fef
03f31df67f
x86: better separation for i386 specific code
That's it, nothing major is gonna happen anymore
until i get amd64 support working and deprecate
the entire i386 branch.  32-bit just adds so many
extra complications to memory management that i
don't want to waste any more energy on this
platform which is obsolete anyway.
2021-11-09 20:25:10 +01:00
fef
36985f51e2
add kqueue API
kqueues are going to form the basis for anything
related to I/O and IPC.  They are a lock-free,
atomic FIFO queue and support multiple emitters
and consumers.
2021-11-04 06:06:31 +01:00
fef
5877697e64
page: use new ptr align macros 2021-11-04 06:01:03 +01:00
fef
ebce7b8e83
mutex: fix lock race conditions 2021-11-04 05:56:40 +01:00
fef
b6385aea0a
panic: move to separate file, add KASSERT macro 2021-11-01 23:54:55 +01:00
fef
24c6e9504d
add kernel panic utility
This also includes some minor rearrangements in
terms of which header files define what.
2021-10-31 02:00:10 +02:00
fef
abd9bb5d43
amd64/atom: fix typo 2021-10-30 23:15:14 +02:00
fef
38d9a9586d
smp: add base for SMP awareness 2021-10-30 03:34:04 +02:00
fef
6d0950501c
page: ensure early page mapping doesn't fail
Up to now, the page frame allocator's
initialization routine relied on the fact that
map_page() never needs to get new pages on i386 if
the mapped page is a hugepage.  This is not at all
true on other architectures, however.
2021-10-29 00:23:30 +02:00
fef
eb0091403e
mutex: add semaphores 2021-10-28 17:08:46 +02:00
fef
c36b03d97c
mutex: avoid wait queue lock if possible
This also tidies up the atomic operations a little
and adds a new atom_cmp_xchg() as well as the same
APIs for longs and pointers.
2021-10-28 17:01:13 +02:00
fef
c66b05216d
clist: add better debugging facilities 2021-10-24 21:55:54 +02:00
fef
2b3eaf4ff7
mm: add basic slab allocator
This still needs some work and integration into
kmalloc() but hey i've tested it and it doesn't
immediately fall apart so why not commit it
2021-10-24 05:36:46 +02:00
fef
e561adbb6f
bits: remove unnecessary xor 2021-10-23 22:16:51 +02:00
fef
16a229c936
mm: protect cache pools with mutex 2021-10-23 02:50:04 +02:00
fef
743424d15f
mm: fix page frame allocator bugs
This also includes a minor refactor of everything,
as well as some optimizations.  The bitmap
operations have been moved into a separate file
because they are probably gonna come in handy in
other parts of the system as well.
2021-10-23 00:56:49 +02:00
fef
96378f019c
kmalloc: add shiny new buddy page frame allocator
This is still kind of a work in progress because
it will be the backend to a slab allocator, which
in turn is managed by kmalloc().
2021-10-22 06:22:38 +02:00
fef
f0706b802b
boot: ignore unaddressable RAM areas on i386
We don't support PAE or any other fancy hack to
get past the 4 GB limit on 32-bit, so we have to
clip areas that would fall outside that range
2021-10-21 23:21:56 +02:00
fef
f59229ba39
types: fix typo in u64 typedef
This would have been a fun one to debug if i
hadn't caught it right now
2021-10-21 23:09:35 +02:00
fef
45ab27e738
x86/atom: add pause in spin loops 2021-10-21 22:12:37 +02:00
fef
d464135ff4
x86: prevent IRQs from firing during init 2021-10-21 22:02:35 +02:00
fef
3fee893f21
x86: begin preparations for amd64 support
This is a huge commit, but it mainly just moves
some files around and doesn't change their
contents much.
A lot of stuff works the same on amd64 as it does
on i386, so i'm moving the parts that are specific
to the latter into separate subdirectories while
the rest can be shared with the amd64 codebase.
2021-10-21 05:27:42 +02:00
fef
4e770a6e58
x86/port: add delay wrappers for x86_io_wait() 2021-10-21 04:39:29 +02:00
fef
2a6dcf8c0c
x86/boot: enable Page Size Extensions
This single fucking bit is the reason 4MB pages
weren't working all along
2021-10-20 06:05:46 +02:00
fef
c911ff9009
x86/mm: add huge page support
This is part of a series of commits where i
completely rewrite kmalloc() because it needs to
be able to return physically contiguous memory for
DMA operations.
Yes, i know the build isn't working right now.
2021-10-17 01:09:51 +02:00
fef
6865864444
x86/atom: use neg instead of not/inc
The x86 apparently has a dedicated instruction for
finding the 2's complement.
2021-10-16 21:30:13 +02:00
fef
ea89961ed2
x86/atom: use correct names in asm, improve docs 2021-10-16 18:39:03 +02:00
fef
7af90dc798
clist: you got to be fucking kidding me
This was my actual intention behind the previous
commit.  I should really go to bed.
2021-10-16 04:30:37 +02:00
fef
9ba75c564a
clist: remove the stupid there, too 2021-10-16 04:26:00 +02:00
fef
721ba69276
mtx: remove the stupid 2021-10-16 04:23:05 +02:00
fef
ad422894f2
mtx: add basic synchronization primitives 2021-10-16 04:00:22 +02:00
fef
582758e868
x86: add atomic primitives 2021-10-16 03:27:53 +02:00
fef
c3847487be
config: refactor kernel address mapping names 2021-10-15 19:52:22 +02:00
fef
d066986994
clion: add code style config 2021-10-15 00:33:05 +02:00
fef
b2fccf1ecd
sched: add base for scheduling and task switching 2021-10-15 00:01:47 +02:00
fef
14e673b8dd
x86: fix page allocator once and for all 2021-10-14 21:06:40 +02:00
fef
65899b35f1
x86: minor page management refactor
Even Uranium-223 ages better than my code
2021-10-13 20:55:35 +02:00
fef
d8e7939093
fix build yet again
(i am too stupid to include all relevant changes
in my commits, mostly due to the fact that my
local diffs are almost always tremendous)
2021-10-13 18:00:22 +02:00
fef
e14bc3ce1e
x86: inline x86_io_wait() 2021-10-12 23:25:11 +02:00
fef
904584ccc0
libc: refactor a couple of string routines
This is just a minor overhaul of several utility
functions, in part because it kept bothering me
and in part because i was bored.
2021-10-12 23:24:17 +02:00
fef
afbb3743d5
refactor type and cdefs headers 2021-10-12 01:31:49 +02:00
fef
e6e3f90d08
libc: oops i forgot yet another one
it's almost 6 AM, i'm tired okay?
2021-10-10 05:44:06 +02:00
fef
3f0e7dd0b5
libc: oops i forgot one 2021-10-10 05:42:44 +02:00
fef
0f9e9f91a6
libc: port FreeBSD string library routines
Oh my fucking god this was by far the most awful
and boring and tedious day in my entire life.

Also, dear FreeBSD people: please don't sue me.
I tried really hard to comply with all the
copyright stuff, but it is absolutely possible i
made a mistake.  Just DM me and i'll do everything
in my power to fix it, even if that means
releasing entire portions of GayBSD under the BSD
license.  I don't care, i just want stuff to work.

(i'm including this message to use it as possible
evidence in case i get sued to show my good will)
2021-10-10 05:41:16 +02:00
fef
4679b7cee5
x86: add irq support 2021-10-07 19:16:21 +02:00
fef
89f3393b8b
x86: move page fault handler to where it belongs 2021-10-05 01:09:13 +02:00
fef
bc917d8651
x86: inline I/O port functions 2021-10-04 05:56:44 +02:00
fef
16b6924beb
kmalloc: fix comments affected by auto rename
Just VS Code things
2021-10-04 05:56:11 +02:00