{"id":21807603,"url":"https://github.com/zhaojh329/barebox","last_synced_at":"2025-04-13T20:52:54.184Z","repository":{"id":90322886,"uuid":"131835605","full_name":"zhaojh329/barebox","owner":"zhaojh329","description":"Better barebox. Support AR9331, AR9344 and more...","archived":false,"fork":false,"pushed_at":"2018-05-20T15:57:45.000Z","size":47923,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T11:21:10.291Z","etag":null,"topics":["ar9331","ar9344","openwrt","rt5350","u-boot","uboot"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhaojh329.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-05-02T10:31:48.000Z","updated_at":"2024-09-04T10:13:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"3e72807e-4c1f-4737-9731-045a302075ae","html_url":"https://github.com/zhaojh329/barebox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaojh329%2Fbarebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaojh329%2Fbarebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaojh329%2Fbarebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhaojh329%2Fbarebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhaojh329","download_url":"https://codeload.github.com/zhaojh329/barebox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248782283,"owners_count":21160716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ar9331","ar9344","openwrt","rt5350","u-boot","uboot"],"created_at":"2024-11-27T12:46:35.773Z","updated_at":"2025-04-13T20:52:49.167Z","avatar_url":"https://github.com/zhaojh329.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Barebox\n-------\n\nBarebox is a bootloader that follows the tradition of Das U-Boot, while\nadopting modern design ideas from the Linux kernel.\n\n\nFeatures\n--------\n\n- A POSIX-based file API\n  Inside barebox the usual open/close/read/write/lseek functions are used.\n  This makes it familiar to everyone who has programmed under UNIX systems.\n\n- Usual shell commands like ls/cd/mkdir/echo/cat,...\n\n- The environment is not a variable store anymore, but a file store. It has\n  currently some limitations, of course. The environment is not a real\n  read/write filesystem, it is more like a tar archive, or even more like\n  an ar archive, because it cannot handle directories. The saveenv command\n  saves the files under a certain directory (by default /env) in persistent\n  storage (by default /dev/env0). There is a counterpart called loadenv, too.\n\n- filesystem support\n  The loader starts up with mounting a ramdisk on /. Then a devfs is mounted\n  on /dev allowing the user (or shell commands) to access devices. Apart from\n  these two filesystems there is currently one filesystem ported: cramfs. One\n  can mount it with the usual mount command.\n\n- device/driver model\n  Devices are no longer described by defines in the config file. Instead\n  there are devices which can be registered in the board .c file or\n  dynamically allocated. Drivers will match upon the devices automatically.\n\n- clocksource support\n  Timekeeping has been simplified by the use of the Linux clocksource API.\n  Only one function is needed for a new board, no [gs]et_timer[masked]() or\n  reset_timer[masked]() functions.\n\n- Kconfig and Kernel build system\n  Only targets which are really needed get recompiled. Parallel builds are\n  no problem anymore. This also removes the need for many many ifdefs in\n  the code.\n\n- simulation target\n  barebox can be compiled to run under Linux. While this is rather useless\n  in real world this is a great debugging and development aid. New features\n  can be easily developed and tested on long train journeys and started\n  under gdb. There is a console driver for Linux which emulates a serial\n  device and a TAP-based Ethernet driver. Linux files can be mapped to\n  devices under barebox to emulate storage devices.\n\n- device parameter support\n  Each device can have a unlimited number of parameters. They can be accessed\n  on the command line with \u003cdevid\u003e.\u003cparam\u003e=\"...\", for example\n  'eth0.ip=192.168.0.7' or 'echo $eth0.ip'\n\n- initcalls\n  hooks in the startup process can be achieved with *_initcall() directives\n  in each file.\n\n- getopt\n  There is a small getopt implementation. Some commands got really\n  complicated (both in code and in usage) due to the fact that U-Boot\n  allowed only positional parameters.\n\n- editor\n  Scripts can be edited with a small editor. This editor has no features\n  except the ones really needed: moving the cursor and typing characters.\n\n\nBuilding Barebox\n----------------\n\nBarebox uses the Linux kernel's build system. It consists of two parts:\nthe Makefile infrastructure (kbuild), plus a configuration system\n(kconfig). So building barebox is very similar to building the Linux\nkernel.\n\nFor the examples below, we use the User Mode barebox implementation, which\nis a port of barebox to the Linux userspace. This makes it possible to\ntest drive the code without having real hardware. So for this test\nscenario, ARCH=sandbox is the valid architecture selection. This currently\nonly works on ia32 hosts and partly on x86-64.\n\nSelection of the architecture and the cross compiler can be done by using\nthe environment variables ARCH and CROSS_COMPILE.\n\nIn order to configure the various aspects of barebox, start the barebox\nconfiguration system:\n\n  # make menuconfig\n\nThis command starts a menu box and lets you select all the different\noptions available for your architecture. Once the configuration was\nfinished (you can simulate this by using the standard demo config file\nwith 'make sandbox_defconfig'), there is a .config file in the toplevel\ndirectory of the source code.\n\nOnce barebox is configured, we can start the compilation\n\n  # make\n\nIf everything goes well, the result is a file called barebox:\n\n  # ls -l barebox\n    -rwxr-xr-x 1 rsc ptx 114073 Jun 26 22:34 barebox\n\nBarebox usually needs an environment for storing the configuration data.\nYou can generate an environment using the example environment contained\nin board/sandbox/env:\n\n  # ./scripts/bareboxenv -s -p 0x10000 arch/sandbox/board/env env.bin\n\nTo get some files to play with you can generate a cramfs image:\n  # mkcramfs somedir/ cramfs.bin\n\nThe barebox image is a normal Linux executable, so it can be started\njust like every other program:\n\n  # ./barebox -e env.bin -i cramfs.bin\n\n  barebox 2.0.0-trunk (Jun 26 2007 - 22:34:38)\n\n  loading environment from /dev/env0\n  barebox\u003e /\n\nSpecifying -[ie] \u003cfile\u003e tells barebox to map the file as a device\nunder /dev. Files given with '-e' will appear as /dev/env[n]. Files\ngiven with '-i' will appear as /dev/fd[n].\n\nIf barebox finds a valid configuration sector on /dev/env0 it will\nload it to /env. It then executes /env/init if it exists. If you have\nloaded the example environment barebox will show you a menu asking for\nyour settings.\n\nIf you have started barebox as root you will find a new tap device on your\nhost which you can configure using ifconfig. Once you configured bareboxs\nnetwork settings accordingly you can do a ping or tftpboot.\n\nIf you have mapped a cramfs image try mounting it with\n\n  # mkdir /cram\n  # mount /dev/fd0 cramfs /cram\n\nMemory can be examined as usual using md/mw commands. They both understand\nthe -f \u003cfile\u003e option to tell the commands that they should work on the\nspecified files instead of /dev/mem which holds the complete address space.\nNote that if you call 'md /dev/fd0' (without -f) barebox will segfault on\nthe host, because it will interpret /dev/fd0 as a number.\n\n\nDirectory Layout\n----------------\n\nMost of the directory layout is based upon the Linux Kernel:\n\narch/*/               -\u003e contains architecture specific parts\narch/*/mach-*/        -\u003e SoC specific code\n\ndrivers/serial        -\u003e drivers\ndrivers/net\ndrivers/...\n\ninclude/asm-*         -\u003e architecture specific includes\ninclude/asm-*/arch-*  -\u003e SoC specific includes\n\nfs/                   -\u003e filesystem support and filesystem drivers\n\nlib/                  -\u003e generic library functions (getopt, readline and the\n                         like)\n\ncommon/               -\u003e common stuff\n\ncommands/             -\u003e many things previously in common/cmd_*, one command\n\t\t\t per file\n\nnet/                  -\u003e Networking stuff\n\nscripts/              -\u003e Kconfig system\n\nDocumentation/        -\u003e Sphinx generated documentation\n\n\nRelease Strategy\n----------------\n\nBarebox is developed with git. From time to time, tarball releases are\nbranched from the repository and released on the project web site. Here\nare the release rules:\n\n- Releases follow a time based scheme:\n\n  barebox-xxxx.yy.z.tar.bz2\n          ^^^^ ^^ ^----------- Bugfix Number, starting at 0\n            \\   \\------------- Month\n             \\---------------- Year\n\n  Example: barebox-2009.12.0.tar.bz2\n\n- Releases are made around the beginning of the month. As we are aiming\n  for monthly releases, development is considered to be a continuous\n  process. If you find bugs in one release, you have the chance to get\n  patches in on a very short time scale.\n\n- Usually, there are no bugfix releases, so z=0. If there is a need\n  to make a bugfix release, z is the right place to increment.\n\n- If there may be a reason for pre releases, they are called\n\n  barebox-xxxx.yy.z-pren.tar.bz\n                       ^------ Number of prerelease, starting with 1\n\n  Example: barebox-2009.12.0-pre1.tar.bz2\n\n  We think that there is no need for pre releases, but if it's ever\n  necessary, this is the scheme we follow.\n\n- Only the monthly releases are archived on the web site. The tarballs\n  are located in http://www.barebox.org/download/ and this location\n  does never change, in order to make life easier for distribution\n  people.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaojh329%2Fbarebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhaojh329%2Fbarebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhaojh329%2Fbarebox/lists"}