mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: kernel list <linux-kernel@vger.kernel.org>, patches@x86-64.org
Subject: bzImage loading directly from floppy
Date: Fri, 25 May 2001 22:25:43 +0200	[thread overview]
Message-ID: <20010525222543.A4605@bug.ucw.cz> (raw)

Hi!

...is broken. If imagesize is 0xf123, bootsect_second only returns
0xf000 in ax, which is < 0xf123, so it continues loading. Then,
bootsect_second returns 0x10000, but it is 16 bit register, so it is
0x0000, and that's also < 0xf123. So it is looping forever.

It can be fixed like this: (Another possible workaround is to set max
size in tools/misc.c to 0xefff instead of 0xffff. OTOH it would be
nice to be able to boot images up to 2.88MB directly from floppy).
								Pavel
(Okay to commit into x86-64 tree?)

--- linux/arch/i386/boot/setup.S	Tue May  8 12:11:01 2001
+++ linux/arch/x86_64/boot/setup.S	Fri May 25 22:18:57 2001
@@ -771,6 +774,8 @@
 	incb	%cs:bootsect_dst_base+2		# to 0x10000
 bootsect_ex:
 	movb	%cs:bootsect_dst_base+2, %ah
+	cmpb	$0x20, %ah
+	je	realbig
 	shlb	$4, %ah				# we now have the number of
 						# moved frames in %ax
 	xorb	%al, %al
@@ -779,6 +784,13 @@
 	popw	%cx
 	lret
 
+realbig:
+	movw	$0xffff,%ax
+	popw	%bx
+	popw	%si
+	popw	%cx
+	lret
+
 bootsect_gdt:
 	.word	0, 0, 0, 0
 	.word	0, 0, 0, 0

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

                 reply	other threads:[~2001-05-26 10:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010525222543.A4605@bug.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patches@x86-64.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

all inboxes | Powered by JetHome®