Files
buildbrain/docs/prompts/0000-introduce-coding-agents.md
2026-03-22 22:28:46 +09:00

2.6 KiB

Objective

This repository contains anything necessary to build an SD card image file of Brainux - a Debian-based Linux distribution for a series of e-dictionary "Brain" series sold by SHARP, a Japanese manufacturer - and now I'm going to add the root AGENTS.md for automated development.

Explore the repository to generate appropriate AGENTS.md that will help CC for future runs. AGENTS.md should contain project memory and instructions for CC.

Hints and instructions about the repo's structure

  • Knowledge useful to understand the inside of SHARP Brain and its hacking scene will be contained in /docs/knowledge.
  • The definition of GitHub Actions workflow (/.github/workflows/build.yml) will be useful to understand how it enters into the build procedure.
  • The repo contains some submodules. File search or string search at the repo's root is not recommended.
    • Linux (linux-brain)
    • U-Boot (u-boot-brain)
    • BrainLILO (chain-boot tool specially made for specific older models)
    • boot4u (chain-boot tool specially made for specific newer models)
    • buildroot (to build an alternative lightweight rootfs, instead of the default Debian)
    • nkbin_maker (converter to turn U-Boot's ELF into an nk.bin that Windows CE's EBOOT bootloader understands)

My typical usage of buildbrain on the development of Brainux

Develop Linux kernel

  1. cd into linux-brain
  2. Checkout an appropriate branch
  • The default branch is brain. When I edit the code, I make another branch from brain.
  1. Edit the code
  2. cd .. and go up into buildbrain
  3. make lclean ldefconfig lbuild to start a clean build
  • Run make lmenuconfig to edit the .config (which is not a suitable way for coding agents due to TUI)
  1. Copy the resulting kernel /linux-brain/arch/arm/boot/zImage and /linux-brain/arch/arm/boot/dts/imx28-pw*.dtb into an SD card and run it on a real machine
  2. Continue try-and-error loop; make another change to the code, make lbuild, and run it
  3. cd linux-brain and commit the change
  • Commit message must comply the kernel's convention; watch surrounding files and commits to infer the format
  1. File a PR and ask review
  2. Merge it

Develop U-Boot

It is mostly the same as Linux kernel.

Update Brainux's configuration script and file

  1. Checkout an appropriate branch
  2. Edit scripts and files in os-brainux
  3. Run make brainux to build the root filesystem
  • ... or run make image/sd.img to create a complete SD image
  1. Copy the root filesystem to an SD card's second partition or write the entire image to an SD card
  2. Repeat 3 and 4
  3. Commit the change, file a PR, ask a review, and merge it