KCMA-D8 Workstation - Building the ROM with GRUB2
Dependencies
- For some reason you can't build the toolchain (the crossgcc thing) on rolling release distributions (probably has something to do with gcc-ada being too new)
- Create a virtual machine with Debian or Ubuntu/Trisquel and compile it there if you are on Arch
sudo apt-get install -y bison build-essential curl flex git gnat libncurses5-dev m4 zlib1g-dev wget autoconf automake python libfreetype-dev unifont
Downloading the Sourcecode
git clone https://review.coreboot.org/coreboot && cd coreboot
git reset --hard ad983ee && git checkout ad983ee # last version before the board got dropped
git revert --no-edit 610d1c6 # fixes a bug that prevent certain RAM modules from booting
git checkout origin/master -- payloads # keep payloads up-to-date
Building the Toolchain
make crossgcc-i386 CPUS=${nproc} # compile the toolchain. Yes, even if you use a 64 bit machine you need to use i386
Smaller Fixes
Allow loading the VGA option ROM
- The VGA option ROM is a blob that your BIOS has to load to be able to use graphics cards. The on-board GPU of the KCMA-D8 can run without any blobs, but since we want to be able to plug in a PCI graphics card we need to enable this option.
- If you enable "Run VGA option ROMs" then your on-board card won't work by default. That's why we have to build a VGABIOS with SeaBIOS and add it later
sed -i '/MAINBOARD_FORCE_NATIVE_VGA_INIT/d' src/mainboard/asus/kcma-d8/Kconfig
Update tint
- If you don't then you will get an error when trying to compile it
sed -i 's/0.04+nmu1/0.05/g' payloads/external/tint/Makefile
sed -i 's/tar.gz/tar.xz/g' payloads/external/tint/Makefile
Optimise CMOS Defaults
sed -i 's/l3_cache_partitioning=Disable/l3_cache_partitioning=Enable/g' src/mainboard/asus/kcma-d8/cmos.default
sed -i 's/experimental_memory_speed_boost=Disable/experimental_memory_speed_boost=Enable/g' src/mainboard/asus/kcma-d8/cmos.default
Download a GRUB configuration
- This is Libreboots' default grub.cfg. Obviously you can use any configuration you want. I'm working on a better one that lets you load SeaBIOS and other payloads.
wget https://notabug.org/libreboot/libreboot/raw/master/resources/grub/config/menuentries/common.cfg && mv common.cfg grub.cfg
Configure Coreboot
make nconfig
Mainboard --->
Mainboard vendor () ---> Asus
Mainboard model () ---> KCMA-D8
ROM chip size () ---> 2048 KB (2 MB) # 2MB is the default. you can also use 8MB or 16MB if you ordered the right chips
System Power State after Failure () ---> S5 Soft Off #keep the computer turned off after failure
General setup --->
[*] Use CMOS for configuration values # speeds up boot significantly
[*] Load default configuration values into CMOS on each boot
[ ] Compress ramstage with LZMA # we have enough space. don't compress for a slight performance boost
[ ] Include the coreboot .config file into the ROM image # you won't need it
[ ] Create a table of timestamps collected during boot # allows you to see boot process performance via CBMEM console
Chipset --->
Include CPU microcode in CBFS () ---> Do not include microcode updates #not needed for Opteron 4100/4200 series (only for Opteron 4300 series)
[*] Enable high speed SPI clock
Devices --->
Graphics initialization () ---> Run VGA Option ROMS #we need this to be able to use external GPUs
[*] Use onboard VGA as primary video device # this will actually give priority to external GPUs
[*] Load Option ROMS on PCI devices # needed for external GPUs
Option ROM execution type () ---> Secure mode # in case you trust the manufacturer of your graphics card you can set this to 'Native mode' for better performance
Generic Drivers --->
[ ] Serial port on SuperIO # gives a slight performance increase. If you need Serial Debugging leave this on
[ ] Support Intel PCI-e WiFi adapters # slight performance increase. Leave this on if you use one
[*] PS/2 keyboard init # to be able to use PS/2 keyboards
Console --->
[ ] Serial port console output # Leave this on if you need Serial Debugging
[ ] Send console output to a CBMEM buffer # leave this on if you need CBMEM console
Default console log level () ---> 0: EMERG # gives slight performance increase. Leave this on for debugging
[*] Don't show any POST codes # gives slight performance increase. Leave this on for debugging
Payload --->
Add a payload () ---> GRUB2 # Obviously you can use whatever you want
GRUB2 version () ---> 2.04 # If aviable you can also use later versions
[*] Include GRUB2 runtime config file into ROM image
(grub.cfg) Path of grub.cfg
Secondary Payloads ---> # You can add any Payload you want, but you have to manually add then in the grub.cfg (SeaBIOS automatically detects them though)
[ ] Load coreinfo as a secondary payload # displays various system information.
[ ] Load Memtest86+ as a secondary payload # checks your RAM modules
[ ] Load nvramcui as a secondary payload # think of it as your "BIOS-settings menue"
[ ] Load tint as a secondary payload # Tetris
Memtest86+ version (Stable) --->
Compile Coreboot
make clean && make
Compile VGABIOS and SeaBIOS
Download the Sourcecode
git clone https://git.seabios.org/seabios.git && cd seabios
git checkout rel-1.14.0 #latest release
Configure SeaBIOS
make nconfig
General Features --->
Build Target () ---> Build for coreboot
VGA Rom -->
VGA Hardware Type () ---> Coreboot linear framebuffer # this will build VGABIOS
Compile SeaBIOS & VGABIOS
make
Add SeaBIOS & VGABIOS to your coreboot.rom
- You don't have to add SeaBIOS. To load it through GRUB you also need to add an entry to your grub.cfg
- You need VGABIOS though if you want your on-board GPU to be usable though
cd ..
build/cbfstool build/coreboot.rom add -t raw -n vgaroms/seavgabios.bin -f seabios/out/vgabios.bin # add the VGABIOS so you can use the on-board GPU
build/cbfstool build/coreboot.rom add-payload -n seabios.elf -f seabios/out/bios.bin.elf # add SeaBIOS
You're done!
- You can find your coreboot.rom in the build folder.
TODO!
- test an Opteron 4300
- test an AMD card
- create a good grub.cfg
- test if coreboot works with 8 RAM modules after reverting 610d1c6
- check jumper configurations
- find out how to compile coreboot in Arch Linux
- decorate this page
- translate this page
- Find possible patches and updates