blob: 74eca0f2283bcf7d80eca76d28411d7337500df6 [file] [log] [blame]
Rob Landley589f5cd2010-01-05 10:41:52 -06001<!--#include file="header.html" -->
2
Rob Landley689f0952012-08-25 14:24:24 -05003<h1>Answers to <a href="#what">What</a>, <a href="#why">Why</a>,
4<a href="#who">Who</a>, <a href="#how">How</a>, <a href="#when">when</a></h1>
5
Rob Landleye258af32008-01-05 18:09:49 -06006<h2><a name="what" />What is ToyBox?</h2>
7
Rob Landley689f0952012-08-25 14:24:24 -05008<p>The goal of the Toybox project is to create simple, small, fast, and
9correct implementations of all the standard Linux command line utilities.
10There's a <a href="design.html">page on design goals</a>.</p>
Rob Landleye258af32008-01-05 18:09:49 -060011
Rob Landley689f0952012-08-25 14:24:24 -050012<p>Toybox offers configurable levels of functionality, and should scale from
13tiny embedded systems up to general purpose development environments.
14The author plans to install it on his Android phone in place of Toolbox,
15and the <a href=/aboriginal>Aboriginal Linux</a> project is working to get a
16complete Linux system to rebuild itself from source code using toybox.</p>
Rob Landleye258af32008-01-05 18:09:49 -060017
Rob Landley1208ca72011-11-15 03:01:41 -060018<p>Toybox is <a href=license.html>released under a simple 2-clause BSD-style
Rob Landley689f0952012-08-25 14:24:24 -050019license</a>. (Earlier versions were released under GPLv2, but
20<a href=oldlicense.html>that changed</a>.)</p>
Rob Landleye258af32008-01-05 18:09:49 -060021
22<p>Toybox can be built as a single "swiss army knife" executable (ala BusyBox
23or Red Hat's Nash), or each command can be built as a traditional independent
24executable.</p>
25
Rob Landley689f0952012-08-25 14:24:24 -050026<b><h2><a name="status" />What commands are implemented in Toybox?</h2></b>
Rob Landleye258af32008-01-05 18:09:49 -060027
Rob Landley689f0952012-08-25 14:24:24 -050028<p>The current list of commands implemented by toybox is on the
29<a href=status.html>status page</a>, which is updated each release.
30There is also <a href=roadmap.html>roadmap</a> of planned commands for the
311.0 release.</p>
Rob Landleye258af32008-01-05 18:09:49 -060032
33<p>In general, configuring toybox for "defconfig" enables all the commands
34compete enough to be useful. Configuring "allyesconfig" enables partially
Rob Landley689f0952012-08-25 14:24:24 -050035implemented commands as well, along with debugging features.</p>
Rob Landleye258af32008-01-05 18:09:49 -060036
Rob Landley4c2484f2012-01-22 19:41:42 -060037<p>Several toybox commands can do things other vesions can't. For example
38the toybox "df" isn't confused by initramfs the way other df implementations
Rob Landley689f0952012-08-25 14:24:24 -050039are. (If initramfs is visible, df shows it like any other mount point.)</p>
Rob Landleybd915512008-01-07 20:28:26 -060040
Rob Landleye258af32008-01-05 18:09:49 -060041<b><h3>Command Shell</h3></b>
42<p>The Toybox Shell (toysh) aims to be a reasonable bash replacement. It
43implements the "sh" and "toysh" commands, plus the built-in commands "cd" and
44"exit". This is the largest single sub-project in toybox.</p>
45
46<p>The following additional commands may be built into the shell (but not as
47separate executables): cd, exit, if, while, for, function, fg, bg, jobs, source,
Rob Landley4c2484f2012-01-22 19:41:42 -060048<a href="http://opengroup.org/onlinepubs/9699919799/utilities/alias.html">alias</a>,
Rob Landleye258af32008-01-05 18:09:49 -060049export, set, unset, read, trap, and exec. (Note: not done yet.)</p>
50
51</ul>
52
53<h2><a name="commands" />Which commands are planned?</h2>
54
55<p>The toybox <a href=todo.txt>todo list</a> mentions many potential commands
56which may be added to this project. (Whether that file is readable by anybody
Rob Landley4c2484f2012-01-22 19:41:42 -060057but the project's maintainer is open to debate.) The roadmap wiki in the
58nav bar has a more human readable version.</p>
Rob Landleye258af32008-01-05 18:09:49 -060059
60<p>The criteria for a toybox 1.0 release is that a system built from just the
Rob Landley4c2484f2012-01-22 19:41:42 -060061Linux kernel, toybox, C library (such as uClibc), and a compiler (such as
62tinycc) can rebuild itself from source code.</p>
Rob Landleye258af32008-01-05 18:09:49 -060063
64<b><h3>Relevant Standards</h3></b>
65
66<p>Most commands are implemented according to
Rob Landley4c2484f2012-01-22 19:41:42 -060067<a href=http://opengroup.org/onlinepubs/9699919799/idx/utilities.html>The
68Single Unix Specification version 4</a> where applicable. This does not mean
Rob Landleye258af32008-01-05 18:09:49 -060069that Toybox is implementing every SUSv3 utility: some such as SCCS and ed are
70obsolete, while others such as c99 are outside the scope of the project.
71Toybox also isn't implementing full internationalization support: it should be
728-bit clean and handle UTF-8, but otherwise we leave this to X11 and higher
73layers. And some things (like $CDPATH support in "cd") await a good
74explanation of why to bother with them. (The standard provides an important
75frame of reference, but is not infallable set of commandments to be blindly
76obeyed.)</p>
77
78<p>The other major sources of commands are the Linux man pages, and testing
79the behavior of existing commands (although not generally looking at their
Rob Landley4c2484f2012-01-22 19:41:42 -060080source code), including the commands in Android's toolbox. SUSv4 does not
81include many basic commands such as "mount", "init", and "mke2fs", which are
82kind of nice to have.</p>
Rob Landleye258af32008-01-05 18:09:49 -060083
84<b><h2><a name="downloads" />Download</h2></b>
85
86<p>This project is maintained as a mercurial archive. To get a copy of the
87current development version, either use mercurial (hg clone
Rob Landleyf83305e2012-02-03 22:39:55 -060088http://landley.net/hg/toybox) or click on one of the zip/gz/bz2 links
Rob Landleye258af32008-01-05 18:09:49 -060089at the top of the <a href=/hg/toybox>mercurial archive browser</a> page to get
90an archive of the appropriate version. Click
91<a href="/hg/toybox?cmd=tags">tags</a> to see all the tagged release
92versions ("tip" is the current development version).</p>
93
94<p>The maintainer's <a href=/notes.html>development log</a> and the project's
Rob Landley4c2484f2012-01-22 19:41:42 -060095<a href=http://lists.landley.net/listinfo.cgi/toybox-landley.net>mailing
Rob Landleye258af32008-01-05 18:09:49 -060096list</a> are also good ways to track what's going on with the project.</p>
97
Rob Landley689f0952012-08-25 14:24:24 -050098<!--
99<b><h2><a name="why">Why do toybox?</h2></b>
100
101<p>Because smart phones are replacing the PC, and Android must become
102self-hosting to beat the iPhone in establishing the new standard.</p>
103
104<p>This is the third such major transition in computer history:
105(mainframe-&gt;minicomputer-&gt;microcomputer-&gt;smartphone).
106The mainframe was replaced by the minicomputer, which was replaced by
107the microcomputer (renamed the "personal" computer to make clear you could
108access porn through it), which is being replaced by the smartphone. Nobody
109needed to wait for printouts from a big computer in another building when they
110could use a little one down the hall. Then nobody needed the big computer
111down the hall when they had a little one on their desk. Now nobody needs the
112big computer on their desk when they have a little one in their pocket.</p>
113
114<p>The new platform displaces the old when it becomes natively self hosting.
115Often they leverage existing technology: just as early microcmputers used
116teletypes and televisions for output, phones can use
117<a href=http://us.toshiba.com/accessory/PA3575U-1PRP>USB docking stations</a>
118to access a bigger screen, mouse, keyboard, speakers, etc. Plugging a phone into
119USB even charges the battery. But to use the phone as a development
120workstation, it needs more software, such as a Posix command line, a native
121compiler, and drivers for the USB peripherals.</p>
122
123<p>The new platform also eventually weans itself off of its dominant language.
124Dalvik is to Android what ROM Basic was to the PC: something it must
125eventually outgrow. Thus toybox is native C code, not Java.</p>
126
127<b><h3>So why aren't self-hosting smartphones attracting more attention?</h3></b>
128
129<p>Because most people are focusing on the legacy platforms, not on the new
130stuff. Existing multi-billion dollar industries are getting evicted from their
131decades-old established niche, and are trying to spin the transition as an
132opportunity instead of a forced march onto reservations. When elephants run
133from mice, it's easier to notice the elephants.</p>
134
135<p>History's our guide here: the previous technology always gets kicked up into
136the "server space", moving from "the thing you stood in front of waiting for
137your printout" to "that thing you sometimes accessed remotely via the new
138computer". This time around they're calling it "the cloud" and pretending it's
139a big deal; it's really just a beowulf cluster with a layer of
140virtualization/containerization software implementing hotplug hardware and
141live migration to provide cheap
142commodity processing power that dominant players (like amazon) literally
143give away for free. These old machines become secondary, only
144accessed through the new machines users now directly interact with.</p>
145
146<p>Since there's only one server space, the mainframe ate the minicomputer in
147the 1980's (when DEC went under), and this time around "the cloud" seems to be
148eating the mainframe (IBM ain't happy). The inevitable consolidation leads
149to drama, but doesn't mean much in the long run.</p>
150
151<p><a href=http://landley.net/notes-2012.html#12-07-2012>For more
152on this topic...</a></p>
153
154<b><h3><a name="why_android">Why is Android important?</h2></b>
155
156<p>Major hardware transitions introduce
157<a href=http://landley.net/notes-2011.html#26-06-2011>new software
158standards</a> which are extremely sticky once
159established, due to network effects.</p>
160
161<p>Last time around, the PC was stuck with
162a proprietary operating system (DOS/Windows) which is still dominant on that
163hardware platform's descendants 30 years later. This time around, the choice
164is between Android (a Linux derivative) and iPhone (a closed BSD fork ala
165SunOS, put out by a company already engaged in multiple aggressive IP lawsuits).
166The main difference between Apple and Microsoft is that Apple is competent.</p>
167
168<p>And yes, it has to be Android, it won't be vanilla Linux any time soon,
169for three reasons. 1) <a href=http://landley.net/notes-2010.html#13-08-2010>Open
170Source can't do user interfaces</a> for about the same reason wikipedia can't
171write a novel, 2) it's too late to the
172party (a 5 year headstart is forever in computers), 3) preinstalls matter
173(GPLv3 spooked all the hardware vendors, Android has a "no GPL in
174userspace" policy which is rigidly enforced).</p>
175
176<p>And "any time soon" is important: attempting to displace an existing
177entrenched de-facto standard is what linux has spent the last 20
178years trying (and failing) to do on the desktop. Spending another 20
179years fighting for less than 1% of the phone market would just be sad.</p>
180
181<b><h3><a name="how_google">How is Google less evil than Apple?</h3></b>
182
183<p>Because Android isn't Google's core business, attaching advertising to large
184scale data searches is. Android and Chrome and such are Google's way of
185"commoditizing their co-factors" to drive down the price of ingredients
186to their core business.</p>
187
188<p>Thus Google is pursuing a commodity market and encouring as many vendors as
189possible to participate, not to control the new space but to hold it open,
190so that its search products are widely available without requiring the
191permission of some other monopoly gatekeeper. Apple is attemping to corner the
192smartphone market and extract monopoly rents, excluding all
193vendors except itself.</p>
194
195<p>So if Google wins we get a commodity market in smartphone/tablet software,
196and may be able to open it further in future. If Apple wins we get a proprietary
197smartphone/tablet OS with a single monopoly vendor, which is likely to close it
198further.</p>
199
200<b><h3>Why not just use BusyBox?</h3></b>
201
202<p>Android can't. Busybox predates android
203by many years; if they were ever going to ship it they'd have done so by
204now. Android has had a "No GPL in Userspace" policy ever since GPLv3
205came out (before the first Android phone shipped), and they mean it.</p>
206
207<p>Toybox also has a better design and simpler code. I did both
208and this is the one I enjoy banging on; I tried to contribute a few things
209to busybox and it was like crawling through a thornbush of #ifdefs. Busybox
210development is just no fun anymore.</p>
211
212-->
213
Rob Landley08671ef2009-09-30 23:30:26 -0500214<b><h2><a name="toycans" />What's the toybox logo image?</h2></b>
Rob Landleyb9d0cf12008-01-05 18:13:19 -0600215
216<p>It's <a href=toycans-big.jpg>carefully stacked soda cans</a>. Specifically,
217it's a bunch of the original "Coke Zero" and "Pepsi One" cans, circa 2006,
Rob Landley797a4c32008-01-05 18:23:30 -0600218stacked to spell out the binary values of the ascii string "Toybox", with
219null terminator at the bottom. (The big picture's on it's side because
220the camera was held sideways to get a better shot.)</p>
221
222<p>No, it's not photoshopped, I actually had these cans until a coworker
223who Totally Did Not Get It <sup><font size=-3><a href=http://www.timesys.com>tm</a></font></sup> threw them out one day after I'd gone home,
224thinking they were recycling. (I still have two of each kind, but
225Pepsi One seems discontinued and Coke Zero switched its can color
226from black to grey, presumably in celebration. It was fun while it lasted...)</p>
Rob Landley589f5cd2010-01-05 10:41:52 -0600227
228<!--#include file="footer.html" -->