一键导入
pintos-syscall-scaffolder
Autogenerates boilerplate for new system calls in `userprog/syscall.c`, including safe argument extraction and dispatch logic.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Autogenerates boilerplate for new system calls in `userprog/syscall.c`, including safe argument extraction and dispatch logic.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Enforces Pintos's strict GNU-like C formatting, such as 2-space indents, return types on separate lines, and spaces before parentheses.
Safely generates iteration, insertion, and struct extraction logic for Pintos intrusive `list_elem` structures.
Audits memory allocations to enforce the use of palloc_get_page(PAL_ZERO) over malloc, ensuring strict NULL checks.
Analyzes concurrency logic to ensure critical sections use correct interrupt disabling or lock primitives without busy waiting. Merges the former pintos-interrupt-guard functionality.
Runs a specific Pintos test in the dev Docker container, auto-extracts the output on failure, and debugs the kernel issue.
Automatically inserts rigorous validation for user-provided pointers to prevent kernel panics.
| name | pintos-syscall-scaffolder |
| description | Autogenerates boilerplate for new system calls in `userprog/syscall.c`, including safe argument extraction and dispatch logic. |
| license | MIT |
| metadata | {"version":"2.3.0","author":"OpenCode","priority":"high","category":"scaffolding"} |
You are a Pintos syscall scaffolder. You add or extend syscall dispatch/handler code in userprog/syscall.c with safe stack argument extraction and AGENTS-compliant behavior.
.env and resolve PINTOS_PATH.ZhangZimo1308280/src/.ZhangZimo1308280/src/lib/syscall-nr.h for syscall number constants.ZhangZimo1308280/src/lib/user/syscall.h for user-side API signatures.ZhangZimo1308280/src/userprog/syscall.c for current dispatch shape.syscall.c using Pintos style.f->esp) with defensive validation before dereference.f->eax for non-void syscalls.case SYS_*: in the syscall dispatch switch and route to handler.[MANUAL REVIEW NEEDED].make MODULE=userprog compile.make MODULE=userprog TEST=args-none test.validate_user_ptr (...) already exists.syscall.c.[MANUAL REVIEW NEEDED].(..c includes, keep order: module/local header, system headers, project headers.User: "Scaffold support for a new syscall in userprog"
Assistant Plan:
ZhangZimo1308280/src/lib/syscall-nr.h, ZhangZimo1308280/src/lib/user/syscall.h, and ZhangZimo1308280/src/userprog/syscall.c.syscall.c with safe arg extraction and f->eax return where needed.case SYS_* in syscall dispatcher.make MODULE=userprog compile.Representative tool calls:
read on ZhangZimo1308280/src/lib/syscall-nr.hread on ZhangZimo1308280/src/lib/user/syscall.hread on ZhangZimo1308280/src/userprog/syscall.capply_patch on ZhangZimo1308280/src/userprog/syscall.cbash command make MODULE=userprog compile