Philip Guenther <guent...@gmail.com> wrote:

> Since we're unlikely to do _more_ with BIOS calls in the boot loader, my
> inclination would be to eliminate the structure value and the code that
> sets it (incorrectly).  Opinions?

I dunno, my crystal ball provides a more cynical outlook.

How about we just repair by swapping the blocks as you propose, then
noone gets surprised down the road if they try to use the bios-interface
API's full functionality.

The bootblocks don't shrink, but they don't grow either.

Is this the right diff?  I'm deleting the name which is in the commitlogs
since that isn't our style.

Index: sys/arch/amd64/stand/libsa/gidt.S
===================================================================
RCS file: /cvs/src/sys/arch/amd64/stand/libsa/gidt.S,v
retrieving revision 1.11
diff -u -p -u -r1.11 gidt.S
--- sys/arch/amd64/stand/libsa/gidt.S   27 Oct 2012 15:43:42 -0000      1.11
+++ sys/arch/amd64/stand/libsa/gidt.S   9 Nov 2019 03:57:11 -0000
@@ -417,19 +417,18 @@ intno     = . - 1
        .byte   0xb8
 2:     .long   0x90909090
 
-       /* pass BIOS return values back to caller */
-       movl    %eax, 0xb*4(%esp)
-       movl    %ecx, 0xa*4(%esp)
-       movl    %edx, 0x9*4(%esp)
-       movb    %bh , 0xe*4(%esp)
-
        /* clear NT flag in eflags */
-       /* Martin Fredriksson <mar...@gbg.netman.se> */
        pushf
        pop     %eax
        and     $0xffffbfff, %eax
        push    %eax
        popf
+
+       /* pass BIOS return values back to caller */
+       movl    %eax, 0xb*4(%esp)
+       movl    %ecx, 0xa*4(%esp)
+       movl    %edx, 0x9*4(%esp)
+       movb    %bh , 0xe*4(%esp)
 
        /* save registers into save area */
        movl    %eax, _C_LABEL(BIOS_regs)+BIOSR_AX
Index: sys/arch/i386/stand/libsa/gidt.S
===================================================================
RCS file: /cvs/src/sys/arch/i386/stand/libsa/gidt.S,v
retrieving revision 1.36
diff -u -p -u -r1.36 gidt.S
--- sys/arch/i386/stand/libsa/gidt.S    31 Oct 2012 13:55:58 -0000      1.36
+++ sys/arch/i386/stand/libsa/gidt.S    9 Nov 2019 03:56:56 -0000
@@ -420,19 +420,18 @@ intno     = . - 1
        .byte   0xb8
 2:     .long   0x90909090
 
-       /* pass BIOS return values back to caller */
-       movl    %eax, 0xb*4(%esp)
-       movl    %ecx, 0xa*4(%esp)
-       movl    %edx, 0x9*4(%esp)
-       movb    %bh , 0xe*4(%esp)
-
        /* clear NT flag in eflags */
-       /* Martin Fredriksson <mar...@gbg.netman.se> */
        pushf
        pop     %eax
        and     $0xffffbfff, %eax
        push    %eax
        popf
+
+       /* pass BIOS return values back to caller */
+       movl    %eax, 0xb*4(%esp)
+       movl    %ecx, 0xa*4(%esp)
+       movl    %edx, 0x9*4(%esp)
+       movb    %bh , 0xe*4(%esp)
 
        /* save registers into save area */
        movl    %eax, _C_LABEL(BIOS_regs)+BIOSR_AX

Reply via email to