Skip to content

exec, dos: assorted bug fixes#148

Open
RMortenB wants to merge 2 commits intoApolloTeam-dev:masterfrom
RMortenB:exec-dos-bugfixes
Open

exec, dos: assorted bug fixes#148
RMortenB wants to merge 2 commits intoApolloTeam-dev:masterfrom
RMortenB:exec-dos-bugfixes

Conversation

@RMortenB
Copy link
Copy Markdown
Contributor

Summary

Bug fixes for rom/exec/ and rom/dos/ collected while working on ApolloOS. Behavior on the fast path is preserved; the changes target corner cases.

exec

  • Switch HANDLE_MANAGED_MEM tests from #ifdef to #if (the macro is #defined as 0 so #ifdef was wrong)
  • nommu_AllocMem rounds byteSize to MEMCHUNK_TOTAL before the memheader scan
  • PrepareExecBase respects nomungwall, OR-s in EXECF_StackSnoop, fixes the "Preperation" debug print
  • RemTask adds Disable() around Remove() so interrupt-level Signal() cannot race the unlink
  • Signal() uses strict > for preemption priority
  • Several Alert(... AT_DeadEnd ...) paths gain explicit return so a non-DeadEnd alert can't fall through
  • A handful of debug-print format/argument fixes

dos

  • fgets bails early on zero-length buffer, decrements once
  • getvar closes file handle on the size-lookup failure path
  • runhandler UnLocks dir on the LoadSeg success path
  • splitname bails early on zero-size buffer

Test plan

  • Boots on Vampire V4SA
  • Reset / reboot survives without yellow alert
  • AllocMem / FreeMem stress under load

RMortenB added 2 commits May 10, 2026 03:27
- fgets: bail early on zero-length buffer, decrement once
- getvar: close file handle on the size-lookup failure path
- runhandler: UnLock dir on the LoadSeg success path
- splitname: bail early on zero-size buffer
- switch HANDLE_MANAGED_MEM tests from #ifdef to #if
  (the macro is defined as 0 when disabled, so #ifdef was wrong)
- memory: free-list consistency, MEMF_MANAGED tests, pool fixes
- memory_nommu: round byteSize up to MEMCHUNK_TOTAL in AllocMem
- newaddtask: pass MemEntry list head correctly
- prepareexecbase: respect "nomungwall" arg, OR-in stacksnoop
  flag instead of clobbering, fix Preparation debug print
- remtask: Disable around list removal to protect against
  interrupt-level Signal moving the task between lists
- signal: priority comparison uses strict greater-than for
  preemption; corrected debug-print arguments
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.

1 participant