29 Commits

Author SHA1 Message Date
csd4ni3l
64206d3596 Update libxunil submodule 2026-04-19 22:45:02 +02:00
csd4ni3l
e1c2373691 Use native syscalls instead of interrupt-based ones, move syscall from
driver to arch, and add x86_64 specific native syscalls.
2026-04-19 22:43:20 +02:00
csd4ni3l
f4c2657b94 Make keyboard lock-free (and fix Doom deadlock) by only pushing
scancodes to a spsc queue from the interrupts and only process them
inside syscalls. Also make CURRENT_PID atomic to use less locking
2026-04-19 18:22:16 +02:00
csd4ni3l
2b8a965c92 Update submodules to latest version 2026-04-10 12:53:40 +02:00
csd4ni3l
c81bed2a4e Add correct sleep which works now because interrupts are re-enabled
using sti in syscalls, remove a bunch of old imports and code, move
keyboard scancode handling to keyboard.rs, add a new KeyboardEvent based
layout where press/release and unicode is handled, add a kbd_read
syscall which writes kbd events to a userspace buffer, add a usercopy
file which provides safe copying functions to userspace
2026-04-10 12:48:00 +02:00
csd4ni3l
d60f80c8a4 Fix libxunil not being in the repo 2026-04-07 23:06:30 +02:00
csd4ni3l
33e849153f Add libxunil as a submodule. 2026-04-07 23:04:01 +02:00
csd4ni3l
599a8e730d remove libxunil folder to make it a submodule 2026-04-07 22:58:16 +02:00
csd4ni3l
eee088c48f Add better register clobbering to syscall calling in libxunil, add header magic to verify each free/malloc/realloc/calloc statement, add our own memcpy, memcmp, memset, memmove 2026-04-07 22:11:18 +02:00
csd4ni3l
9e8090c736 Make Doom run by improving and fixing libc stubs, adding proper heap
allocation, adding a timer, a framebuffer swap, rectangle and buffer
draw syscall, moving the header files to the correct directory,
disabling stack protection, AVX and MMX, while enabling SSE, fix
interrupt handler popping in the wrong order, improve
load_segment_to_memory alignment, add load_from_ptr to framebuffer for
very quick drawing, serial_print as well as render font in
consolewriter, zero the memory in sbrk, add a fake file system and
methods to libxunil for DOOM, add correct printf, vsnprintf add _start
which calls the main function in libxunil, mark all registers as used
inside syscalls for no memory corruption, add build_helloworld.sh script
2026-04-07 18:06:52 +02:00
csd4ni3l
ae3915147a Add a usermode address space which can be switched to, make
FRAME_ALLOCATOR global, make XunilFrameAllocator not hold Limine entries
so it can be used without lifetimes, implement the process struct, add
user heap by giving back heap_start from ELF and adding sbrk syscall,
align ELF loading in userspace_stub, implement lots of libc functions in
libxunil, remove x86_64 dependency from libxunil, add malloc and all
required heap functions to libxunil and more syscall numbers, add a util
file to libxunil, add build scripts for libxunil and doomgeneric
2026-04-05 20:12:59 +02:00
csd4ni3l
1e899e2f97 Add a scheduler which just keeps of processes for now, and a
with_process to interact with them. User space now has it's own address
space and mapper which means we will be able to allocate memory for it.
I added a bunch of functions as stubs into libxunil which are required
for doomgeneric.
2026-04-03 11:28:31 +02:00
csd4ni3l
720b68190d Add doomgeneric submodule 2026-04-01 21:27:39 +02:00
csd4ni3l
6ac13a876f Add ET_DYN support for the ELF loader, which required adding
relocations, add some more functions to libxunil, use include inside of
tests instead of manually defining types and add basic libc header
files. Move libxunil to the user folder, and add helloworld and
doomgeneric as apps
2026-04-01 21:25:34 +02:00
csd4ni3l
47a480009f Fix sleep not being imported and re-add the boot_animation. 2026-04-01 14:18:17 +02:00
csd4ni3l
9aeff321f8 Add ET_EXEC ELF loading and validation, and a non-working ET_REL
implementation, running support, also basic syscalls to test if it
works. add a syscall ABI and a new libxunil ABI for calling back to the
kernel with syscalls, add user mode protection when running ELF, add TSS
Privilege Stack table to fix GPF issues, add invalid opcode handler, fix
rust panics using rectangle_filled instead of fb clear. Also add a hello
world example binary that runs in usermode at startup.
2026-04-01 14:06:20 +02:00
csd4ni3l
aa5a2a6da6 Make keyboards use events, move all userspace-like code (from mouse as
well) to a stub file instead of being inside the kernel.
2026-03-30 16:24:42 +02:00
csd4ni3l
91828daae2 Remove old next variable from the frame allocator, add a mouse bitmap
for drawing and move mouse drawing and updating functions to the mouse
struct.
2026-03-29 15:59:37 +02:00
csd4ni3l
3ef95940a7 Remove micromath dependency, improve primitive drawing speed by 300x,
add mouse support and interrupts on x86_64 using a ps2 mouse which
needed pic unmasking, add span filling to framebuffer, add back
without_interrupts to serial console and framebuffer, add a mouse
rectangle which tracks the mouse position and test the performance of
the drawing.
2026-03-29 14:38:43 +02:00
csd4ni3l
aa5cd85b48 Add a kernel crash function, add a timer using the timer interrupt and
set PIT interval to 1000hz, use a vector inside Framebuffer, remove
without_interrupts from the framebuffer and serial console, move to
usize on primitives, add date at boot and turn on multithreading, add a
boot animation and add a test_performance function with the new timer
2026-03-28 21:03:13 +01:00
csd4ni3l
4a3c1c9ced Add a linked list allocator for heap that can now do 256 mib due to
frame allocator optimizations, make a basic init function in arch that
will initialize everything for a given arch. Add tests in kmain for
alloc, and add a Locked struct used for static mutables and the linked
list.
2026-03-28 15:06:16 +01:00
csd4ni3l
269d900d97 Add interrupts and IDT and react to double, page, general prot faults
and breakpoints, add keyboard support through the keyboar interrupt, add
paging memory management and a Frame Allocator, add a generic arch
module that initializes arch-specific things, fix framebuffer and
serialconsole being accessed from multiple places, move serial to driver
since its not actually a serial console.
2026-03-24 13:48:31 +01:00
csd4ni3l
e28b898d79 Formatted the code, made the arch code x86_64 only for now, fixed the
serial writer always centering and assuming, added a margin for correct
displaying. Added the IDT and GDT tables, and the TSS so double faults
cant happen. Handled all of these interrupts using functions. Serial
console is now topleft and panic messages are formatted correctly from
there. core PI constant is now used instead of our own.
2026-03-23 18:29:33 +01:00
csd4ni3l
8701b83f57 Use white instead of black for serial console text, add print macros 2026-03-14 16:51:39 +01:00
csd4ni3l
7a938283f7 Move to single arch, add serial console, font rendering, panic handling, move graphics to multiple files, use a global mutex framebuffer & serialconsole 2026-03-14 16:40:23 +01:00
csd4ni3l
8308a7ae32 Make a new layout for the OS, rebrand to XunilOS 2026-03-14 11:33:01 +01:00
csd4ni3l
eeb1c6c701 Add qemu auto-run to makefile, separate utils into a directory, add graphics support with rectangles, circles and triangles, double buffering (kind of) , and make example shapes on startup with an orange background. 2026-03-13 23:00:27 +01:00
csd4ni3l
b80e6735cd Build upon the limine Rust template and a working pipeline, display an orange background on load. 2026-03-13 18:57:56 +01:00
1da63e1d62 Initial commit 2026-03-09 19:04:38 +01:00