1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-11-04 01:09:37 +03:00

seabios: build vgabios for qemu use, with custom resolution

This commit is contained in:
Samuel Dionne-Riel 2019-10-05 02:43:03 -04:00
parent 0d21d694f6
commit 31902140cf
3 changed files with 77 additions and 0 deletions

View File

@ -101,6 +101,9 @@ in
kernel-builder-gcc6 = callPackage ./mobile-nixos/kernel/builder.nix {
stdenv = with self; overrideCC stdenv buildPackages.gcc6;
};
virtualization = {
bios = callPackage ./seabios {};
};
};
imageBuilder = callPackage ../lib/image-builder {};

View File

@ -0,0 +1,41 @@
From fe256e0ac58e583b06640106f664ad9ae131d6ba Mon Sep 17 00:00:00 2001
From: Samuel Dionne-Riel <samuel@dionne-riel.com>
Date: Sat, 5 Oct 2019 01:27:34 -0400
Subject: [PATCH] HACK: Adds mobile-like VGA modes
---
vgasrc/bochsvga.c | 3 +++
vgasrc/cbvga.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/vgasrc/bochsvga.c b/vgasrc/bochsvga.c
index ec5d101..62e38fb 100644
--- a/vgasrc/bochsvga.c
+++ b/vgasrc/bochsvga.c
@@ -100,6 +100,9 @@ static struct bochsvga_mode
{ 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } },
{ 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } },
{ 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } },
+ // "Mobile" modes
+ { 0x193, { MM_DIRECT, 720, 1280, 32, 8, 16, SEG_GRAPH } },
+ { 0x194, { MM_DIRECT, 1080, 1920, 32, 8, 16, SEG_GRAPH } },
};
static int dispi_found VAR16 = 0;
diff --git a/vgasrc/cbvga.c b/vgasrc/cbvga.c
index f85989a..8d7395b 100644
--- a/vgasrc/cbvga.c
+++ b/vgasrc/cbvga.c
@@ -81,6 +81,9 @@ static struct cbvga_mode_s
{ 0x190, { MM_DIRECT, 1920, 1080, 16, 8, 16, SEG_GRAPH } },
{ 0x191, { MM_DIRECT, 1920, 1080, 24, 8, 16, SEG_GRAPH } },
{ 0x192, { MM_DIRECT, 1920, 1080, 32, 8, 16, SEG_GRAPH } },
+ // "Mobile" modes
+ { 0x193, { MM_DIRECT, 720, 1280, 32, 8, 16, SEG_GRAPH } },
+ { 0x194, { MM_DIRECT, 1080, 1920, 32, 8, 16, SEG_GRAPH } },
};
struct vgamode_s *cbvga_find_mode(int mode)
--
2.23.0

View File

@ -0,0 +1,33 @@
{ seabios }:
seabios.overrideAttrs({patches ? [], ...}: {
# Config taken from the QEMU source.
configurePhase = ''
cat > .config <<EOF
# for qemu machine types 2.0 + newer
CONFIG_QEMU=y
CONFIG_ROM_SIZE=256
CONFIG_ATA_DMA=n
CONFIG_NO_VGABIOS=n
CONFIG_VGA_BOCHS=y
EOF
make oldnoconfig
'';
patches = [
./0001-HACK-Adds-mobile-like-VGA-modes.patch
];
installPhase = ''
mkdir -p $out
cp ".config" "out/bios.bin" "out/vgabios.bin" $out/
(
cd $out;
ln -sf vgabios.bin vgabios-stdvga.bin
)
'';
dontStrip = true;
hardeningDisable = [ "all" ];
})