Compare commits

...
Author SHA1 Message Date
t3hn3rd c0c199bfe6 .gitattributes update
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Updated .gitattributes linguist excludes for compile-time directories.
2026-03-02 21:48:10 +00:00
t3hn3rd 7ec3bcb9b9 .gitattributes & doc directory
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Added gitattributes for linguist exclusions
- Created empty doc folder for local working docs
2026-03-02 21:41:14 +00:00
admin 4bd0a2dfbf Merge pull request 'Merge feature/graphics-interrupts into develop' (#14) from feature/graphics-interrupts into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #14
2026-03-02 19:19:46 +00:00
admin 431e5bc8f4 Merge pull request 'Merge feature/USB into develop' (#13) from feature/USB into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #13
2026-03-02 19:14:05 +00:00
t3hn3rd 8169d93a9c refactor: move render loop & USB hotplug to timer-driven units
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Replace the blocking main render loop in kernel.pas with two new
timer-hooked units that are driven by the 1024Hz PIT interrupt:

- graphicsrefresh: calls desktop.update, uidebug.update, lvgl_handler
  and video.Flush every 4 ticks (~256 FPS target).
- usbhotplug: calls usbcore.usb_check_hotplug every 1024 ticks (~1Hz).

The kernel main procedure now registers both timer hooks and enters an
idle STI/HLT loop (kernel.yield), allowing the CPU to sleep between
interrupts instead of busy-spinning.

Also removes the unused myUserLandFunction and reorders early syslog
init calls for clarity.
2026-03-02 19:04:42 +00:00
t3hn3rd 547251dbd0 update: Kernel.pas changes to align with USB implementation
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Kernel.pas updated to init USB devices & check for hotplug.
- USB Poll removed given USB stack is now interrupt driven.
2026-03-02 15:53:40 +00:00
t3hn3rd 7bbcc44c5e Feature: USB - Hotplug, mass storage, disconnect callbacks, dynamic device lists
- Add disconnect callback (fnDisconnect) to TUSBDevice for safe unplug handling
- Add HotplugArmed/PortChangePending flags to TUSBHCDriver for deferred
  hotplug processing from ISR context (OHCI RHSC, EHCI PCD, xHCI PSC)
- Implement usb_rescan_port() and usb_check_hotplug() in usbcore
- Add usb_bulk_transfer_wait() with timer-based timeout (bios_data_area)
- Add timer-based timeout to usb_control_msg polling loop
- Replace static device arrays with dynamic linked lists in class drivers:
  usb_keyboard (KeyboardList), usb_mouse (MouseList), usb_storage (StorageList)
- Add 3-strike fail-count self-deactivation in keyboard/mouse poll loops
- Add unload() disconnect handlers for keyboard, mouse, and storage drivers
- Implement USB Mass Storage BOT driver (usb_storage.pas):
  CBW/CSW transport, SCSI INQUIRY/READ_CAPACITY/READ10/WRITE10,
  storagemanagement integration with read/write callbacks
- xHCI: acknowledge port status change W1C bits in event handler
- Integrate usb_check_hotplug + poll_keyboards/poll_mice into kernel main loop
2026-03-02 15:52:49 +00:00
t3hn3rd 25475a88a7 featur: USB - Add device tracking, stall recovery, removal, and terminal command
- Track enumerated devices per-HC via linked list (hc^.Devices)
- Add usb_clear_halt() for endpoint stall recovery (CLEAR_FEATURE)
- Add usb_remove_device() to clean up and free device records
- Add get_hc() for indexed host controller access
- Implement 'USB' terminal command showing HC info, connected devices,
  speeds, class descriptors, and endpoint details
2026-03-02 15:50:55 +00:00
t3hn3rd db49c29627 fix: lowercase names for units
- PCI.pas -> pci.pas
2026-03-02 13:38:10 +00:00
t3hn3rd c237553508 fix: ps2_keyboard report key-up events for break codes
The PS/2 keyboard callback hardcoded is_down_code := true for every
scancode, so key releases were never reported. This caused keys to
repeat endlessly until the next key was pressed.

In PS/2 scancode set 1, bit 7 indicates a break (release) code.
The callback now:
- Detects break codes via (scancode AND $80)
- Masks to base code (scancode AND $7F) for key matrix lookup
- Sets is_down_code := false for break codes
- Updates modifier state (shift/ctrl/alt) before building the
  key event, so modifier releases take effect immediately

Files changed:
- ps2_keyboard.pas: rewrite callback to handle make/break codes
2026-03-02 13:37:29 +00:00
t3hn3rd 0c96d32754 feature: move all USB HC drivers from polling to interrupt-driven completion
Replace main-loop polling (poll_all, poll_keyboards, poll_mice) with
hardware interrupt handlers for all four USB host controller drivers.

Each HC driver (XHCI, EHCI, OHCI, UHCI) now:
- Registers an ISR on its PCI interrupt line via isrmanager
- Enables hardware interrupts after HC initialization
- Acknowledges interrupt status in the ISR before calling poll,
  preventing interrupt storms on level-triggered PCI lines
- Uses a PollBusy re-entrancy guard to prevent ISR/inline poll races

usbcore gains a completion hook system (register_completion_hook /
fire_completion_hooks) so HID drivers (keyboard, mouse) are notified
directly from the ISR after transfer completion.

Files changed:
- usbcore.pas: completion hook infrastructure
- XHCI.pas: ISR, enable_interrupts, submit ordering fix
- EHCI.pas: ISR, enable_interrupts, status ack in ISR
- OHCI.pas: ISR, enable_interrupts, status ack in ISR
- UHCI.pas: ISR, enable_interrupts, status ack in ISR
- usb_keyboard.pas: register completion hook
- usb_mouse.pas: register completion hook
2026-03-02 13:36:40 +00:00
t3hn3rd 3f83f279d7 XHCI driver implementation
- Beginnings of a functional XHCI driver implemented.
2026-03-02 12:24:02 +00:00
t3hn3rd 82fe9fa6df EHCI Implementation
- Beginnings of a functional EHCI driver implemented.
2026-03-02 12:23:35 +00:00
admin 983d9a428d Merge pull request 'feature: Tracer O(1) ring buffer refactor' (#12) from feature/tracer-optimizations into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #12
2026-03-01 22:29:53 +00:00
t3hn3rd 2fa77d8295 Merge branch 'feature/tracer-optimizations' into feature/USB 2026-03-01 21:26:56 +00:00
t3hn3rd f53afc1d2d feature: Tracer O(1) ring buffer refactor
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Replaced O(n) shift loop + StringCopy/kalloc/kfree with O(1) ring
  buffer storing PChar pointers directly (zero allocation).
- Eliminated mod operator (causes int64 promotion + broken RTL helpers
  on i386 bare-metal); uses pure uint32 branch arithmetic.
- Removed dead code: PTracerEntry/TTracerEntry linked list types,
  head/tail PTracerEntry vars, c_lock boolean
- Dropped lmemorymanager and serial from uses clause
- pop_trace remains as no-op stub for ABI compat
- get_trace_N uses underflow-safe index: if head >= idx then
  head - idx else MAX_TRACE - (idx - head)
- Added print_traces debug helper
2026-03-01 21:26:35 +00:00
t3hn3rd cb7144f282 USB Stack & HID Refactor
- New units: usbtypes, usbcore, usbhub, UHCI, OHCI, usb_keyboard,
  usb_mouse
- usbtypes: shared USB descriptors, constants, HC abstraction,
  aligned alloc, unit tests
- usb_keyboard: USB HID boot keyboard driver with HID-to-ASCII
  translation, polling, unit tests
- usb_mouse: USB HID boot mouse driver with delta/scroll/button
  processing, polling, unit tests

HID Layer Restructure:
- keyboard.pas: stripped to abstract API (hook + reportKeyEvent),
  no PS/2 dependency
- mouse.pas: absorbed mousestate.pas, now owns
  position/buttons/scroll/hooks directly
- mousestate.pas: deleted (merged into mouse.pas)
- New ps2_keyboard.pas: PS/2 scan code translation,
  calls keyboard.reportKeyEvent
- New ps2_mouse.pas: PS/2 packet handling, calls
  mouse.setMousePos/fireMouseEvent

LVGL Integration:
- lvgl.pas: updated to use mouse.pas directly (was mousestate),
  improved keyboard input handling with proper key held/release tracking
- vterminal.pas: removed serial debug logging, dropped serial dependency

Kernel:
- kernel.pas: added USB units, USB polling in main loop, unit test
  calls, ps2_keyboard/ps2_mouse init
2026-03-01 21:23:33 +00:00
admin afdc83eaf6 Merge pull request 'Merge feature/hardening into develop' (#11) from feature/hardening into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #11
2026-03-01 02:57:23 +00:00
t3hn3rd 2239d9c848 Rebase: Fixed console -> syslog interface
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2026-03-01 02:46:13 +00:00
t3hn3rd beb4b253ab fix: guard against uint32 underflow in memset/memcpy and strings unit
When size=0 was passed to memset() or memcpy(), the loop bound
`0 to size-1` underflowed to $FFFFFFFF, iterating ~4 billion times
and causing an immediate page fault.

Added `if size = 0 then exit` guards to both memset() and memcpy()
in util.pas.

Also guarded all `for i:=0 to X-1` loops in strings.pas where X
could be 0 on empty string inputs:
- stringToUpper: wrap loop in `if stringSize > 0`
- stringToLower: wrap loop in `if stringSize > 0`
- stringEquals: early exit when both sizes are 0
- stringToInt: early exit when string is empty

Additionally fixed all previously identified bugs in strings.pas:
- hexStringToInt: guard against empty string underflow
- stringConcat: cache stringSize calls to avoid redundant O(n) scans
- stringTrim: clamp length to source string size
- stringSub: bounds check start/size against source length
- stringReplace: complete rewrite - was using stringEquals() for
  substring matching (only matched at string end), dropped prefix
  chars, had dangling assignment overwriting valid result with
  uninitialized pointer, and had unused variable
- stringIndexOf: rewritten to use new stringMatchAt() helper for
  correct substring matching
- stringContains: simplified to delegate to fixed stringIndexOf(),
  also fixing uint32 underflow when sub was empty
- stringToInt: removed always-true `v >= 0` check on uint32
- intToString: implemented (was a stub returning ' ')
- Added stringMatchAt() helper for prefix comparison
- Added comprehensive UnitTest procedure with 77 assertions
  including adversarial empty/nil/boundary inputs
2026-03-01 02:33:28 +00:00
admin 084130da80 Merge pull request 'feat: VESA rendering implementation & LVGL for graphics drawing' (#10) from feature/lvgl into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2026-03-01 02:25:47 +00:00
t3hn3rd f752be48ce refactor/feature/fix: Major refactor of codebase
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
refactor(stdio): replace console/terminal command system with buffer-based stdio
- Introduced stdio.pas as the unified command I/O layer.
- All 31 command procedures across 15 files now receive stdin_buf,
  stdout_buf, and stderr_buf (POutBuf) instead of a single outbuf.
- vterminal.pas creates all three buffers per command invocation and
  displays both stdout and stderr.
- Deleted console.pas, terminal.pas, and 9 obsolete windowing programs
  (shell, splash, edit, memview, themer, netlog, vmlog, vmstate, udpcat).
- Migrated all registerCommand calls to stdio, rewrote vterminal
  processCommand to use stdio.findCommand, and added proper error
  routing to stderr for invalid params, bad paths, and system errors.

refactor(syslog): replace console logging with serial-backed syslog
- Introduced syslog.pas for kernel-level logging over serial/dev.
- Migrated all boot logging in kernel.pas from console.outputln/
  writestringln to syslog.logln/writestringln.
- Converted 19 fault handlers, hashmap, lists, scheduler, tracer, net,
  udp, and all driver init paths to use syslog.
- Rewrote BSOD in util.pas (50+ calls) from console to syslog.
- Removed CONSOLE_SLOW_REDRAW, TRGB565, TRGB565Pair, and HWND
  from system.pas.

fix(keyboard): add ring buffer and proper press/release cycling for LVGL input
- Replaced the single last_key/key_pressed slot in lvgl.pas with a
  16-entry ring buffer (kb_buf, kb_head, kb_tail) to prevent ISR
  overwrites when typing fast.
- Added a kb_pending_release flag so each keystroke gets a
  full PRESSED->RELEASED cycle before the next key is consumed —
  LVGL requires this pairing and was silently dropping intermediate
  keys when receiving consecutive PRESSED events without
  intervening releases.

feat(vterminal): use Hack monospace font for terminal output
- Added Hack Regular 14px (hack_14.c) as a custom LVGL font.
- Removed the .static_bitmap field from the generated font file
  (not present in LVGL 9.2 lv_font_t struct).
- Declared the hack_14 external symbol in lvgl.pas and switched
  vterminal's text label from lv_font_montserrat_14 to hack_14
  for proper monospace terminal rendering.
2026-03-01 02:06:31 +00:00
t3hn3rd dbe6e958e2 fix: More changes for Hyper-V PS/2 mouse compatability
continuous-integration/drone/push Build is passing
2026-02-28 22:54:19 +00:00
t3hn3rd 201cda4c29 fix: Pipeline fixes for temporary lvgl directory
continuous-integration/drone/push Build is passing
- Fixed missing lvgl artefacts for build pipeline causing drone failures.
2026-02-28 16:48:41 +00:00
t3hn3rd e54b34aa93 fix: gate AVX enable on XSAVE support and set CR4.OSXSAVE first
continuous-integration/drone/push Build is failing
XGETBV/XSETBV require CR4 bit 18 (OSXSAVE) to be set before execution,
otherwise the CPU raises #UD (invalid opcode). Hyper-V enforces this
strictly; VirtualBox was silently tolerating it.

- Check both AVX and XSAVE CPUID flags before attempting AVX enable
- Set CR4.OSXSAVE (bit 18) before issuing XGETBV/XSETBV
- If XSAVE is not exposed by the hypervisor, AVX enable is skipped
  gracefully instead of faulting
2026-02-28 16:31:57 +00:00
t3hn3rd fcfe7c3204 fix: Mouse driver Hyper-V compatibility + resolution-independent bounds clamping
- Add mouse_wait_long() with 100,000 iteration timeout for init-time
  i8042 controller commands (mouse_write/mouse_read/load). The original
  mouse_wait() stays at 100 iterations for ISR-safe use in main().

- In load(): use mouse_wait_long() for all direct port I/O ($64/$60)
  and clear CCB bit 5 (AND NOT $20) to ensure the mouse clock is not
  disabled — required for Hyper-V which enforces this strictly.

- Replace Console.getConsoleProperties^.Width/Height with
  video.frontBufferWidth/Height for mouse bounds clamping. The old
  console properties are zero when console.init() is not called,
  which locked the cursor to (0,0). Add 'video' to uses clause.
2026-02-28 16:31:26 +00:00
t3hn3rd be4b482bde fix: LVGL rendering for 16bpp framebuffers (HyperV compatibility)
continuous-integration/drone/push Build is failing
The LVGL flush callback assumed 32bpp (4-byte stride, direct pixel
copy), causing corrupted output on hypervisors that fall back to
16bpp modes (e.g. HyperV at 1600x1200x16).

- lvgl.pas: Make lvgl_flush_cb BPP-aware; add ARGB8888->RGB565
  conversion path for 16bpp, keep direct copy for 32bpp. Replace
  static lv_buf1 array (hardcoded 1600px wide) with kalloc'd buffer
  sized to actual screen width.
- doublebuffer.pas: Fix allocateBackBuffer size from (W*H*BPP) to
  (W*H*BPP) div 8 to get correct byte count.
- vesa.pas: Account for BPP in allocateVESAFrameBuffer page range
  calculation to avoid under-mapping at higher BPP/resolutions.
- Removed the initialization of console in kernel.pas as this will
  cause issues on some systems that don't expect to need to allocate the
  textmode buffer.
2026-02-28 15:38:11 +00:00
t3hn3rd 6f50b053b7 Full LVGL binding & Cursor fix
- Full(ish) LVGL bindings implemented.
- Cursor replaced with an actual cursor.
2026-02-28 00:06:10 +00:00
t3hn3rd ece376660c Removed old lv_conf
continuous-integration/drone/push Build is failing
2026-02-27 22:43:53 +00:00
t3hn3rd 98a14bc7dc More work towards LVGL implementation
continuous-integration/drone/push Build is failing
2026-02-27 22:43:02 +00:00
t3hn3rd 989e36ffe2 Initial LVGL modifications
Basic LVGL wrapper with an example desktop & windowing system.
2026-02-27 16:30:31 +00:00
t3hn3rd ceb03a9d7e Merge branch 'feature/fpc-3.2.2' into feature/lvgl
# Conflicts:
#	.drone.yml
#	virtualbox-wrapper.ps1
2026-02-26 15:51:37 +00:00
admin 924305a1ab Merge pull request 'Migration from FPC 2.6.4 to FPC 3.2.2' (#9) from feature/fpc-3.2.2 into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #9
2026-02-26 12:51:09 +00:00
t3hn3rd 4ef61b0d3b Drone failing due to webhook stage
- Added ignore failure to discord webhook stage.
2026-02-26 12:23:42 +00:00
t3hn3rd 2b071a58c7 feature: Upgrade FPC from 2.6.4 to 3.2.2
continuous-integration/drone Build was killed
Migrate the build toolchain from Free Pascal Compiler 2.6.4 to 3.2.2.
FPC 3.2.2 requires a significantly expanded custom system unit and
several syntactic adjustments across the codebase.

Dockerfile:
- Bump FPC_VERSION from 2.6.4 to 3.2.2

compile_sources.sh:
- Replace obsolete -Op3 flag with -OpPENTIUM3

linker.script:
- Add /DISCARD/ section for .init_array, .fini_array, .ctors, .dtors,
  .eh_frame, .gcc_except_table, and .note.GNU-stack sections emitted
  by FPC 3.2.2

system.pas:
- Fix hresult to 'type longint' (was cardinal, incompatible with 3.2.2)
- Add required types: SizeInt, SizeUInt, PtrInt, PtrUInt, NativeInt,
  NativeUInt, CodePointer, TTypeKind, jmp_buf, TExceptAddr, TGuid,
  FileRec, TextRec
- Add required globals: ExceptAddrStack, ExitCode, ErrorAddr, ErrorCode,
  ExitProc, StackBottom, StackLength, RandSeed
- Implement compilerprocs: fpc_initializeunits, fpc_do_exit,
  fpc_handleerror, fpc_rangeerror, fpc_overflow, fpc_divbyzero,
  fpc_objecterror, fpc_abstracterror, fpc_stackcheck, fpc_iocheck,
  fpc_pushexceptaddr, fpc_popaddrstack, fpc_setjmp (asm),
  fpc_longjmp (asm), fpc_shortstr_assign, fpc_mul_int64 (asm),
  fpc_getmem, fpc_freemem, fpc_reraise, fpc_raiseexception,
  fpc_catches, fpc_doneexception
- Add move() procedure with FPC_MOVE alias

util.pas, serial.pas:
- Fix inline asm functions (getESP, inl, inw, inb, sinb) to use temp
  variables instead of function-name result — FPC 3.2.2 no longer
  allows 'MOV funcname, reg' syntax in inline asm blocks

lmemorymanager.pas:
- Export kalloc/kfree with public aliases (kernel_kalloc, kernel_kfree)
  so system.pas fpc_getmem/fpc_freemem can link to them
2026-02-26 00:01:40 +00:00
t3hn3rd 1145b900e4 Merge pull request 'Virtualbox-Wrapper - Bugfix' (#8) from feature/Virtualbox-Wrapper-Fix into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #8
Reviewed-by: Aaron Hance <[email protected]>
2025-03-23 19:01:28 +00:00
t3hn3rd 436cd86d8c Updated virtualbox wrapper as it was causing stale powershell processes to build up over time
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Updated `Virtualbox-Wrapper.ps1` to include `Get-Job | Stop-Job | Remove-Job -Force` at the end of execution, as the spawning of jobs was causing stale PowerShell processes to build up over time.
2025-03-23 17:54:55 +00:00
t3hn3rd 540444dfbf Merge pull request 'feature/drone-discord-webhooks' (#7) from feature/drone-discord-webhooks into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #7
2025-03-23 15:21:58 +00:00
t3hn3rd 2d7c51ed15 Further formatting cleanups
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
- Attempted to remove automatic discord embeds by surrounding any markdown links with `<` `>`.
- Corrected some spacing.
2025-03-23 01:14:28 +00:00
t3hn3rd c842d9774f Formatting Fixed - Enchancing
continuous-integration/drone/push Build is passing
- Formatting is now fixed & newlines are working correctly, shame the YAML looks w?*! 🤣
- Added sections to the message for links to Gitea & Drone.
2025-03-23 00:59:36 +00:00
t3hn3rd 5963504f6b More attempts at format fixes
continuous-integration/drone/push Build is passing
Formatting still off, condensing to one line to see if the escaped newlines will work. YAML is wild.
2025-03-23 00:48:31 +00:00
t3hn3rd e64a59714a Formatting Fixes
continuous-integration/drone/push Build is passing
Formatting was off for the message posted to Discord, it also triggered at the start of the pipeline.
- Fixed formatting with an attempt to use newlines.
- Added a depends_on `compile`.
2025-03-23 00:41:22 +00:00
t3hn3rd dd5d908e43 DroneCI config updated to push to discord webhook
continuous-integration/drone/push Build is passing
- `.drone.yml` updated to push notifications to the discord webhook.
2025-03-23 00:31:20 +00:00
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 8be364c990 Merge pull request 'feature/ci-cd-drone-migration' (#3) from feature/ci-cd-drone-migration into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #3
2025-03-10 20:08:38 +00:00
t3hn3rd 0e2c6b2936 Final commit to merge through develop & master
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is failing
- 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.

# Conflicts:
#	.drone.yml
2025-03-10 12:48:21 +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 632c3fa66b 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:05:39 +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 875e3e4765 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 19:29:46 +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
t3hn3rd e28d68128d Merge branch 'feature/video-refactor' of https://gitlab.spexeah.com/spexeah/asuro into feature/video-refactor 2022-02-07 19:48:15 +00:00
t3hn3rd a9969d58f8 Draw texture function added to Video driver. 2022-02-07 19:48:01 +00:00
t3hn3rd d7a54d858d TARGA & Texture Units
Added TARGA and Texture units to represent & parse TARGA into and provide a standard texture format for use when drawing.
2022-02-07 19:48:00 +00:00
t3hn3rd 4e991c3e6f Double Buffer with SSE 128 copy working 2022-02-07 19:48:00 +00:00
t3hn3rd a3217de71a SSE MOVUPS/128bit Memcpy + Fixed Doublebuffer 2022-02-07 19:48:00 +00:00
t3hn3rd 19b433a19f Vesa32 additions + util functions to support 2022-02-07 19:48:00 +00:00
t3hn3rd 69d1d22a18 Fixed files being weird with case/unit searches 2022-02-07 19:48:00 +00:00
t3hn3rd 5c15343ed0 Delete files to recommit with lowercase names. 2022-02-07 19:48:00 +00:00
t3hn3rd 3ae349fbc8 New modular driver set for video
Started outlining how the modular driver set will look for video drawing routines. Currently supports Drawing pixels to the screen & Flushing backbuffer -> frontbuffer.
Still very much test code, tracer is used everywhere for debugging, NOT DEVELOP READY.
Many more draw routines need implementing - such as, but not limited to; drawRect, drawBitmap, drawLine, drawCurve, drawCircle.

TODO: Implement the aforementioned routines in all VESA modes + WindowManager.
2022-02-07 19:48:00 +00:00
t3hn3rd 78c060c114 Abstracted video driver somewhat
Split out video driver into abstract/standard/implementation.
2022-02-07 19:48:00 +00:00
t3hn3rd cd925e96c2 Enabled AVX + Changed flush to flush 2 pixels per iteration. 2022-02-07 19:48:00 +00:00
t3hn3rd 142dd486dd Double buffering implemented
Double buffering is now enabled with the use of the new large alloc (klalloc).
2022-02-07 19:48:00 +00:00
t3hn3rd beeeabd441 Expaneded Video.pas and addec color.pas
Backbuffer will need modification to lmemorymanager to remove the limits to allocation size.
2022-02-07 19:48:00 +00:00
t3hn3rd b73c66f6d6 Started work on refactored video. 2022-02-07 19:48:00 +00:00
Aaron 189526cab8 Merge branch 'feature/kernel-size-awareness' into 'develop'
Kernel Size Awareness

See merge request spexeah/asuro!32
2022-02-07 19:43:45 +00:00
Aaron 595dd4fbac Merge branch 'feature/compile-script-improvements' into 'develop'
Compile Script Improvements

See merge request spexeah/asuro!31
2022-02-07 19:42:59 +00:00
t3hn3rd ba6d8037d2 Compile Script Improvements
Improved the compile script (compile_sources.sh) to show line numbers on error and generally compile faster.
2022-02-06 13:32:57 +00:00
t3hn3rd 208bda92c8 Kernel Size Awareness
Modified the linker script + Added an init function to System.pas to be called at system boot, this allows tracking of the Kernel start & end addresses, and thus, allows us to calculate the kernel size.
2022-02-06 13:29:29 +00:00
t3hn3rd a7111d3cac Draw texture function added to Video driver. 2022-02-06 13:26:12 +00:00
t3hn3rd d182fd7f46 TARGA & Texture Units
Added TARGA and Texture units to represent & parse TARGA into and provide a standard texture format for use when drawing.
2022-02-06 13:25:04 +00:00
t3hn3rd 4c5038b001 Merge branch 'cherry-pick-24c371ca' into 'develop'
Added new String functions

See merge request spexeah/asuro!30
2022-01-31 11:26:25 +00:00
Aaron 98481ea1ce Added new String functions
(cherry picked from commit 24c371cab1)
2022-01-31 00:36:22 +00:00
t3hn3rd b5582b1284 Double Buffer with SSE 128 copy working 2022-01-30 00:17:50 +00:00
Aaron 346dc4e4c9 Merge branch 'feature/readme-update-1' into 'develop'
Update readme.md

See merge request spexeah/asuro!29
2022-01-29 12:47:56 +00:00
t3hn3rd b2eee58df4 Update readme.md 2022-01-29 12:46:35 +00:00
t3hn3rd 161cea4920 SSE MOVUPS/128bit Memcpy + Fixed Doublebuffer 2022-01-29 01:39:45 +00:00
t3hn3rd 6b81c4ece0 Vesa32 additions + util functions to support 2022-01-23 16:58:46 +00:00
t3hn3rd ee17f69115 Fixed files being weird with case/unit searches 2021-07-07 17:49:04 +01:00
t3hn3rd 81c19bff16 Delete files to recommit with lowercase names. 2021-07-07 17:49:04 +01:00
t3hn3rd e7cda58113 New modular driver set for video
Started outlining how the modular driver set will look for video drawing routines. Currently supports Drawing pixels to the screen & Flushing backbuffer -> frontbuffer.
Still very much test code, tracer is used everywhere for debugging, NOT DEVELOP READY.
Many more draw routines need implementing - such as, but not limited to; drawRect, drawBitmap, drawLine, drawCurve, drawCircle.

TODO: Implement the aforementioned routines in all VESA modes + WindowManager.
2021-07-07 17:49:04 +01:00
t3hn3rd 44f18554e1 Abstracted video driver somewhat
Split out video driver into abstract/standard/implementation.
2021-07-07 17:49:04 +01:00
t3hn3rd 52b42ec975 Enabled AVX + Changed flush to flush 2 pixels per iteration. 2021-07-07 17:49:04 +01:00
t3hn3rd 2815dd9e4d Double buffering implemented
Double buffering is now enabled with the use of the new large alloc (klalloc).
2021-07-07 17:49:04 +01:00
t3hn3rd d057bfc3ff Expaneded Video.pas and addec color.pas
Backbuffer will need modification to lmemorymanager to remove the limits to allocation size.
2021-07-07 17:49:04 +01:00
t3hn3rd e4621c8aaa Started work on refactored video. 2021-07-07 17:49:04 +01:00
t3hn3rd 170b93dd69 Merge branch 'feature/pipeline-docs-fix' into 'develop'
Docgen changes

See merge request spexeah/asuro!27
2021-07-06 19:42:57 +00:00
t3hn3rd 34d6873a6a Docgen changes
Changed docgen job to create doc folder, not public for now.
2021-07-06 20:35:26 +01:00
t3hn3rd e69d06ea4f Merge branch 'joe/ci-suggestions' into 'develop'
3 time the charm

See merge request spexeah/asuro!26
2021-07-06 19:18:24 +00:00
Jinux 2939afa729 3 time the charm 2021-07-06 19:18:23 +00:00
t3hn3rd ad8e80913a Merge branch 'feature/documentation' into 'develop'
Changed comments in Asuro.pas when generated

Changed the Asuro.pas comment to be the standard format in terms of Directory->File (no .pas) for PasDoc gen.

See merge request spexeah/asuro!23
2021-07-05 18:23:11 +00:00
t3hn3rd 4d25ceef77 Merge branch 'feature/documentation' into 'develop'
Tidied up comments for docgen.

Added some documentation to Asuro.pas, ProgManager, AHCI, asfs & ATA_ISR to fix some of the pasdoc/docgen issues.

See merge request spexeah/asuro!22
2021-07-05 18:09:51 +00:00
145 changed files with 71255 additions and 6986 deletions
+66
View File
@@ -0,0 +1,66 @@
kind: pipeline
type: docker
name: build
steps:
- name: build-image
image: plugins/docker
settings:
repo: t3hn3rd/asuro-build
tags: latest
dockerfile: Dockerfile
registry: docker.io
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: compile
image: t3hn3rd/asuro-build:latest
depends_on:
- build-image
commands:
- git fetch --tags
- find . -type f -print0 | xargs -0 dos2unix
- chmod +x /drone/src/*.sh
- /drone/src/compile.sh
- name: upload-iso-artifact
image: alpine/git
depends_on:
- compile
when:
branch:
- master
environment:
GITEA_TOKEN:
from_secret: gitea_token
commands:
- apk add --no-cache curl
- chmod +w Asuro.iso
- cp Asuro.iso "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Uploading Asuro-$(git rev-parse --short HEAD).iso to Gitea Packages..."
- |
curl -X PUT "https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/$(git rev-parse --short HEAD)/Asuro.iso" \
-H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso"
- echo "Updating latest ISO reference..."
- |
curl -X DELETE https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \
-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 \
-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}}"
+8 -1
View File
@@ -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
+6 -2
View File
@@ -10,5 +10,9 @@
/*.sh~
/*.img
src/include/asuro.pas
.vscode/launch.json
.vscode
localenv.json
/lvgl/
dockerout.txt
AGENTS.md
*.log
/doc/*.md
-99
View File
@@ -1,99 +0,0 @@
stages:
- Generate Stub and Versions
- Generate Version Files
- Compile Sources
- Link
- Generate ISO
- Generate Sources List
- Generate Documentation
compile_stub:
stage: Generate Stub and Versions
script:
- chmod +x ./compile_stub.sh
- ./compile_stub.sh
artifacts:
paths:
- lib/stub.o
vergen:
stage: Generate Stub and Versions
script:
- chmod +x ./compile_vergen.sh
- ./compile_vergen.sh
artifacts:
paths:
- release/*.svg
- src/include/asuro.pas
compile_sources:
stage: Compile Sources
script:
- chmod +x ./compile_sources.sh
- ./compile_sources.sh
artifacts:
paths:
- lib/*.o
dependencies:
- compile_stub
- vergen
needs:
- vergen
- compile_stub
link:
stage: Link
script:
- chmod +x ./compile_link.sh
- ./compile_link.sh
artifacts:
paths:
- bin/kernel.bin
dependencies:
- compile_sources
needs:
- compile_sources
isogen:
stage: Generate ISO
script:
- chmod +x ./compile_isogen.sh
- ./compile_isogen.sh
- chmod +x ./compile_sumgen.sh
- ./compile_sumgen.sh
artifacts:
paths:
- ./Asuro.iso
- ./release/checksum.svg
dependencies:
- link
needs:
- link
sourcelist:
stage: Generate Sources List
script:
- chmod +x ./compile_sourcelist.sh
- ./compile_sourcelist.sh
artifacts:
paths:
- ./sources.list
dependencies:
- vergen
needs:
- vergen
docgen:
stage: Generate Documentation
script:
- chmod +x ./compile_docs.sh
- ./compile_docs.sh
artifacts:
paths:
- ./doc/*
dependencies:
- vergen
- sourcelist
needs:
- vergen
- sourcelist
+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]>
+3 -10
View File
@@ -3,18 +3,11 @@
{
"name":"Run",
"request": "launch",
"type": "coreclr",
"type": "PowerShell",
"preLaunchTask": "Build",
"program": "VBoxSDL",
"args": [
"--comment",
"Asuro",
"--startvm",
"7d395c96-891c-4139-b77d-9b6b144b0b93"
],
"script": "${workspaceFolder}/virtualbox-wrapper.ps1",
"args": ["-Command", "up"],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"internalConsoleOptions": "neverOpen"
}
]
}
+24 -2
View File
@@ -9,14 +9,18 @@
"command": "docker-compose",
"args": [
"run",
"builder"
"builder",
],
"type": "shell",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
"dependsOn": [
"Close VirtualBox",
"Clean"
]
},
{
"label": "Build (Builder)",
@@ -26,6 +30,24 @@
"builder"
],
"type": "shell"
},
{
"label": "Clean",
"command": "docker-compose",
"args": [
"down",
"--remove-orphans"
],
"type": "shell"
},
{
"label": "Close VirtualBox",
"command": "./virtualbox-wrapper.ps1",
"args": [
"-Command",
"down"
],
"type": "shell"
}
]
}
+13 -9
View File
@@ -2,18 +2,22 @@ FROM ubuntu:latest
VOLUME ["/code"]
ENV DEBIAN_FRONTEND=noninteractive
RUN dpkg --add-architecture i386
RUN apt-get update
RUN apt-get install nasm curl make:i386 binutils:i386 xorriso grub-pc-bin dos2unix -y
RUN apt-get clean
RUN curl https://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.i386-linux.tar/download --output fpc.tar -L && \
tar -xf fpc.tar
RUN apt-get update && apt-get install -y \
curl dos2unix wget git make nasm binutils xorriso grub-pc-bin gcc gcc-multilib && \
apt-get clean my room
WORKDIR ./fpc-2.6.4.i386-linux
RUN ./install.sh
SHELL ["/bin/bash", "-c"]
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 - && \
pushd fpc-$FPC_VERSION.i386-linux && ./install.sh && popd && \
rm -rf fpc-$FPC_VERSION.i386-linux
COPY compile.sh /compile.sh
RUN mkdir /code
ADD https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver /usr/bin/semver
RUN chmod +x /usr/bin/semver
WORKDIR /code
RUN find . -type f -print0 | xargs -0 dos2unix
ENTRYPOINT ["/bin/bash", "/compile.sh"]
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/compile.sh"]
+32 -44
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
ERRCOUNT=0
echo " "
echo "======================="
@@ -7,56 +7,44 @@ echo "Asuro Compilation"
echo " "
#Compile Stub.asm
./compile_stub.sh
if [ $? -ne 0 ]
then
echo "Failed to compile stub!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
rm -f lib/*
#Generate .pas with versioning headers.
./compile_vergen.sh
runOrFail() {
local binary=$1
local errorText=$2
if $binary; then
echo "Success."
else
echo "$errorText"
ERRCOUNT=$((ERRCOUNT+1))
fi
}
#Compile all .pas sources
./compile_sources.sh
if [ $? -ne 0 ]
then
echo " "
echo "Failed to compile FPC Sources!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo " "
echo "Success."
fi
declare -a run_steps=(
"compile_stub.sh" "Failed to compile stub!"
"compile_vergen.sh" "Versions failed to compile"
"compile_lvgl.sh" "Failed to compile LVGL!"
"compile_sources.sh" "Failed to compile FPC Sources!"
"compile_link.sh" "Failed linking!"
"compile_isogen.sh" "Failed to create ISO!"
)
#Link into a binary.
./compile_link.sh
if [ $? -ne 0 ]
then
echo "Failed linking!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
#Generate an ISO with GRUB as the Bootloader.
./compile_isogen.sh
if [ $? -ne 0 ]
then
echo "Failed to create ISO!"
ERRCOUNT=$((ERRCOUNT+1))
else
echo "Success."
fi
for ((i=0; i<${#run_steps[@]}; i+=2))
do
if [ "$ERRCOUNT" -eq "0" ]
then
script=$(pwd)/"${run_steps[$i]}"
message="${run_steps[$i+1]}"
runOrFail "$script" "$message"
fi
done
#Call generate final artifacts based on failure or success of the above.
if [ "$ERRCOUNT" -ne "0" ]
then
./compile_finish.sh "failed"
. ./compile_finish.sh "failed"
else
./compile_finish.sh "success"
. ./compile_finish.sh "success"
fi
cd ..
cd ..
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo > checksums.md5
for directory in $(find src/ -maxdepth 10 -type d); do
for filename in $directory/*.pas; do
+2 -3
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
@@ -14,5 +14,4 @@ echo "Removing old docs"
rm -rf ./doc/*
echo "Generating Docs..."
./pasdoc/bin/pasdoc -N "Asuro" -T "Asuro OS Documentation" -O "html" -E ./doc/ -S sources.list --use-tipue-search
echo "Docgen finished."
exit 0
echo "Docgen finished."
+2 -2
View File
@@ -1,8 +1,8 @@
#/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
if [ "$1" == "failed" ]
if [[ "$1" == "failed" ]]
then
echo "Errors Occurred, please review."
wget -q https://img.shields.io/badge/build-failed-red.svg -O release/build.svg 2>/dev/null
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
+7 -2
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
@@ -14,4 +14,9 @@ done;
objstring=lib/stub.o" "$objstring
echo "Object Files: "$objstring
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
+118
View File
@@ -0,0 +1,118 @@
#!/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..."
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
echo "Done."
echo " "
echo "LVGL compilation complete."
echo " "
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
+2 -2
View File
@@ -1,7 +1,7 @@
#!/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling FPC Sources..."
echo " "
fpc -Aelf -gw -n -va -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/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
+1 -2
View File
@@ -1,8 +1,7 @@
#!/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
echo "Compiling Stub..."
echo " "
rm lib/*
nasm -f elf src/stub/stub.asm -o lib/stub.o
+1 -1
View File
@@ -1,4 +1,4 @@
#/bin/sh
#!/usr/bin/env bash
echo " "
echo "======================="
echo " "
+55 -47
View File
@@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
echo " "
echo "======================="
echo " "
@@ -8,60 +9,67 @@ chmod +x ./compile_checksum.sh
./compile_checksum.sh
outfile="src/include/asuro.pas"
file="version"
while IFS=: read -r line;do
major=$(echo $line | awk '{print $1}')
minor=$(echo $line | awk '{print $2}')
sub=$(echo $line | awk '{print $3}')
release=$(echo $line | awk '{print $4}')
done <"$file"
{
# this script requires semver tool
wget -q https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver -O bin/semver && chmod +x bin/semver
export PATH="$(pwd)/bin:$PATH"
}
tagref=$(git describe --tags)
revision=$(git rev-parse --short=8 HEAD)
major=$(semver get major $tagref)
minor=$(semver get minor $tagref)
sub=$(semver get patch $tagref)
version=$(semver get release $tagref)
release=$(semver get prerel $tagref)
build=$(semver get build $tagref)
linecount=$(./loc.sh | awk '{print $1}')
sourcecount=$(find src -type f | wc -l)
drivercount=$(find src/driver -type f | wc -l)
revision=$(git rev-list --all --count)
fpcversion=$(fpc -h | grep -m 1 version | awk '{print $5}')
makeversion=$(make -v | grep GNU | awk '{print $3}' | grep -v GNU)
nasmversion=$(nasm -v | awk '{print $3'})
compiledate=$(date +"%d/%m/%y")
compiletime=$(date +"%T")
checksum=$(md5sum checksums.md5 | awk '{print $1}')
echo "{" > $outfile
echo " Include->Asuro - Constants generated during pipeline/compilation for use at runtime." >> $outfile
echo " @author(Autogenerated)" >> $outfile
echo "}" >> $outfile
echo "unit asuro;" >> $outfile
echo " " >> $outfile
echo "interface" >> $outfile
echo " " >> $outfile
echo "const" >> $outfile
echo " VERSION = '$major.$minor.$sub-$revision$release'; //The current full version as a string." >> $outfile
echo " VERSION_MAJOR = '$major'; // Current major version as a string." >> $outfile
echo " VERSION_MINOR = '$minor'; // Current minor version as a string." >> $outfile
echo " VERSION_SUB = '$sub'; // Current sub version as a string." >> $outfile
echo " REVISION = '$revision'; // Current revision as a string." >> $outfile
echo " RELEASE = '$release'; // Current release as a string." >> $outfile
echo " LINE_COUNT = $linecount; // Project line count as compiled as a string." >> $outfile
echo " FILE_COUNT = $sourcecount; // Project line count as compiled as a string." >> $outfile
echo " DRIVER_COUNT = $drivercount; // Number of baked drivers in the current binary." >> $outfile
echo " FPC_VERSION = '$fpcversion'; // Version of the FreePascal Compiler used to compile the current binary." >> $outfile
echo " NASM_VERSION = '$nasmversion'; // Version of the Netwide Assembler used to compile the multiboot stub." >> $outfile
echo " MAKE_VERSION = '$makeversion'; // Version of MAKE used to link the current binary." >> $outfile
echo " COMPILE_DATE = '$compiledate'; // Date in which the current binary was compiled." >> $outfile
echo " COMPILE_TIME = '$compiletime'; // Time in which the current binary was compiled." >> $outfile
echo " CHECKSUM = '$checksum'; // MD5 pseduo-checksum of all of the sourcefiles together." >> $outfile
echo " " >> $outfile
echo "implementation" >> $outfile
echo " " >> $outfile
echo "end." >> $outfile
[[ -n "$release" ]] && version="$version-$release"
cat > $outfile <<EOF
unit asuro;
interface
const
VERSION = '$version';
VERSION_MAJOR = '$major';
VERSION_MINOR = '$minor';
VERSION_SUB = '$sub';
REVISION = '$revision';
RELEASE = '$release';
LINE_COUNT = $linecount;
FILE_COUNT = $sourcecount;
DRIVER_COUNT = $drivercount;
FPC_VERSION = '$fpcversion';
NASM_VERSION = '$nasmversion';
MAKE_VERSION = '$makeversion';
COMPILE_DATE = '$compiledate';
COMPILE_TIME = '$compiletime';
CHECKSUM = '$checksum';
implementation
end.
EOF
echo "Generating release info..."
wget -q https://img.shields.io/badge/version-$major.$minor.$sub--$revision$release-blue.svg -O release/version.svg 2>/dev/null
wget -q https://img.shields.io/badge/revision-$revision-blue.svg -O release/revision.svg 2>/dev/null
wget -q https://img.shields.io/badge/release-$release-blue.svg -O release/release.svg 2>/dev/null
wget -q https://img.shields.io/badge/lines-$linecount-blueviolet.svg -O release/lines.svg 2>/dev/null
wget -q https://img.shields.io/badge/files-$sourcecount-blueviolet.svg -O release/files.svg 2>/dev/null
wget -q https://img.shields.io/badge/drivers-$drivercount-blueviolet.svg -O release/drivers.svg 2>/dev/null
wget -q https://img.shields.io/badge/FPC_version-$fpcversion-lightgrey.svg -O release/fpcversion.svg 2>/dev/null
wget -q https://img.shields.io/badge/NASM_version-$nasmversion-lightgrey.svg -O release/nasmversion.svg 2>/dev/null
wget -q https://img.shields.io/badge/MAKE_version-$makeversion-lightgrey.svg -O release/makeversion.svg 2>/dev/null
wget -q https://img.shields.io/badge/release_date-$compiledate-lightgrey.svg -O release/date.svg 2>/dev/null
wget -q https://img.shields.io/badge/fingerprint-$checksum-important.svg -O release/fingerprint.svg 2>/dev/null
set +e # These can fail on branches and such, for now
wget -q https://img.shields.io/badge/version-$major.$minor.$sub--$revision$release-blue.svg -O release/version.svg
wget -q https://img.shields.io/badge/revision-$revision-blue.svg -O release/revision.svg
wget -q https://img.shields.io/badge/release-$release-blue.svg -O release/release.svg
wget -q https://img.shields.io/badge/lines-$linecount-blueviolet.svg -O release/lines.svg
wget -q https://img.shields.io/badge/files-$sourcecount-blueviolet.svg -O release/files.svg
wget -q https://img.shields.io/badge/drivers-$drivercount-blueviolet.svg -O release/drivers.svg
wget -q https://img.shields.io/badge/FPC_version-$fpcversion-lightgrey.svg -O release/fpcversion.svg
wget -q https://img.shields.io/badge/NASM_version-$nasmversion-lightgrey.svg -O release/nasmversion.svg
wget -q https://img.shields.io/badge/MAKE_version-$makeversion-lightgrey.svg -O release/makeversion.svg
wget -q https://img.shields.io/badge/release_date-$compiledate-lightgrey.svg -O release/date.svg
wget -q https://img.shields.io/badge/fingerprint-$checksum-important.svg -O release/fingerprint.svg
echo "Done versioning."

Some files were not shown because too many files have changed in this diff Show More