fixes to arch/i386/boot/bootsect.S

Emmanuel Marty (core@mirus.fr)
Sun, 05 Apr 1998 19:37:01 +0000


This is a multi-part message in MIME format.
--------------E641955ACBE37481CB0350B3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello all,

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. So I rewrote that small
bit of the bootsector; while I was at it, I made it smaller and use less stack.. Gives
a few new extra bytes to stuff more things in ;)

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. It means that linux might not load from floppy properly on old bioses
that had a low number of sectors in the partition table (what that part of
the bootloader is about, in the first place). I fixed that too..

Since the diff is very small, I am attaching it gzipped to this email. This is in no way
a major fix, but problem #2 could be nasty; it makes the bootsector smaller and
work on all architectures, too.

Tell me what you think?

Emmanuel.

--------------E641955ACBE37481CB0350B3
Content-Type: application/x-gzip; name="bootsect.diff.gz"
Content-Transfer-Encoding: base64
Content-Disposition: inline; filename="bootsect.diff.gz"

H4sICLTVJzUCA2Jvb3RzZWN0LmRpZmYAhVRRb9owEH5OfsVVfSg0DoWwUkBCYuvQVqnrS/sH
nNgBr0kc+RwI/35nJ3S0UzWEwPbdd/fdd2fHcQzcZLsbNZ3PblKtrf9BmdnR80gXInhuKvha
G4BbSMbL8XyZJDBZLOZhFEWfQz/AbhfL6V0HW68hTtgMooTdwXodwkXwBsMguNf10ajtzsLg
fugQE+Z+E3hUVYPwos2eFwIdrNRC5UoKSI/w3cgDbLLXHTfCfjR+M00mYbPnFcIgFXIYRu8d
NmXJq0YW8Isbe4SBLN3/kOLQF/7SA4VQaC4IxS2M27tsPHZ4u5OQKo0xWgI2NRjdWFVJZMAr
AaXeS8cYFMUpciAj6NyjDpzQGrgQRiJSyMWYPh3sd1PW6LyMHHnZFrdsOoVoMWPTsZcOroOf
pBUILbG6srBrjB0BPOqDPxo5D+/1LLelrCxSwyRwhFwXhT7gEgSuJK4QVxlCDA9PDy/Pmx8s
jAkT5AgrIC5bX3dD8kvhQ96EQAoCSW6UtbKCSltXBTlATjWnErDkRSGNr8NZnYnEyV4pS6eu
0yNrIdOV5YoaM4bc6JKC1k4vPABPSTbKFFOr9kSGZW2/Tlt2SeLPg+CC8i3T1vGrueGltJTT
8rSQJ0kJUje4C4RbodwSgBY0QQEqNkjbYeCiCFyiclFQNyaTYeTziJaRn7Mj30tyOp07Lj3O
SRRGveGcmJFcfEqqc+8Z9DvesqTb9gduw4Tyify0Ht/mhMSutaq86sT4FNDjmTzjydv39X1G
CELwkKxglzMPyegiwiSh8bZueMki3rRUYUwn1KquIXigPdl07U3doieBh8CH47lL6g8YCEWy
eSo9jYgykT/1JzixT4Mv8SQZCDVk19OZC1Fzm+3A3URtiF5T2dN0kO9/HOPz7p+J+/H4XwVF
pyCpRNH8EIAbXfcM+BuMki583CVDqszQqjj29fqHgZ6PtNDZ68jhnrSVdEzPx5XEK9cSXrhR
ObpA0NSj8A/yowpSkwUAAA==
--------------E641955ACBE37481CB0350B3--

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