一键导入
add-builtin
Add a new shell built-in command to BDOS. Use when asked to add a shell command, built-in, or CLI command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Add a new shell built-in command to BDOS. Use when asked to add a shell command, built-in, or CLI command.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Debug hardware issues on FPGC: SPI devices, DMA transfers, SD card, Ethernet, USB. Use when asked to debug a hardware problem, add debug output, or diagnose a peripheral issue.
Add a new syscall to BDOS and expose it to userland programs. Use when asked to add a system call, kernel API, or new OS functionality accessible from user programs.
Update documentation after making code or hardware changes. Use when asked to update docs, write documentation, or after completing a feature that needs documenting.
Create a new userBDOS program (user-space application for BDOS). Use when asked to write a new program, app, tool, or utility for the FPGC.
基于 SOC 职业分类
| name | add-builtin |
| description | Add a new shell built-in command to BDOS. Use when asked to add a shell command, built-in, or CLI command. |
The shell is a userBDOS program at Software/C/userBDOS/sh.c.
Built-in commands are implemented directly in sh.c.
Edit Software/C/userBDOS/sh.c.
Add an implementation function following the existing pattern:
static int bi_YOURCOMMAND(int argc, char **argv)
{
// argc includes the command name itself
// argv[0] is the command name
if (argc < 2) {
print_str("Usage: YOURCOMMAND <arg>\n");
return 1;
}
// Implementation here
return 0; // 0 = success
}
Find the builtin dispatch section in sh.c and add your command.
The registration mechanism is a string comparison chain — add yours
following the existing pattern.
Find the help command implementation in sh.c and add a line
describing your new command.
make compile-userbdos file=sh
sh.cmake compile-userbdos file=sh passesFor commands that should be standalone programs (pipe-compatible,
usable outside the shell), create a new userBDOS program in
Software/C/userBDOS/ instead. See existing programs like ls.c,
cat.c, grep.c for examples. External programs are preferred
over builtins for most new commands.