Compare commits
52
Commits
master
..
98a14bc7dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98a14bc7dc | ||
|
|
989e36ffe2 | ||
|
|
ceb03a9d7e | ||
|
|
4ef61b0d3b | ||
|
|
2b071a58c7 | ||
|
|
1145b900e4 | ||
|
|
436cd86d8c | ||
|
|
540444dfbf | ||
|
|
2d7c51ed15 | ||
|
|
c842d9774f | ||
|
|
5963504f6b | ||
|
|
e64a59714a | ||
|
|
dd5d908e43 | ||
|
|
28846af43c | ||
|
|
b1e3953960 | ||
|
|
7e00e23801 | ||
|
|
bd12bbe862 | ||
|
|
48c203f028 | ||
|
|
d859e40e4a | ||
|
|
8be364c990 | ||
|
|
0e2c6b2936 | ||
|
|
632c3fa66b | ||
|
|
875e3e4765 | ||
|
|
dbc5105b9b | ||
|
|
a61289a318 | ||
|
|
e28d68128d | ||
|
|
a9969d58f8 | ||
|
|
d7a54d858d | ||
|
|
4e991c3e6f | ||
|
|
a3217de71a | ||
|
|
19b433a19f | ||
|
|
69d1d22a18 | ||
|
|
5c15343ed0 | ||
|
|
3ae349fbc8 | ||
|
|
78c060c114 | ||
|
|
cd925e96c2 | ||
|
|
142dd486dd | ||
|
|
beeeabd441 | ||
|
|
b73c66f6d6 | ||
|
|
a7111d3cac | ||
|
|
d182fd7f46 | ||
|
|
b5582b1284 | ||
|
|
161cea4920 | ||
|
|
6b81c4ece0 | ||
|
|
ee17f69115 | ||
|
|
81c19bff16 | ||
|
|
e7cda58113 | ||
|
|
44f18554e1 | ||
|
|
52b42ec975 | ||
|
|
2815dd9e4d | ||
|
|
d057bfc3ff | ||
|
|
e4621c8aaa |
No files matched your search
+16
-2
@@ -24,7 +24,7 @@ steps:
|
|||||||
- find . -type f -print0 | xargs -0 dos2unix
|
- find . -type f -print0 | xargs -0 dos2unix
|
||||||
- chmod +x /drone/src/*.sh
|
- chmod +x /drone/src/*.sh
|
||||||
- /drone/src/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,4 +49,18 @@ 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}}"
|
||||||
@@ -11,3 +11,7 @@
|
|||||||
/*.img
|
/*.img
|
||||||
src/include/asuro.pas
|
src/include/asuro.pas
|
||||||
localenv.json
|
localenv.json
|
||||||
|
/lvgl/
|
||||||
|
dockerout.txt
|
||||||
|
AGENTS.md
|
||||||
|
*.log
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# 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]>
|
||||||
+2
-2
@@ -5,11 +5,11 @@ 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:i386 xorriso grub-pc-bin && \
|
curl dos2unix wget git make nasm binutils xorriso grub-pc-bin gcc gcc-multilib && \
|
||||||
apt-get clean my room
|
apt-get clean my room
|
||||||
|
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
ARG FPC_VERSION=2.6.4
|
ARG FPC_VERSION=3.2.2
|
||||||
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
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,7 @@ echo "Asuro Compilation"
|
|||||||
echo " "
|
echo " "
|
||||||
|
|
||||||
#Compile Stub.asm
|
#Compile Stub.asm
|
||||||
rm lib/*
|
rm -f lib/*
|
||||||
|
|
||||||
runOrFail() {
|
runOrFail() {
|
||||||
local binary=$1
|
local binary=$1
|
||||||
@@ -23,6 +23,7 @@ runOrFail() {
|
|||||||
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_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!"
|
||||||
|
|||||||
+6
-1
@@ -14,4 +14,9 @@ done;
|
|||||||
objstring=lib/stub.o" "$objstring
|
objstring=lib/stub.o" "$objstring
|
||||||
echo "Object Files: "$objstring
|
echo "Object Files: "$objstring
|
||||||
echo " "
|
echo " "
|
||||||
ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring
|
|
||||||
|
# Find libgcc for i386 (needed by LVGL compiled with gcc)
|
||||||
|
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/liblvgl.a ${LIBGCC} --end-group
|
||||||
+117
@@ -0,0 +1,117 @@
|
|||||||
|
#!/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.
|
||||||
|
set -e
|
||||||
|
|
||||||
|
LVGL_VERSION="v9.2.2"
|
||||||
|
LVGL_REPO="https://github.com/lvgl/lvgl.git"
|
||||||
|
LVGL_DIR="/tmp/lvgl"
|
||||||
|
OBJ_DIR="/tmp/lvgl_obj"
|
||||||
|
CONF_DIR="$(pwd)/lvglh"
|
||||||
|
OUT_DIR="$(pwd)/lib"
|
||||||
|
|
||||||
|
CC="gcc"
|
||||||
|
CFLAGS="-m32 -march=i686 -ffreestanding \
|
||||||
|
-fno-builtin -fno-stack-protector -fno-pic -fno-pie \
|
||||||
|
-O2 -Wall -Wno-unused-function -Wno-unused-variable \
|
||||||
|
-I${CONF_DIR} \
|
||||||
|
-I${LVGL_DIR} \
|
||||||
|
-I${LVGL_DIR}/.. \
|
||||||
|
-DLV_CONF_INCLUDE_SIMPLE"
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "======================="
|
||||||
|
echo " "
|
||||||
|
echo "Compiling LVGL..."
|
||||||
|
echo " "
|
||||||
|
|
||||||
|
# Clone LVGL into /tmp (container-local)
|
||||||
|
rm -rf "$LVGL_DIR"
|
||||||
|
echo "Downloading LVGL ${LVGL_VERSION}..."
|
||||||
|
git clone --depth 1 --branch "${LVGL_VERSION}" "${LVGL_REPO}" "${LVGL_DIR}" 2>&1
|
||||||
|
echo "Download complete."
|
||||||
|
|
||||||
|
# Gather all LVGL .c source files (core library only, no demos/examples)
|
||||||
|
SOURCES=$(find "${LVGL_DIR}/src" -name '*.c' -not -path '*/test/*')
|
||||||
|
TOTAL=$(echo "$SOURCES" | wc -l)
|
||||||
|
echo "Found ${TOTAL} LVGL source files."
|
||||||
|
|
||||||
|
# Compile each .c file to .o (container-local)
|
||||||
|
rm -rf "$OBJ_DIR"
|
||||||
|
mkdir -p "$OBJ_DIR"
|
||||||
|
|
||||||
|
COUNT=0
|
||||||
|
ERRORS=0
|
||||||
|
for src in $SOURCES; do
|
||||||
|
COUNT=$((COUNT + 1))
|
||||||
|
rel="${src#${LVGL_DIR}/src/}"
|
||||||
|
obj_path="${OBJ_DIR}/${rel%.c}.o"
|
||||||
|
mkdir -p "$(dirname "$obj_path")"
|
||||||
|
|
||||||
|
if ! $CC $CFLAGS -c "$src" -o "$obj_path" 2>&1; then
|
||||||
|
echo "FAILED: $rel"
|
||||||
|
ERRORS=$((ERRORS + 1))
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $((COUNT % 50)) -eq 0 ]; then
|
||||||
|
echo " Compiled ${COUNT}/${TOTAL}..."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Compiled ${COUNT} files (${ERRORS} errors)."
|
||||||
|
|
||||||
|
if [ "$ERRORS" -ne 0 ]; then
|
||||||
|
echo "LVGL compilation FAILED with ${ERRORS} errors."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Archive into static library
|
||||||
|
OBJECTS=$(find "$OBJ_DIR" -name '*.o')
|
||||||
|
ar rcs "${OUT_DIR}/liblvgl.a" $OBJECTS
|
||||||
|
echo "Created ${OUT_DIR}/liblvgl.a"
|
||||||
|
|
||||||
|
# Compile custom LVGL extension files from lvglh/
|
||||||
|
LVGLH_SOURCES=$(find "${CONF_DIR}" -name '*.c' 2>/dev/null || true)
|
||||||
|
if [ -n "$LVGLH_SOURCES" ]; then
|
||||||
|
echo " "
|
||||||
|
echo "Compiling custom LVGL files from lvglh/..."
|
||||||
|
LVGLH_OBJ_DIR="/tmp/lvglh_obj"
|
||||||
|
rm -rf "$LVGLH_OBJ_DIR"
|
||||||
|
mkdir -p "$LVGLH_OBJ_DIR"
|
||||||
|
HCOUNT=0
|
||||||
|
HERRORS=0
|
||||||
|
for src in $LVGLH_SOURCES; do
|
||||||
|
HCOUNT=$((HCOUNT + 1))
|
||||||
|
rel="${src#${CONF_DIR}/}"
|
||||||
|
obj_path="${LVGLH_OBJ_DIR}/${rel%.c}.o"
|
||||||
|
mkdir -p "$(dirname "$obj_path")"
|
||||||
|
echo " [lvglh] $rel"
|
||||||
|
if ! $CC $CFLAGS -c "$src" -o "$obj_path" 2>&1; then
|
||||||
|
echo " FAILED: $rel"
|
||||||
|
HERRORS=$((HERRORS + 1))
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "Compiled ${HCOUNT} custom files (${HERRORS} errors)."
|
||||||
|
if [ "$HERRORS" -ne 0 ]; then
|
||||||
|
echo "Custom LVGL compilation FAILED."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# Append custom objects into the existing archive
|
||||||
|
HOBJECTS=$(find "$LVGLH_OBJ_DIR" -name '*.o')
|
||||||
|
ar rcs "${OUT_DIR}/liblvgl.a" $HOBJECTS
|
||||||
|
echo "Updated ${OUT_DIR}/liblvgl.a with custom objects."
|
||||||
|
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..."
|
||||||
|
rm -rf /lvgl/* /lvgl/.[!.]* /lvgl/..?* 2>/dev/null || true
|
||||||
|
cp -a "$LVGL_DIR/src" /lvgl/src
|
||||||
|
cp -a "$OBJ_DIR" /lvgl/obj
|
||||||
|
echo "Done."
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "LVGL compilation complete."
|
||||||
|
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 -vlewn -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* 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/* src/kernel.pas
|
||||||
+2
-1
@@ -2,4 +2,5 @@ services:
|
|||||||
builder:
|
builder:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- .:/code
|
- .:/code
|
||||||
|
- ./lvgl:/lvgl
|
||||||
@@ -34,4 +34,14 @@ SECTIONS
|
|||||||
}
|
}
|
||||||
end = .; _end = .; __end = .;
|
end = .; _end = .; __end = .;
|
||||||
kernel_end = .;
|
kernel_end = .;
|
||||||
|
|
||||||
|
/DISCARD/ : {
|
||||||
|
*(.init_array*)
|
||||||
|
*(.fini_array*)
|
||||||
|
*(.ctors)
|
||||||
|
*(.dtors)
|
||||||
|
*(.eh_frame*)
|
||||||
|
*(.gcc_except_table*)
|
||||||
|
*(.note.GNU-stack)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+374
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
+3
-2
@@ -1776,14 +1776,15 @@ var
|
|||||||
fb: puint32;
|
fb: puint32;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
|
Ready:= False;
|
||||||
fb:= puint32(uint32(multibootinfo^.framebuffer_addr));
|
fb:= puint32(uint32(multibootinfo^.framebuffer_addr));
|
||||||
Console_Properties.Width:= multibootinfo^.framebuffer_width;
|
Console_Properties.Width:= multibootinfo^.framebuffer_width;
|
||||||
Console_Properties.Height:= multibootinfo^.framebuffer_height;
|
Console_Properties.Height:= multibootinfo^.framebuffer_height;
|
||||||
Console_Properties.BitsPerPixel:= multibootinfo^.framebuffer_bpp;
|
Console_Properties.BitsPerPixel:= multibootinfo^.framebuffer_bpp;
|
||||||
Console_Properties.MAX_CELL_X:= (Console_Properties.Width div 8) - 1;
|
Console_Properties.MAX_CELL_X:= (Console_Properties.Width div 8) - 1;
|
||||||
Console_Properties.MAX_CELL_Y:= (Console_Properties.Height div 16) - 1;
|
Console_Properties.MAX_CELL_Y:= (Console_Properties.Height div 16) - 1;
|
||||||
If Console_Properties.BitsPerPixel <> 16 then while true do begin
|
If Console_Properties.BitsPerPixel <> 16 then begin
|
||||||
|
exit;
|
||||||
end;
|
end;
|
||||||
kpalloc(uint32(fb));
|
kpalloc(uint32(fb));
|
||||||
keyboard.hook(@keyhook);
|
keyboard.hook(@keyhook);
|
||||||
|
|||||||
+23
@@ -291,6 +291,28 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure enableAVX();
|
||||||
|
begin
|
||||||
|
if CPUID.Capabilities1^.AVX then begin
|
||||||
|
asm
|
||||||
|
PUSH EAX
|
||||||
|
PUSH ECX
|
||||||
|
PUSH EDX
|
||||||
|
XOR ECX, ECX
|
||||||
|
db $0F
|
||||||
|
db $01
|
||||||
|
db $D0
|
||||||
|
OR EAX, 7
|
||||||
|
db $0F
|
||||||
|
db $01
|
||||||
|
db $D1
|
||||||
|
POP EDX
|
||||||
|
POP ECX
|
||||||
|
POP EAX
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure init();
|
procedure init();
|
||||||
begin
|
begin
|
||||||
terminal.registerCommand('CPU', @Terminal_Command_CPU, 'CPU Info.');
|
terminal.registerCommand('CPU', @Terminal_Command_CPU, 'CPU Info.');
|
||||||
@@ -300,6 +322,7 @@ begin
|
|||||||
getCPUCapabilities;
|
getCPUCapabilities;
|
||||||
getCPUClockSpeed;
|
getCPUClockSpeed;
|
||||||
enableSSE;
|
enableSSE;
|
||||||
|
enableAVX;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
@@ -51,6 +51,11 @@ type
|
|||||||
|
|
||||||
procedure init();
|
procedure init();
|
||||||
procedure DrawCursor;
|
procedure DrawCursor;
|
||||||
|
function getMouseX: sint32;
|
||||||
|
function getMouseY: sint32;
|
||||||
|
function getMouseLMB: boolean;
|
||||||
|
function getMouseRMB: boolean;
|
||||||
|
function getMouseScroll: sint32; { returns accumulated scroll delta since last call }
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@@ -59,7 +64,7 @@ var
|
|||||||
FirstDraw : boolean = true;
|
FirstDraw : boolean = true;
|
||||||
BackPixels : Array[0..1] of Array[0..7] of uint64;
|
BackPixels : Array[0..1] of Array[0..7] of uint64;
|
||||||
Cycle : uint32 = 0;
|
Cycle : uint32 = 0;
|
||||||
Mouse_Byte : Array[0..2] of uint8;
|
Mouse_Byte : Array[0..3] of uint8;
|
||||||
Packet : uint32;
|
Packet : uint32;
|
||||||
Registered : Boolean = false;
|
Registered : Boolean = false;
|
||||||
NeedsRedraw : Boolean = false;
|
NeedsRedraw : Boolean = false;
|
||||||
@@ -67,6 +72,35 @@ var
|
|||||||
LMouseDownPos : TMousePos;
|
LMouseDownPos : TMousePos;
|
||||||
LMouseDown : Boolean;
|
LMouseDown : Boolean;
|
||||||
RMouseDown : Boolean;
|
RMouseDown : Boolean;
|
||||||
|
HasScrollWheel : Boolean = false;
|
||||||
|
ScrollAccum : sint32 = 0;
|
||||||
|
PacketSize : uint32 = 3;
|
||||||
|
|
||||||
|
function getMouseX: sint32;
|
||||||
|
begin
|
||||||
|
getMouseX := Current.x;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function getMouseY: sint32;
|
||||||
|
begin
|
||||||
|
getMouseY := Current.y;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function getMouseLMB: boolean;
|
||||||
|
begin
|
||||||
|
getMouseLMB := LMouseDown;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function getMouseRMB: boolean;
|
||||||
|
begin
|
||||||
|
getMouseRMB := RMouseDown;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function getMouseScroll: sint32;
|
||||||
|
begin
|
||||||
|
getMouseScroll := ScrollAccum;
|
||||||
|
ScrollAccum := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure DrawCursor;
|
procedure DrawCursor;
|
||||||
var
|
var
|
||||||
@@ -151,7 +185,7 @@ begin
|
|||||||
Mouse_Byte[Cycle]:= b;
|
Mouse_Byte[Cycle]:= b;
|
||||||
Inc(Cycle);
|
Inc(Cycle);
|
||||||
end;
|
end;
|
||||||
if Cycle = 3 then begin
|
if Cycle = PacketSize then begin
|
||||||
//Process
|
//Process
|
||||||
f:= Mouse_Byte[0];
|
f:= Mouse_Byte[0];
|
||||||
Packet.x_sign:= (f AND %00010000) = %00010000;
|
Packet.x_sign:= (f AND %00010000) = %00010000;
|
||||||
@@ -173,6 +207,10 @@ begin
|
|||||||
if Current.x > (Console.getConsoleProperties^.Width-8) then Current.x:= (Console.getConsoleProperties^.Width-8);
|
if Current.x > (Console.getConsoleProperties^.Width-8) then Current.x:= (Console.getConsoleProperties^.Width-8);
|
||||||
if Current.y > (Console.getConsoleProperties^.Height-8) then Current.y:= (Console.getConsoleProperties^.Height-8);
|
if Current.y > (Console.getConsoleProperties^.Height-8) then Current.y:= (Console.getConsoleProperties^.Height-8);
|
||||||
end;
|
end;
|
||||||
|
{ Process scroll wheel (4th byte, signed) }
|
||||||
|
if HasScrollWheel then begin
|
||||||
|
ScrollAccum := ScrollAccum + sint8(Mouse_Byte[3]);
|
||||||
|
end;
|
||||||
Cycle:= 0;
|
Cycle:= 0;
|
||||||
if Packet.LMB_Down then begin
|
if Packet.LMB_Down then begin
|
||||||
if not LMouseDown then begin
|
if not LMouseDown then begin
|
||||||
@@ -217,7 +255,8 @@ end;
|
|||||||
|
|
||||||
function load(ptr : void) : boolean;
|
function load(ptr : void) : boolean;
|
||||||
var
|
var
|
||||||
status : uint8;
|
status : uint8;
|
||||||
|
devid_byte : uint8;
|
||||||
begin
|
begin
|
||||||
push_trace('mouse.load');
|
push_trace('mouse.load');
|
||||||
mouse_wait(1);
|
mouse_wait(1);
|
||||||
@@ -232,6 +271,26 @@ begin
|
|||||||
outb($60, status);
|
outb($60, status);
|
||||||
mouse_write($F6);
|
mouse_write($F6);
|
||||||
mouse_read();
|
mouse_read();
|
||||||
|
|
||||||
|
{ Enable IntelliMouse scroll wheel: set sample rate 200, 100, 80 }
|
||||||
|
mouse_write($F3); mouse_read(); mouse_write(200); mouse_read();
|
||||||
|
mouse_write($F3); mouse_read(); mouse_write(100); mouse_read();
|
||||||
|
mouse_write($F3); mouse_read(); mouse_write(80); mouse_read();
|
||||||
|
|
||||||
|
{ Query device ID — ID 3 = IntelliMouse (scroll wheel) }
|
||||||
|
mouse_write($F2);
|
||||||
|
mouse_read(); { ACK }
|
||||||
|
devid_byte := mouse_read(); { Device ID }
|
||||||
|
if devid_byte = 3 then begin
|
||||||
|
HasScrollWheel := true;
|
||||||
|
PacketSize := 4;
|
||||||
|
console.outputln('PS/2 MOUSE', 'Scroll wheel enabled (IntelliMouse).');
|
||||||
|
end else begin
|
||||||
|
HasScrollWheel := false;
|
||||||
|
PacketSize := 3;
|
||||||
|
console.outputln('PS/2 MOUSE', 'Standard mouse (no scroll wheel).');
|
||||||
|
end;
|
||||||
|
|
||||||
mouse_write($F4);
|
mouse_write($F4);
|
||||||
mouse_read();
|
mouse_read();
|
||||||
isrmanager.registerISR(44, @Main);
|
isrmanager.registerISR(44, @Main);
|
||||||
|
|||||||
@@ -58,16 +58,19 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function sinb(port : uint16) : uint8;
|
function sinb(port : uint16) : uint8;
|
||||||
|
var
|
||||||
|
tmp : uint8;
|
||||||
begin
|
begin
|
||||||
asm
|
asm
|
||||||
PUSH EAX
|
PUSH EAX
|
||||||
PUSH EDX
|
PUSH EDX
|
||||||
MOV DX, port
|
MOV DX, port
|
||||||
IN AL, DX
|
IN AL, DX
|
||||||
MOV sinb, AL
|
MOV tmp, AL
|
||||||
POP EDX
|
POP EDX
|
||||||
POP EAX
|
POP EAX
|
||||||
end;
|
end;
|
||||||
|
sinb := tmp;
|
||||||
io_wait;
|
io_wait;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
@@ -491,22 +491,26 @@ begin
|
|||||||
|
|
||||||
{ Create a new header to the use in our DHCP REQUEST packet }
|
{ Create a new header to the use in our DHCP REQUEST packet }
|
||||||
SendHeader:= createHeader();
|
SendHeader:= createHeader();
|
||||||
CopyIPv4(puint8(@Header^.Your_IP[0]), puint8(@SendHeader^.Client_IP[0]));
|
CopyIPv4(@getIPv4Config^.Address[0], puint8(@SendHeader^.Client_IP[0]));
|
||||||
CopyIPv4(puint8(@Header^.Server_IP[0]), puint8(@SendHeader^.Server_IP[0]));
|
CopyIPv4(puint8(@Header^.Server_IP[0]), puint8(@SendHeader^.Server_IP[0]));
|
||||||
processHeader(SendHeader);
|
processHeader(SendHeader);
|
||||||
|
|
||||||
{ Setup Options }
|
{ Setup Options }
|
||||||
SendOptions:= newOptions();
|
SendOptions:= newOptions();
|
||||||
|
|
||||||
{ Create a message type option and assign it the value REQUEST }
|
{ Create a message type option and assign it the value REQUEST }
|
||||||
SendMsgType:= ord(TDHCPMessageType.REQUEST);
|
SendMsgType:= ord(TDHCPMessageType.REQUEST);
|
||||||
NewOption(SendOptions, TDHCPOpCode.DHCP_MESSAGE_TYPE, void(@SendMsgType), 1, false);
|
NewOption(SendOptions, TDHCPOpCode.DHCP_MESSAGE_TYPE, void(@SendMsgType), 1, false);
|
||||||
|
|
||||||
{ Create a Requested IP option and assign it the value from the OFFER packet header }
|
{ Create a Requested IP option and assign it the value from the OFFER packet header }
|
||||||
NewOption(SendOptions, TDHCPOpCode.REQUESTED_IP_ADDRESS, void(@SendHeader^.Client_IP[0]), 4, false);
|
NewOption(SendOptions, TDHCPOpCode.REQUESTED_IP_ADDRESS, void(@Header^.Your_IP[0]), 4, false);
|
||||||
|
|
||||||
{ Create a Server Identifier Option and assign it the value from the OFFER packet options }
|
{ Create a Server Identifier Option and assign it the value from the OFFER packet options }
|
||||||
Option:= getOptionByOpcode(Options, TDHCPOpCode.SERVER_IDENTIFIER);
|
Option:= getOptionByOpcode(Options, TDHCPOpCode.SERVER_IDENTIFIER);
|
||||||
if Option <> nil then begin
|
if Option <> nil then begin
|
||||||
NewOption(SendOptions, TDHCPOpCode.SERVER_IDENTIFIER, void(@Option^.Value[0]), 4, false);
|
NewOption(SendOptions, TDHCPOpCode.SERVER_IDENTIFIER, void(@Option^.Value[0]), 4, false);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Create a Parameter Request List, Request the following: Netmask, Gateway, DNS Name & DNS Server }
|
{ Create a Parameter Request List, Request the following: Netmask, Gateway, DNS Name & DNS Server }
|
||||||
RequestParams[0]:= Ord(TDHCPOpCode.SUBNET_MASK);
|
RequestParams[0]:= Ord(TDHCPOpCode.SUBNET_MASK);
|
||||||
RequestParams[1]:= Ord(TDHCPOpCode.ROUTER);
|
RequestParams[1]:= Ord(TDHCPOpCode.ROUTER);
|
||||||
@@ -522,9 +526,13 @@ begin
|
|||||||
MAC:= getMAC();
|
MAC:= getMAC();
|
||||||
packetCtx:= PPacketContext(Kalloc(sizeof(TPacketContext)));
|
packetCtx:= PPacketContext(Kalloc(sizeof(TPacketContext)));
|
||||||
packetCtx^.TTL:= 128;
|
packetCtx^.TTL:= 128;
|
||||||
copyMAC(@BROADCAST_MAC[0], @packetCtx^.MAC.Destination[0]);
|
|
||||||
|
{ Copy over MAC - src: broadcast - dst: DHCP Server }
|
||||||
copyMAC(MAC, @packetCtx^.MAC.Source[0]);
|
copyMAC(MAC, @packetCtx^.MAC.Source[0]);
|
||||||
copyIPv4(@NULL_IP[0], @packetCtx^.IP.Source[0]);
|
copyMAC(@BROADCAST_MAC[0], @packetCtx^.MAC.Destination[0]);
|
||||||
|
|
||||||
|
{ Copy over IP - src: NULL - dst: Broadcast }
|
||||||
|
CopyIPv4(@getIPv4Config^.Address[0], @packetCtx^.IP.Source[0]);
|
||||||
copyIPv4(@BROADCAST_IP[0], @packetCtx^.IP.Destination[0]);
|
copyIPv4(@BROADCAST_IP[0], @packetCtx^.IP.Destination[0]);
|
||||||
|
|
||||||
{ Setup UDPContext (UDP) & copy in the correct details }
|
{ Setup UDPContext (UDP) & copy in the correct details }
|
||||||
@@ -570,7 +578,7 @@ begin
|
|||||||
|
|
||||||
{ Check the frame is for us and then process }
|
{ Check the frame is for us and then process }
|
||||||
MAC:= getMAC;
|
MAC:= getMAC;
|
||||||
if MACEqual(@context^.PacketContext^.MAC.Destination[0], MAC) then begin
|
if MACEqual(@context^.PacketContext^.MAC.Destination[0], MAC) or MACEqual(@context^.PacketContext^.MAC.Destination[0], BROADCAST_MAC) then begin
|
||||||
Outputln('DHCP','Frame is addressed to us.');
|
Outputln('DHCP','Frame is addressed to us.');
|
||||||
{ Check the message type is client specific }
|
{ Check the message type is client specific }
|
||||||
If Header^.Message_Type = $02 then begin
|
If Header^.Message_Type = $02 then begin
|
||||||
@@ -655,7 +663,7 @@ begin
|
|||||||
copyMAC(@BROADCAST_MAC[0], @packetCtx^.MAC.Destination[0]);
|
copyMAC(@BROADCAST_MAC[0], @packetCtx^.MAC.Destination[0]);
|
||||||
MAC:= getMAC;
|
MAC:= getMAC;
|
||||||
copyMAC(MAC, @packetCtx^.MAC.Source[0]);
|
copyMAC(MAC, @packetCtx^.MAC.Source[0]);
|
||||||
copyIPv4(@NULL_IP[0], @packetCtx^.IP.Source[0]);
|
CopyIPv4(@getIPv4Config^.Address[0], @packetCtx^.IP.Source[0]);
|
||||||
copyIPv4(@BROADCAST_IP[0], @packetCtx^.IP.Destination[0]);
|
copyIPv4(@BROADCAST_IP[0], @packetCtx^.IP.Destination[0]);
|
||||||
|
|
||||||
{ Setup UDPContext (UDP) }
|
{ Setup UDPContext (UDP) }
|
||||||
|
|||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,100 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
{
|
||||||
|
Driver->Video->Doublebuffer - Implements a very basic double buffer, tested with VESA drivers.
|
||||||
|
|
||||||
|
@author(Kieron Morris <[email protected]>)
|
||||||
|
}
|
||||||
|
unit doublebuffer;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
lmemorymanager, tracer, videotypes, serial, util;
|
||||||
|
|
||||||
|
//Init the driver, and register with the video interface in a state ready for execution.
|
||||||
|
procedure init(Register : FRegisterDriver);
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
function allocateBackBuffer(Width : uint32; Height : uint32; BitsPerPixel : uint8) : uint64;
|
||||||
|
begin
|
||||||
|
tracer.push_trace('doublebuffer.allocateBackBuffer.enter');
|
||||||
|
//This doesn't currently work... Needs a rework of lmemorymanager
|
||||||
|
allocateBackBuffer:= uint64(klalloc((Width * Height) * BitsPerPixel));
|
||||||
|
tracer.push_trace('doublebuffer.allocateBackBuffer.exit');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure initBackBuffer(VInterface : PVideoInterface; Width : uint32; Height : uint32; BitsPerPixel : uint8);
|
||||||
|
begin
|
||||||
|
tracer.push_trace('doublebuffer.initBackBuffer.enter');
|
||||||
|
if not(VInterface^.BackBuffer.Initialized) then begin
|
||||||
|
VInterface^.BackBuffer.Location:= allocateBackBuffer(Width, Height, BitsPerPixel);
|
||||||
|
if (VInterface^.BackBuffer.Location <> 0) then begin
|
||||||
|
VInterface^.BackBuffer.Width:= Width;
|
||||||
|
VInterface^.BackBuffer.Height:= Height;
|
||||||
|
VInterface^.BackBuffer.BitsPerPixel:= BitsPerPixel;
|
||||||
|
VInterface^.BackBuffer.Initialized:= True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
tracer.push_trace('doublebuffer.initBackBuffer.exit');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure Flush(FrontBuffer : PVideoBuffer; BackBuffer : PVideoBuffer);
|
||||||
|
var
|
||||||
|
idx : uint32;
|
||||||
|
Back,Front : uint32;
|
||||||
|
BufferSize : uint32;
|
||||||
|
|
||||||
|
const
|
||||||
|
//COPY_WIDTH = 64; //Use this for 64bit copies
|
||||||
|
COPY_WIDTH = 128; //Use this for SSE copies
|
||||||
|
|
||||||
|
begin
|
||||||
|
//tracer.push_trace('doublebuffer.Flush.enter');
|
||||||
|
if not(BackBuffer^.Initialized) then exit;
|
||||||
|
if ((FrontBuffer^.Width > BackBuffer^.Width) or (FrontBuffer^.Height > BackBuffer^.Height)) then exit;
|
||||||
|
Back:= BackBuffer^.Location;
|
||||||
|
Front:= FrontBuffer^.Location;
|
||||||
|
BufferSize:= ( ( BackBuffer^.Width * BackBuffer^.Height * BackBuffer^.BitsPerPixel) div COPY_WIDTH ) - 1;
|
||||||
|
for idx:=0 to BufferSize do begin
|
||||||
|
//Front[idx]:= Back[idx];
|
||||||
|
// -- TODO: Get SSE working here for 128bit copies --
|
||||||
|
__SSE_128_memcpy(Back + (idx * 16), Front + (idx * 16));
|
||||||
|
end;
|
||||||
|
//tracer.push_trace('doublebuffer.Flush.exit');
|
||||||
|
end;
|
||||||
|
|
||||||
|
function enable(VideoInterface : PVideoInterface) : boolean;
|
||||||
|
begin
|
||||||
|
tracer.push_trace('doublebuffer.enable.enter');
|
||||||
|
enable:= false;
|
||||||
|
initBackBuffer(VideoInterface, VideoInterface^.FrontBuffer.Width, VideoInterface^.FrontBuffer.Height, VideoInterface^.FrontBuffer.BitsPerPixel);
|
||||||
|
if VideoInterface^.BackBuffer.Initialized then begin
|
||||||
|
VideoInterface^.DefaultBuffer:= @VideoInterface^.BackBuffer;
|
||||||
|
VideoInterface^.DrawRoutines.Flush:= @Flush;
|
||||||
|
enable:= true;
|
||||||
|
end;
|
||||||
|
tracer.push_trace('doublebuffer.enable.exit');
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init(Register : FRegisterDriver);
|
||||||
|
begin
|
||||||
|
tracer.push_trace('doublebuffer.init.enter');
|
||||||
|
Register('BASIC_DOUBLE_BUFFER', @enable);
|
||||||
|
tracer.push_trace('doublebuffer.init.exit');
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
Loaded 20 of 42 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user