-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathREADME
149 lines (107 loc) · 5.12 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
What is this project
~~~~~~~~~~~~~~~~~~~~
This is a base system / early userspace for Linux.
The role of this project in a system is similar to that of busybox
in small custom distributions. Boot the system, load modules, mount
partitions, establish networking, provide basic services. It is aimed
primarily at personal devices running GUIs however.
The project builds into small statically-linked executables with no
external dependencies. There are no build-time library dependencies
either, not even libc. The tools can be built with any toolchain that
can build the kernel.
Supported targets: x86_64 arm aarch64 rv64 mips mips64 i386.
(anything else will not work even if toolchain is available)
This project should be mostly useful for people building their own
custom systems, distribution, or maybe even just looking for tools
to put into initrd.
Project status
~~~~~~~~~~~~~~
Dead-end experimentation.
This project started as an experiment in making a better userspace for Linux,
with a different (compared to mainline) way of running applications. No SUID,
different approach to shells, better isolation. In a way, it was about making
Linux a better OS that it was meant to be.
Back when it started, the Linux kernel was still a decent choice to build
such a project on. Not great, it's definitely not the style of kernel
I would prefer given the choice, but it was acceptable, and there was not
much choice anyway.
Then, Linux (the kernel) took a nosedive.
In its current state, this project only makes sense if the underlying kernel
is worth spending time on. The Linux kernel isn't anymore. The loss of a viable
kernel effectively left the development hanging.
The real next step, would be a lightweight kernel better suited for running
the applications the right way. I might still push this project for some kind
of completion, but only with a much reduced scope, as a no-dependencies toolbox
for small embedded Linux systems I might need to work with.
How to build and run the tools
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
For a proper build, run
./configure
make
The final target executables will be located in ./bin.
To try the tools without setting up a VM, configure and build
the project in development mode:
./configure devel
make
Most tools can be run right from their source directories.
Run `make clean` when switching between devel and regular build
to force the objects to be rebuilt with the new compiler flags.
To build only the tools from a particular directory:
make libs
make -C src/wsupp
This should be run after configure.
Just how small exactly?
~~~~~~~~~~~~~~~~~~~~~~~
The largest individual executable so far is `wsupp`, the WPA supplicant.
Statically linked for x86_64, it's about 25 KiB in size. Realistically
it also needs `dhconf` (12 KiB) to work, and the client tool `wifi` (16 KiB).
`msh` is about 16 KiB. `cmd` (interactive shell) is about 18 KiB.
`svchub` (pid 1 for the majority of system's uptime) is under 10 KiB.
`vtmux` (logind equivalent) is about 12 KiB.
Why bother making it small? Because it's a side effect of making it readable
and debuggable. The idea is that anyone could pick a tool from minibase,
start reading it and gain complete understanding of how it works in a very
reasonable amount of time, say hours. And if necessary, audit or debug it
down to assembly level. A major point in achieving this is making sure
there are no unnecessary wrappers, useless abstractions or dead code,
which eventually translates into small executables.
Contributing
~~~~~~~~~~~~
This is not a community project. Do not send patches or pull requests.
If there's a bug to be fixed, or a tool that you think should be in minibase,
or a target to support, open an issue.
This will probably change around 1.0 release but not earlier.
Licensing
~~~~~~~~~
GNU Public License version 3, see COPYING.
Limited closed-box license may or may not get added in the future.
The code in lib/sys, lib/bits and lib/arch constitutes the public interface
of the Linux kernel. No claims are made for that code, and it should not be
copyrightable anyway. If unsure, grab corresponding fragments from either
the kernel sources (GPLv2) or the musl libc (MIT license).
The code in lib/crypto is mostly BSD-licensed. See README there.
Credits
~~~~~~~
Dietlibc and "Writing Small and Fast Software" by Felix von Leitner.
https://www.fefe.de/dietlibc/diet.pdf
The project was heavily influenced by busybox at early stages.
Certain decision from skarnet/s6 project also played significant role.
Syscall code (static inline functions with asm volatile blocks)
follows musl, because musl folks got it right.
The Rust coreutils project provided a great deal of inspiration,
specifically by showing how not to write coreutils.
See also
~~~~~~~~
https://busybox.net/
http://www.landley.net/toybox/
http://www.fefe.de/embutils/
http://skarnet.org/software/
http://suckless.org
http://jdebp.eu/Softwares/nosh/
http://b0llix.net/perp/
http://u-root.tk/
https://swtch.com/plan9port/
https://www.gnu.org/software/coreutils/coreutils.html
https://www.kernel.org/pub/linux/utils/util-linux/
https://github.com/uutils/coreutils
https://github.com/mit-pdos/xv6-public (userspace tools)