Coreboot: Difference between revisions
imported>Milahu + qemu: test the new image |
imported>Milahu fix nix-shell with mkShellNoCC |
||
| Line 1: | Line 1: | ||
== Building in nix-shell == | == Building in nix-shell == | ||
To build your own coreboot bios: | To build your own coreboot bios: | ||
Create a <code>shell.nix</code>, and run <code>nix-shell</code> | |||
<syntaxhighlight lang="nix"> | |||
# shell.nix | |||
# NOTE we need mkShellNoCC | |||
# mkShell would add the regular gcc, which has no ada (gnat) | |||
# https://github.com/NixOS/nixpkgs/issues/142943 | |||
with import <nixpkgs> { }; | |||
mkShellNoCC { | |||
buildInputs = [ | |||
gnat11 # gcc with ada | |||
#gnatboot # gnat1 | |||
ncurses # make menuconfig | |||
#bison # generate parsers | |||
#flex | |||
#clang | |||
zlib | |||
#acpica-tools # iasl | |||
pkgconfig | |||
qemu # test the image | |||
]; | |||
shellHook = '' | |||
# TODO remove? | |||
NIX_LDFLAGS="$NIX_LDFLAGS -lncurses" | |||
''; | |||
} | |||
</syntaxhighlight> | |||
Now we can build coreboot: | |||
<syntaxHighlight lang=bash> | <syntaxHighlight lang=bash> | ||
| Line 9: | Line 41: | ||
du -sh . # 700 MByte | du -sh . # 700 MByte | ||
# configure | |||
make menuconfig | |||
# build toolchain | |||
# this can take some hours | |||
make crossgcc CPUS=$(nproc) | make crossgcc CPUS=$(nproc) | ||
# build firmware | |||
make | make | ||
# test firmware | |||
qemu-system-x86_64 -bios build/coreboot.rom -serial stdio | qemu-system-x86_64 -bios build/coreboot.rom -serial stdio | ||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Compiler version === | === Compiler version === | ||