Sortix 1.1dev nightly manual
This manual documents Sortix 1.1dev nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
|DEVELOPMENT(7)||Miscellaneous Information Manual||DEVELOPMENT(7)|
operating system development instructions git(1) repository. It can be modified, compiled and installed on the current system. The source code is built with a make(1) build system. The source code can be located in any location, if so, simply substitute /src with the real location. These instructions only apply to building the operating system from within itself, those building it from another operating system needs to follow cross-development(7) instead. If you are building a new version of the operation system where build tools have been added or changed, you first need to install the new tools. This is not needed when building the matching release. To do so, run as root:To build the base operating system and upgrade the current system, run as root:The build system creates a minimal root filesystem structure in the /src/sysroot and builds each operating system component in turn, installing them into the sysroot. If the source code for ports are placed in /src/ports then they are automatically built as well. The result is a minimal system that can be turned into working system by adding important configuration such as passwd(5). The sysmerge make target ensures a system is built in /src/sysroot and then runs the sysmerge(8) program which installs the new system files onto the existing system. It updates the system manifest as well all ports installed in the sysroot. The initrd(7) is automatically regenerated using update-initrd(8). The bootloader, if enabled in upgrade.conf(5), is reinstalled and configured as necessary. The new user-space is running on completion, though existing processes will be running the old programs. A reboot is needed to run the new kernel. If the ABI changed and the current kernel isn't able to run the new programs, then the upgrade is delayed and will be automatically completed on the next boot. The sysmerge-wait make target forces waiting until the next boot.Note the individual makefiles only install the new system files and leak any files that don't exist anymore; and they also don't run any upgrade hooks to migrate the current system. This mechanism isn't supported unless you are building the same source code as the current operating system. The global sysmerge makefile targets should be used instead as the supported mechanism for operating system upgrades. System libraries are statically linked and you will have to relink programs with the new library for changes to take effect. Building the whole operating system from the root makefile ensures components are built in the right order such that all programs use fresh libraries. The root makefile invokes component makefiles withThe presubmit makefile target can be used to verify your work needs some of the development conventions. You can then easily prepare your a set of patches for upstream submission:This will create a series of .patch files containing your changes. Review them and rewrite git history as needed until they are of submittable quality. You can then submit them for review at the official website. To transfer files out of the operating system, you can either mount the local root filesystem from another operating system with networking, or you transmit the patches over the serial connection as described in serial-transfer(7). following-development(7) manual page documents what needs to be done to stay updated with the latest developments. You will need to read the new version of that document whenever you update the source code. git(1), make(1), cross-development(7), following-development(7), installation(7), porting-guide(7), serial-transfer(7), upgrade(7), sysinstall(8), sysmerge(8), update-initrd(8)
cd /src make distclean # fully clean build directory make install-build-tools # install new tools make clean-build-tools # clean for real build below
cd /src make # build new operating system in /src/sysroot make sysmerge # upgrade current operating system with /src/sysroot
- (default) Build each component in turn and install them into the sysroot.
- Make all build tools.
- Clean the component directories and the port source code. (clean-core, clean-ports)
- Clean the directories of all build tools.
- Run every clean target such that the source code is ready for distribution. (clean-builds, clean-core, clean-ports, clean-release, clean-repository, clean-sysroot)
- Install all build tools after making them.
- Create a release iso in the /src/builds directory after making all.
- Clean everything except binary packages. (clean-builds, clean-core, clean-ports, clean-release, clean-sysroot)
- Verify the coding style is followed (verify-coding-style), the manual pages does not have lints (verify-manual), the build tools compile (verify-build-tools), that everything compiles without warnings on all architectures (verify-build), and the system headers works in all supported configurations (verify-headers).
- Make iso and construct release directory tree in /src/release suitable for online publishing.
- Make iso and place it in the current directory as sortix.iso.
- Upgrade the current operating system using the sysroot after making the all target.
- Like sysmerge but do a full operating system upgrade that uninstalls ports not present in the sysroot using --full.
- The combination of sysmerge-full and sysmerge-full-wait.
- Like sysmerge but delay the upgrade until the next boot using --wait.
- Create the sysroot and install only the headers of the standard library and kernel into it. This is useful when bootstrapping the runtime libraries of the compiler that need to know about libc prior to building libc.
- The platform of the current operating system. This defaults to the current machine and operating system.
- Specifies platform on which the compiled code will run.
This defaults to the current machine and operating system. This is used
when cross-compiling the operating system. When cross-compiling the
operating system, it must be set to one of
x86_64-sortix. This must be unset when
building the build tools as they run on the current operating system. The
compiler tools are prefixed with this variable if it does not match
- Specifies compiler optimization options that gets added to
- Specifies whether the source code is included in the sysroot. This must be one of no, yes or git and defaults to git if git(1) is installed and yes otherwise.
- Specifies the compression algorithm used in iso files. This must be one of none, gzip or xz and defaults to xz.
cd /src/libc make make install
SYSROOTset to /src/sysroot to force the compiler to locate files there. Likewise when installing, it sets
DESTDIRto /src/sysroot to make it install files there.
- If this directory exists, each subdirectory can contain the source code for a port that gets built along with the rest of the system.
- The release root makefile target creates this directory and populates it with a directory structure suitable for online publishing of a release.
- If ports are present, this directory is made when binary packages are built and they are stored here. This works as a cache so ports don't have to be rebuilt every time the operating system is. Packages are also copied from here rather than the sysroot when making releases.
- This directory is made when building the operating system and the freshly made files are installed here. The build system uses this as the system root which forces the compiler to look here for headers and libraries. This ensures a clean bootstrap where files from the current operating system do not leak into the new system.
- If this directory exists, it is added to the initrd of the produced iso and can contain additional system files.
git checkout -b local git add utils/hello.c git commit -m 'Add hello(1).'
git format-patch master..local
|December 29, 2015||Debian|