Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f427b7bcc7 | ||
|
|
4ba3c5b524 | ||
|
|
7180ad39d8 | ||
|
|
6c7bcc1911 | ||
|
|
e09c9b5595 | ||
|
|
9476bb0c8a | ||
|
|
8f7db8507b | ||
|
|
188b1aebb0 | ||
|
|
452203b7b4 | ||
|
|
76c419336e | ||
|
|
2ad0ae8420 | ||
|
|
c0c199bfe6 | ||
|
|
7ec3bcb9b9 | ||
|
|
4bd0a2dfbf | ||
|
|
431e5bc8f4 | ||
|
|
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 " "
|
||||
+1
-1
@@ -4,4 +4,4 @@ echo "======================="
|
||||
echo " "
|
||||
echo "Compiling FPC Sources..."
|
||||
echo " "
|
||||
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
|
||||
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
|
||||
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
+10
-19
@@ -67,29 +67,13 @@ uses
|
||||
hashmap, vfs,
|
||||
video, vesa, doublebuffer, color, lvgl, desktop, uidebug,
|
||||
vterminal,
|
||||
graphicsrefresh, usbhotplug;
|
||||
graphicsrefresh, usbhotplug,
|
||||
fifo, cfifo, cfifols, lifo, circ, minh, maxh, prio;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||
|
||||
implementation
|
||||
|
||||
procedure terminal_command_meminfo(params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
|
||||
begin
|
||||
push_trace('kernel.terminal_command_meminfo');
|
||||
|
||||
stdio.bufWriteStr(stdout_buf, 'Lower Memory = ');
|
||||
stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_lower);
|
||||
stdio.bufWriteStrLn(stdout_buf, 'KB');
|
||||
stdio.bufWriteStr(stdout_buf, 'Higher Memory = ');
|
||||
stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_upper);
|
||||
stdio.bufWriteStrLn(stdout_buf, 'KB');
|
||||
stdio.bufWriteStr(stdout_buf, 'Total Memory = ');
|
||||
stdio.bufWriteInt(stdout_buf, ((multibootinfo^.mem_upper + 1000) div 1024) + 1);
|
||||
stdio.bufWriteStrLn(stdout_buf, 'MB');
|
||||
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
procedure terminal_command_bsod(params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
|
||||
begin
|
||||
push_trace('kernel.terminal_command_bsod');
|
||||
@@ -182,7 +166,6 @@ begin
|
||||
|
||||
{ Stdio Init }
|
||||
stdio.init();
|
||||
stdio.registerCommand('MEMINFO', @terminal_command_meminfo, 'Print Simple Memory Information.');
|
||||
stdio.registerCommand('BSOD', @terminal_command_bsod, 'Force a Panic Screen.');
|
||||
|
||||
tss.init();
|
||||
@@ -271,6 +254,14 @@ begin
|
||||
usbhub.UnitTest;
|
||||
usb_keyboard.UnitTest;
|
||||
usb_mouse.UnitTest;
|
||||
fifo.UnitTest;
|
||||
cfifo.UnitTest;
|
||||
cfifols.UnitTest;
|
||||
lifo.UnitTest;
|
||||
circ.UnitTest;
|
||||
minh.UnitTest;
|
||||
maxh.UnitTest;
|
||||
prio.UnitTest;
|
||||
|
||||
{ Register timer-driven tasks }
|
||||
graphicsrefresh.init;
|
||||
|
||||
+520
-165
File diff suppressed because it is too large
Load Diff
+251
-111
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
// Copyright 2021 Kieron Morris
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
{
|
||||
Prog->meminfo - Print memory statistics (PMM / LMM).
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit meminfo;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
stdio, multiboot, pmemorymanager, lmemorymanager, tracer;
|
||||
|
||||
procedure init();
|
||||
|
||||
implementation
|
||||
|
||||
procedure run(Params : PParamList; stdin_buf, stdout_buf, stderr_buf : POutBuf);
|
||||
var
|
||||
pmm_total, pmm_free, pmm_used : uint32;
|
||||
lmm_pages, lmm_free : uint32;
|
||||
begin
|
||||
{ Multiboot memory info }
|
||||
stdio.bufWriteStrLn(stdout_buf, '--- Multiboot ---');
|
||||
stdio.bufWriteStr(stdout_buf, 'Lower Memory : ');
|
||||
stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_lower);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' KB');
|
||||
stdio.bufWriteStr(stdout_buf, 'Upper Memory : ');
|
||||
stdio.bufWriteInt(stdout_buf, multibootinfo^.mem_upper);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' KB');
|
||||
stdio.bufWriteStr(stdout_buf, 'Total Memory : ');
|
||||
stdio.bufWriteInt(stdout_buf, ((multibootinfo^.mem_upper + 1000) div 1024) + 1);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' MB');
|
||||
|
||||
{ PMM stats }
|
||||
stdio.bufWriteStrLn(stdout_buf, '--- PMM (4 MB blocks) ---');
|
||||
pmm_total := pmemorymanager.pmm_total_blocks;
|
||||
pmm_free := pmemorymanager.pmm_free_blocks;
|
||||
pmm_used := pmm_total - pmm_free;
|
||||
stdio.bufWriteStr(stdout_buf, 'Total Blocks : ');
|
||||
stdio.bufWriteIntLn(stdout_buf, pmm_total);
|
||||
stdio.bufWriteStr(stdout_buf, 'Free Blocks : ');
|
||||
stdio.bufWriteIntLn(stdout_buf, pmm_free);
|
||||
stdio.bufWriteStr(stdout_buf, 'Used Blocks : ');
|
||||
stdio.bufWriteIntLn(stdout_buf, pmm_used);
|
||||
stdio.bufWriteStr(stdout_buf, 'Free Physical : ');
|
||||
stdio.bufWriteInt(stdout_buf, pmm_free * 4);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' MB');
|
||||
|
||||
{ LMM heap stats }
|
||||
stdio.bufWriteStrLn(stdout_buf, '--- LMM (Heap) ---');
|
||||
lmm_pages := lmemorymanager.lmm_page_count;
|
||||
lmm_free := lmemorymanager.lmm_total_free;
|
||||
stdio.bufWriteStr(stdout_buf, 'Heap Pages : ');
|
||||
stdio.bufWriteIntLn(stdout_buf, lmm_pages);
|
||||
stdio.bufWriteStr(stdout_buf, 'Heap Size : ');
|
||||
stdio.bufWriteInt(stdout_buf, lmm_pages * 4);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' MB');
|
||||
stdio.bufWriteStr(stdout_buf, 'Heap Free : ');
|
||||
stdio.bufWriteInt(stdout_buf, lmm_free div 1024);
|
||||
stdio.bufWriteStrLn(stdout_buf, ' KB');
|
||||
end;
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
tracer.push_trace('meminfo.init');
|
||||
stdio.registerCommand('MEMINFO', @Run, 'Print memory statistics (PMM/LMM).');
|
||||
end;
|
||||
|
||||
end.
|
||||
+2
-1
@@ -24,7 +24,7 @@ interface
|
||||
uses
|
||||
tracer,
|
||||
//progs
|
||||
base64_prog, md5sum, dhclient, vbeinfo;
|
||||
base64_prog, md5sum, dhclient, vbeinfo, meminfo;
|
||||
|
||||
{ Initialize all baked-in programs }
|
||||
procedure init();
|
||||
@@ -40,6 +40,7 @@ begin
|
||||
tracer.push_trace('progmanager.dhclient.init');
|
||||
dhclient.init();
|
||||
vbeinfo.init();
|
||||
meminfo.init();
|
||||
end;
|
||||
|
||||
end.
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user