On Mon, 13 Jan 2003, Mad Hatter wrote:
> Hi,
>
> 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 ?
>
Because, when they are used, they are ORed into word-sized registers.
The track and sector are are put into register CX and the head and drive
number are put into DX.
> 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 ?
>
On page 218, "System BIOS for IBM PC/XT/AT Computers", Phoenix
Technical Reference Series, ISBN 0-201-51806-6, the documentation
clearly states that BL contains the foreground color and BH the
active page. Therefore 0x0007 is the correct value to be put
into that register for the "Write Teletype to Active Page" function.
FYI, the startup functions are used once-per-boot. Any "improvements"
other than those necessary to "fix" something are useless in the
overall scheme of things.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Why is the government concerned about the lunatic fringe? Think about it.
-
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/
This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:46 EST