Compare commits

..
34 Commits
Author SHA1 Message Date
Aaron 28846af43c Merge pull request 'feature/dynamic-lists' (#6) from feature/dynamic-lists into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #6
Reviewed-by: t3hn3rd <[email protected]>
2025-03-22 19:24:52 +00:00
t3hn3rd b1e3953960 Merge pull request 'Fixed a DHCP bug' (#5) from feature/DHCP-BugFix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #5
2025-03-22 19:13:25 +00:00
Aaron 7e00e23801 Fixed and expanded dynamic lists, commented whole file 2025-03-22 19:02:43 +00:00
t3hn3rd bd12bbe862 DevOps Workflow Improvements 2025-03-22 18:42:44 +00:00
t3hn3rd 48c203f028 Fixed a DHCP bug
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Fixed a bug within `dhcp.pas` - `processPacket_OFFER` in which the client was responding with the client IP value within the DHCP header was incorrectly being filled out with the IP being requested & this value was then being used within the REQUESTED_IP_ADDRESS option. Corrected this to fill out the client IP with the currently configured IP, which will be NULL (0.0.0.0) on boot, and whatever is issued thereafter.
- Cascaded the change to use the currently configured IP as opposed to a NULL IP to any other functions that were calling `copyIPv4(@NULL_IP[0], @packetCtx^.IP.Source[0])`.
- Allowed `processPacket_OFFER` to process packets addressed to the BROADCAST MAC (WHY COULDN'T IT DO THIS ALREADY?!).
2025-03-17 00:00:21 +00:00
Aaron d859e40e4a Added mail map
continuous-integration/drone/push Build is passing
2025-03-15 10:52:08 +00:00
t3hn3rd 8c3649f691 Merge pull request 'feature/ci-cd-drone-migration' (#3) from feature/ci-cd-drone-migration into develop
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
Reviewed-on: #3
2025-03-09 22:32:16 +00:00
t3hn3rd b47194ed99 Final commit to merge through develop & master
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- CI/CD Pipeline now working & tested.
- Commits to all branches will trigger the pipeline in DroneCI.
- Commits to master will trigger the resulting ISO artefact to be uploaded to Gitea as a Package.
2025-03-09 22:25:08 +00:00
t3hn3rd 6bca42f2a5 Final Test before finalizing
continuous-integration/drone/push Build is passing
- Single quotes were causing the first CURL to fail.
- This should be the penultimate commit before ready to progress through dev to master.
2025-03-09 22:18:19 +00:00
t3hn3rd f1211f3cca Slowly making progress
continuous-integration/drone/push Build is passing
- YAML is now valid - however, the attempt to temp store the revision number failed. Doing it inline instead.
2025-03-09 22:08:18 +00:00
t3hn3rd 0913daebc6 Still experiencing YAML errors, for some reason.
continuous-integration/drone/push Build is passing
2025-03-09 22:01:55 +00:00
t3hn3rd d1a4b4d42f Another attempt - issues with YAML layout for some reason
continuous-integration/drone/push Build encountered an error
2025-03-09 21:57:19 +00:00
t3hn3rd 2906b8724b Exports don't persist between commands
continuous-integration/drone/push Build encountered an error
- Exports don't persist between commands in Drone commands - removed these exports and made more verbose commands.
2025-03-09 21:45:29 +00:00
t3hn3rd 5e6e6c394a Debugging & Testing
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
- Mistakes made in the curl methods used & the curl upload-file flag - rectified.
2025-03-09 21:18:49 +00:00
t3hn3rd 315050f095 Further permission issues
continuous-integration/drone/push Build is failing
- Further attempts to fix permission issues within Drone when exporting the Asuro.iso artefact
- Switched to `alpine/git` instead of `curl` image, as git didn't exist under the `curl` image.
2025-03-09 20:42:40 +00:00
t3hn3rd f795ba24f8 Further tweaks to artefact upload step
continuous-integration/drone/push Build is failing
DroneCI wasn't happy with the mv of `Asuro.iso` - changed to a cp.
2025-03-09 20:36:19 +00:00
t3hn3rd 738307d070 Testing artefact upload
continuous-integration/drone/push Build is failing
- Testing the upload of the resulting `Asuro.iso` to Gitea fromt the Drone pipeline.
2025-03-09 20:30:45 +00:00
t3hn3rd 04cff2e2c3 Testing Succeeded - Refinement & removal of debugging code
continuous-integration/drone/push Build is passing
- Removed the debug `exit 1` from `compile_stub.sh`
- Improved `compile.sh` to use runOrFail in a more suitable way, correctly passing through failure messages.
2025-03-09 19:58:24 +00:00
t3hn3rd 0b5981242b Intentional edit to cause build failure
continuous-integration/drone/push Build is failing
- Intentional edit to `compile_stub.sh` in order to cause a build failure.
2025-03-09 19:44:19 +00:00
t3hn3rd f0dc598f44 Cleaning up compile scripts
continuous-integration/drone/push Build is passing
- Debugging removed from `compile_vergen.sh`
- `compile.sh` modified to use a for loop for each command & only continue if previous steps succeeded.
2025-03-09 19:39:25 +00:00
t3hn3rd d4236f455e DroneCI doesn't fetch tags by default
continuous-integration/drone/push Build is passing
- Added `git fetch --tags` as the first command
- Changes to compile_vergen.sh in order to debug.
2025-03-09 19:16:23 +00:00
t3hn3rd 96fcf19c14 Further updates to .drone.yml
continuous-integration/drone/push Build is passing
Still experiencing issues with not being able to find the .sh files due to missing /code directory.
2025-03-09 18:59:32 +00:00
t3hn3rd 8c51bd8690 Attempts to resolve issues with missing /code directory
continuous-integration/drone/push Build is failing
Dockerfile expects `/code` attempting to resolve this in the .drone.yml
2025-03-09 18:54:38 +00:00
t3hn3rd 43464bb550 Still not working
continuous-integration/drone/push Build is failing
Testing whether mount paths are the problem
2025-03-09 18:08:28 +00:00
t3hn3rd 6a1b87e250 .drone.yml modifications
continuous-integration/drone/push Build is passing
Modified drone.yml to copy source from the /drone/src directory to the /code directory.
2025-03-09 17:49:04 +00:00
t3hn3rd 9473e26b50 Dockerfile corrections
continuous-integration/drone/push Build is passing
- /code already exists, don't create it in Dockerfile
2025-03-09 17:42:06 +00:00
t3hn3rd f19444201d Updated registry to the registry server, as opposed to my username
continuous-integration/drone/push Build is failing
Oops.
2025-03-09 17:36:45 +00:00
t3hn3rd f907b7e072 First attempt at drone cicd migration
continuous-integration/drone/push Build is failing
- Created a new `.drone.yml` that will compile the Dockerfile, upload this to the Docker Registry & then use this for building.
2025-03-09 17:32:35 +00:00
t3hn3rd 80d0183391 Merge pull request 'DevOps Workflow Improvements' (#2) from feature/devlops-workflow-improvements into develop
Reviewed-on: #2
2025-03-09 13:03:04 +00:00
t3hn3rd 5f3de290f3 DevOps Workflow Improvements
- `VirtualBox-Wrapper.ps1` now takes 'up' or 'down' as opposed to a machine name. This allows start/stop of a virtualmachine.
- `VirtualBox-Wrapper.ps1` now relies on a gitignored `localenv.json` to work.
- `VirtualBox-Wrapper.ps1` can also optionally monitor the log file generated from the serial adapter in VirtualBox.
- `readme.md` updated to provide instructions on how to populate the `localenv.json` file.
- `tasks.json` updated to have a "Clean" task to --remove-orphans, the Build task depends on this.
- `tasks.json` updated to have a "Close VirtualBox" task, this runs the `virtualbox-wrapper.ps1` in 'down' mode. The Build task depends on this.
- `launch.json` updated to run the `VirtualBox-Wrapper.ps1` with the "-Command up" argument, instead of machine name.
- .gitignore updated to ignore any instances of `localenv.json`.
2025-03-09 13:01:10 +00:00
t3hn3rd 07106b9aed Merge pull request 'VirtualBox 7 Compatability Changes' (#1) from feature/virtualbox-7-compatibility into develop
Reviewed-on: #1
2025-03-08 19:19:40 +00:00
t3hn3rd 25df276101 VirtualBox 7 Compatability Changes
- Created a PowerShell script `virtualbox-wrapper.ps1` to wrap calls to vboxmanage and only exit once the virtual machine has been terminated.
- Updated launch.json to use the PowerShell launch type to launch `virtualbox-wrapper.ps1` with the machine name supplied as an argument.
- Updated `readme.md` to reflect these changes.
2025-03-08 18:59:12 +00:00
Aaron dbc5105b9b Dynamic lists fixes and additions 2022-02-08 21:28:47 +00:00
Aaron a61289a318 Dynamic list/array inital commit.- 2022-02-07 21:37:36 +00:00
39 changed files with 1076 additions and 6480 deletions

No files matched your search

+13
View File
@@ -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]>
+1 -4
View File
@@ -5,12 +5,9 @@ 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 \ curl dos2unix wget git make nasm binutils:i386 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=2.6.4 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 - && \
-1
View File
@@ -23,7 +23,6 @@ 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_imgui.sh" "Failed to compile ImGui!"
"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!"
-90
View File
@@ -1,90 +0,0 @@
#!/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
+1 -3
View File
@@ -14,6 +14,4 @@ done;
objstring=lib/stub.o" "$objstring objstring=lib/stub.o" "$objstring
echo "Object Files: "$objstring echo "Object Files: "$objstring
echo " " echo " "
LIBGCC=$(gcc -m32 -print-libgcc-file-name) ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring
ld -m elf_i386 -s --gc-sections -Tlinker.script -o bin/kernel.bin $objstring \
--start-group lib/cimgui.a $LIBGCC --end-group
+1 -1
View File
@@ -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/* -Fusrc/driver/video/* -Fusrc/driver/video/imgui/* src/kernel.pas 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
-20
View File
@@ -1,20 +0,0 @@
4023:CIMGUI_API float igGetWindowDpiScale(void);
4081:CIMGUI_API const ImVec4_c* igGetStyleColorVec4(ImGuiCol idx);
4082:CIMGUI_API ImVec2_c igGetCursorScreenPos(void);
4084:CIMGUI_API ImVec2_c igGetContentRegionAvail(void);
4085:CIMGUI_API ImVec2_c igGetCursorPos(void);
4086:CIMGUI_API float igGetCursorPosX(void);
4087:CIMGUI_API float igGetCursorPosY(void);
4091:CIMGUI_API ImVec2_c igGetCursorStartPos(void);
4350:CIMGUI_API void igBeginDisabled(bool disabled);
4372:CIMGUI_API ImVec2_c igGetItemRectMin(void);
4373:CIMGUI_API ImVec2_c igGetItemRectMax(void);
4374:CIMGUI_API ImVec2_c igGetItemRectSize(void);
4377:CIMGUI_API ImDrawList* igGetBackgroundDrawList(ImGuiViewport* viewport);
4378:CIMGUI_API ImDrawList* igGetForegroundDrawList_ViewportPtr(ImGuiViewport* viewport);
4387:CIMGUI_API ImVec2_c igCalcTextSize(const char* text,const char* text_end,bool hide_text_after_double_hash,float wrap_width);
4388:CIMGUI_API ImVec4_c igColorConvertU32ToFloat4(ImU32 in);
4405:CIMGUI_API bool igIsMouseDoubleClicked_Nil(ImGuiMouseButton button);
5092:CIMGUI_API ImDrawList* igGetForegroundDrawList_WindowPtr(ImGuiWindow* window);
5161:CIMGUI_API void igBeginDisabledOverrideReenable(void);
5244:CIMGUI_API bool igIsMouseDoubleClicked_ID(ImGuiMouseButton button,ImGuiID owner_id);
-10
View File
@@ -34,14 +34,4 @@ 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)
}
} }
+2 -48
View File
@@ -838,18 +838,6 @@ const
MAX_WINDOWS = 255; //< Maximum number of Windows open. MAX_WINDOWS = 255; //< Maximum number of Windows open.
DefaultWND = 0; //< The Window assigned for output when no Window is specified. (Default). DefaultWND = 0; //< The Window assigned for output when no Window is specified. (Default).
type
TWNDCaptureCallback = procedure(s: pchar);
var
WND_CaptureActive : boolean = false;
WND_CaptureHWND : uint32 = 0;
WND_CaptureBuf : array[0..511] of char;
WND_CaptureBufIdx : uint32 = 0;
WND_CaptureCallback : TWNDCaptureCallback = nil;
procedure flushCapture;
implementation implementation
uses uses
@@ -1788,15 +1776,14 @@ 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 begin If Console_Properties.BitsPerPixel <> 16 then while true do begin
exit;
end; end;
kpalloc(uint32(fb)); kpalloc(uint32(fb));
keyboard.hook(@keyhook); keyboard.hook(@keyhook);
@@ -2271,7 +2258,6 @@ var
x,y: Byte; x,y: Byte;
begin begin
if WND_CaptureActive and (WND = WND_CaptureHWND) then exit;
if WindowManager.Windows[WND] <> nil then begin if WindowManager.Windows[WND] <> nil then begin
for y:=0 to Console_Properties.MAX_CELL_Y do begin for y:=0 to Console_Properties.MAX_CELL_Y do begin
for x:=0 to Console_Properties.MAX_CELL_X do begin for x:=0 to Console_Properties.MAX_CELL_X do begin
@@ -2432,26 +2418,8 @@ begin
console.writeintlnexWND(i, Console_Properties.Default_Attribute, WND); console.writeintlnexWND(i, Console_Properties.Default_Attribute, WND);
end; end;
procedure flushCapture;
begin
if WND_CaptureActive and (WND_CaptureCallback <> nil) and (WND_CaptureBufIdx > 0) then begin
WND_CaptureBuf[WND_CaptureBufIdx] := #0;
WND_CaptureCallback(@WND_CaptureBuf[0]);
WND_CaptureBufIdx := 0;
WND_CaptureBuf[0] := #0;
end;
end;
procedure writecharexWND(character: char; attributes: uint32; WND : uint32); procedure writecharexWND(character: char; attributes: uint32; WND : uint32);
begin begin
if WND_CaptureActive and (WND = WND_CaptureHWND) and (WND_CaptureCallback <> nil) then begin
if WND_CaptureBufIdx < 511 then begin
WND_CaptureBuf[WND_CaptureBufIdx] := character;
inc(WND_CaptureBufIdx);
WND_CaptureBuf[WND_CaptureBufIdx] := #0;
end;
exit;
end;
if WindowManager.Windows[WND] <> nil then begin if WindowManager.Windows[WND] <> nil then begin
WindowManager.Windows[WND]^.Buffer[WindowManager.Windows[WND]^.Cursor.Y][WindowManager.Windows[WND]^.Cursor.X].Character:= character; WindowManager.Windows[WND]^.Buffer[WindowManager.Windows[WND]^.Cursor.Y][WindowManager.Windows[WND]^.Cursor.X].Character:= character;
WindowManager.Windows[WND]^.Buffer[WindowManager.Windows[WND]^.Cursor.Y][WindowManager.Windows[WND]^.Cursor.X].Attributes:= attributes; WindowManager.Windows[WND]^.Buffer[WindowManager.Windows[WND]^.Cursor.Y][WindowManager.Windows[WND]^.Cursor.X].Attributes:= attributes;
@@ -2634,13 +2602,6 @@ end;
procedure backspaceWND(WND : uint32); procedure backspaceWND(WND : uint32);
begin begin
if WND_CaptureActive and (WND = WND_CaptureHWND) then begin
if WND_CaptureBufIdx > 0 then begin
dec(WND_CaptureBufIdx);
WND_CaptureBuf[WND_CaptureBufIdx] := #0;
end;
exit;
end;
if WindowManager.Windows[WND] <> nil then begin if WindowManager.Windows[WND] <> nil then begin
Dec(WindowManager.Windows[WND]^.Cursor.X); Dec(WindowManager.Windows[WND]^.Cursor.X);
writecharWND(' ', WND); writecharWND(' ', WND);
@@ -2697,13 +2658,6 @@ end;
procedure _safeincrement_y_WND(WND : uint32); procedure _safeincrement_y_WND(WND : uint32);
begin begin
if WND_CaptureActive and (WND = WND_CaptureHWND) and (WND_CaptureCallback <> nil) then begin
WND_CaptureBuf[WND_CaptureBufIdx] := #0;
WND_CaptureCallback(@WND_CaptureBuf[0]);
WND_CaptureBufIdx := 0;
WND_CaptureBuf[0] := #0;
exit;
end;
if WindowManager.Windows[WND] <> nil then begin if WindowManager.Windows[WND] <> nil then begin
WindowManager.Windows[WND]^.Cursor.Y:= WindowManager.Windows[WND]^.Cursor.Y+1; WindowManager.Windows[WND]^.Cursor.Y:= WindowManager.Windows[WND]^.Cursor.Y+1;
if WindowManager.Windows[WND]^.Cursor.Y > WindowManager.Windows[WND]^.WND_H-1 then begin if WindowManager.Windows[WND]^.Cursor.Y > WindowManager.Windows[WND]^.WND_H-1 then begin
-23
View File
@@ -291,28 +291,6 @@ 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.');
@@ -322,7 +300,6 @@ begin
getCPUCapabilities; getCPUCapabilities;
getCPUClockSpeed; getCPUClockSpeed;
enableSSE; enableSSE;
enableAVX;
end; end;
end. end.
+24 -29
View File
@@ -49,12 +49,8 @@ type
y : sint32; y : sint32;
end; end;
{ Mouse hook callback: receives absolute position and button states }
TMouseHook = procedure(x, y: sint32; lmb, rmb, mmb: boolean);
procedure init(); procedure init();
procedure DrawCursor; procedure DrawCursor;
procedure setHook(h: TMouseHook);
implementation implementation
@@ -71,7 +67,6 @@ var
LMouseDownPos : TMousePos; LMouseDownPos : TMousePos;
LMouseDown : Boolean; LMouseDown : Boolean;
RMouseDown : Boolean; RMouseDown : Boolean;
MouseHookCB : TMouseHook = nil;
procedure DrawCursor; procedure DrawCursor;
var var
@@ -179,38 +174,43 @@ begin
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;
Cycle:= 0; Cycle:= 0;
{ Track button transitions } if Packet.LMB_Down then begin
if Packet.LMB_Down and (not LMouseDown) then begin if not LMouseDown then begin
LMouseDown:= true; LMouseDown:= true;
LMouseDownPos.x:= Current.x; LMouseDownPos.x:= Current.x;
LMouseDownPos.y:= Current.y; LMouseDownPos.y:= Current.y;
//MouseDownEvent
console._mouseDown();
end; end;
if (not Packet.LMB_Down) and LMouseDown then end;
if not Packet.LMB_Down then begin
if LMouseDown then begin
If (Current.x = LMouseDownPos.x) and (Current.y = LMouseDownPos.y) then begin
Console._MouseClick(true);
end;
//MouseUpEvent
Console._MouseUp();
LMouseDown:= false; LMouseDown:= false;
if Packet.RMB_Down and (not RMouseDown) then begin end;
end;
if Packet.RMB_Down then begin
if not RMouseDown then begin
RMouseDown:= true; RMouseDown:= true;
RMouseDownPos.x:= Current.x; RMouseDownPos.x:= Current.x;
RMouseDownPos.y:= Current.y; RMouseDownPos.y:= Current.y;
end; end;
if (not Packet.RMB_Down) and RMouseDown then
RMouseDown:= false;
{ Dispatch to hook or console }
if MouseHookCB <> nil then
MouseHookCB(Current.x, Current.y, Packet.LMB_Down, Packet.RMB_Down, Packet.MMB_Down)
else begin
if Packet.LMB_Down and (not LMouseDown) then console._mouseDown();
if (not Packet.LMB_Down) and LMouseDown then begin
if (Current.x = LMouseDownPos.x) and (Current.y = LMouseDownPos.y) then
Console._MouseClick(true);
Console._MouseUp();
end; end;
if (not Packet.RMB_Down) and RMouseDown then begin
if (Current.x = RMouseDownPos.x) and (Current.y = RMouseDownPos.y) then if not Packet.RMB_Down then begin
if RMouseDown then begin
if (Current.x = RMouseDownPos.x) and (Current.y = RMouseDownPos.y) then begin
Console._MouseClick(false); Console._MouseClick(false);
end; end;
console.setMousePosition(Current.x, Current.y);
end; end;
RMouseDown:= false;
end;
console.setMousePosition(Current.x, Current.y);
end; end;
end; end;
end; end;
@@ -242,11 +242,6 @@ begin
pop_trace; pop_trace;
end; end;
procedure setHook(h: TMouseHook);
begin
MouseHookCB := h;
end;
procedure init(); procedure init();
var var
devid : TDeviceIdentifier; devid : TDeviceIdentifier;
+14 -6
View File
@@ -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) }
+1 -15
View File
@@ -92,7 +92,6 @@ var
Root : PVFSObject; Root : PVFSObject;
CurrentDirectory : pchar = nil; CurrentDirectory : pchar = nil;
PushPopDirectory : PLinkedListBase; PushPopDirectory : PLinkedListBase;
MountDepth : uint32 = 0;
procedure init(); procedure init();
Function OpenFile(Filename : pchar; OpenMode : TOpenMode; WriteMode : TWriteMode; Lock : Boolean; Error : PError) : TFileHandle; Function OpenFile(Filename : pchar; OpenMode : TOpenMode; WriteMode : TWriteMode; Lock : Boolean; Error : PError) : TFileHandle;
@@ -105,7 +104,6 @@ function GetDirectories(Handle : uint32; Path : pchar) : PHashMap;
function PathValid(Path : pchar) : TIsPathValid; function PathValid(Path : pchar) : TIsPathValid;
function changeDirectory(Path : pchar) : TIsPathValid; function changeDirectory(Path : pchar) : TIsPathValid;
function getWorkingDirectory : pchar; function getWorkingDirectory : pchar;
function GetDirectoryListing(Path : pchar) : PHashMap;
//VFS Functions //VFS Functions
function newVirtualDirectory(Path : pchar) : TError; function newVirtualDirectory(Path : pchar) : TError;
@@ -290,7 +288,6 @@ begin
NewObj:= PVFSObject(hashmap.get(ht, item)); NewObj:= PVFSObject(hashmap.get(ht, item));
if NewObj = nil then begin if NewObj = nil then begin
GetObjectFromPath:= nil; GetObjectFromPath:= nil;
STRLL_Free(SplitPath);
tracer.push_trace('vfs.GetObjectFromPath.shortexit_1'); tracer.push_trace('vfs.GetObjectFromPath.shortexit_1');
exit; exit;
end; end;
@@ -307,7 +304,6 @@ begin
end; end;
end; end;
GetObjectFromPath:= Obj; GetObjectFromPath:= Obj;
STRLL_Free(SplitPath);
tracer.push_trace('vfs.GetObjectFromPath.exit'); tracer.push_trace('vfs.GetObjectFromPath.exit');
end; end;
@@ -352,17 +348,7 @@ begin
GetDirectoryListing:= nil; GetDirectoryListing:= nil;
end; end;
otMOUNT:begin otMOUNT:begin
{ Safety: cap mount-follow depth to prevent infinite recursion
from circular mounts. Use a simple static counter. }
if MountDepth < 16 then begin
Inc(MountDepth);
GetDirectoryListing:= GetDirectoryListing(PVFSMount(Obj^.Reference)^.Path); GetDirectoryListing:= GetDirectoryListing(PVFSMount(Obj^.Reference)^.Path);
Dec(MountDepth);
end else
GetDirectoryListing:= nil;
end;
else begin
GetDirectoryListing:= nil;
end; end;
end; end;
end else begin end else begin
@@ -434,7 +420,7 @@ begin
NewObj^.Reference:= void(NewDev); NewObj^.Reference:= void(NewDev);
hashmap.add(ht, stringCopy(DeviceName), void(NewObj)); hashmap.add(ht, stringCopy(DeviceName), void(NewDev));
end; end;
{ Filesystem Functions } { Filesystem Functions }
-116
View File
@@ -1,116 +0,0 @@
// 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
Back,Front : uint32;
Count64 : uint32;
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;
{ Number of 64-byte blocks: total_bytes / 64 = (W * H * BPP/8) / 64 }
Count64:= ( BackBuffer^.Width * BackBuffer^.Height * BackBuffer^.BitsPerPixel) div 512;
if Count64 = 0 then exit;
{ Bulk SSE copy: 4 x MOVAPS (64 bytes) per iteration.
4x fewer loop iterations than the old per-16-byte function-call loop. }
asm
PUSH ESI
PUSH EDI
MOV ESI, Back
MOV EDI, Front
MOV ECX, Count64
@sseloop:
MOVAPS XMM0, [ESI]
MOVAPS XMM1, [ESI + 16]
MOVAPS XMM2, [ESI + 32]
MOVAPS XMM3, [ESI + 48]
MOVAPS [EDI], XMM0
MOVAPS [EDI + 16], XMM1
MOVAPS [EDI + 32], XMM2
MOVAPS [EDI + 48], XMM3
ADD ESI, 64
ADD EDI, 64
DEC ECX
JNZ @sseloop
POP EDI
POP ESI
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.
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
-87
View File
@@ -1,87 +0,0 @@
// 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->VESA - VESA Display Driver.
@author(Kieron Morris <[email protected]>)
}
unit vesa;
interface
uses
videotypes, tracer, multiboot, lmemorymanager;
//Init the driver, and register with the video interface in a state ready for execution.
procedure init(Register : FRegisterDriver);
implementation
uses
VESA8, VESA16, VESA24, VESA32;
procedure allocateVESAFrameBuffer(Address : uint32; Width : uint32; Height : uint32);
var
LowerAddress, UpperAddress : uint32;
Block : uint32;
begin
tracer.push_trace('VESA.allocateFrameBuffer.enter');
LowerAddress:= ((Address) SHR 22)-1;
UpperAddress:= ((Address + (Width * Height)) SHR 22)+1;
For Block:=LowerAddress to UpperAddress do begin
kpalloc(Block SHL 22);
end;
tracer.push_trace('VESA.allocateFrameBuffer.exit');
end;
procedure initVESAFrameBuffer(VideoBuffer : PVideoBuffer; Location : uint64; Width : uint32; Height : uint32; BitsPerPixel : uint8);
begin
tracer.push_trace('VESA.initVESAFrameBuffer.enter');
if not(VideoBuffer^.Initialized) then begin
VideoBuffer^.Location:= Location;
VideoBuffer^.BitsPerPixel:= BitsPerPixel;
VideoBuffer^.Width:= Width;
VideoBuffer^.Height:= Height;
allocateVESAFrameBuffer(VideoBuffer^.Location, VideoBuffer^.Width, VideoBuffer^.Height);
if VideoBuffer^.Location <> 0 then
VideoBuffer^.Initialized:= True;
end;
tracer.push_trace('VESA.initVESAFrameBuffer.exit');
end;
function enable(VideoInterface : PVideoInterface) : boolean;
begin
tracer.push_trace('VESA.enable.enter');
initVESAFrameBuffer(@VideoInterface^.FrontBuffer, multiboot.multibootinfo^.framebuffer_addr, multiboot.multibootinfo^.framebuffer_width, multiboot.multibootinfo^.framebuffer_height, multiboot.multibootinfo^.framebuffer_bpp);
case (VideoInterface^.FrontBuffer.BitsPerPixel) of
08:VESA8.init(@VideoInterface^.DrawRoutines);
16:VESA16.init(@VideoInterface^.DrawRoutines);
24:VESA24.init(@VideoInterface^.DrawRoutines);
32:VESA32.init(@VideoInterface^.DrawRoutines);
end;
enable:= VideoInterface^.FrontBuffer.Initialized;
tracer.push_trace('VESA.enable.exit');
end;
procedure init(Register : FRegisterDriver);
begin
tracer.push_trace('VESA.init.enter');
if Register <> nil then
Register('VESA', @enable);
tracer.push_trace('VESA.init.exit');
end;
end.
Loaded 20 of 39 files, more files were not shown because too many files have changed in this diff. Show more