Commit graph

19 commits

Author SHA1 Message Date
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