From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Coywolf Qi Hunt <coywolf@greatcn.org>
Cc: tao@acc.umu.se, alan@lxorguk.ukuu.org.uk,
Linux kernel <Linux-Kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix GDT limit in setup.S for 2.0 and 2.2
Date: Mon, 23 Feb 2004 11:21:47 -0500 (EST) [thread overview]
Message-ID: <Pine.LNX.4.53.0402231114150.505@chaos> (raw)
In-Reply-To: <Pine.LNX.4.53.0402231012590.8959@chaos>
If you are going to muck with the startup code, I suggest this:
--- linux-2.4.24/arch/i386/boot/setup.S.orig Mon Feb 23 10:34:11 2004
+++ linux-2.4.24/arch/i386/boot/setup.S Mon Feb 23 11:07:09 2004
@@ -822,12 +822,16 @@
a20_done:
# set up gdt and idt
+ movl $idt_48,%eax # End of GDT
+ subl $gdt, %eax # Subtract beginning
+ decl %eax # One less
+ movw %ax, (gdt_48) # Length of the table
lidt idt_48 # load idt with 0,0
xorl %eax, %eax # Compute gdt_base
movw %ds, %ax # (Convert %ds:gdt to a linear ptr)
shll $4, %eax
addl $gdt, %eax
- movl %eax, (gdt_48+2)
+ movl %eax, (gdt_lo)
lgdt gdt_48 # load gdt with whatever is
# appropriate
@@ -1080,8 +1084,11 @@
delay:
outb %al,$0x80
ret
-
-# Descriptor tables
+#
+# Descriptor tables, note that more entries will be entered when the
+# kernel starts. However, we do not want to load tables that don't
+# exist at this time!
+#
gdt:
.word 0, 0, 0, 0 # dummy
.word 0, 0, 0, 0 # unused
@@ -1100,11 +1107,12 @@
idt_48:
.word 0 # idt limit = 0
.word 0, 0 # idt base = 0L
-gdt_48:
- .word 0x8000 # gdt limit=2048,
- # 256 GDT entries
-
- .word 0, 0 # gdt base (filled in later)
+#
+# Filled in by startup code around label a20_done.
+#
+gdt_48: .word 0 # Length of GDT -1
+gdt_lo: .word 0 # GDT base low word
+gdt_hi: .word 0 # GDT base high word
# Include video setup & detection code
FYI, this machine is running with that change. The current
code loads a discriptor table with a (non-existant) length
of 0x8000 (plus a byte) bytes. For some reason, it's lucky.
Later on, more entries are added and the new table is loaded
with another LGDT instruction, fine. But, in the existing
code, any "entries" after those shown are video setup code.
The correct code will load the correct table length, not some
length that might be used in the future.
Cheers,
Dick Johnson
Penguin : Linux version 2.4.24 on an i686 machine (797.90 BogoMips).
Note 96.31% of all statistics are fiction.
prev parent reply other threads:[~2004-02-23 16:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-16 19:07 [PATCH 2.4.24] Fix GDT limit in setup.S Coywolf Qi Hunt
2004-02-16 20:44 ` Richard B. Johnson
2004-02-19 0:54 ` Coywolf Qi Hunt
2004-02-19 1:18 ` Coywolf Qi Hunt
2004-02-19 8:33 ` { Linux not only practical, but an ideal. } " Coywolf Qi Hunt
2004-02-17 3:51 ` [2.0.40 2.2.25 2.4.25] Fix boot GDT limit 0x800 to 0x7ff in setup.S or not Coywolf Qi Hunt
2004-02-21 3:39 ` Coywolf Qi Hunt
2004-02-21 4:12 ` H. Peter Anvin
2004-02-23 5:30 ` Coywolf Qi Hunt
2004-02-23 14:02 ` [PATCH] Fix GDT limit in setup.S for 2.0 and 2.2 Coywolf Qi Hunt
2004-02-23 14:21 ` David Weinehall
2004-02-25 0:10 ` Pavel Machek
2004-02-23 14:43 ` Richard B. Johnson
2004-02-23 15:28 ` Richard B. Johnson
2004-02-23 16:21 ` Richard B. Johnson [this message]
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=Pine.LNX.4.53.0402231114150.505@chaos \
--to=root@chaos.analogic.com \
--cc=Linux-Kernel@vger.kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=coywolf@greatcn.org \
--cc=tao@acc.umu.se \
/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®