lkml.org 
[lkml]   [1999]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Updated i386 bootcode rewrite patch...

> I see that the patch submitted by Chris Noe <stiker@northlink.com>
> requires a minimum of binutils-2.9.1.0.7.
>
> Chris Noe says:
>
> Simple patch that takes all the as86/ld86 stuff in arch/i386/boot and
> makes it use standard GNU as/ld. Needs a minimum of binutils-2.9.1.0.7,
> but that's it (that is the minimum per Documentation/Changes for 2.2
> anyway). I'd love to see this squeeze into 2.3 as a 'bugfix' as no new
> features are anywhere to be found, I swear. :)
>
> As I read Documentation/Changes, it currently states that
> the minimum binutils required is
> - Binutils 2.8.1.0.23 ; ld -v
> It also mentions, but does not require 2.9.1.0.15.

Quoting 2.2/2.3 Documentation/Changes (just for background):

"The last public release of the binutils 2.8.x series was 2.8.1.0.23.
Binutils 2.8.1.0.25 to 2.9.1.0.2 are beta releases, and are known to be
very buggy. Binutils 2.9.1 (note the absence of a suffix) from the FSF
should work, and binutils 2.9.1.0.7 and later releases are also good.
Either use binutils-2.8.1.0.23 or binutils-2.9.1.0.7 or later. Glibc2
users should especially try to use the 2.9.1.0.x releases, as they
resolve known issues with glibc2 and binutils-2.8.x releases."

Yes, there was also supposed to be a hunk in the patch that removed all
references of binutils 2.8 from the Changes and made 2.9.1.0.7 the
absolute minimum. Of course I managed to get more caught up in the code
and let the documentation slip. :)

Yes the upping of the version is inconvenient, but really for a good
reason -- 2.9.1 is still not the most optimal (2.9.5 would be), but 2.9.1
is present and in (almost?) every modern distribution; the time has come
to up the minimum, and it has (expectedly) caused some problems. I
wouldn't have done it except for the fact that any binutils earlier than
that have trouble compiling the most basic 16 bit code. I'd love to make
it a more recent version, but as we've seen, the lowest version
recommended is often the version most often used :)

> Chris Noe says that "This thing has been tested by many people"
> but if this is what made it into linux-2.3.21 then none
> of those people were running binutils 2.8.1.0.23.

Right, because 2.9.1.0.7 is the absolute minimum; anything below that is
*KNOWN TO MISCOMPILE* this code. I wouldn't be surprised if other asms
around the kernel were compiled wrong (or at least sub-optimally) with
older binutils.

> I didn't here back from an Chris Ricker
> Re: bbootsect.s Error: base/index register must be 32 bit register
> on updating Documentation/Changes to reflect this new requirements for
> binutils clearly.

It's in the works, and in a diff going into 2.3.22.

Here's a recent (code only) diff, please test this against a clean 2.3.21,
with a binutils >= 2.9.1.0.7, and let me know if it causes any problems.
It fixes the one compile-killing outb/outw typo, along with fixing bzImage
loading (as reported by Vojtech), as well as a few iffy asms caught by
the latest 2.9.5 (thanks to Mike Galbraith).

Vojtech Pavlik: This diff fixes the very problem you were having.

Chris Noe
(stiker@northlink.com)
--- bootsect.S.orig Tue Oct 12 06:36:19 1999
+++ bootsect.S Tue Oct 12 17:25:24 1999
@@ -247,7 +247,7 @@
xorw %bx, %bx # bx is starting address within segment
rp_read:
#ifdef __BIG_KERNEL__
- lcall bootsect_kludge # in setup.S
+ .word 0x1eff, 0x0220 # lcall * bootsect_kludge in setup.S
#else
movw %es, %ax
subw $SYSSEG, %ax
@@ -398,11 +398,9 @@
# don't have to worry about it later.

kill_motor:
- pushw %dx
movw $0x3f2, %dx
xorb %al, %al
- outw %al, %dx
- popw %dx
+ outb %al, %dx
ret

sectors: .word 0
--- setup.S.orig Tue Oct 12 06:36:23 1999
+++ setup.S Tue Oct 12 17:43:29 1999
@@ -145,7 +145,7 @@
#ifdef SAFE_RESET_DISK_CONTROLLER
# Reset the disk controller.
movw $0x0000, %ax
- movb $0x80, $dl
+ movb $0x80, %dl
int $0x13
#endif

@@ -400,7 +400,7 @@
subw $DELTA_INITSEG, %ax # aka INITSEG
movw %ax, %ds
xorw %ax, %ax
- movw %ax, 0xa0 # set table length to 0
+ movw %ax, (0xa0) # set table length to 0
movb $0xc0, %ah
stc
int $0x15 # moves feature table to es:bx
@@ -496,7 +496,7 @@
cmpw $0, %cs:realmode_swtch
jz rmodeswtch_normal

- call *%cs:realmode_swtch
+ lcall %cs:realmode_swtch

jmp rmodeswtch_end
\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.191 / U:0.712 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site