Skip to content

dos.library: AllocDosObject/FreeDosObject for DOS_STDPKT and DOS_CLI - #187

Merged
sidick merged 1 commit into
sidick:mainfrom
codewiz:alloc-dos-object-types
Oct 23, 2026
Merged

sidick merged 1 commit into
sidick:mainfrom
codewiz:alloc-dos-object-types

Conversation

@codewiz

@codewiz codewiz commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Rebased on main after #191, which implemented DOS_FILEHANDLE (better integrated than this PR's version, which is dropped). What remains are the two types <dos/dos.h> defines that are still missing, so that every type is implemented:

  • DOS_STDPKT (3): a zeroed struct StandardPacket with sp_Msg.mn_Node.ln_Name -> sp_Pkt and sp_Pkt.dp_Link -> sp_Msg. As in the autodoc and AROS's allocdospacket(), the pointer returned (and taken back by FreeDosObject) is the DosPacket part, 20 bytes in. It is the documented way to get a packet for SendPkt/WaitPkt, and needs nothing from the runtime's own bookkeeping.
  • DOS_CLI (4): a struct CommandLineInterface with its four BSTR buffers (cli_SetName, cli_CommandName, cli_CommandFile, cli_Prompt), sized by ADO_DirLen/ADO_CommNameLen/ADO_CommFileLen/ADO_PromptLen (255 each when absent, as in AROS) plus the length byte, each an empty string. Per <dos/dostags.h>, everything else is zero except cli_FailLevel (10) and cli_Background (DOSTRUE). FreeDosObject frees the buffers too. This is the object as real AllocDosObject returns it, not attached to the runtime's pr_CLI; a caller that wants that installs it itself, as on AmigaOS.

DOS_FILEHANDLE keeps #191's path. The plain zeroed types and the two new ones share an alloc_dos_block/free_dos_block pair; exectask.rs gains the CLI field offsets, and utility::find_tag_item_impl becomes pub(crate) for the tag lookup. An unknown type still fails loudly; the test for that now uses 6, since 4 is DOS_CLI.

No binary in the corpus needs these yet: ixemul no longer depends on this PR, as you noted. If you'd rather keep to adding types when a binary needs them, feel free to close it.

Tests

New end-to-end tests: the StandardPacket links, the DOS_CLI defaults, DOS_CLI with an ADO_PromptLen tag list, and alloc/free round trips for both types that check the blocks (and the CLI buffers) are really freed.

Spotted on the way: end_to_end_alloc_and_free_dos_object_fib_round_trip and the RDArgs round trip move the object into D2 with 0x2E02, commented move.l d3,d2, but that encodes move.l d2,d7, so their FreeDosObject gets the NULL tags and frees nothing. The new round trips use 0x2403. Not changed here.

cargo test -p volamos-core: all pass except exectask::tests::pending_host_break_folds_into_check_signal and ..._into_wait, which fail the same way on main when the whole suite runs, and pass alone.

🤖 Generated with Claude Code

@sidick

sidick commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Looks like this conflicts with a recent merge to main (probably #191, which touched the same AllocDosObject/FreeDosObject code). Could you rebase on main and resolve the conflicts? Thanks!

@sidick

sidick commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Also worth noting: #186 is now closed — #191 (merged to main) implemented DOS_FILEHANDLE + packet-level file I/O, and the ixemul hello-world from #186 now runs to completion with just that. So the premise here (that __open() needs DOS_STDPKT/DOS_CLI to get going) may no longer apply — might be worth double-checking against current main whether this is still needed, in addition to the rebase.

With sidick#191's DOS_FILEHANDLE, every type <dos/dos.h> defines is now implemented.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@codewiz
codewiz force-pushed the alloc-dos-object-types branch from 45136db to 3c6a407 Compare October 22, 2026 22:42
@codewiz codewiz changed the title dos.library: AllocDosObject/FreeDosObject for DOS_FILEHANDLE, DOS_STDPKT and DOS_CLI dos.library: AllocDosObject/FreeDosObject for DOS_STDPKT and DOS_CLI Oct 22, 2026
@codewiz

codewiz commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebased on main and narrowed: #191's DOS_FILEHANDLE is kept as is and this PR's version is gone, so what remains is DOS_STDPKT and DOS_CLI, which complete the set of types <dos/dos.h> defines. You're right that ixemul doesn't need them any more; I've said so in the description, so feel free to close it if you'd rather add types only when a binary asks for them.

@sidick
sidick merged commit 02fe8cf into sidick:main Oct 23, 2026
9 checks passed
@codewiz
codewiz deleted the alloc-dos-object-types branch October 23, 2026 15:14
@sidick sidick mentioned this pull request Oct 23, 2026
4 tasks done
sidick added a commit that referenced this pull request Oct 23, 2026
Fills in the 0.13 changelog: ixemul.library's full path-based file
I/O (GetDeviceProc's dvp_Port, the path packet actions, and Info())
from #197/#198, Supervisor()'s real exception frame unblocking nested
library calls from #199, the dl_TimeReq clock() fix from #194, the
remaining AllocDosObject types (DOS_STDPKT/DOS_CLI) from #187, and
#200's new_lock leak fix. Also documents these in
Supported-Libraries.md (expanded packet-action list, Supervisor's
RTE-anywhere support, dl_TimeReq).

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants