public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Timothy Miller <miller@techsource.com>
To: Joshua <jhudson@cyberspace.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] restore floppy boot image
Date: Wed, 30 Jun 2004 16:34:20 -0400	[thread overview]
Message-ID: <40E323CC.5030105@techsource.com> (raw)
In-Reply-To: <Pine.SUN.3.96.1040630143510.23723A-100000@grex.cyberspace.org>



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


  parent reply	other threads:[~2004-06-30 20:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-30 18:45 [PATCH] restore floppy boot image Joshua
2004-06-30 18:56 ` Brian Gerst
2004-06-30 20:34 ` Timothy Miller [this message]
2004-06-30 21:33 ` Timothy Miller
2004-06-30 21:52   ` Joshua
2004-06-30 21:55     ` Randy.Dunlap
2004-07-01 14:50       ` Timothy Miller
2004-06-30 23:17 ` Tobias Diedrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40E323CC.5030105@techsource.com \
    --to=miller@techsource.com \
    --cc=jhudson@cyberspace.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox