Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2003 19:13:17 -0800
From:      Soren Kristensen <soren@soekris.com>
To:        Adrian Steinmann <ast@marabu.ch>
Cc:        msmith@freebsd.org
Subject:   Re: BTX loader reboot on Soekris comBIOS1.22 fails (patches forbtx.s and	loader/main.c enclosed)
Message-ID:  <3FB6EB4D.8050901@soekris.com>
In-Reply-To: <200311160131.CAA21864@marabu.marabu.ch>
References:  <32365.1068624044@critter.freebsd.dk> <3FB281B4.5060105@soekris.com> <200311160131.CAA21864@marabu.marabu.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Adrian,

Adrian Steinmann wrote:
> 
> In the BTX loader, the reboot command simply exits the loader, and
> end up in exit near line 252 in /usr/src/sys/boot/i386/btx/btx/btx.s
> which disables paging, flushes TLB, switches to real mode, flags a
> warm boot (writes 0x1234 to 0x472) and then jumps to the BIOS reboot
> handler:
> -		ljmp $0xffff,$0x0		# reboot the machine
> 
> however in various literature it is mentioned that $0xf000,$0xfff0
> is bound to work better on most platforms, so I tried
> +		ljmp $0xf000,$0xfff0		# reboot the machine
> 
> which indeed works! (OpenBSD, for example, uses ljmp $0xf000,$0xfff0).

The reason is that on some hardware (t.ex the Geode) there need to be 
work done early on in the BIOS to enable access to the BIOS in low 
memory before that first far jump, and therefore the first jump is not a 
far jump as on the original PC, but a near jump. Having the segment set 
at FFFF can screw up that first near jump....

So the ljmp $0xf000,$0xfff0 would be the best way, but since my BIOS 
patches F000:FFF0 after copying the BIOS from flash to ram, I could also 
change my near jump to a far jump to increase compatibility....



Regards,


Soren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3FB6EB4D.8050901>