Re: fixes to arch/i386/boot/bootsect.S

Malware (Michael.Mueller4@post.rwth-aachen.de)
Sun, 05 Apr 1998 22:51:35 +0200


Hi Emmanuel,

you wrote:
> Looking at arch/i386/boot/bootsect.S , just to see how much the Linux
> bootsector does, I spotted two small things :
>
> The part that copies the disk parameter table so that it can patch
> the sector count makes use of register FS. This register only exists
> on 386 and up.. It means that the bootsector will hang on a 8086/80286
> without letting the chance to setup to be loaded and eventually print
> an appropriate message. This hasn't been done in setup yet, and
> the percentage of people who will try to boot a linux kernel on < 386
> is very low, but I know Linux programmers care about old hardware.

I am not sure it is very helpfull since actually there is no code in the
Setup that checks for an processor <386.

> The second problem is that I think the number of sectors isn't patched
> correctly :
> it is modified relative to DS, not ES which is the segment where the
> memory copy now is.

: push ds
: seg fs
: lds si,(bx) ! ds:si is source
: mov cl,#6 ! copy 12 bytes
: cld
: push di
:
: rep
: movsw
:
: pop di
: pop ds

Note the last one above sets DS back to INITSEG.
And thus the followed movb is ok. Seems you moved the 'pop ds' somewhere
else, lost track about this change and thus created the bug.

: movb 4(di),*36 ! patch sector count

Malware

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu