116 Commits (main)
 

Author SHA1 Message Date
anna 45ab27e738
x86/atom: add pause in spin loops 3 years ago
anna d464135ff4
x86: prevent IRQs from firing during init 3 years ago
anna 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.
3 years ago
anna 4e770a6e58
x86/port: add delay wrappers for x86_io_wait() 3 years ago
anna 2a6dcf8c0c
x86/boot: enable Page Size Extensions
This single fucking bit is the reason 4MB pages
weren't working all along
3 years ago
anna 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.
3 years ago
anna 6865864444
x86/atom: use neg instead of not/inc
The x86 apparently has a dedicated instruction for
finding the 2's complement.
3 years ago
anna ea89961ed2
x86/atom: use correct names in asm, improve docs 3 years ago
anna 7af90dc798
clist: you got to be fucking kidding me
This was my actual intention behind the previous
commit.  I should really go to bed.
3 years ago
anna 9ba75c564a
clist: remove the stupid there, too 3 years ago
anna 721ba69276
mtx: remove the stupid 3 years ago
anna ad422894f2
mtx: add basic synchronization primitives 3 years ago
anna 582758e868
x86: add atomic primitives 3 years ago
anna c3847487be
config: refactor kernel address mapping names 3 years ago
anna d066986994
clion: add code style config 3 years ago
anna b2fccf1ecd
sched: add base for scheduling and task switching 3 years ago
anna 14e673b8dd
x86: fix page allocator once and for all 3 years ago
anna 65899b35f1
x86: minor page management refactor
Even Uranium-223 ages better than my code
3 years ago
anna 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)
3 years ago
anna e14bc3ce1e
x86: inline x86_io_wait() 3 years ago
anna 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.
3 years ago
anna afbb3743d5
refactor type and cdefs headers 3 years ago
anna e6e3f90d08
libc: oops i forgot yet another one
it's almost 6 AM, i'm tired okay?
3 years ago
anna 3f0e7dd0b5
libc: oops i forgot one 3 years ago
anna 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)
3 years ago
anna 4679b7cee5
x86: add irq support 3 years ago
anna 89f3393b8b
x86: move page fault handler to where it belongs 3 years ago
anna bc917d8651
x86: inline I/O port functions 3 years ago
anna 16b6924beb
kmalloc: fix comments affected by auto rename
Just VS Code things
3 years ago
anna d69fd0d2aa
x86: refactor traps, add register dump support 3 years ago
anna 3e43ec5491
kprintf: minor refactor, fix stupid offset bugs 3 years ago
anna d475429639
kprintf: implement "full" format sequence support
So this was painful.  kprintf() supports most of
the format specifiers from BSD now, except for the
$ sequence.  It has gotten a general overhaul and
is significantly more sophisticated, bloated and
slower now.  There is also some minor stuff i
forgot about, like the 't' length modifier, but
that isn't so important right now and will be
fixed later(TM).
3 years ago
anna c31149c6cc
cmake: "fix" compiler stuff
I have no idea if i've made things better or worse
with these changes, but tbh i don't really care.
It didn't compile (with the upcoming changes to
kprintf(), that is) before, it does compile now.
End of story.
3 years ago
anna 9e89be2eab
clion: add project configuration files 3 years ago
anna 613c28a965
x86: add basic interrupt support
This commit also fixes the fun little size bug in
segment.S where i subtracted the end from the
start address of the GDT instead of the other way
round which resulted in a gigantic overflow :)
3 years ago
anna 347bb5cc9c
kmalloc: bugfixes and performance improvements 3 years ago
anna d4ee4e5953
clang: make code submissive and debuggable 3 years ago
anna 5c0fa715a4
kmalloc: add actual memory allocator
Now that memory allocation finally kind of works,
we can finally start focusing on the core system
architecture.  This commit also fixes some bugs in
get_page() and friends, as well as performance
improvements because the page map is addressed as
unsigned longs rather than individual bytes.
3 years ago
anna f1922723f0
types.h: fix uintptr_t sign 3 years ago
anna 7c4819e5fd
clist: corrupt removed entry pointers if DEBUG 3 years ago
anna 3f73072153
types.h: use rust-style naming scheme, add bools 3 years ago
anna 3e2bf39ff5
x86: remove unnecessary c flag
All i really wanted to do is prevent accidentally
using floats, but the -mgeneral-regs-only option
seemed a little overkill and clang ignored it
anyway, so there is little use for it other than
emitting noisy compile warnings.
3 years ago
anna 8129518640
mm: replace GRUB's GDT with our own 3 years ago
anna 66a1f8726e
add README 3 years ago
anna 3d6258a06e
mm: implement runtime page mapping 3 years ago
anna 17320f2571
boot: enable paging in boot sequence 3 years ago
anna d436d9b203
mm: add page frame allocator 3 years ago
anna 2a0ed8121a
util: refactor misc utility stuff 3 years ago
anna 623daf58ed
arch: disable cpu extensions
we don't use that in kernel mode to speed up
context switching, and noone needs floats and
such in the kernel anyway.
3 years ago
anna 8fb2f7987c
kprintf: fix vararg bug
Turns out you can't pass a va_list to subroutines
as per the C standard, even though it worked
perfectly fine on ARM.  Well then, the entire
kprintf thing needs to be refactored anyway at
some point in the future, so that more formatting
options are supported.
3 years ago