aboutsummaryrefslogtreecommitdiffstats
path: root/misc/seabios
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2016-03-31 23:32:49 +0800
committerroyger <royger@FreeBSD.org>2016-03-31 23:32:49 +0800
commit5dc1142247bb52fffb5a556739422ccd0bbeac96 (patch)
treecd98eb4786c3bc495a5eaad6dbc1831cfdb7a983 /misc/seabios
parent47384b7b765d30db8a3f19efbc728da56db408c1 (diff)
downloadfreebsd-ports-gnome-5dc1142247bb52fffb5a556739422ccd0bbeac96.tar.gz
freebsd-ports-gnome-5dc1142247bb52fffb5a556739422ccd0bbeac96.tar.zst
freebsd-ports-gnome-5dc1142247bb52fffb5a556739422ccd0bbeac96.zip
xen-tools: extract seabios, build with clang
Submitted by: bapt Minor fixes by: royger Approved by: bapt
Diffstat (limited to 'misc/seabios')
-rw-r--r--misc/seabios/Makefile27
-rw-r--r--misc/seabios/distinfo2
-rw-r--r--misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch73
-rw-r--r--misc/seabios/pkg-descr4
4 files changed, 106 insertions, 0 deletions
diff --git a/misc/seabios/Makefile b/misc/seabios/Makefile
new file mode 100644
index 000000000000..5bd8e0939a3d
--- /dev/null
+++ b/misc/seabios/Makefile
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+PORTNAME= seabios
+PORTVERSION= 1.9.1
+CATEGORIES= misc
+MASTER_SITES= http://code.coreboot.org/p/seabios/downloads/get/
+
+MAINTAINER= royger@FreeBSD.org
+COMMENT= Open source implementation of a 16bit X86 BIOS
+
+LICENSE= LGPL3
+
+USES= gmake python:build
+
+MAKE_ARGS= HOSTCC="${CC}" LD32BIT_FLAG="-melf_i386_fbsd"
+USE_GCC= yes
+
+EXTRA_PATCHES= ${FILESDIR}/0001-build-fix-.text-section-address-alignment.patch:-p1
+
+PLIST_FILES= ${DATADIR}/bios.bin
+
+do-install:
+ ${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKSRC}/out/bios.bin ${STAGEDIR}${DATADIR}
+
+.include <bsd.port.mk>
+RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*}
diff --git a/misc/seabios/distinfo b/misc/seabios/distinfo
new file mode 100644
index 000000000000..a90bb79f1700
--- /dev/null
+++ b/misc/seabios/distinfo
@@ -0,0 +1,2 @@
+SHA256 (seabios-1.9.1.tar.gz) = 8a2a562fe5cfd37fe8327cdc4a60accdfe441e235b29e6999fdeb442ba98d608
+SIZE (seabios-1.9.1.tar.gz) = 570186
diff --git a/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch b/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch
new file mode 100644
index 000000000000..303adae77e11
--- /dev/null
+++ b/misc/seabios/files/0001-build-fix-.text-section-address-alignment.patch
@@ -0,0 +1,73 @@
+From 8a0df37ee2f77a126925dfe9ae1d6a6bd24aad45 Mon Sep 17 00:00:00 2001
+From: Kevin O'Connor <kevin@koconnor.net>
+Date: Fri, 19 Feb 2016 21:34:16 -0500
+Subject: [PATCH] build: fix .text section address alignment
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some linkers verify that sections have a start address that is aligned
+with the minimum alignment of that section. Add extra padding to the
+".text" section to ensure it is always aligned with the maximum
+alignment of any section placed in ".text".
+
+Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+Reported by: Ed Maste <emaste@FreeBSD.org>
+
+(cherry picked from commit 3910de0dee216d5b5bf23cfa29bfc80d082b2ee7)
+---
+ scripts/layoutrom.py | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/scripts/layoutrom.py b/scripts/layoutrom.py
+index b976fb0..6616721 100755
+--- a/scripts/layoutrom.py
++++ b/scripts/layoutrom.py
+@@ -34,18 +34,22 @@ COMMONTRAILER = """
+ # Determine section locations
+ ######################################################################
+
+-# Align 'pos' to 'alignbytes' offset
++# Align 'pos' up to 'alignbytes' offset
+ def alignpos(pos, alignbytes):
+ mask = alignbytes - 1
+ return (pos + mask) & ~mask
+
++# Align 'pos' down to 'alignbytes' offset
++def aligndown(pos, alignbytes):
++ mask = alignbytes - 1
++ return pos & ~mask
++
+ # Determine the final addresses for a list of sections that end at an
+ # address.
+ def setSectionsStart(sections, endaddr, minalign=1, segoffset=0):
+ totspace = 0
+ for section in sections:
+- if section.align > minalign:
+- minalign = section.align
++ minalign = max(minalign, section.align)
+ totspace = alignpos(totspace, section.align) + section.size
+ startaddr = int((endaddr - totspace) / minalign) * minalign
+ curaddr = startaddr
+@@ -269,7 +273,7 @@ def doLayout(sections, config, genreloc):
+ final_sec32low_end = BUILD_LOWRAM_END
+ zonelow_base = final_sec32low_end - 64*1024
+ relocdelta = final_sec32low_end - sec32low_end
+- li.sec32low_start, li.sec32low_align = setSectionsStart(
++ li.sec32low_start, sec32low_align = setSectionsStart(
+ sections32low, sec32low_end, 16
+ , segoffset=zonelow_base - relocdelta)
+ li.sec32low_end = sec32low_end
+@@ -405,6 +409,8 @@ def writeLinkerScripts(li, out16, out32seg, out32flat):
+ if li.config.get('CONFIG_MULTIBOOT'):
+ multiboot_header = "LONG(0x1BADB002) LONG(0) LONG(-0x1BADB002)"
+ sec32all_start -= 3 * 4
++ sec32all_align = max([section.align for section in li.sections])
++ sec32all_start = aligndown(sec32all_start, sec32all_align)
+ out += outXRefs(filesections32flat, exportsyms=[li.entrysym]) + """
+ _reloc_min_align = 0x%x ;
+ zonefseg_start = 0x%x ;
+--
+2.6.4 (Apple Git-63)
+
diff --git a/misc/seabios/pkg-descr b/misc/seabios/pkg-descr
new file mode 100644
index 000000000000..237fb79fed0c
--- /dev/null
+++ b/misc/seabios/pkg-descr
@@ -0,0 +1,4 @@
+Seabios is an open source implementation of a 16bit X86 BIOS. SeaBIOS can run in
+an emulator or it can run natively on X86 hardware
+
+WWW: http://www.seabios.org