NetBSD: Difference between revisions

From coreboot
Jump to navigation Jump to search
(note utilities in pkgsrc-wip)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This page documents coreboot usage with NetBSD.  It is probably terser than it could be, as it mostly just describes differences from the more-commonly-documented Linux procedures.
[http://www.netbsd.org/ NetBSD] is a free, fast, secure, and highly portable Unix-like Open Source operating system.


== building coreboot on NetBSD ==
This page documents coreboot usage with NetBSD. It is probably terser than it could be, as it mostly just describes differences from the more-commonly-documented Linux procedures.
GNU make is required to build coreboot, install it from pkgsrc/devel/gmake.
=== coreboot v2 ===
As of revision 3363 only one change needs to be made.


<source lang="text">
== Building coreboot on NetBSD ==
Index: src/config/Config.lb
===================================================================
--- src/config/Config.lb        (revision 3389)
+++ src/config/Config.lb        (working copy)
@@ -5,7 +5,7 @@
makedefine CPP:= $(CC) -x assembler-with-cpp -DASSEMBLY -E
makedefine LIBGCC_FILE_NAME := $(shell $(CC) -print-libgcc-file-name)
-makedefine GCC_INC_DIR := $(shell LC_ALL=C $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
+makedefine GCC_INC_DIR := /usr/include
makedefine CPPFLAGS := -I$(TOP)/src/include -I$(TOP)/src/arch/$(ARCH)/include -I$(GCC_INC_DIR) $(CPUFLAGS)
makedefine CFLAGS := $(CPU_OPT) $(DISTRO_CFLAGS) $(CPPFLAGS) -Os -nostdinc -nostdlib -fno-builtin  -Wall
</source>


GNU make is required to build coreboot, install it from '''pkgsrc/devel/gmake'''.


=== coreboot v3 ===
Use '''coreboot/util/crossgcc''', you may have to work around an issue with the path to the gcc sources.
<source lang="text">
Index: Makefile
===================================================================
--- Makefile    (revision 690)
+++ Makefile    (working copy)
@@ -106,7 +106,7 @@
# Note: This _must_ come after 'CC' is set for the second time in this
# Makefile (see above), otherwise the build would break if 'gcc' isn't
# the compiler actually used for the build (e.g. on cross compiler setups).
-CFLAGS += -nostdinc -isystem `$(CC) -print-file-name=include`
+CFLAGS += -nostdinc -isystem /usr/include
include lib/Makefile
include device/Makefile
</source>


On NetBSD libintl is required to build kconfig.
== Building SeaBIOS on NetBSD ==
<source lang="bash">
gmake INTLLIBS=-lintl menuconfig
</source>


== building [[LegacyBIOS]] on NetBSD ==
Build [[SeaBIOS]] with the previously mentioned '''crossgcc'''. You may need to (temporarily) use '''pkgsrc/shells/bash''' as your shell.
A change is required to '''legacybios/Makefile''', then gmake can be used to build LegacyBIOS in the normal way.
<source lang="text">
-$(Q)/bin/echo -e '$(foreach i,$2,#include "../$i"\n)' > $3.tmp.c
+$(Q)echo -e '$(foreach i,$2,#include "../$i"\n)' > $3.tmp.c
</source>


== using NetBSD/x86 with coreboot ==
== Using NetBSD/x86 with coreboot ==
=== interrupt routing ===


Legacy interrupt routing (the PCI interrupt line register) is traditionally not
=== Interrupt routing ===
implemented on many mainboards under coreboot. MPBIOS or ACPI will be required.


NetBSD does not (without patching) search for a MPBIOS floating pointer at the location
Legacy interrupt routing (the PCI interrupt line register) is traditionally not implemented by coreboot on many mainboards. MPBIOS or ACPI will be required otherwise.
coreboot usually places it. LegacyBIOS does relocate this pointer structure however.
 
NetBSD does not (without patching) search for a MPBIOS floating pointer at the location coreboot usually places it. SeaBIOS does relocate this pointer structure however.


=== BIOS calls ===
=== BIOS calls ===
(This section is probably only relevant when not loading via SeaBIOS.)
NetBSD/i386 GENERIC still makes some BIOS calls after boot(8):
NetBSD/i386 GENERIC still makes some BIOS calls after boot(8):
* isapnp(4)
* isapnp(4)
* mca(4)
* mca(4)


Removal of these subsystems from your kernel config(5) file removes these calls.
Removal of these subsystems from your kernel '''config(5)''' file removes these calls.


Due to the nature of x86_64, BIOS calls on NetBSD/amd64 are not a problem, as they cannot be made from long-mode.
Due to the nature of x86_64, BIOS calls on NetBSD/amd64 are not a problem, as they cannot be made from long-mode.
Line 72: Line 36:
=== coreboot-related utilities ===
=== coreboot-related utilities ===


Both [[nvramtool]] and [[flashrom]] are in [http://pkgsrc-wip.sourceforge.net pkgsrc-wip].
Both [[nvramtool]] and [http://www.flashrom.org flashrom] are in [http://www.pkgsrc.org/ pkgsrc].


{{PD-self}}
{{PD-self}}

Latest revision as of 14:02, 2 April 2013

NetBSD is a free, fast, secure, and highly portable Unix-like Open Source operating system.

This page documents coreboot usage with NetBSD. It is probably terser than it could be, as it mostly just describes differences from the more-commonly-documented Linux procedures.

Building coreboot on NetBSD

GNU make is required to build coreboot, install it from pkgsrc/devel/gmake.

Use coreboot/util/crossgcc, you may have to work around an issue with the path to the gcc sources.

Building SeaBIOS on NetBSD

Build SeaBIOS with the previously mentioned crossgcc. You may need to (temporarily) use pkgsrc/shells/bash as your shell.

Using NetBSD/x86 with coreboot

Interrupt routing

Legacy interrupt routing (the PCI interrupt line register) is traditionally not implemented by coreboot on many mainboards. MPBIOS or ACPI will be required otherwise.

NetBSD does not (without patching) search for a MPBIOS floating pointer at the location coreboot usually places it. SeaBIOS does relocate this pointer structure however.

BIOS calls

(This section is probably only relevant when not loading via SeaBIOS.)

NetBSD/i386 GENERIC still makes some BIOS calls after boot(8):

  • isapnp(4)
  • mca(4)

Removal of these subsystems from your kernel config(5) file removes these calls.

Due to the nature of x86_64, BIOS calls on NetBSD/amd64 are not a problem, as they cannot be made from long-mode.

coreboot-related utilities

Both nvramtool and flashrom are in pkgsrc.

Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.