[SeaBIOS] vgabios -> seabios breaks (my) 16-bit applications

Richard Laager rlaager at wiktel.com
Mon Jan 12 23:07:26 CET 2015


On Mon, 2015-01-12 at 15:06 -0500, Kevin O'Connor wrote:
> On Mon, Jan 12, 2015 at 01:13:54PM -0600, Richard Laager wrote:
> > Your patch implementing idea 6 fixes the problem for my business
> > application on a stock Ubuntu package (with extra stack enabled).
> 
> Thanks.
> 
> The key part of option 5 (as described in my previous email) looks
> like the patch below.  It also works with skifree on Vista for me.
> 
> -Kevin
> 
> 
> --- a/vgasrc/vgaentry.S
> +++ b/vgasrc/vgaentry.S
> @@ -111,8 +111,10 @@ entry_10_extrastack:
>          cld
>          pushw %ds               // Set %ds:%eax to space on ExtraStack
>          pushl %eax
> -        movw %cs:ExtraStackSeg, %ds
> -        movl $(CONFIG_VGA_EXTRA_STACK_SIZE-PUSHBREGS_size-16), %eax
> +        movw $SEG_BDA, %ax
> +        movw %ax, %ds
> +        movw 0x0e, %ds
> +        movl $(1024-PUSHBREGS_size-16), %eax
>          SAVEBREGS_POP_DSEAX     // Save registers on extra stack
>          movl %esp, PUSHBREGS_size+8(%eax)
>          movw %ss, PUSHBREGS_size+12(%eax)

I may have screwed something up while applying, but when I tested with
git plus this patch, I didn't get any video output during booting.

I tested with Ubuntu's seabios 1.7.4, and adding a modified version of
this patch did fix the problem. The changes seemed pretty obvious in
context. It seems that BREGS_size-8 was changed to PUSHBREGS_size-16
somewhere after 1.7.4. Here's the patch that I applied to 1.7.4:

Index: seabios-1.7.4/vgasrc/vgaentry.S
===================================================================
--- seabios-1.7.4.orig/vgasrc/vgaentry.S	2015-01-12 15:28:20.060000981 -0600
+++ seabios-1.7.4/vgasrc/vgaentry.S	2015-01-12 15:29:35.296142288 -0600
@@ -101,8 +101,10 @@
         cld
         pushw %ds               // Set %ds:%eax to space on ExtraStack
         pushl %eax
-        movw %cs:ExtraStackSeg, %ds
-        movl $(CONFIG_VGA_EXTRA_STACK_SIZE-BREGS_size-8), %eax
+        movw $SEG_BDA, %ax
+        movw %ax, %ds
+        movw 0x0e, %ds
+        movl $(1024-BREGS_size-8), %eax
         popl BREGS_eax(%eax)    // Backup registers
         popw BREGS_ds(%eax)
         movl %edi, BREGS_edi(%eax)

So it seems you have two working solutions (though I should retest with
git, if you want to go with option 5).

If/when you choose one of these and commit it, I'll update the Ubuntu
bug asking them to deploy the patch as an SRU (stable release update).

-- 
Richard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://www.seabios.org/pipermail/seabios/attachments/20150112/b263bb39/attachment.asc>


More information about the SeaBIOS mailing list