lkml.org 
[lkml]   [2004]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] restore floppy boot image


Joshua wrote:

> +enter:

You get a segment number here into AX...

> + pop %ax /* Pointer to setup area */
> + mov %ax, %ds
> + mov %ax, %es
> + mov %ax, %fs
> + mov %ax, %gs
> + movb $0x20, 0x210 /* Tell setup.S that we are the bootsect
> */
> + orb $0x1, 0x211 /* Covert any zImage to bzImage (weird) */
> + movw $0x0, 0x214 /* This is where we loaded it */
> + movw $0x10, 0x216
> +
> + /*
> + * This procedure turns off the floppy drive motor, so
> + * that we enter the kernel in a known state, and
> + * don't have to worry about it later.
> + *
> + * Actually, all this does is not annoy sysadmin, when he is
> + * forced to use this method of booting, because if the floppy
> + * is a demand-loaded module, the motor just won't turn off
> + * otherwise.
> + */
> +
> + mov $0x3f2, %dx

Then you clobber it here....

> + mov $0, %al
> + /* outb */
> + .byte 0xEE /* I don't have time to figure out
> + * why this didn't assemble. */
> +
> + /*
> + * Enter kernel with interrupts off, and at segment +20 from
> + * legacy bootsect location
> + */
> + cli

And then you use the clobbered value here. (Unless the low byte of SS
is supposed to be zero.)

> + mov %ax, %ss
> + mov $0xFFF0, %sp /* Plenty heap */
> + ljmp $KS_LOAD + 0x20, $0

-
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/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.055 / U:2.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site