1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690 | diff -Nru seabios-1.8.1/debian/changelog seabios-1.8.2/debian/changelog
--- seabios-1.8.1/debian/changelog 2015-06-04 16:07:13.000000000 -0500
+++ seabios-1.8.2/debian/changelog 2015-07-30 11:18:39.000000000 -0500
@@ -1,3 +1,22 @@
+seabios (1.8.2-1ubuntu1~vga1) wily; urgency=medium
+
+ * New debian release. Remaining change:
+ - Build with -fgnu89-inline for GCC 5 (doko)
+ * Turn off VGA_ALLOCATE_EXTRA_STACK (LP: #1404396)
+
+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Thu, 30 Jul 2015 10:40:01 -0500
+
+seabios (1.8.2-1) unstable; urgency=medium
+
+ * new upstream (minor) release (1.8.2)
+ * add vgabios-virtio.bin (new in 1.8.2)
+ * remove some leftovers from d/rules
+ * set VERSION to $(DEB_VENDOR)-$(DEB_VERSION)
+ and make build reproducible (Closes: #782905)
+ * update d/watch (Closes: #786413)
+
+ -- Michael Tokarev <mjt@tls.msk.ru> Wed, 17 Jun 2015 12:00:25 +0300
+
seabios (1.8.1-2ubuntu1) wily; urgency=medium
* New debian release. Remaining change:
diff -Nru seabios-1.8.1/debian/changelog.d seabios-1.8.2/debian/changelog.d
--- seabios-1.8.1/debian/changelog.d 2015-04-28 08:47:24.000000000 -0500
+++ seabios-1.8.2/debian/changelog.d 1969-12-31 18:00:00.000000000 -0600
@@ -1,244 +0,0 @@
-seabios (1.8.1-2) unstable; urgency=medium
-
- * reupload to unstable (previous upload was to experimental)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Tue, 28 Apr 2015 16:46:53 +0300
-
-seabios (1.8.1-1) unstable; urgency=medium
-
- * new upstream release (1.8.1)
- * update debian/optionrom up to qemu commit b466e1731be837
- (Thu Dec 11 02:17:03 2014 +0100)
- * update standards-version (no changes needed)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Sat, 18 Apr 2015 16:21:20 +0300
-
-seabios (1.7.5-1) unstable; urgency=medium
-
- * new upstream release
- * dropped all patches taken from upstream
- * disabled more features (XEN & USB_UAS) from the 128k bios build to fit
- * set upstream source URL (Closes: #740471)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Sat, 31 May 2014 12:29:13 +0400
-
-seabios (1.7.4-4) unstable; urgency=low
-
- * apply vgabios-attempt-to-detect-old-x86emu-and-force-a-fault.diff:
- a patch from upstream to work around apparently broken x86 emulation
- in some software. (Closes: #737142)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Mon, 17 Feb 2014 21:35:59 +0400
-
-seabios (1.7.4-3) unstable; urgency=low
-
- * allow seabios to be built using more recent iasl, finally,
- and enable acpica-tools build-depend alternative. This has
- actually been fixed long ago (the patch is in 1.7.1), even
- before the version against which #707454 has been reported,
- but the fix required a new iasl option which were available
- only in next iasl release. But no one actually noticed this.
- (Gladly Closes: #707454)
- * update standards-version to 3.9.5 (no changes needed)
- * replace $(PWD) with $(CURDIR) in d/rules (fixes build failure)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Fri, 07 Feb 2014 00:38:29 +0400
-
-seabios (1.7.4-2) unstable; urgency=low
-
- * actually update optionrom/multiboot.S from the commit indicated
- in optionrom/README file. (Closes: #736902)
- * build all variants in build/*, refresh debian/rules
- * added bios-256k.bin variant for qemu > 1.7, and reduce regular
- ("small) bios (for qemu <= 1.7) to be 128Kb in size again
- * vgabios-Make-sure-exported-structs-use-PACKED.diff: patch from
- upstream to fix interface between vgabios and real world
-
- -- Michael Tokarev <mjt@tls.msk.ru> Thu, 06 Feb 2014 23:31:04 +0400
-
-seabios (1.7.4-1) unstable; urgency=low
-
- * new upstream release (1.7.4)
- * remove all patches (upstreamed)
- * acpi tables are now in $out/src/fw/ not in $out/
-
- -- Michael Tokarev <mjt@tls.msk.ru> Thu, 16 Jan 2014 15:50:54 +0400
-
-seabios (1.7.3-3) unstable; urgency=low
-
- * applied HDTV video modes patch from upstream
-
- -- Michael Tokarev <mjt@tls.msk.ru> Fri, 06 Dec 2013 02:50:15 +0400
-
-seabios (1.7.3-2) unstable; urgency=low
-
- [ Michael Tokarev ]
- * update to upstream 1.7.3.2 bugfix release
- * Multi-Arch: foreign (vs allowed) (Closes: #728475)
- * move optionrom/*.bin to the main directory (with compat symlinks)
- * update optionrom files to ones from qemu-1.7
- * simplify debian/optionrom/Makefile
-
- -- Michael Tokarev <mjt@tls.msk.ru> Sun, 24 Nov 2013 00:40:53 +0400
-
-seabios (1.7.3-1) unstable; urgency=low
-
- * new upstream release (1.7.3)
- * Multi-Arch: allowed
-
- -- Michael Tokarev <mjt@tls.msk.ru> Mon, 08 Jul 2013 21:34:44 +0400
-
-seabios (1.7.2-3) unstable; urgency=low
-
- * update to the next upstream pointpoint-release (1.7.2.2)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Tue, 28 May 2013 10:54:39 +0400
-
-seabios (1.7.2-2) unstable; urgency=low
-
- * bump Standards-Version to 3.9.4 (no changes needed)
- * add a versioned dependency on iasl (<< 20130214), see #707454
- * add upstream 1.7.2.1 (as a patch since upstream didn't release source)
- (Closes: #707645)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Mon, 13 May 2013 19:45:38 +0400
-
-seabios (1.7.2-1) unstable; urgency=low
-
- * new upstream release:
- - Support for ICH9 host chipset ("q35") on emulators
- - Support for booting from LSI MegaRAID SAS controllers
- - Support for using the ACPI PM timer on emulators
- - Improved Geode VGA BIOS support.
- - Several bug fixes
- * build main bios after all vgabioses
- * ship acpi-dsdt.aml and q35-acpi-dsdt.aml (*dsdt.aml) too
- (needed by new qemu)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Sat, 19 Jan 2013 14:48:28 +0400
-
-seabios (1.7.1-1) unstable; urgency=low
-
- * updated to new minor upstream release (1.7.1):
- - native scsi boot support (Closes: #652530)
- - usb-attached scsi boot support
- - Xen support (Closes: #678042)
- - better integration with qemu
- - some bugfixes
- * removed fix-==-in-shell.patch (not needed anymore)
- * updated debian/rules (adapted for upstream changes a bit)
- * updated multiboot.S and fw_cfg.h in debian/optionrom from qemu-1.3
- * updated debian/control VCS links to canonical anonscm.debian.org ones
- * break old qemu-system, not conflict with it, and mention qemu-kvm too
-
- -- Michael Tokarev <mjt@tls.msk.ru> Sat, 29 Dec 2012 19:48:28 +0400
-
-seabios (1.7.0-1) unstable; urgency=low
-
- * new upstream release (1.7.0), featuring vgabios.
- * drop 1.6.3.1 patch
- * do not require root in clean target
- * split build procedure into several targets, move bios.bin
- out of out/ directory (preparing for the next change), and
- change clean target accordingly
- * build and ship vgabios-{cirrus,stdvga,vmware,qxl,isavga}.bin
- * patches/fix-==-in-shell.patch -- fix build error with dash
- * move all optionrom files taken from qemu into debian/optionrom,
- instead of having them as patches in debian/patches. While at
- it, update optionroms from current qemu (1.1) and add
- vapic.bin => kvmvapic.bin compatibility symlink.
- * add myself to uploaders
- * bump Standards-Version to 3.9.3 (no changes needed)
-
- -- Michael Tokarev <mjt@tls.msk.ru> Tue, 17 Apr 2012 14:22:01 +0400
-
-seabios (1.6.3-2) unstable; urgency=low
-
- * Add patch from 1.6.3.1 to fix usb boot paths.
-
- -- Vagrant Cascadian <vagrant@debian.org> Fri, 02 Dec 2011 19:36:13 -0800
-
-seabios (1.6.3-1) experimental; urgency=low
-
- [ Michael Tokarev ]
- * New upstream release (1.6.3, jumped from 0.6.2).
- Upstream now uses kbuild-like configuration.
- Use distclean target not clean, to remove .config too.
- * Removed debian/patches/05_struct_bregs.patch (applied upstream).
- * Removed usage of $(CURDIR) from "some" debian/rules
- (it was used inconsistently and is not needed anyway).
-
- [ Vagrant Cascadian ]
- * debian/control: Add Vcs-* headers.
- * debian/control: Add Homepage header.
- * debian/rules: Add dummy build-arch and build-indep targets.
- * Update optionrom patches.
-
- -- Vagrant Cascadian <vagrant@debian.org> Mon, 28 Nov 2011 23:22:34 -0800
-
-seabios (0.6.1.2-3) unstable; urgency=low
-
- * Add patches/05_struct_bregs.patch from upstream to fix FTBFS with
- gcc-4.6. Closes: bug#625000.
- * Bump Standards-Version to 3.9.2 (no changes).
-
- -- Aurelien Jarno <aurel32@debian.org> Sat, 21 May 2011 11:47:36 +0200
-
-seabios (0.6.1.2-2) unstable; urgency=low
-
- * Conflicts with qemu-system (<< 0.14.0). Closes: bug#591780.
- * Switch to debhelper 7.
-
- -- Aurelien Jarno <aurel32@debian.org> Sat, 19 Feb 2011 10:37:48 +0000
-
-seabios (0.6.1.2-1) unstable; urgency=low
-
- * New upstream version from git tag.
- - Fixes virtio-blk failure after reboot (Closes: #604735).
- * Update debian/watch file.
-
- -- Vagrant Cascadian <vagrant@debian.org> Fri, 26 Nov 2010 17:54:44 -0800
-
-seabios (0.6.0+git20100710-2) unstable; urgency=low
-
- * Temporarily reduce the conflicts on qemu-system due to the previous
- upload done in unstable instead of experimental.
-
- -- Aurelien Jarno <aurel32@debian.org> Mon, 02 Aug 2010 22:52:36 +0200
-
-seabios (0.6.0+git20100710-1) unstable; urgency=low
-
- * New upstream snapshot, compatible with qemu 0.13.x.
- * Add conflicts with qemu-system (<< 0.13.0).
- * Bump Standards-Version to 3.9.1 (no changes).
- * Update from QEMU 0.13:
- - 00_optionrom_buildsystem.patch
- - 02_optionrom_linuxboot.patch
- * Update from QEMU-KVM 0.13:
- - 01_optionrom_extboot.patch
-
- -- Aurelien Jarno <aurel32@debian.org> Sun, 01 Aug 2010 21:06:30 +0200
-
-seabios (0.5.1-3) unstable; urgency=low
-
- [ Vagrant Cascadian ]
- * Add watch file.
-
- [ Aurelien Jarno ]
- * Fix PS/2 mouse in old applications.
-
- -- Aurelien Jarno <aurel32@debian.org> Wed, 16 Jun 2010 22:03:41 +0200
-
-seabios (0.5.1-2) unstable; urgency=low
-
- * Update to 0.5.1-stable.
- * Bump Standards-Version to 3.8.4 (no changes).
-
- -- Aurelien Jarno <aurel32@debian.org> Fri, 05 Mar 2010 20:05:31 +0100
-
-seabios (0.5.1-1) unstable; urgency=low
-
- [ Aurelien Jarno ]
- * Initial release (Closes: #492935).
-
- -- Aurelien Jarno <aurel32@debian.org> Tue, 26 Jan 2010 00:49:28 +0100
diff -Nru seabios-1.8.1/debian/patches/gcc-5.diff seabios-1.8.2/debian/patches/gcc-5.diff
--- seabios-1.8.1/debian/patches/gcc-5.diff 2015-06-04 16:09:15.000000000 -0500
+++ seabios-1.8.2/debian/patches/gcc-5.diff 2015-07-30 11:17:28.000000000 -0500
@@ -1,11 +1,11 @@
-Index: seabios-1.8.1/Makefile
+Index: seabios-1.8.2/Makefile
===================================================================
---- seabios-1.8.1.orig/Makefile
-+++ seabios-1.8.1/Makefile
+--- seabios-1.8.2.orig/Makefile
++++ seabios-1.8.2/Makefile
@@ -57,6 +57,7 @@ COMMONCFLAGS := -I$(OUT) -Isrc -Os -MD -
$(call cc-option,$(CC),-Wtype-limits,) \
-m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
- -minline-all-stringops \
+ -minline-all-stringops -fomit-frame-pointer \
+ -fgnu89-inline \
-freg-struct-return -ffreestanding -fno-delete-null-pointer-checks \
-ffunction-sections -fdata-sections -fno-common -fno-merge-constants
diff -Nru seabios-1.8.1/debian/patches/series seabios-1.8.2/debian/patches/series
--- seabios-1.8.1/debian/patches/series 2015-03-06 10:23:34.000000000 -0600
+++ seabios-1.8.2/debian/patches/series 2015-07-30 11:16:40.000000000 -0500
@@ -1 +1,2 @@
gcc-5.diff
+turn-vga-allocate-extra-stack-off
diff -Nru seabios-1.8.1/debian/patches/turn-vga-allocate-extra-stack-off seabios-1.8.2/debian/patches/turn-vga-allocate-extra-stack-off
--- seabios-1.8.1/debian/patches/turn-vga-allocate-extra-stack-off 1969-12-31 18:00:00.000000000 -0600
+++ seabios-1.8.2/debian/patches/turn-vga-allocate-extra-stack-off 2015-07-30 11:17:31.000000000 -0500
@@ -0,0 +1,13 @@
+Index: seabios-1.8.2/vgasrc/Kconfig
+===================================================================
+--- seabios-1.8.2.orig/vgasrc/Kconfig
++++ seabios-1.8.2/vgasrc/Kconfig
+@@ -104,7 +104,7 @@ menu "VGA ROM"
+ config VGA_ALLOCATE_EXTRA_STACK
+ depends on BUILD_VGABIOS
+ bool "Allocate an internal stack for 16bit interrupt entry point"
+- default y
++ default n
+ help
+ Attempt to allocate (via BIOS PMM call) an internal stack
+ for the legacy 16bit 0x10 interrupt entry point. This
diff -Nru seabios-1.8.1/debian/rules seabios-1.8.2/debian/rules
--- seabios-1.8.1/debian/rules 2014-05-31 03:20:17.000000000 -0500
+++ seabios-1.8.2/debian/rules 2015-06-17 03:53:11.000000000 -0500
@@ -5,12 +5,11 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/vendor.mk
+VERSION = $(DEB_VENDOR)-$(DEB_VERSION)
-VGABIOSES = cirrus stdvga vmware qxl isavga
+VGABIOSES = cirrus stdvga virtio vmware qxl isavga
VGABIOS_TARGETS = $(addprefix build/vgabios-, $(addsuffix .bin, $(VGABIOSES)))
BUILD_TARGETS = build/bios.bin build/bios-256k.bin \
$(VGABIOS_TARGETS) build/optionrom-stamp
@@ -33,7 +32,7 @@
done > $$d/.config; \
$(MAKE) KCONFIG_CONFIG=$(CURDIR)/$$d/.config OUT=$$d/ oldnoconfig; \
fi; \
-$(MAKE) KCONFIG_CONFIG=$(CURDIR)/$$d/.config OUT=$$d/ $$d/$1.bin; \
+$(MAKE) KCONFIG_CONFIG=$(CURDIR)/$$d/.config OUT=$$d/ VERSION="${VERSION}" $$d/$1.bin; \
rm -f $@; ln $$d/$1.bin $@
endef
@@ -56,6 +55,9 @@
$(call build-bios,vgabios,BUILD_VGABIOS=y VGA_CIRRUS=y VGA_PCI=y)
build/vgabios-stdvga.bin:
$(call build-bios,vgabios,BUILD_VGABIOS=y VGA_BOCHS=y VGA_PCI=y)
+build/vgabios-virtio.bin:
+ $(call build-bios,vgabios,BUILD_VGABIOS=y VGA_BOCHS=y VGA_PCI=y \
+ OVERRIDE_PCI_ID=y VGA_VID=0x1af4 VGA_DID=0x1050)
build/vgabios-vmware.bin:
$(call build-bios,vgabios,BUILD_VGABIOS=y VGA_BOCHS=y VGA_PCI=y \
OVERRIDE_PCI_ID=y VGA_VID=0x15ad VGA_DID=0x0405)
diff -Nru seabios-1.8.1/debian/watch seabios-1.8.2/debian/watch
--- seabios-1.8.1/debian/watch 2014-05-31 03:01:30.000000000 -0500
+++ seabios-1.8.2/debian/watch 2015-06-17 03:59:10.000000000 -0500
@@ -1,3 +1,3 @@
version=3
-
-http://www.linuxtogo.org/~kevin/SeaBIOS/seabios-(.*)\.tar\.gz
+http://qa.debian.org/cgi-bin/fakeupstream.cgi?upstream=coreboot/seabios \
+.*=seabios(?:[_\-]v?|)(\d[^\s/]*)\.(?:tar\.xz|txz|tar\.bz2|tbz2|tar\.gz|tgz)
diff -Nru seabios-1.8.1/Makefile seabios-1.8.2/Makefile
--- seabios-1.8.1/Makefile 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/Makefile 2015-06-16 03:00:30.000000000 -0500
@@ -56,7 +56,7 @@
-Wall -Wno-strict-aliasing -Wold-style-definition \
$(call cc-option,$(CC),-Wtype-limits,) \
-m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 \
- -minline-all-stringops \
+ -minline-all-stringops -fomit-frame-pointer \
-freg-struct-return -ffreestanding -fno-delete-null-pointer-checks \
-ffunction-sections -fdata-sections -fno-common -fno-merge-constants
COMMONCFLAGS += $(call cc-option,$(CC),-nopie,)
@@ -64,15 +64,14 @@
COMMONCFLAGS += $(call cc-option,$(CC),-fno-stack-protector-all,)
COMMA := ,
-CFLAGS32FLAT := $(COMMONCFLAGS) -DMODE16=0 -DMODESEGMENT=0 -fomit-frame-pointer
+CFLAGS32FLAT := $(COMMONCFLAGS) -DMODE16=0 -DMODESEGMENT=0
CFLAGSSEG := $(COMMONCFLAGS) -DMODESEGMENT=1 -fno-defer-pop \
$(call cc-option,$(CC),-fno-jump-tables,-DMANUAL_NO_JUMP_TABLE) \
$(call cc-option,$(CC),-fno-tree-switch-conversion,)
-CFLAGS32SEG := $(CFLAGSSEG) -DMODE16=0 -fomit-frame-pointer
-CFLAGS16INC := $(CFLAGSSEG) -DMODE16=1 \
+CFLAGS32SEG := $(CFLAGSSEG) -DMODE16=0
+CFLAGS16 := $(CFLAGSSEG) -DMODE16=1 \
$(call cc-option,$(CC),-m16,-Wa$(COMMA)src/code16gcc.s) \
$(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline)
-CFLAGS16 := $(CFLAGS16INC) -fomit-frame-pointer
# Run with "make V=1" to see the actual compile commands
ifdef V
@@ -155,7 +154,7 @@
$(OUT)romlayout16.lds: $(OUT)ccode32flat.o $(OUT)code32seg.o $(OUT)ccode16.o $(OUT)romlayout.o scripts/layoutrom.py scripts/buildversion.sh
@echo " Building ld scripts"
- $(Q)./scripts/buildversion.sh $(OUT)version.c
+ $(Q)BUILD_VERSION="$(VERSION)" ./scripts/buildversion.sh $(OUT)version.c
$(Q)$(CC) $(CFLAGS32FLAT) -c $(OUT)version.c -o $(OUT)version.o
$(Q)$(LD) $(LD32BIT_FLAG) -r $(OUT)ccode32flat.o $(OUT)version.o -o $(OUT)code32flat.o
$(Q)$(LD) $(LD32BIT_FLAG) -r $(OUT)ccode16.o $(OUT)romlayout.o -o $(OUT)code16.o
@@ -210,23 +209,25 @@
vgasrc/clext.c vgasrc/bochsvga.c vgasrc/geodevga.c \
src/fw/coreboot.c vgasrc/cbvga.c
-CFLAGS16VGA = $(CFLAGS16INC) -Isrc
-
-$(OUT)vgaccode16.raw.s: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRCVGA)) ; $(call whole-compile, $(CFLAGS16VGA) -S, $(SRCVGA),$@)
+ifeq "$(CONFIG_VGA_FIXUP_ASM)" "y"
+$(OUT)vgaccode16.raw.s: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRCVGA)) ; $(call whole-compile, $(filter-out -fomit-frame-pointer,$(CFLAGS16)) -fno-omit-frame-pointer -S -Isrc, $(SRCVGA),$@)
$(OUT)vgaccode16.o: $(OUT)vgaccode16.raw.s scripts/vgafixup.py
@echo " Fixup VGA rom assembler"
$(Q)$(PYTHON) ./scripts/vgafixup.py $< $(OUT)vgaccode16.s
$(Q)$(AS) --32 src/code16gcc.s $(OUT)vgaccode16.s -o $@
+else
+$(OUT)vgaccode16.o: $(OUT)autoconf.h $(patsubst %.c, $(OUT)%.o,$(SRCVGA)) ; $(call whole-compile, $(CFLAGS16) -Isrc, $(SRCVGA),$@)
+endif
$(OUT)vgaentry.o: vgasrc/vgaentry.S $(OUT)autoconf.h $(OUT)asm-offsets.h
@echo " Compiling (16bit) $@"
- $(Q)$(CC) $(CFLAGS16VGA) -c -D__ASSEMBLY__ $< -o $@
+ $(Q)$(CC) $(CFLAGS16) -c -D__ASSEMBLY__ $< -o $@
$(OUT)vgarom.o: $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgasrc/vgalayout.lds scripts/buildversion.sh
@echo " Linking $@"
- $(Q)./scripts/buildversion.sh $(OUT)vgaversion.c VAR16
- $(Q)$(CC) $(CFLAGS16VGA) -c $(OUT)vgaversion.c -o $(OUT)vgaversion.o
+ $(Q)BUILD_VERSION="$(VERSION)" ./scripts/buildversion.sh $(OUT)vgaversion.c VAR16
+ $(Q)$(CC) $(CFLAGS16) -c $(OUT)vgaversion.c -o $(OUT)vgaversion.o
$(Q)$(LD) --gc-sections -T $(OUT)vgasrc/vgalayout.lds $(OUT)vgaccode16.o $(OUT)vgaentry.o $(OUT)vgaversion.o -o $@
$(OUT)vgabios.bin.raw: $(OUT)vgarom.o
diff -Nru seabios-1.8.1/scripts/buildversion.sh seabios-1.8.2/scripts/buildversion.sh
--- seabios-1.8.1/scripts/buildversion.sh 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/scripts/buildversion.sh 2015-06-16 03:00:30.000000000 -0500
@@ -4,14 +4,18 @@
VAR16MODE="$2"
# Extract version info
-if [ -d .git -o -f .git ]; then
- VERSION="`git describe --tags --long --dirty`"
-elif [ -f .version ]; then
- VERSION="`cat .version`"
+if [ -z "$BUILD_VERSION" ]; then
+ if [ -d .git -o -f .git ]; then
+ VERSION="`git describe --tags --long --dirty`"
+ elif [ -f .version ]; then
+ VERSION="`cat .version`"
+ else
+ VERSION="?"
+ fi
+ VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`"
else
- VERSION="?"
+ VERSION="$BUILD_VERSION"
fi
-VERSION="${VERSION}-`date +"%Y%m%d_%H%M%S"`-`hostname`"
echo "Version: ${VERSION}"
# Build header file
diff -Nru seabios-1.8.1/scripts/vgafixup.py seabios-1.8.2/scripts/vgafixup.py
--- seabios-1.8.1/scripts/vgafixup.py 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/scripts/vgafixup.py 2015-06-16 03:00:30.000000000 -0500
@@ -7,8 +7,8 @@
# The x86emu code widely used in Linux distributions when running Xorg
# in vesamode is known to have issues with "retl", "leavel", "entryl",
-# and some variants of "calll". This code modifies those instructions
-# (ret and leave) that are known to be generated by gcc to avoid
+# "leal", and some variants of "calll". This code modifies those
+# instructions that are known to be generated by gcc to avoid
# triggering the x86emu bugs.
# It is also known that the Windows vgabios emulator has issues with
@@ -16,7 +16,59 @@
# worked around by not using the gcc parameter "-fomit-frame-pointer"
# when compiling.
-import sys
+import sys, re
+
+# leal parameter regex - example string: -3(%edx,%eax,8), %eax
+re_leal = re.compile(
+ r'^\s*(?P<offset>[^(]*?)\s*'
+ r'\(\s*(?P<base>[^,)]*?)\s*(?:,\s*(?P<index>[^,)]*?)\s*)?'
+ r'(?:,\s*(?P<scale>[^,)]*?)\s*)?\)\s*'
+ r',\s*(?P<dest>.*?)\s*$')
+
+# Find an alternate set of instructions for a given "leal" instruction
+def handle_leal(sline):
+ m = re_leal.match(sline[5:])
+ if m is None or m.group('index') == '%esp':
+ print("Unable to fixup leal instruction: %s" % (sline,))
+ sys.exit(-1)
+ offset, base, index, scale, dest = m.group(
+ 'offset', 'base', 'index', 'scale', 'dest')
+ if dest == '%esp':
+ # If destination is %esp then just use 16bit leaw instead
+ return 'leaw %s\n' % (sline[5:].replace('%e', '%'),)
+ if not scale:
+ scale = '1'
+ scale = {1: 0, 2: 1, 4: 2, 8: 3}[int(scale, 0)]
+ # Try to rearrange arguments to simplify 'base' (to improve code gen)
+ if not scale and base == index:
+ base, index, scale = '', index, 1
+ elif not index or (not scale and base in (dest, '%esp') and index != dest):
+ base, index, scale = index, base, 0
+ # Produce instructions to calculate "leal"
+ insns = ['pushfw']
+ if base != dest:
+ # Calculate "leal" directly in dest register
+ if index != dest:
+ insns.insert(0, 'movl %s, %s' % (index, dest))
+ if scale:
+ insns.append('shll $%d, %s' % (scale, dest))
+ if base:
+ if base == '%esp':
+ offset += '+2'
+ insns.append('addl %s, %s' % (base, dest))
+ elif base == index:
+ # Use "imull" method
+ insns.append('imull $%d, %s' % ((1<<scale)+1, dest))
+ else:
+ # Backup/restore index register and do scaling in index register
+ insns.append('pushl %s' % (index,))
+ insns.append('shll $%d, %s' % (scale, index))
+ insns.append('addl %s, %s' % (index, dest))
+ insns.append('popl %s' % (index,))
+ if offset and offset != '0':
+ insns.append('addl $%s, %s' % (offset, dest))
+ insns.append('popfw\n')
+ return ' ; '.join(insns)
def main():
infilename, outfilename = sys.argv[1:]
@@ -30,6 +82,9 @@
out.append('movl %ebp, %esp ; popl %ebp\n')
elif sline.startswith('call'):
out.append('pushw %ax ; callw' + sline[4:] + '\n')
+ elif sline.startswith('leal'):
+ out.append(handle_leal(sline))
+ #print("-> %s\n %s" % (sline, out[-1].strip()))
else:
out.append(line)
infile.close()
diff -Nru seabios-1.8.1/src/fw/smm.c seabios-1.8.2/src/fw/smm.c
--- seabios-1.8.1/src/fw/smm.c 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/src/fw/smm.c 2015-06-16 03:00:30.000000000 -0500
@@ -18,8 +18,14 @@
#include "util.h" // smm_setup
#include "x86.h" // wbinvd
-#define SMM_REV_I32 0x00020000
-#define SMM_REV_I64 0x00020064
+/*
+ * Check SMM state save area format (bits 0-15) and require support
+ * for SMBASE relocation.
+ */
+#define SMM_REV_MASK 0x0002ffff
+
+#define SMM_REV_I32 0x00020000
+#define SMM_REV_I64 0x00020064
struct smm_state {
union {
@@ -62,9 +68,10 @@
if (smm == (void*)BUILD_SMM_INIT_ADDR) {
// relocate SMBASE to 0xa0000
- if (smm->cpu.i32.smm_rev == SMM_REV_I32) {
+ u32 rev = smm->cpu.i32.smm_rev & SMM_REV_MASK;
+ if (rev == SMM_REV_I32) {
smm->cpu.i32.smm_base = BUILD_SMM_ADDR;
- } else if (smm->cpu.i64.smm_rev == SMM_REV_I64) {
+ } else if (rev == SMM_REV_I64) {
smm->cpu.i64.smm_base = BUILD_SMM_ADDR;
} else {
warn_internalerror();
diff -Nru seabios-1.8.1/src/hw/ahci.c seabios-1.8.2/src/hw/ahci.c
--- seabios-1.8.1/src/hw/ahci.c 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/src/hw/ahci.c 2015-06-16 03:00:30.000000000 -0500
@@ -601,7 +601,7 @@
dprintf(2, "AHCI: cap 0x%x, ports_impl 0x%x\n",
ctrl->caps, ctrl->ports);
- max = ctrl->caps & 0x1f;
+ max = 0x1f;
for (pnr = 0; pnr <= max; pnr++) {
if (!(ctrl->ports & (1 << pnr)))
continue;
diff -Nru seabios-1.8.1/.version seabios-1.8.2/.version
--- seabios-1.8.1/.version 2015-03-16 02:52:28.000000000 -0500
+++ seabios-1.8.2/.version 2015-06-17 01:57:47.000000000 -0500
@@ -1 +1 @@
-1.8.1
+1.8.2
diff -Nru seabios-1.8.1/vgasrc/bochsvga.c seabios-1.8.2/vgasrc/bochsvga.c
--- seabios-1.8.1/vgasrc/bochsvga.c 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/vgasrc/bochsvga.c 2015-06-16 03:00:30.000000000 -0500
@@ -403,10 +403,7 @@
case 0x15ad: /* qemu vmware vga */
barid = 1;
break;
- case 0x1af4: /* virtio-vga */
- barid = 2;
- break;
- default: /* stdvga, qxl */
+ default: /* stdvga, qxl, virtio */
barid = 0;
break;
}
diff -Nru seabios-1.8.1/vgasrc/Kconfig seabios-1.8.2/vgasrc/Kconfig
--- seabios-1.8.1/vgasrc/Kconfig 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/vgasrc/Kconfig 2015-06-16 03:00:30.000000000 -0500
@@ -90,6 +90,17 @@
Support emulating text mode features when only a
framebuffer is available.
+ config VGA_FIXUP_ASM
+ depends on BUILD_VGABIOS
+ bool "Fixup assembler to work with broken emulators"
+ default y
+ help
+ This option will cause the build to attempt to avoid
+ certain x86 machine instructions that are known to confuse
+ some emulators. In particular, it works around
+ deficiencies in the Windows vgabios emulator and the
+ x86emu vgabios emulator (frequently used in Xorg).
+
config VGA_ALLOCATE_EXTRA_STACK
depends on BUILD_VGABIOS
bool "Allocate an internal stack for 16bit interrupt entry point"
diff -Nru seabios-1.8.1/vgasrc/vgabios.c seabios-1.8.2/vgasrc/vgabios.c
--- seabios-1.8.1/vgasrc/vgabios.c 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/vgasrc/vgabios.c 2015-06-16 03:00:30.000000000 -0500
@@ -259,7 +259,7 @@
, sizeof(info->bda_0x84));
u16 vbe_mode = GET_FARVAR(seg, info->vbe_mode);
SET_BDA_EXT(vbe_mode, vbe_mode);
- struct vgamode_s *vmode_g = vgahw_find_mode(vbe_mode);
+ struct vgamode_s *vmode_g = vgahw_find_mode(vbe_mode & ~MF_VBEFLAGS);
SET_BDA_EXT(vgamode_offset, (u32)vmode_g);
SET_IVT(0x1f, GET_FARVAR(seg, info->font0));
SET_IVT(0x43, GET_FARVAR(seg, info->font1));
diff -Nru seabios-1.8.1/vgasrc/vgaentry.S seabios-1.8.2/vgasrc/vgaentry.S
--- seabios-1.8.1/vgasrc/vgaentry.S 2015-03-13 04:02:17.000000000 -0500
+++ seabios-1.8.2/vgasrc/vgaentry.S 2015-06-16 03:00:30.000000000 -0500
@@ -45,33 +45,15 @@
* Entry points
****************************************************************/
- // Force a fault if found to be running on broken x86emu versions.
- DECLFUNC x86emu_fault
-msg: .ascii "SeaVGABIOS: x86emu leal trap!\n"
-x86emu_fault:
-#if CONFIG_DEBUG_IO
- movw %cs:DebugOutputPort, %dx
- movw $msg, %si
-1: movb %cs:(%si), %al
- outb %al, (%dx)
- incw %si
- cmpw $x86emu_fault, %si
- jl 1b
-#endif
-1: hlt
- jmp 1b
-
// This macro implements a call while avoiding instructions
// that old versions of x86emu have problems with.
.macro VGA_CALLL cfunc
- // Make sure leal instruction works.
- movl $0x8000, %ecx
- leal (%ecx, %ecx, 1), %ecx
- cmpl $0x10000, %ecx
- jne x86emu_fault
- // Use callw instead of calll
- push %ax
+#if CONFIG_VGA_FIXUP_ASM
+ pushw %ax
callw \cfunc
+#else
+ calll \cfunc
+#endif
.endm
// This macro is the same as ENTRY_ARG except VGA_CALLL is used.
|