Commit Graph

59 Commits

Author SHA1 Message Date
csd4ni3l 00fdcc1f1a Update doomgeneric submodule to fix github action issues commit-00fdcc1f1a22eef0c93bebbf841928a96c25348f 2026-06-01 00:30:02 +02:00
csd4ni3l 3c0966f22d Update helloworld makefile to use better CC handling 2026-06-01 00:26:51 +02:00
csd4ni3l a36b9c64a7 Fix x86_64 specific packages being installed instead of default gcc and
binutils
2026-06-01 00:24:03 +02:00
csd4ni3l cc51445424 Do not add arm64 architecture to dpkg in github action 2026-06-01 00:21:11 +02:00
csd4ni3l 880c589950 fix aarch64 compile by specifying sysroot, revert no cross-building,
always install cross-build deps
2026-06-01 00:19:14 +02:00
csd4ni3l 4b85a7c8c3 Add mold for faster linking 2026-06-01 00:07:38 +02:00
csd4ni3l c2877f9451 Turns out badapple wasn't added to the repo, also update README for
SPECIFIC running instructions
2026-06-01 00:06:57 +02:00
csd4ni3l fafb040a22 Add back accidentally removed ccache 2026-05-31 23:58:56 +02:00
csd4ni3l d48e9f6069 Update build script to create assets directory and only install what is
needed for both arches
2026-05-31 23:57:25 +02:00
csd4ni3l e5da29ab1d add ccache install to github action 2026-05-31 23:48:54 +02:00
csd4ni3l 38a8c18910 Checkout repository with submodules: recursive 2026-05-31 23:47:19 +02:00
csd4ni3l 991d28688d Fix build deps in github action 2026-05-31 23:43:04 +02:00
csd4ni3l 43ec0e97df Add a proper VFS in a struct which now lives on the heap with no hacky
static lifetimes, move cursor.bmp to image assets and add wallpapers,
and a logo, add Github Action that auto-releases, add build_all script
which just builds without running
2026-05-31 23:41:02 +02:00
csd4ni3l f943cf5426 Increase kernel heap size to fit more ELFs, improve scheduler by
removing O(n) operations (ready and sleep queues now), caching timer
ticks per irq on init_interrupts aarch64, only saving context when
switching, add kill syscall and use it for exit, only push input to
init, fix accidental REL_X events drop with virtio, fix the possibility
of not having a process to switch to by either staying, switching or
idling, improve scheduler by removing double locking and splitting code
to multiple functions, do not switch every IRQ but only 100 IRQs,
improve rust app building, move x86_64 kernel fb so it doesn't hit heap,
update submodules
2026-05-30 19:10:26 +02:00
csd4ni3l 6b4b53729b Add shell as a submodule, didnt work in previous commit 2026-05-28 18:52:07 +02:00
csd4ni3l 5f4154bd24 Remove unused imports, merge ps2 and virtio to both use linux input
events and move parsing code to libxunil, and add mouse support again by
using them, remove unneeded graphics and console output code, merge
build files to a rust app builder, make framebuffer a driver and remove
the graphics folder, add shell as an app in VFS
2026-05-28 18:51:03 +02:00
csd4ni3l 6ebc6ada09 Increase kernel stack size to 2mb, move from cooperative to timer
preemption based scheduling, add correct save_lock on aarch64, add
simple IPC (read, write, manage), and simple and unsecure SHM, add
per-process kernel stacks, add copy_cstr_to_user, always use run_next
for aarch64, remove primitives from the kernel
2026-05-26 09:53:59 +02:00
csd4ni3l 7070b53355 Remove unneccessary debug, increase kernel heap to 64mb, add a global
build_and_run script, fix build.rs sometimes using the wrong
architecture, add badapple ELF and change default font size to 1 for it
to work, improve framebuffer errors, remove unnecessary commands from
make and improve debug filtering
2026-05-23 17:28:21 +02:00
csd4ni3l f90d29340a remove unnecessary debug print 2026-05-22 22:21:10 +02:00
csd4ni3l 56c5da0742 Improve aarch64 support by building everything for both archictectures,
remove incorrect timer frequency set, fix interrupt handler not
restoring stack ptr, handle both user and kernel aborts, remove aarch64
ps2 support, fix ELF code mapped as code making it unwritable, add
assets.rs to handle both arches automatically, make PS2 x86_64
compatible with linux keycodes, always try printing kernel panic to
serial
2026-05-22 22:18:42 +02:00
csd4ni3l 1205d8ce7a Add virtio driver for aarch64 with only input for now, move keyboard,
mouse and other io logic to an io folder, make ps2 convert to linux
event codes like virtio, force modern mmio and gic version 2 on aarch64
2026-05-17 20:32:42 +02:00
csd4ni3l 5efbef1712 Don't run setup_kmi on aarch64 since it doesnt work 2026-05-16 23:44:10 +02:00
csd4ni3l 2a73c3aeb4 Add a config.mk file where global variables can be modified, add aarch64
interrupts with IRQ and syscalls, make phys_to_virt checked, recreate
stack on aarch64, make serial console finally line wrap and have max
height correctly, add U64Buf for when i need number debug, rename mouse
and keyboard files to kmi and merge them, add non-working pl050 support
2026-05-16 23:43:13 +02:00
csd4ni3l 812d4cf6d4 Patched everything for aarch64, aside from scheduler, add more linker
points to aarch64 ld, add aarch64 heap, init, page tables and usermode,
make hhdm_offset a global atomic, aarch64 uses semihosting for output,
add generic PageTable type, add a function that creates and maps pages,
use allow to remove warnings, add a bufwriter so kernel panic always
works
2026-05-16 00:30:01 +02:00
csd4ni3l 17f2a3c7e4 Update template to newest version which fixes edk2, make aarch64 compile
(nothing yet) by stubbing lots of functions and modules, make the frame
allocator and heap multiarch, make kernel panic print inside of serial
on x86_64
2026-05-14 18:46:17 +02:00
csd4ni3l 85e0d45d3c Add correct framebuffer mapping, so Doom works again, remove unneded
code, add cooperative scheduling on syscalls determined by the
reschedule flag, make serial console automatically clear and be a single
render, make process_scancodes push to all processes, add a user-facing
framebuffer to be mapped, automatically swap buffers inside timer
interrupt, update all submodules
2026-05-11 19:09:20 +02:00
csd4ni3l 925b2bc8d2 Add a proper vfs driver into the kernel which handles file operations,
fix munmap number, remove the draw calls, make address space an option,
copy only the top 256 bytes of the HHDM and map the ELF code inside
userspace, add safe copying from userspace
2026-05-09 11:36:48 +02:00
csd4ni3l 674d68cdc5 Fix kmain including userspace_stub which doesnt exist anymore 2026-05-08 11:33:31 +02:00
csd4ni3l 4bd55e6cbb Add xunil-init as a submodule 2026-05-07 20:33:54 +02:00
csd4ni3l 7f27952167 Fix relocation issue where an invalid dyn_hdr was loaded, make xunilos
run init at startup, add init build script, delete userspace stub
2026-05-07 19:33:03 +02:00
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