Commit graph

26 commits

Author SHA1 Message Date
7b4e4afd43 Defined a couple of functions, added documentation templates
Didn't feel the need to make a new branch for this one, but i added some
doxygen documentation templates to all of the headers. It's a bit
overdue.
2025-07-17 07:36:45 -04:00
6261af8e3a Some changes to names and a convenience ASM function
asm.h now can nuke the TLB by refreshing the PD.
also changed some symbols to more accurately represent what they are
for, such as the kernelspace page tables or the global PD.
2025-07-15 23:14:33 -04:00
Jake Holtham
20357559c1 The beginning of paging!
The kernel resides in the higher half, and as of now still identity maps the lower half for compatibility. Will not merge back to master until all the previous features work properly in virtual memory..
2025-07-15 14:52:48 -04:00
4ffc4692ae Page frame setup done, plus makefile changes.
Makefile now has VGA=2 to set the QEMU monitor to STDOUT. Nice for
things like memory dumps.

Can now parse the memory and create a bitmap of workable regions.
Allocation soon(tm)
2025-07-11 18:29:03 -04:00
Jake Holtham
c45eb306df Potentially working bitmap allocator, still need to debug it, but i need to push this so i can switch machines. 2025-07-11 11:53:10 -04:00
ffd3b2fee4 Partially implemented physical frame management.
I'm tired. I'll think more about this tomorrow.
2025-07-11 01:38:26 -04:00
Jake Holtham
0c6e42f713 Added physical memory file lol 2025-07-09 17:44:59 -04:00
472f91fe14 Started work on memory map, added printf features
Printf now has long (64-bit), char, and % literal support. I haven't written
anything specific for shorts yet but if you cast it to an int on the way
in, it'll work anyway, so whatever.
2025-07-05 04:36:39 -04:00
53198515c8 Temporary "default output" global, makefile changes.
Default output variable holds a generic writer, and any output that
isn't really sure where to output to can just output there. Set by the
system early in boot.

Also made some changes to the makefile to support arguments in the "make
run" or "make debug" subset of calls. For now, it's just VGA=1/0 or
SERIAL=1/0 to enable/disable VGA/serial. Defaults are VGA=1, SERIAL=0.
2025-07-04 02:20:31 -04:00
62ab718e4d Serial output works! 2025-07-04 01:47:44 -04:00
d6465ade55 Reworked I/O methodology
Instead of passing function pointers, we're passing structs with context
now. The idea is the same, I/O functions require some struct with a
function pointer and some generic memory that only the output device
cares about. I/O just calls it.

VGA has been reworked to accomodate this change, as well as default
outputs being created for low-overhead use (such as interrupt handlers).
2025-07-03 01:36:47 -04:00
26dd32345f Added header and asm file for assembly function wrappers 2025-07-02 21:17:57 -04:00
981c224f55 Serial implementation Pt1
Serial testing with COM1 works - need to rework I/O to have it output
tho. That's next.
2025-07-02 19:48:33 -04:00
4899877cec Changed I/O to be more generic.
instead of stuffing all of the i/o stuff into the "kio" library, i've
decided to rework i/o to be a generic handler that takes in a function
pointer for putc, and does the rest of the logic onto that pointer.
That way, you can pass any function that can take in characters and move
them to buffers.
I'll do a writeup on this at some point to document it.
2025-06-29 01:13:43 -04:00
55d5823bde Added tons of documentation
Still need to document a lot of functions, but I cleaned up and
explained a lot of the code via comments.
2025-06-28 02:11:09 -04:00
4c76d5647a Fixed interrupt handler bug
Table was wrong. Oops. Pointer math got me.
2025-06-28 01:35:35 -04:00
561c7f9fa7 Loaded IDT!
Many code changes, many undocumented. Documentation and cleanup is next.

Fixed a lot of bugs related to IDT structure. Changed the IDT paradigm
to be dynamically written isntead of statically to account for nobits on
that section.
Also added a gdb remote debugger automatic script, for simplicity in
debugging.
2025-06-28 00:14:42 -04:00
fbef354410 Small IDT work, gotta go hiking lol 2025-06-17 20:13:09 -04:00
8c51b7010e Interrupt Descriptors implemented
Now just need to populate the IDT, then debug the whole thing.
2025-06-16 22:40:02 -04:00
623b9e339f Removing the tables header. Moving its contents to table headers. 2025-06-16 00:52:05 -04:00
d32c1fab63 dude PLEASE i dont want to implement ISRs dude PLEASEEEEE
I did set up all of the stuff around it tho. Gotta implement some
handlers.
2025-06-12 01:19:59 -04:00
d97ec36f8c Half-baked commit, but i added a struct type for the tss and allocated
some memory for it in bss. Also put some space in for the gdt in rodata.
Need to leave now, so this broken build goes to the repo!
2025-06-10 09:17:21 -04:00
295e622fe1 Moved the kernel to the 1MB boundary in the linker script. Also did some
stuff with ccls for language server stuff.
2025-06-09 18:27:55 -04:00
745cf9045c Moved multiboot structs to kmultiboot.h 2025-06-08 22:44:17 -04:00
8734cd4da6 Added some functions, did some reorganizing.
kttools.h/c is a lib for converting types (only currently contains
i_to_str).

Also added a printf for i/o.
2025-06-08 16:18:06 -04:00
5efb8d9fbc Moved i/o content to kerno.c
Added function for integer -> string (library pending)
Modified makefile to reflect use of include/ dir
2025-05-28 23:19:50 -04:00