Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
188b1aebb0 | ||
|
|
452203b7b4 | ||
|
|
76c419336e | ||
|
|
2ad0ae8420 | ||
|
|
c0c199bfe6 | ||
|
|
7ec3bcb9b9 | ||
|
|
4bd0a2dfbf | ||
|
|
431e5bc8f4 | ||
|
|
8169d93a9c | ||
|
|
983d9a428d |
+8
-1
@@ -1 +1,8 @@
|
||||
* 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
|
||||
@@ -15,3 +15,4 @@ localenv.json
|
||||
dockerout.txt
|
||||
AGENTS.md
|
||||
*.log
|
||||
/doc/*.md
|
||||
+22
-8
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# compile_lvgl.sh — Download LVGL v9.2 source and compile into lib/liblvgl.a
|
||||
# Clone & compile in /tmp (fast container-local fs).
|
||||
# Copy source + objects to /lvgl (host mount) for debugging.
|
||||
# Cache liblvgl.a on host mount (/code/lvgl/) to skip rebuild.
|
||||
set -e
|
||||
|
||||
LVGL_VERSION="v9.2.2"
|
||||
@@ -10,6 +10,7 @@ LVGL_DIR="/tmp/lvgl"
|
||||
OBJ_DIR="/tmp/lvgl_obj"
|
||||
CONF_DIR="$(pwd)/lvglh"
|
||||
OUT_DIR="$(pwd)/lib"
|
||||
CACHE_DIR="/code/lvgl"
|
||||
|
||||
CC="gcc"
|
||||
CFLAGS="-m32 -march=i686 -ffreestanding \
|
||||
@@ -26,6 +27,17 @@ echo " "
|
||||
echo "Compiling LVGL..."
|
||||
echo " "
|
||||
|
||||
# If cached liblvgl.a exists on host mount, just copy it and skip everything
|
||||
if [ -f "${CACHE_DIR}/liblvgl.a" ]; then
|
||||
echo "Found cached liblvgl.a in ${CACHE_DIR}, copying to ${OUT_DIR}..."
|
||||
cp "${CACHE_DIR}/liblvgl.a" "${OUT_DIR}/liblvgl.a"
|
||||
echo "(Delete lvgl/liblvgl.a to force a full rebuild.)"
|
||||
echo " "
|
||||
echo "LVGL compilation complete (cached)."
|
||||
echo " "
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Clone LVGL into /tmp (container-local)
|
||||
rm -rf "$LVGL_DIR"
|
||||
echo "Downloading LVGL ${LVGL_VERSION}..."
|
||||
@@ -105,14 +117,16 @@ else
|
||||
echo "No custom LVGL files in lvglh/."
|
||||
fi
|
||||
|
||||
# Copy source + objects to /lvgl host mount for debugging
|
||||
echo "Copying LVGL source and objects to host mount..."
|
||||
mkdir /code/lvgl 2>/dev/null || true
|
||||
rm -rf /code/lvgl/* /code/lvgl/.[!.]* /code/lvgl/..?* 2>/dev/null || true
|
||||
cp -a "$LVGL_DIR/src" /code/lvgl/src
|
||||
cp -a "$OBJ_DIR" /code/lvgl/obj
|
||||
# Cache liblvgl.a and source to host mount for next build
|
||||
echo "Caching LVGL to host mount..."
|
||||
mkdir -p "$CACHE_DIR"
|
||||
rm -rf ${CACHE_DIR}/* ${CACHE_DIR}/.[!.]* ${CACHE_DIR}/..?* 2>/dev/null || true
|
||||
cp "${OUT_DIR}/liblvgl.a" "${CACHE_DIR}/liblvgl.a"
|
||||
cp -a "$LVGL_DIR/src" "${CACHE_DIR}/src"
|
||||
cp -a "$LVGL_DIR"/*.h "${CACHE_DIR}/" 2>/dev/null || true
|
||||
cp -a "$OBJ_DIR" "${CACHE_DIR}/obj"
|
||||
echo "Done."
|
||||
|
||||
echo " "
|
||||
echo "LVGL compilation complete."
|
||||
echo " "
|
||||
echo " "
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
Driver->Timer->GraphicsRefresh - Timer-driven graphics refresh at ~120FPS.
|
||||
|
||||
Hooks into the 1024Hz timer (TMR_0_ISR) and calls the desktop, uidebug,
|
||||
LVGL and video flush routines every ~9 ticks (1024/9 ≈ 113.8 FPS).
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit graphicsrefresh;
|
||||
|
||||
interface
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
util,
|
||||
TMR_0_ISR,
|
||||
desktop,
|
||||
uidebug,
|
||||
lvgl,
|
||||
video,
|
||||
syslog;
|
||||
|
||||
const
|
||||
{ 1024 / 4 ≈ 256 FPS }
|
||||
TICKS_PER_FRAME = 4;
|
||||
|
||||
var
|
||||
TickCounter : uint32;
|
||||
|
||||
procedure on_tick(data : void);
|
||||
begin
|
||||
TickCounter := TickCounter + 1;
|
||||
if TickCounter >= TICKS_PER_FRAME then begin
|
||||
TickCounter := 0;
|
||||
desktop.update;
|
||||
uidebug.update;
|
||||
lvgl_handler;
|
||||
video.Flush;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
TickCounter := 0;
|
||||
TMR_0_ISR.hook(uint32(@on_tick));
|
||||
syslog.logln('GFXREFRESH', 'Hooked into 1024Hz timer (~120 FPS).');
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
Driver->Timer->USBHotplug - Timer-driven USB hotplug polling at ~1Hz.
|
||||
|
||||
Hooks into the 1024Hz timer (TMR_0_ISR) and calls
|
||||
usbcore.usb_check_hotplug every 1024 ticks (approximately once per second).
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit usbhotplug;
|
||||
|
||||
interface
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
uses
|
||||
util,
|
||||
TMR_0_ISR,
|
||||
usbcore,
|
||||
syslog;
|
||||
|
||||
const
|
||||
{ 1024 ticks at 1024Hz ≈ 1 second }
|
||||
TICKS_PER_POLL = 1024;
|
||||
|
||||
var
|
||||
TickCounter : uint32;
|
||||
|
||||
procedure on_tick(data : void);
|
||||
begin
|
||||
TickCounter := TickCounter + 1;
|
||||
if TickCounter >= TICKS_PER_POLL then begin
|
||||
TickCounter := 0;
|
||||
usbcore.usb_check_hotplug;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
begin
|
||||
TickCounter := 0;
|
||||
TMR_0_ISR.hook(uint32(@on_tick));
|
||||
syslog.logln('USBHOTPLUG', 'Hooked into 1024Hz timer (~1Hz polling).');
|
||||
end;
|
||||
|
||||
end.
|
||||
+17
-24
@@ -66,7 +66,8 @@ uses
|
||||
rand,
|
||||
hashmap, vfs,
|
||||
video, vesa, doublebuffer, color, lvgl, desktop, uidebug,
|
||||
vterminal;
|
||||
vterminal,
|
||||
graphicsrefresh, usbhotplug;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||
|
||||
@@ -103,18 +104,14 @@ begin
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
procedure myUserLandFunction;
|
||||
var
|
||||
i : uint32;
|
||||
|
||||
procedure yield();
|
||||
begin
|
||||
i:=0;
|
||||
while true do begin
|
||||
i:=i+1;
|
||||
asm
|
||||
MOV EAX, i
|
||||
end;
|
||||
end;
|
||||
asm
|
||||
sti
|
||||
@idle:
|
||||
hlt
|
||||
jmp @idle
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; [public, alias: 'kmain'];
|
||||
@@ -132,6 +129,7 @@ begin
|
||||
|
||||
{ Syslog Init — right after serial so log hooks work }
|
||||
syslog.init();
|
||||
syslog.writestringln('Booting Asuro...');
|
||||
|
||||
{ Store Multiboot info }
|
||||
multibootinfo:= mbinfo;
|
||||
@@ -140,10 +138,8 @@ begin
|
||||
{ Ensure tracer is frozen }
|
||||
tracer.freeze();
|
||||
|
||||
syslog.writestringln('Booting Asuro...');
|
||||
|
||||
syslog.writestringln('Checking for Multiboot Compliance');
|
||||
{ Check for Multiboot }
|
||||
syslog.writestringln('Checking for Multiboot Compliance');
|
||||
if (multibootmagic <> MULTIBOOT_BOOTLOADER_MAGIC) then begin
|
||||
syslog.logln('KERNEL', 'Multiboot Compliant Boot-Loader Needed!');
|
||||
syslog.logln('KERNEL', 'HALTING.');
|
||||
@@ -276,16 +272,13 @@ begin
|
||||
usb_keyboard.UnitTest;
|
||||
usb_mouse.UnitTest;
|
||||
|
||||
{ Main render loop — USB completions are now interrupt-driven }
|
||||
syslog.logln('KERNEL', 'Entering main render loop.');
|
||||
while true do begin
|
||||
desktop.update;
|
||||
uidebug.update;
|
||||
lvgl_handler;
|
||||
usbcore.usb_check_hotplug;
|
||||
video.Flush();
|
||||
end;
|
||||
{ Register timer-driven tasks }
|
||||
graphicsrefresh.init;
|
||||
usbhotplug.init;
|
||||
|
||||
{ All work is now driven by timer interrupts — idle the CPU }
|
||||
syslog.logln('KERNEL', 'All tasks registered. Halting into idle.');
|
||||
kernel.yield();
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
@@ -190,7 +190,7 @@ begin
|
||||
push_trace('vmemorymanager.vtop');
|
||||
idx:= address SHR 22;
|
||||
paddress:= uint32(KERNEL_PAGE_DIRECTORY^[idx].address) SHL 12;
|
||||
loadd:= address AND $FFFFFF;
|
||||
loadd:= address AND $3FFFFF;
|
||||
vtop:= paddress + loadd;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user