Messages in this thread | ![/](/images/icornerl.gif) | | Date | Mon, 13 Jan 2003 08:59:41 -0800 (PST) | From | "Randy.Dunlap" <> | Subject | Re: bootsect.S: 2 questions |
| |
Hi-
(mostly "what R. Johnson said")
On Mon, 13 Jan 2003, Mad Hatter wrote:
| I was looking through the linux (2.5.56) arch/i386/boot/bootsect.S and was | puzzled about a couple of things: | | 1. Near line 221 we have: | sread: .word 0 # sectors read of current track | head: .word 0 # current head | track: .word 0 # current track | | However, since a diskette can have at most 2 heads, 80 tracks and 36 sectors | per track, why are these not bytes instead of words especially since space is | at such a tight premium in this code ?
If you change those to bytes to save 3 bytes of space, and then you change all of the instructions that load or store those values to 16-bit registers, do you have a net saving of space? Or you load/store them to 8-bit registers and rewrite the code, what happens?
| 2. Near line 272 we have "movw $7, %bx" but the documentation I've | been able to find about the "int 0x10" BIOS call says that for service | code 0xe (write character and advance cursor), it does not take an | attribute byte input parameter but rather uses the existing attribute. Is | this movw instruction superfluous ?
Perhaps, or perhaps on some particular system it was found to be needed. We don't have a fully indexed changelog history of each line AFAIK. Ralf Brown's interrupt page for this function says: BH = page number BL = foreground color (graphics modes only) (see http://www.ctyme.com/intr/rb-0106.htm) Or it could be important to clear BH and setting BL to 7 was just safe.
-- ~Randy
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |