Messages in this thread Patch in this message | | | Date | Mon, 11 Oct 1999 22:23:08 -0400 (EDT) | From | Chris Noe <> | Subject | Re: [patch] 2.3.31 i386/bootsect.S |
| |
Thanks Linus, I was in 'quick! fix bug!' mode and got a little careless.
Such is the excitement of dev kernels, I suppose. Well, here's a pile of the latest fixes:
* all 'base/index must be 32 bit' errors should be fixed (prefix bytes now eat us alive for code space, yay!) -- but I have no way of testing it for sure... * s/outw/outb in kill_motor * fixed simple bzImage loader (was only tested with lilo/syslinux, never as 'cat bzImage > /dev/fd0' * shortened "Loading" msg to just "Linux" -- quick hack to save a few precious bytes :) * a few misc. optimizations for code size
Patch attached. Tested with zImage, bzImage: both cat'd to disk, and also with lilo.
Anyone wanting 2.3.21 to compile should apply this; it supercedes the other quick patches I threw together earlier tonight.
Let me know if anything breaks or isn't fixed.
Chris Noe (stiker@northlink.com) --- bootsect.S.orig Mon Oct 11 19:07:40 1999 +++ bootsect.S Mon Oct 11 22:13:05 1999 @@ -104,7 +104,7 @@ movw %cx, %fs # set fs to 0 movw $0x78, %bx # fs:bx is parameter table address pushw %ds - ldsw %fs:(%bx), %si # ds:si is source + ldsw %fs:(%ebx), %si # ds:si is source movb $3, %cl # copy 12 bytes cld pushw %di # di = 0x4000-12. @@ -112,9 +112,9 @@ movsl popw %di popw %ds - movb $36, 0x4(%di) # patch sector count - movw %di, %fs:(%bx) - movw %es, %fs:2(%bx) + movb $36, 0x4(%edi) # patch sector count + movw %di, %fs:(%ebx) + movw %es, %fs:2(%ebx) # Load the setup-sectors directly after the bootblock. # Note that 'es' is already set up. @@ -184,7 +184,7 @@ movb $0x03, %ah # read cursor pos xorb %bh, %bh int $0x10 - movw $9, %cx + movw $5, %cx # size of string movw $0x0007, %bx # page 0, attribute 7 (normal) movw $msg1, %bp movw $0x1301, %ax # write string, move cursor @@ -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 @@ -397,18 +397,17 @@ # that we enter the kernel in a known state, and # don't have to worry about it later. +# Nothing depends on %dx being saved +# saves us some bytes by not saving it on the stack kill_motor: - pushw %dx movw $0x3f2, %dx xorb %al, %al - outw %al, %dx - popw %dx + outb %al, %dx ret sectors: .word 0 disksizes: .byte 36, 18, 15, 9 -msg1: .byte 13, 10 - .ascii "Loading" +msg1: .ascii "Linux" # XXX: This is a *very* snug fit. | |