Commit graph

111 commits

Author SHA1 Message Date
72639cfb78 feat(aten-gui): implement KVM console viewer with Slint display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:51:56 +00:00
ac496fe03f feat(aten-kvm): implement KvmSession run loop with message dispatch
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:48:13 +00:00
2128d5b58f feat(aten-kvm): implement Hermon tile decoder (full frame + incremental)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:44:58 +00:00
3b1bc6c992 feat(aten-kvm): implement RFB handshake and message parsers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:41:22 +00:00
468513ae7b feat(aten-kvm): add Hermon pixel format conversion (RGB555, 8bpp)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:37:38 +00:00
0880305189 feat: scaffold aten-kvm crate with public types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:35:34 +00:00
01d1287e7a docs: update CLAUDE.md and README.md for aten-gui
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:32:52 +00:00
3c070978a1 Add aten-kvm implementation plan
7 tasks: scaffold crate, Hermon pixel conversion, tile decoder,
RFB protocol, session run loop, GUI integration, nix/docs update.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:28:17 +00:00
f75cd70e23 Add aten-kvm + aten-gui KVM viewer design
Display-only KVM console: RFB protocol with Hermon (WPCM450) video
decoder, Slint framebuffer display, no keyboard/mouse input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:23:15 +00:00
f91bd29742 fix: fix QMAKE path and CRLF line endings in flake.nix
The qtbase setup hook sets QMAKE to a path inside the setup-hook
derivation that doesn't contain an actual qmake binary. Combined
with CRLF line endings injecting \r into shell variable values,
this caused qttypes to compile with cfg(no_qt), producing a Slint
binary with no functional Qt backend.

Fix by overriding QMAKE in preBuild (nix build) and shellHook
(devShell), and converting flake.nix to Unix line endings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:05:37 +00:00
c6d2aa7413 feat: add aten-gui to flake, update devShell with Qt6 deps
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:28:10 +00:00
a497333a07 feat: scaffold aten-gui crate with Slint Qt6 hello world
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:20:04 +00:00
2c75675678 Add aten-gui phase 1 implementation plan
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:12:40 +00:00
1edac4e33b Update CLAUDE.md 2026-03-11 20:11:59 +00:00
19ed947202 Add aten-gui phase 1 design doc
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:11:30 +00:00
df86f2bd51 docs: flesh out README.md and CLAUDE.md
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:53:44 +00:00
ab11099787 chore: remove Go implementation, now replaced by Rust
The Rust rewrite in crates/aten-mount/ has full feature parity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:49:03 +00:00
c07e22f844 fix: add READ TRACK INFORMATION (0x52) and fix unknown opcode behavior
The server could not open the virtual CD-ROM block device because the
Linux kernel sends READ TRACK INFORMATION during device enumeration and
our client was returning ILLEGAL REQUEST instead of track data.

Implemented the 0x52 handler by decompiling the firmware's ReadTrackInfo
function (at 0x00128bea). Returns a 28-byte Track Information Block
describing a single Mode 1 data track covering the full disc.

Also fixed the default SCSI opcode handler to match firmware behavior:
the original IsoCommand default case returns no data with status PASS
(no error sense), but we were returning ILLEGAL REQUEST with FAILED
status, which could cause the host OS to reject the device.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 19:45:01 +00:00
b236cde937 Switch flake.nix build target from Go to Rust
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:57:29 +00:00
5dbc256d6e fix: address code review findings
- Remove panics from build_plugin_packet (return io::Result)
- Drain unknown PDU payloads to prevent stream desync
- Use overflow-safe LBA bounds check in READ(10)/READ(12)
- Move set_nodelay before initial packet exchange
- Move set_read_timeout out of command loop

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:55:31 +00:00
437c6ef446 chore: fix unused import and constant warnings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:49:10 +00:00
de531b2a5c feat: implement aten-mount CLI binary
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:48:37 +00:00
922da15f56 feat: implement SCSI command handlers for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:45:20 +00:00
14b91d27bc feat: implement protocol packet builders and PDU header for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:43:35 +00:00
83581a7d69 feat: add USB descriptor data for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:39:09 +00:00
ad0213d455 feat: implement RC4 encryption for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:36:19 +00:00
05c01bfbea feat: scaffold Rust workspace for aten-mount rewrite
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:34:45 +00:00
6553659ba4 Add Rust rewrite implementation plan for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:06:43 +00:00
81b26c0e3c Add Rust rewrite design doc for aten-mount
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 18:01:56 +00:00
24d67796a3 Add ghidra MCP start script, update .gitignore 2026-03-11 17:39:58 +00:00
559c30030a Update README.md 2026-03-11 16:14:14 +00:00
be65a2a0ca feat: add READ DISC INFORMATION (0x51) and silence zero PDU warning
Add SCSI READ DISC INFORMATION command handler matching the ATEN
firmware response (verified via Ghidra decompilation). Returns a
34-byte Disc Information Block describing a finalized CD-ROM with
1 session and 1 track. Also silence the benign PDU type 0x00000000
the BMC sends after SetEP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:43:04 +00:00
4af5455d9c Add documentation 2026-03-11 15:41:39 +00:00
3bdf350702 fix: correct PlugIn auth by adding SID and fixing device config byte
The PlugIn packet was getting auth failure (status 0x01) from the BMC.
Root cause: device config byte was 0x02 (no SID auth, no descriptor mode)
when BMC expects 0x83 (SID auth ON, descriptor mode ON, device index 2),
and SID bytes were all zeros instead of random values.

Additional corrections from reverse engineering findings:
- idProduct: 0x2222 -> 0x1111 (descriptor_mode=1, always true)
- Interface SubClass: 0x06 -> 0x05 (SFF-8070i, matching original template)
- SetEP subclass: 0x06 -> 0x05 (override to 0x06 only when template=0x02)
- Add missing USB descriptor entries 5-7 from vuDevRespData table
- Mount status >= 0x07 treated as success (original binary quirk)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 15:25:55 +00:00
826edc817a refactor: extract mount library package, add flake.nix
Move protocol and SCSI code into importable mount/ package with a
single public API (Config + Run). Restructure as multi-binary repo
with cmd/aten-mount/ CLI wrapper using context-based cancellation.
Add Nix flake with go_1_26 for builds and devshell.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:28:22 +00:00
2ae20b8827 docs: final sweep - wire format verification, SCSI enumeration, structure maps
Round 6 findings: byte-level verification of all 9 packet types confirmed
correct, 16 new function addresses, 5 missing ISO SCSI handlers documented,
per-device structure layout, VMInfoCalloc extra slot discovery, credential
validation paths, FillErrorData ASC/ASCQ logic. Updated investigation items
(USB descriptors and system/popen marked DONE).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:03:51 +00:00
7155882144 docs: fill protocol gaps - error handling, HTTP upload, multi-device, SetEP
Round 5 findings: TCP error handling deficiencies (no recv/send checking,
infinite retry loops, no SIGPIPE handling), HTTP upload method details
(WebISO empty body, UploadIMA 1KB chunks), multi-device race conditions,
OEM connection type is non-functional (NULL vtable), SetEP fixed endpoints
(0x10/0x20/0x30). Integrated all agent 1-4 findings into MOUNT_PROTOCOL.md.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 14:03:47 +00:00
ca9fc1b345 docs: add USB descriptor assembly, edge cases, implementation reference
Round 4 findings: vuDevRespData table layout, st_VSDevConfigDescriptor
structure, RX_BULK_OUT_DATA state handling, connection type detection
(IPv4/IPv6/OEM), VMCFGTable_Init function pointer setup, and minimal
ISO mount pseudocode reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:39:33 +00:00
9c5da77d7a docs: add network I/O model, unmount flow, CBW/CSW verification
- Document VM_Thread main loop: blocking recv/send, no select/poll,
  200KB TX/RX buffers, 100ms sleep when disconnected
- Document complete unmount flow: client-initiated (type=0x05) and
  BMC-initiated (type=0x06), thread lifecycle on unmount
- Verify CBW/CSW wire format byte-by-byte from decompilation
- Clarify PDU header mixed endianness (type=BE, length=LE)
- Verify keepalive packet format (12 bytes, confirmed correct)
- Document MtVM_Engine vs MtMethod_Media distinction
- Add function addresses for VM_Thread, unmount handlers, etc.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:26:22 +00:00
76eb271f4e docs: add floppy/IMA handlers, device dispatch, state machine details
- Document IMA/floppy SCSI handlers (10 commands, 512-byte sectors,
  WRITE support, static INQUIRY/READ CAPACITY data from binary)
- Document Execute_VM_CMD dispatch: device type character encoding
  (high 3 bits = class, low 5 bits = handler index)
- Add complete state machine state values and function addresses
- Detail device status query response format (per-slot status bytes)
- Detail HTTP port query response format (10 bytes, LE uint16)
- Document virtual folder mount (FAT16 emulation, ~4MB image)
- Add physical device handler overview (SG_IO passthrough)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 13:12:24 +00:00
e7c4f51925 docs: verify and correct mount protocol authentication flow
- Corrected mount sequence diagram: document pre-mount status query
  (type=0x08), HTTP port query (type=0x0A), and connection lifecycle
  (temporary vs persistent TCP connections)
- Added SID generation details (rand() seeded with time(), weak)
- Documented credential pre-verification path (UI_PreVerifyVMInfo,
  device config bit 6 = verify-only flag)
- Clarified PlugIn packet header: offset 4 is base credential length
  (0x2C), not total packet length
- Noted status code quirk: values >= 0x07 fall through to success
- Added that RC4 and SID auth are always hardcoded ON in JASWInit
- Updated REVERSING.md with new function addresses and SID globals

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:51:36 +00:00
f5a2a045b0 Update KVM_PROTOCOL.md 2026-03-11 12:36:50 +00:00
d294cb3e33 docs: cursor compositing, mouse encryption correction, object layouts
Key changes to KVM_PROTOCOL.md:
- CursorPosition (type 0x04): cursor_extra is actually compositing_mode
  (0=XOR/overlay, 1=alpha-blend), not just metadata
- Documented ARGB4444 cursor pixel format with full compositing logic:
  mode 0 has three sub-cases (direct color, transparent, XOR-invert),
  mode 1 has true 4-bit alpha blending
- Only ASTVideoDecoder implements MixedCursor; others are stubs
- CORRECTED field order in ProcMouseInfo: byte1=encryption_enabled (0x18),
  byte2=mouse_mode (0x14), byte3=additional_config (0x1c). Previous docs
  had mouse_mode and encryption_enabled swapped.
- Updated type 0x35 and 0x37 wire formats with corrected field names
- Fixed AES encryption section to reference encryption_enabled, not
  mouse_mode

Key changes to REVERSING.md:
- Updated RFBMouse object layout with correct field names and order
- Fixed constructor address (0x001193F0 not 0x00119350)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:24:13 +00:00
9cb819be18 docs: add NtwStream/TcpSocket internals, connection teardown details
Key additions to KVM_PROTOCOL.md:
- Full NtwStream object layout (0x628 bytes): mutex + 1520-byte write
  buffer + write cursor + TcpSocket pointer
- Reads are unbuffered (each goes directly to recv), writes are batched
- TcpSocket object layout (0x60 bytes) with socket options
- Socket uses SO_SNDBUF/SO_RCVBUF=256KB, no TCP_NODELAY, 30s timeout
- Connection teardown: no graceful disconnect, just shutdown+close
- Network error handling via C++ exceptions with error codes

Key additions to REVERSING.md:
- TcpSocket object layout, vtable, and connection internals
- Updated NtwStream method table with addresses for StreamWriteStart/Flush
- Write batching protocol explanation
- File playback/recording debug mode documentation
- SIGPIPE handler details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:13:44 +00:00
ca4355572d docs: verify and update authentication flow from binary analysis
Verified RFBProtocol::Authenticate at 0x00118190 against documentation.
Key findings:
- Auth flow is largely correct but added important nuances
- ClientInit/ServerInit run inside Authenticate on success, not as
  separate steps from Java's perspective
- Username and password are sent atomically (single buffered write)
- Challenge is genuinely discarded (confirmed no DES/XOR/hash usage)
- Error message on failure is read but discarded by native code
- Added explicit big-endian annotations for auth_result and error_len
- Documented Userinfo_t struct layout (48 bytes)
- Noted JNI password buffer is 96 bytes but only 24 sent on wire

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 12:07:10 +00:00
58f5bf4803 docs: final cleanup, consistency fixes, minimal client implementation guide
- Fixed overview to correctly state mouse-only AES encryption
- Added ScreenCalibration to wire format quick reference
- Fixed stale "keyboard/mouse" encryption refs in REVERSING.md
- Completed client message senders table (13->19 entries)
- Cross-verified all wire formats between sections for consistency
- Added minimal client implementation guide section
- Verified KeepAlive reads 1 status byte (discarded), ACK is always 0x01
- All 19 client-to-server and 7 server-to-client types documented

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:09:59 +00:00
806a069a02 docs: verify dispatch table, add wire-level handshake, fix corrections
- Verified all 7 ProtocolHandler dispatch entries against raw jump table
- Confirmed plaintext auth: 24-byte VNC challenge genuinely discarded
- Added complete step-by-step wire bytes for full connection handshake
- Fixed FramebufferUpdate: 3-byte "padding" is padding(1)+num_rects(2)
- getPowerStatus JNI is misnamed: actually returns mouse config
- changeLEDstate is purely local X11 (not a network message)
- GetDecoder returns NULL for unknown encodings (no fallback)
- Documented NtwStream object layout (0x628 bytes)
- Added RFBScreen constructor and framebuffer allocation details

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:52:28 +00:00
1afc782270 docs: add all video decoder wire formats, NtwStream, teardown details
- AST2050 (0x57): 4-byte header + nibble-coded tile bitstream with VQ,
  RC4 obfuscation using hardcoded key "fedcba9876543210"
- Hermon (0x59): Raw 16bpp/8bpp tiles with 10-byte header, 16x16 tiles
- Yarkon (0x60): Huffman/RLE + RFB Hextile sub-encoding, RGB555
- Pilot3 (0x61): 5 color depths, dual-escape RLE, 32x32 tiles
- NtwStream: 1520-byte MTU-sized write buffer, mutex batching,
  TCP_NODELAY never set, 30s socket timeout
- No graceful disconnect protocol; teardown is socket shutdown+close
- Screen recording: raw RFB bytes natively, AVI done in Java layer

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:38:18 +00:00
31e121893b docs: add mouse/privilege/QoS details, error handling, new message types
- Mouse encryption controlled by mouse_mode (not separate flag):
  mode 0=cleartext, modes 1/2=encrypted
- Discovered 3 new client-to-server messages: MouseReset (0x08),
  MouseSetPT (0x36), MouseUpdateInfo (0x37)
- Full RFBPrivilege analysis with 256-byte key material read loop
- QoS sends 3 u32 params (application-level semantics)
- FW protocol flag at offset 0x48 controls SetScreenUILang extra field
- ServerInit ATEN extensions exact layout confirmed
- Error handling documented: ErrMsg class, 5 error codes, 30s timeout
- Complete RFBMouse/RFBPrivilege object layouts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:26:58 +00:00
98036cf5db docs: add keyboard/mouse encryption, video format, and screen internals
- Keyboard events are NEVER encrypted (mouse-only AES-128-CBC)
- Documented full processVK key translation tables (3 maps, 169 entries)
- Decoded AST JPEG wire format: 16-byte header + tile command stream
  with 4:2:0 YCbCr macroblocks
- Added complete RFBScreen internals (ScreenDecode, ScreenUpdate, etc.)
- Documented power action codes (0=off, 1=on, 2=reset, 3=soft off)
- Discovered new client-to-server message type 0x19 (GetCursorPos)
- Added ast_jpeg decoder state layout (0x588 bytes, 30+ fields)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 02:13:31 +00:00