Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
61930ac5b5 | ||
|
|
fc080027b2 | ||
|
|
8b4335768b | ||
|
|
99fd5507ca | ||
|
|
035d489c4f | ||
|
|
5e9d0004d7 |
No files matched your search
+7
-21
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# compile_lvgl.sh — Download LVGL v9.2 source and compile into lib/liblvgl.a
|
# compile_lvgl.sh — Download LVGL v9.2 source and compile into lib/liblvgl.a
|
||||||
# Clone & compile in /tmp (fast container-local fs).
|
# Clone & compile in /tmp (fast container-local fs).
|
||||||
# Cache liblvgl.a on host mount (/code/lvgl/) to skip rebuild.
|
# Copy source + objects to /lvgl (host mount) for debugging.
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
LVGL_VERSION="v9.2.2"
|
LVGL_VERSION="v9.2.2"
|
||||||
@@ -10,7 +10,6 @@ LVGL_DIR="/tmp/lvgl"
|
|||||||
OBJ_DIR="/tmp/lvgl_obj"
|
OBJ_DIR="/tmp/lvgl_obj"
|
||||||
CONF_DIR="$(pwd)/lvglh"
|
CONF_DIR="$(pwd)/lvglh"
|
||||||
OUT_DIR="$(pwd)/lib"
|
OUT_DIR="$(pwd)/lib"
|
||||||
CACHE_DIR="/code/lvgl"
|
|
||||||
|
|
||||||
CC="gcc"
|
CC="gcc"
|
||||||
CFLAGS="-m32 -march=i686 -ffreestanding \
|
CFLAGS="-m32 -march=i686 -ffreestanding \
|
||||||
@@ -27,17 +26,6 @@ echo " "
|
|||||||
echo "Compiling LVGL..."
|
echo "Compiling LVGL..."
|
||||||
echo " "
|
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)
|
# Clone LVGL into /tmp (container-local)
|
||||||
rm -rf "$LVGL_DIR"
|
rm -rf "$LVGL_DIR"
|
||||||
echo "Downloading LVGL ${LVGL_VERSION}..."
|
echo "Downloading LVGL ${LVGL_VERSION}..."
|
||||||
@@ -117,14 +105,12 @@ else
|
|||||||
echo "No custom LVGL files in lvglh/."
|
echo "No custom LVGL files in lvglh/."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cache liblvgl.a and source to host mount for next build
|
# Copy source + objects to /lvgl host mount for debugging
|
||||||
echo "Caching LVGL to host mount..."
|
echo "Copying LVGL source and objects to host mount..."
|
||||||
mkdir -p "$CACHE_DIR"
|
mkdir /code/lvgl 2>/dev/null || true
|
||||||
rm -rf ${CACHE_DIR}/* ${CACHE_DIR}/.[!.]* ${CACHE_DIR}/..?* 2>/dev/null || true
|
rm -rf /code/lvgl/* /code/lvgl/.[!.]* /code/lvgl/..?* 2>/dev/null || true
|
||||||
cp "${OUT_DIR}/liblvgl.a" "${CACHE_DIR}/liblvgl.a"
|
cp -a "$LVGL_DIR/src" /code/lvgl/src
|
||||||
cp -a "$LVGL_DIR/src" "${CACHE_DIR}/src"
|
cp -a "$OBJ_DIR" /code/lvgl/obj
|
||||||
cp -a "$LVGL_DIR"/*.h "${CACHE_DIR}/" 2>/dev/null || true
|
|
||||||
cp -a "$OBJ_DIR" "${CACHE_DIR}/obj"
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
|
||||||
echo " "
|
echo " "
|
||||||
|
|||||||
+1
-1
@@ -4,4 +4,4 @@ echo "======================="
|
|||||||
echo " "
|
echo " "
|
||||||
echo "Compiling FPC Sources..."
|
echo "Compiling FPC Sources..."
|
||||||
echo " "
|
echo " "
|
||||||
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/include/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
|
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
|
||||||
@@ -29,11 +29,14 @@ unit contextswitcher;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
idt, isrmanager, processmanager, proctypes, util, tracer;
|
idt, isrmanager, processmanager, proctypes, util, syslog, tracer;
|
||||||
|
|
||||||
{ Initialise: overwrite IDT gate 32 with our custom ISR. }
|
{ Initialise: overwrite IDT gate 32 with our custom ISR. }
|
||||||
procedure init;
|
procedure init;
|
||||||
|
|
||||||
|
{ No idle ESP variable needed — idle is now a formal process (PID 0)
|
||||||
|
with its SavedESP managed like any other process. }
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
{ -----------------------------------------------------------------------
|
{ -----------------------------------------------------------------------
|
||||||
|
|||||||
@@ -957,14 +957,11 @@ end;
|
|||||||
procedure usb_check_hotplug;
|
procedure usb_check_hotplug;
|
||||||
var
|
var
|
||||||
i : uint32;
|
i : uint32;
|
||||||
count: uint32;
|
|
||||||
hc : PUSBHCDriver;
|
hc : PUSBHCDriver;
|
||||||
port : uint8;
|
port : uint8;
|
||||||
begin
|
begin
|
||||||
if HCList = nil then exit;
|
if HCList = nil then exit;
|
||||||
count := LL_Size(HCList);
|
for i := 0 to LL_Size(HCList) - 1 do begin
|
||||||
if count = 0 then exit;
|
|
||||||
for i := 0 to count - 1 do begin
|
|
||||||
hc := PUSBHCDriver(LL_Get(HCList, i));
|
hc := PUSBHCDriver(LL_Get(HCList, i));
|
||||||
if (hc <> nil) and hc^.PortChangePending then begin
|
if (hc <> nil) and hc^.PortChangePending then begin
|
||||||
hc^.PortChangePending := false;
|
hc^.PortChangePending := false;
|
||||||
|
|||||||
@@ -119,12 +119,8 @@ var
|
|||||||
x32, y32 : sint32;
|
x32, y32 : sint32;
|
||||||
r : pchar;
|
r : pchar;
|
||||||
begin
|
begin
|
||||||
{ mouse_wait(0) checks OBF with a short timeout (100 iterations).
|
|
||||||
When it returns true, data is ready — read it directly with inb($60).
|
|
||||||
Do NOT call mouse_read here: it uses mouse_wait_long (100k iterations)
|
|
||||||
and would spin-block the ISR if the next packet byte hasn't arrived yet. }
|
|
||||||
while mouse_wait(0) do begin
|
while mouse_wait(0) do begin
|
||||||
b := inb($60);
|
b := mouse_read;
|
||||||
if Cycle = 0 then begin
|
if Cycle = 0 then begin
|
||||||
if (b AND $08) = $08 then begin
|
if (b AND $08) = $08 then begin
|
||||||
Mouse_Byte[Cycle] := b;
|
Mouse_Byte[Cycle] := b;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
{
|
{
|
||||||
Driver->Timer->TMR_0_ISR - 8khz Timer Driver.
|
Driver->Timer->TMR_0_ISR - 1024hz Timer Driver.
|
||||||
|
|
||||||
@author(Kieron Morris <[email protected]>)
|
@author(Kieron Morris <[email protected]>)
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ var
|
|||||||
Hooks : Array[1..MAX_HOOKS] of pp_hook_method;
|
Hooks : Array[1..MAX_HOOKS] of pp_hook_method;
|
||||||
Registered : boolean = false;
|
Registered : boolean = false;
|
||||||
|
|
||||||
procedure Main; //IRQ0, ~8001hz
|
procedure Main; //IRQ0, 1024.19hz aprox
|
||||||
var
|
var
|
||||||
i : integer;
|
i : integer;
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ procedure register();
|
|||||||
begin
|
begin
|
||||||
if not registered then begin
|
if not registered then begin
|
||||||
asm
|
asm
|
||||||
mov ax, 149
|
mov ax, 1193
|
||||||
out $40, al
|
out $40, al
|
||||||
mov al, ah
|
mov al, ah
|
||||||
out $40, al
|
out $40, al
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
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,
|
||||||
|
windows,
|
||||||
|
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;
|
||||||
|
windows.reapOrphanedWindows;
|
||||||
|
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.
|
||||||
@@ -365,7 +365,7 @@ begin
|
|||||||
now_tick := lvgl_get_ticks;
|
now_tick := lvgl_get_ticks;
|
||||||
|
|
||||||
if (now_tick - last_tick) >= FPS_INTERVAL then begin
|
if (now_tick - last_tick) >= FPS_INTERVAL then begin
|
||||||
current_fps := safeDiv32(frame_count * 8000, now_tick - last_tick);
|
current_fps := safeDiv32(frame_count * 1000, now_tick - last_tick);
|
||||||
frame_count := 0;
|
frame_count := 0;
|
||||||
last_tick := now_tick;
|
last_tick := now_tick;
|
||||||
|
|
||||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -18,7 +18,7 @@ const
|
|||||||
PROCESS_STACK_SIZE = 8192;
|
PROCESS_STACK_SIZE = 8192;
|
||||||
|
|
||||||
{ Base quantum multiplier: quantum = Priority * BASE_QUANTUM ticks }
|
{ Base quantum multiplier: quantum = Priority * BASE_QUANTUM ticks }
|
||||||
BASE_QUANTUM = 5;
|
BASE_QUANTUM = 8;
|
||||||
|
|
||||||
type
|
type
|
||||||
{ Forward declaration }
|
{ Forward declaration }
|
||||||
|
|||||||
Loaded 20 of 26 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user