Compare commits

..
Author SHA1 Message Date
t3hn3rd aac376fa22 progress: ImGui Port - Desktop UI + ImGui rendering performance overhaul
Full ImGui desktop environment (desktop.pas):
- Gradient wallpaper, taskbar with clock, start menu
- Desktop icons with click-to-open
- Windowed apps: System Info, Terminal, File Browser, Task Manager
- Terminal dispatches to registered kernel commands with output capture

Performance: Software rasterizer rewrite (imgui.pas, imgbridge.c)
- Quad detection: merge consecutive triangle pairs into fast rect fills
- 3 new fast-path rect fillers (solid/gradient/textured) using REP STOSD
  and 16.16 fixed-point integer inner loops
- Triangle rasterizer rewritten with fixed-point edge functions
- Back-buffer clear: DrawPixel loop -> REP STOSD (~200x faster)
- Render stat debug counters added

ISR-safe input buffering (imgbridge.c)
- Keyboard/mouse events buffered in lock-free ring buffers from ISR context
- Drained once per frame from main loop to prevent data races

Other changes:
- imguitypes.pas: InputTextFlags renumbered for cimgui 1.91+
- video.pas: backBufferLocation getter added
- kernel.pas: VFS init moved earlier, main loop uses desktop_frame,
  mouse hook uses ISR-safe buffering
- lmemorymanager.pas: kalloc/kfree exported with public aliases for C linkage
- scheduler.pas: Root_Task moved to interface for desktop task manager
- terminal.pas: freeParams exposed in interface
2026-02-25 23:28:12 +00:00
t3hn3rd 51a29244ed Imgui initial changes & shim (Claude Opus 4.6)
Can now draw ImGui demo.
2026-02-22 21:06:59 +00:00
260 changed files with 18234 additions and 102748 deletions
+4 -18
View File
@@ -22,9 +22,9 @@ steps:
commands: commands:
- git fetch --tags - git fetch --tags
- find . -type f -print0 | xargs -0 dos2unix - find . -type f -print0 | xargs -0 dos2unix
- chmod +x /drone/src/toolchain/*.sh - chmod +x /drone/src/*.sh
- /drone/src/toolchain/compile.sh - /drone/src/compile.sh
- name: upload-iso-artifact - name: upload-iso-artifact
image: alpine/git image: alpine/git
depends_on: depends_on:
@@ -49,18 +49,4 @@ steps:
-H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found." -H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found."
- | - |
curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \ curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso" -H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"
- name: msg status
image: appleboy/drone-discord
failure: ignore
depends_on:
- compile
when:
status: [success, failure, changed]
settings:
webhook_id:
from_secret: discord_webhook_id
webhook_token:
from_secret: discord_webhook_secret
message: "**Asuro Build**\n\n{{#success build.status}}✅ Build successful!\n\n{{else}}❌ Build failed!\n\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}}`\nAuthor: `{{commit.author}} <{{commit.email}}>`\n\nGitea Diff: [Link](<{{commit.link}}>)\nDrone Build: [Link](<{{build.link}}>)\n\nMessage: {{commit.message}}"
+1 -8
View File
@@ -1,8 +1 @@
* text=auto eol=lf * text=auto eol=lf
lvglh/** linguist-vendored
lvgl/** linguist-vendored
.vscode/* linguist-vendored
lib/* linguist-generated
release/* linguist-generated
iso/* linguist-generated
*.asm linguist-detectable
-8
View File
@@ -11,11 +11,3 @@
/*.img /*.img
src/include/asuro.pas src/include/asuro.pas
localenv.json localenv.json
/lvgl/
dockerout.txt
AGENTS.md
lessons_learnt.md
*.log
/doc/*.md
wasuro
src/core/core.version.pas
-13
View File
@@ -1,13 +0,0 @@
# Map all Aaron identities to a single preferred identity
Aaron Hance <[email protected]> aaron <aaron@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c>
Aaron Hance <[email protected]> aaronhance <[email protected]>
Aaron Hance <[email protected]> aaron hance <[email protected]>
Aaron Hance <[email protected]> Aaron <[email protected]>
# Map all Kieron identities to a single preferred identity
Kieron Morris <[email protected]> kieron <kieron@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c>
Kieron Morris <[email protected]> Kieron <[email protected]>
Kieron Morris <[email protected]> t3hn3rd <[email protected]>
# Map goose's multiple identities
goose <goose@6dbc8c32-bb84-406f-8558-d1cf31a0ab0c> goose <[email protected]>
+7 -3
View File
@@ -5,18 +5,22 @@ VOLUME ["/code"]
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386 RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl dos2unix wget git make nasm binutils xorriso grub-pc-bin gcc gcc-multilib && \ curl dos2unix wget git make nasm binutils xorriso grub-pc-bin \
gcc-multilib g++-multilib && \
apt-get clean my room apt-get clean my room
RUN git clone --depth=1 --recurse-submodules https://github.com/cimgui/cimgui.git /cimgui
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
ARG FPC_VERSION=3.2.2 ARG FPC_VERSION=2.6.4
RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSION/fpc-$FPC_VERSION.i386-linux.tar/download | tar -xf - && \ RUN curl -sL https://sourceforge.net/projects/freepascal/files/Linux/$FPC_VERSION/fpc-$FPC_VERSION.i386-linux.tar/download | tar -xf - && \
pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \ pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \
rm -rf fpc-$FPC_VERSION.i386-linux rm -rf fpc-$FPC_VERSION.i386-linux
COPY compile.sh /compile.sh
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
RUN chmod +x /usr/bin/semver RUN chmod +x /usr/bin/semver
WORKDIR /code WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "-c"] ENTRYPOINT ["/bin/bash", "-c"]
CMD ["find toolchain -name '*.sh' -exec dos2unix {} + 2>/dev/null; find toolchain -name '*.sh' -exec chmod +x {} +; bash toolchain/compile.sh"] CMD ["/compile.sh"]
-75
View File
@@ -1,75 +0,0 @@
{ Compatibility shim: wasuro references the old unit name 'lmemorymanager'.
Since wasuro/ cannot be modified, this unit re-exports the public API of
memory.heap so that 'uses lmemorymanager' continues to compile. }
unit lmemorymanager;
interface
uses
memory.heap;
const
ALLOC_UNIT = memory.heap.ALLOC_UNIT;
DATA_OFFSET = memory.heap.DATA_OFFSET;
PAGE_SIZE_LMM = memory.heap.PAGE_SIZE_LMM;
TOTAL_UNITS = memory.heap.TOTAL_UNITS;
BITMAP_DWORDS = memory.heap.BITMAP_DWORDS;
SIZE_PREFIX = memory.heap.SIZE_PREFIX;
LARGE_ALLOC_MAGIC = memory.heap.LARGE_ALLOC_MAGIC;
type
PHeapPageHeader = memory.heap.PHeapPageHeader;
THeapPageHeader = memory.heap.THeapPageHeader;
procedure init;
function kalloc(size : uint32) : void;
function klalloc(size : uint32) : void;
procedure klfree(address : uint32);
function kpalloc(address : uint32) : void;
procedure kfree(area : void);
function lmm_total_free : uint32;
function lmm_page_count : uint32;
implementation
procedure init;
begin
memory.heap.init;
end;
function kalloc(size : uint32) : void; inline;
begin
kalloc := memory.heap.kalloc(size);
end;
function klalloc(size : uint32) : void; inline;
begin
klalloc := memory.heap.klalloc(size);
end;
procedure klfree(address : uint32); inline;
begin
memory.heap.klfree(address);
end;
function kpalloc(address : uint32) : void; inline;
begin
kpalloc := memory.heap.kpalloc(address);
end;
procedure kfree(area : void); inline;
begin
memory.heap.kfree(area);
end;
function lmm_total_free : uint32; inline;
begin
lmm_total_free := memory.heap.lmm_total_free;
end;
function lmm_page_count : uint32; inline;
begin
lmm_page_count := memory.heap.lmm_page_count;
end;
end.
-7
View File
@@ -1,7 +0,0 @@
unit types;
interface
implementation
end.
+5 -8
View File
@@ -7,7 +7,7 @@ echo "Asuro Compilation"
echo " " echo " "
#Compile Stub.asm #Compile Stub.asm
rm -f lib/* rm lib/*
runOrFail() { runOrFail() {
local binary=$1 local binary=$1
@@ -20,13 +20,10 @@ runOrFail() {
fi fi
} }
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
declare -a run_steps=( declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!" "compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile" "compile_vergen.sh" "Versions failed to compile"
"compile_lvgl.sh" "Failed to compile LVGL!" "compile_imgui.sh" "Failed to compile ImGui!"
"compile_wasuro.sh" "Failed to pull Wasuro!"
"compile_sources.sh" "Failed to compile FPC Sources!" "compile_sources.sh" "Failed to compile FPC Sources!"
"compile_link.sh" "Failed linking!" "compile_link.sh" "Failed linking!"
"compile_isogen.sh" "Failed to create ISO!" "compile_isogen.sh" "Failed to create ISO!"
@@ -36,7 +33,7 @@ for ((i=0; i<${#run_steps[@]}; i+=2))
do do
if [ "$ERRCOUNT" -eq "0" ] if [ "$ERRCOUNT" -eq "0" ]
then then
script="${TOOLCHAIN_DIR}/${run_steps[$i]}" script=$(pwd)/"${run_steps[$i]}"
message="${run_steps[$i+1]}" message="${run_steps[$i+1]}"
runOrFail "$script" "$message" runOrFail "$script" "$message"
fi fi
@@ -45,9 +42,9 @@ done
#Call generate final artifacts based on failure or success of the above. #Call generate final artifacts based on failure or success of the above.
if [ "$ERRCOUNT" -ne "0" ] if [ "$ERRCOUNT" -ne "0" ]
then then
. "${TOOLCHAIN_DIR}/compile_finish.sh" "failed" . ./compile_finish.sh "failed"
else else
. "${TOOLCHAIN_DIR}/compile_finish.sh" "success" . ./compile_finish.sh "success"
fi fi
cd .. cd ..
+90
View File
@@ -0,0 +1,90 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling ImGui (cimgui)..."
echo " "
IMGUI_DIR=/cimgui
IMGUI_SRC=$IMGUI_DIR/imgui
BRIDGE_SRC=src/driver/video/imgui
# Flags shared by all C/C++ compilation units:
# -m32 -> i386 target
# -ffreestanding -> no implicit stdlib inclusion
# -fno-builtin -> don't inline memcpy/memset/etc. so our stubs are used
# -O2 -> optimise for speed
# -ffunction-sections -fdata-sections -> allow --gc-sections in linker
C_FLAGS="-m32 -ffreestanding -fno-builtin -O2 -ffunction-sections -fdata-sections"
# Extra flags for C++ translation units (cimgui/imgui sources):
# -fno-exceptions -> no stack-unwinding machinery
# -fno-rtti -> no typeinfo / dynamic_cast
# -fno-use-cxa-atexit -> don't emit __cxa_atexit calls for static dtors
# -fno-threadsafe-statics -> no guard-variable emission for local statics
# NOTE: *not* -ffreestanding / -fno-builtin here — imgui includes <cmath> and
# other hosted headers that refuse to compile in freestanding mode.
# The object files are archived into a static lib and linked freestanding;
# any hosted-stdlib calls (malloc/free/sin/cos/…) resolve to crtshim.c.
CPP_FLAGS="-m32 -O2 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -fno-stack-protector -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0 -DNDEBUG -DIMGUI_ENABLE_STB_TRUETYPE"
INCLUDE="-I$IMGUI_DIR -I$IMGUI_SRC"
echo "Compiling C runtime shim..."
gcc $C_FLAGS $INCLUDE \
-c $BRIDGE_SRC/crtshim.c \
-o lib/imgui_crtshim.o || { echo "Failed: crtshim.c"; exit 1; }
echo "Compiling render bridge..."
# imgbridge is compiled as C++ so it sees cimgui.h function declarations
# (C++ mode is required; the .c extension is overridden with -x c++)
g++ $CPP_FLAGS $INCLUDE \
-x c++ \
-DCIMGUI_DEFINE_ENUMS_AND_STRUCTS \
-c $BRIDGE_SRC/imgbridge.c \
-o lib/imgui_bridge.o || { echo "Failed: imgbridge.c"; exit 1; }
echo "Compiling cimgui wrapper..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_DIR/cimgui.cpp \
-o lib/imgui_cimgui.o || { echo "Failed: cimgui.cpp"; exit 1; }
echo "Compiling imgui core..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_SRC/imgui.cpp \
-o lib/imgui_core.o || { echo "Failed: imgui.cpp"; exit 1; }
echo "Compiling imgui draw..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_SRC/imgui_draw.cpp \
-o lib/imgui_draw.o || { echo "Failed: imgui_draw.cpp"; exit 1; }
echo "Compiling imgui tables..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_SRC/imgui_tables.cpp \
-o lib/imgui_tables.o || { echo "Failed: imgui_tables.cpp"; exit 1; }
echo "Compiling imgui widgets..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_SRC/imgui_widgets.cpp \
-o lib/imgui_widgets.o || { echo "Failed: imgui_widgets.cpp"; exit 1; }
echo "Compiling imgui demo..."
g++ $CPP_FLAGS $INCLUDE \
-c $IMGUI_SRC/imgui_demo.cpp \
-o lib/imgui_demo.o || { echo "Failed: imgui_demo.cpp"; exit 1; }
echo "Archiving cimgui.a..."
# NOTE: imgui_bridge.o and imgui_crtshim.o are NOT in the archive because
# compile_link.sh already picks them up individually via find lib/ -name "*.o".
# Including them here would cause duplicate symbol errors.
ar rcs lib/cimgui.a \
lib/imgui_cimgui.o \
lib/imgui_core.o \
lib/imgui_draw.o \
lib/imgui_tables.o \
lib/imgui_widgets.o \
lib/imgui_demo.o || { echo "Failed: ar"; exit 1; }
echo "ImGui compiled successfully."
exit 0
@@ -14,9 +14,6 @@ done;
objstring=lib/stub.o" "$objstring objstring=lib/stub.o" "$objstring
echo "Object Files: "$objstring echo "Object Files: "$objstring
echo " " echo " "
# Find libgcc for i386 (needed by LVGL compiled with gcc)
LIBGCC=$(gcc -m32 -print-libgcc-file-name) LIBGCC=$(gcc -m32 -print-libgcc-file-name)
echo "libgcc: ${LIBGCC}" ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring \
--start-group lib/cimgui.a $LIBGCC --end-group
ld -m elf_i386 -s --gc-sections -Ttoolchain/linker.script -o bin/kernel.bin $objstring --start-group lib/liblvgl.a ${LIBGCC} --end-group
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -gw -g -gl -n -vlewn -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/video/* -Fusrc/driver/video/imgui/* src/kernel.pas
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling Stub..."
echo " "
nasm -f elf src/stub/stub.asm -o lib/stub.o
@@ -1,15 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -e set -e
TOOLCHAIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo " " echo " "
echo "=======================" echo "======================="
echo " " echo " "
echo "Generating Versioning Info..." echo "Generating Versioning Info..."
echo " " echo " "
chmod +x "${TOOLCHAIN_DIR}/compile_checksum.sh" chmod +x ./compile_checksum.sh
"${TOOLCHAIN_DIR}/compile_checksum.sh" ./compile_checksum.sh
outfile="src/core/core.version.pas" outfile="src/include/asuro.pas"
file="toolchain/version" file="version"
{ {
# this script requires semver tool # this script requires semver tool
wget -q https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver -O bin/semver && chmod +x bin/semver wget -q https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver -O bin/semver && chmod +x bin/semver
@@ -23,7 +22,7 @@ sub=$(semver get patch $tagref)
version=$(semver get release $tagref) version=$(semver get release $tagref)
release=$(semver get prerel $tagref) release=$(semver get prerel $tagref)
build=$(semver get build $tagref) build=$(semver get build $tagref)
linecount=$("${TOOLCHAIN_DIR}/loc.sh" | awk '{print $1}') linecount=$(./loc.sh | awk '{print $1}')
sourcecount=$(find src -type f | wc -l) sourcecount=$(find src -type f | wc -l)
drivercount=$(find src/driver -type f | wc -l) drivercount=$(find src/driver -type f | wc -l)
fpcversion=$(fpc -h | grep -m 1 version | awk '{print $5}') fpcversion=$(fpc -h | grep -m 1 version | awk '{print $5}')
@@ -35,7 +34,7 @@ checksum=$(md5sum checksums.md5 | awk '{print $1}')
[[ -n "$release" ]] && version="$version-$release" [[ -n "$release" ]] && version="$version-$release"
cat > $outfile <<EOF cat > $outfile <<EOF
unit core.version; unit asuro;
interface interface
View File

Some files were not shown because too many files have changed in this diff Show More