Commit Graph

195 Commits

Author SHA1 Message Date
daniel 2ace2509be feat: add header dependency tracking for programs 2026-07-08 10:24:21 +02:00
daniel 75ef340359 cleanup: remove test programs/libraries 2026-07-08 10:06:07 +02:00
daniel d9d32deb3e feat: reliable Bluetooth pairing, reconnection, and A2DP setup
Four fixes, each a root cause verified on hardware (AX211 + Bose QC Ultra):

1. Link Key Request Reply TRUNCATED: the pending-command queue's params
   buffer was 16 bytes; the reply is 22 (addr 6 + key 16).  The controller
   got 10 key bytes -> every stored-key reconnection failed authentication
   (status 5) since 2026-06-03 (c119a70).  Fresh pairings never touch this
   path, which kept the bug perfectly disguised as a headset quirk.

2. Secure Connections host support (0x0C7A) now enabled: bonds are minted
   as P-256 (Type=7), interoperable with BlueZ's, and SC-bonded peers can
   actually authenticate us.

3. Never write the BD_ADDR override (0xFC31) with the factory address:
   it desyncs the firmware's crypto address from the on-air one and ALL
   SSP pairing fails with status 5.  (The spoofing feature itself was
   already known-cosmetic: the baseband answers pages on the factory
   address regardless.)  import-bluez-bond.sh now removes the override.

4. A2DP channel setup: wait for Encryption Change before dialing L2CAP
   (post-SSP sinks ignore unencrypted CONN_REQ), and LISTEN 2.5s first --
   on reconnection the sink dials AVDTP itself and ignores our dials while
   doing so.  Ends the historical connRsp=FFFF retry-then-give-up failures.

Plus: queued security replies now log delivery + controller status.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 19:46:02 +02:00
daniel 13a841d0f2 feat: auth-failure bond recovery + BlueZ bond import for dual-boot BT
- On Authentication Failure (Auth Complete status!=0 -- previously swallowed
  silently -- or disconnect reason 0x05), drop the stale local link key so
  the next connect falls back to fresh SSP pairing instead of failing
  identically forever (BlueZ behavior).  Log the link-key exchange.

- scripts/import-bluez-bond.sh: copy a BlueZ link key into the MontaukOS
  key store on the installed root.  Root cause: the AX211 BD_ADDR override
  (0xFC31) is cosmetic -- the baseband answers pages on the FACTORY address,
  so peers see Linux and MontaukOS as ONE device with ONE key slot, and each
  OS's pairing clobbers the other's key.  Sharing identity + key ends the
  fight: both OSes reconnect (incl. autoconnect) without re-pairing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 13:44:47 +02:00
daniel 5314af3718 feat: fully async Intel BT firmware bring-up + HCI multi-packet event reassembly
The BT firmware download now runs from the idle loop after boot (zero boot
stall), completing the async goal.  What made every earlier deferral attempt
fail was a months-latent HCI-layer bug, not the deferred environment:

  WaitCommandComplete returned after the FIRST USB packet of an event, but
  events larger than the 64-byte interrupt max-packet (like the AX211's
  96-byte FC05 TLV version response) span several packets.  Sending the next
  command while the tail of the previous response was still in flight wedges
  the AX211 bootloader into permanently ignoring commands.  Boot-time flanterm
  rendering added milliseconds between commands and accidentally paced the
  protocol past the race -- which is why the synchronous bring-up always
  worked and every log-suppressed (deferred) bring-up went mute at FC05 #2,
  regardless of scheduling/MSI/xHCI fixes.

  Fix: reassemble multi-packet Command Complete/Status events in the
  transfer callback; the mailbox is marked ready only when the declared
  event length has fully arrived.  This inherently paces command flow and,
  as a bonus, the TLV version read now sees the full response (sbe_type
  present -> ECDSA/RSA selection is no longer a guess).

Also: per-slot EP0 completion tracking in the xHCI (a waiting ControlTransfer
can no longer be released early by another device's EP0 completion).

Verified on the AX211: instant boot, background download, real BD_ADDR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:31:30 +02:00
daniel 37f5ff892c feat: fast Intel BT firmware download (bulk-pipelined payload, no timeout burns)
Two fixes, verified on the AX211 (8087:0033), ibt-1040-0041.sfi, 720 KB:

1. TryHeader waited 1500+2000 ms for secure-send results after the CSS and
   key/signature sends, but on success this controller stays SILENT until
   the end of the whole download (traced) -- both timeouts always burned in
   full.  A rejection arrives within milliseconds, so 250 ms windows lose
   nothing and save ~3 s per cold boot.

2. The payload now goes over the bulk OUT endpoint with up to 7 fragments
   in flight (the btusb bootloader path for 0xFC09), replacing ~2900
   synchronous 3-stage EP0 control transfers.  Headers stay on EP0; the
   ACL TX DMA ring is reused (no ACL header, no NOCP credit accounting).
   DrainBulkTx() ensures all bytes reach the controller before waiting for
   the download-complete result.

Also in this branch since main: IRQ-safe BT-TRACE ring (KernelLogStream in
TransferCallback deadlocked on the terminal Mutex from MSI context), xHCI
interrupt-IN ZLP length fix, always-re-arm of the BT event pipe,
InPollContext same-core owner check, TLV version read retry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 11:52:21 +02:00
daniel c6a4e8d008 wip: BT firmware debugging 2026-07-06 18:17:06 +02:00
daniel f437601b76 wip: async BT firmware download attempt — DO NOT MERGE, breaks AX211 bring-up
Deferring the Intel BT firmware download off the boot path made the AX211
bootloader stop answering after the first FC05; even the final synchronous
revert freezes boot, so one of the 'neutral' fixes kept in this diff breaks
the bring-up on its own (candidates: BT-TRACE logging inside TransferCallback,
unconditional interrupt-IN re-queue after error completions on a halted EP,
xHCI interrupt-IN ZLP len fix interacting with HID, InPollContext owner
check).  Full history + next experiments in memory notes, 2026-07-05/06.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 15:46:06 +02:00
daniel fcf8ae1e0b feat: add Power GUI app (powermgr) 2026-07-05 11:34:27 +02:00
daniel 35e5aba23f feat: HWP scaling, C1E, closed-loop thermal governor for Intel CPUs 2026-07-05 10:51:11 +02:00
daniel 46c56b057b fix: RTL-SDR bug fixes and accuracy improvements 2026-07-03 10:36:41 +02:00
daniel 5363ca5265 feat: add RTL-SDR, R820t drivers, radio APIs, and sdr demo tool 2026-06-22 11:49:16 +02:00
daniel c8d8ed6ebe cleanup: Bluetooth/A2DP code cleanup 2026-06-21 15:01:37 +02:00
daniel 4596f8d708 feat: release notes for 0.1.4; archive 0.1.4 iso; bump version to 0.1.5 2026-06-21 12:46:48 +02:00
daniel 4cda83aa58 feat: auto-generate and verify TCC C API syscall numbers 2026-06-21 12:32:22 +02:00
daniel c92993a16a cleanup: rename Graphics:Cursor => Graphics::Framebuffer 2026-06-21 10:42:27 +02:00
daniel 772eaee9f4 feat: introduce bootloader-agnostic Boot Contract, add btlist command to list connected Bluetooth devices 2026-06-20 21:25:24 +02:00
daniel de871ac402 fix: lock crash report ring buffer (SMP race) and guard crashpad crash loop 2026-06-19 19:36:21 +02:00
daniel 820b908b80 fix: convention fix, performance improvement in kcp::cstringstream 2026-06-19 18:37:19 +02:00
daniel d68dd6979d cleanup: remove early kernel-mode PanelBar functionality 2026-06-19 18:29:37 +02:00
daniel f2aaa39ca6 feat: add proclist command, fix TLS bug, link libc for system programs 2026-06-19 12:03:12 +02:00
daniel ac25a4edd5 feat: add support for console sessions to crashpad and crash handling in kernel 2026-06-18 12:56:29 +02:00
daniel a96519f8a6 cleanup: const and type hygeine in tabcompletion module 2026-06-18 12:20:25 +02:00
daniel 580a95348a feat: complete command completion in shell 2026-06-18 07:56:00 +02:00
daniel a22ac7ceb4 fix: fix Terminal zoom inconsistency 2026-06-17 18:18:46 +02:00
daniel 94997c2cda fix: fix Terminal scrolling issue at zoom 2026-06-17 18:10:07 +02:00
daniel 84f200db8b feat: add Console Session mode 2026-06-17 18:00:47 +02:00
daniel b922207f04 feat: add cwd file matching to shell tab completion 2026-06-17 07:58:41 +02:00
daniel 4261212913 feat: add support for shell builtins to command completion 2026-06-16 18:41:56 +02:00
daniel f616bf6a86 fix: ensure tab completion is not reliant on single-digit volume number 2026-06-16 14:54:49 +02:00
daniel 248afb844c fix: shell tab completion - ensure loop continues if file with non-.elf extension is encountered 2026-06-16 14:37:58 +02:00
daniel 3b87ab5ec5 feat: add rudimentary tab completion for executables to shell 2026-06-16 14:02:46 +02:00
daniel e3dc1e881d cleanup: namespace Montauk (capital M) => montauk::abi 2026-06-16 09:09:16 +02:00
daniel b091af7653 feat: allow MAC spoofing in Bluetooth stack, show paired devices in Bluetooth app 2026-06-16 08:49:06 +02:00
daniel 4dc310e616 fix: prevent NVMe completion-queue desync from breaking reads 2026-06-13 17:41:11 +02:00
daniel 25f9d6e401 fix: fix TCP stack bugs 2026-06-13 17:06:54 +02:00
daniel 22691c5c17 feat: A2DP reliability improvements 2026-06-12 11:48:24 +02:00
daniel ca79678823 feat: A2DP bluetooth audio working 2026-06-10 16:00:42 +02:00
daniel dff5a4a4b1 fix: fix UI issues in Files app dialogs 2026-06-07 10:56:43 +02:00
daniel 64f5c67630 feat: release notes for 0.1.3; archive 0.1.3 iso; bump version to 0.1.4 2026-06-07 10:13:56 +02:00
daniel 3d620673c0 feat: filesystem and Files app support for >64 file entries, 64-bit sizes, async ops, GUI toolkit improvements to devexplorer app 2026-06-07 09:33:46 +02:00
daniel 6554ef7e15 fix: fix Bluetooth shutdown delay with no active connections 2026-06-06 18:46:35 +02:00
daniel cee21738ee feat: disconnect Bluetooth devices, flush disks on shutdown/reboot, display progress in login.elf window 2026-06-06 18:27:19 +02:00
daniel b51ab42eb9 feat: use MTK toolkit widgets in login.elf, improve login.elf draw performance 2026-06-06 17:32:57 +02:00
daniel c27516b8fd feat: Word Processor discovers fonts automatically (via 0:/fonts), UI fix 2026-06-06 10:12:11 +02:00
daniel df204cc15a feat: libdialogs GUI tweaks 2026-06-05 19:29:21 +02:00
daniel 6b44b3ccc9 feat: extend Files app marquee selection and highlight to list view 2026-06-04 07:47:42 +02:00
daniel c119a70d5b feat: Intel BT firmware download, A2dp & Bluetooth audio progress 2026-06-03 18:05:17 +02:00
daniel c4e610991f feat: add build numbering 2026-05-30 10:22:40 +02:00
daniel 90788e842f fix: fix VFS Delete op for Ramdisk driver 2026-05-27 18:06:27 +02:00