Skip to content

Commit

Permalink
improved readme
Browse files Browse the repository at this point in the history
  • Loading branch information
FedorLap2006 committed Nov 23, 2024
1 parent 15c927d commit 94d16ef
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,31 @@ Stable, flexible and very simple in use Operating System, which doesn't restrict
DepthOS requires GNU Make, GCC and NASM to build. And QEMU to run.


## Build
Kernel and userland requires a custom toolchain compiled for the platform.
To use it, set `CC` and `LD` environment variables when running `make`.

You can use one produced by "Working with ports" section (in particular, by `cross-toolchain` package).
Like this: `CC=$PORTS_BUILDDIR/tools/cross-gcc/bin/i686-depthos-gcc LD=$PORTS_BUILDDIR/tools/cross-binutils/bin/i686-depthos-ld`

### Kernel
To just build the kernel, run `make build`.

## Applications

To select the apps you want to build and install, edit the `APPS` variable in `apps/Makefile`.
## Packages

## Working with ports
To build packages, you have to install [xbstrap](https://github.com/managarm/xbstrap) first.

To build ports, you have to install [xbstrap](https://github.com/managarm/xbstrap) first.
Afterwards you must create a build directory (`$PORTS_BUILDDIR`) and `cd` into it.
Afterwards you must create a build directory (`$PKGS_BUILDDIR`) and `cd` into it.
Then run `xbstrap init ../ports`.

Now you can run `xbstrap compile-tool <tool>` (e.g. gcc) or `xbstrap build <package>` (e.g. libpng) to build tools/packages.

After you have built the package/tool, you can install it by calling `xbstrap install`/`xbstrap install-tool`.
If it's a package, it will be installed into the `$PORTS_BUILDDIR/system-root`.
If it's a tool it's gonna be installed into `$PORTS_BUILDDIR/tools/path/to/tool` (e.g. `$BUILDDIR/tools/cross-gcc/bin/i686-depthos-gcc`).
If it's a package, it will be installed into the `$PKGS_BUILDDIR/system-root`.
If it's a tool it's going to be installed into `$PKGS_BUILDDIR/tools/path/to/tool` (e.g. `$BUILDDIR/tools/cross-gcc/bin/i686-depthos-gcc`).

To install the package into the image, you'd have to set the `SYSROOT` variable to `$PKGS_BUILDDIR/system-root` when running `tools/sync.sh` script.

## Build
Kernel and userland requires a custom toolchain compiled for the platform.
To use it, set `CC` and `LD` environment variables when running `make`.

To install the package into the image, you'd have to set the `SYSROOT` variable to `$PORTS_BUILDDIR/system-root` when running `tools/sync.sh` script.
> [!NOTE]
> You can build `cross-gcc` and `cross-binutils` tools from previous section to build the kernel as well.
> Like this: `CC=$PKGS_BUILDDIR/tools/cross-gcc/bin/i686-depthos-gcc LD=$PKGS_BUILDDIR/tools/cross-binutils/bin/i686-depthos-ld make ...`
## Generating the image

Expand Down

0 comments on commit 94d16ef

Please sign in to comment.