Subject: Re: boot problems on VIA Eden i586 board
To: David Laight <david@l8s.co.uk>
From: Dan LaBell <dan4l-nospam@verizon.net>
List: port-i386
Date: 03/11/2005 03:04:28
On Mar 10, 2005, at 4:48 PM, David Laight wrote:

>> I also tried stepping thru via dos debug, which didn't work,
>
> It is unlikely that dos-debug is capable of stepping through the code
> that changes from 16bit to 32bit mode!

*Nod*  I assumed it would break, but was hoping to get some info before 
it did,
but actually it breaks because it isn't a dos disk, which I is why I 
tried
stepping through an old reset.com thing I wrote ages ago.

>
>> then for some reason I tried a reboot from dos via int 19. int 19 is 
>> boot
>> failure, boots rom basic on org. PC's, on some pc's it breaks into 
>> cmos
>> menu, in others reboots again after try again prompt, etc.
> Hum - the netbsd code uses int 0x18 for much the same thing!
> (read http://www.ctyme.com/rbrown.htm)
>
Oh, no, is that a link to Ralph Brown's interrupt list?  I remember it 
from bbs's.  I really should have consulted my copy before posting ;-[ 
.  It's amazing how confident the 4 am memory is.   Hmm.  No, int 19 / 
cd19 is what I was actually doing.  "reset quick" in my prog.  Just 
confused, I guess.

>> and I got 2 error messages on the screen with my hang, instead
>> of just messedup  display with a hang:
>>
>> Boot-failed (errno 5): Can't open /boot
>
> That is a 'normal' error message - it happens if the code in the
> first 8k of the partition fails to find /boot (which is the
> interactive boot code) in the root filesystem.
> Getting that far does rather indicate that whatever is wrong
> is something trivial that is hard to find!
>
>> And also:
>>
>> RPL-ROM-ERR : DE48 ; RPL Halted
>
> Did that follow the previous message?  If so it is what that
> bios does when entered by int 0x18.
> (see code in sys/arch/i386/stand/bootxx/bootxx.S)
>
It seems bios related.  It seems to printed at a fixed location on the 
screen,
unrelated to location from the bootstrap.  I remember having a machine 
where I could step through , through the bios, to a fair amount of dos 
loading before it would hang as it overwrote itself, but this machine 
not so, but that machine didn't do much more than 'press key for retry 
or f1 for cmos menu.' (maybe that was int 18 ) -- Anyway -- What does 
int 18 do? Well it doesn't load rom basic, but there is an "Option ROM" 
at CC00.
Some what abbreviated output looks like:

Novel Netware Ready Firmware v1.00 (940909)
(C) Copyright [...]
SiS 900/7016 [...]
(c) [...]


RPL-ROM-ADR: 000A E63B 8523
RPL-ROM-IRQ: 11
RPL-ROM-PIO: DA00

RPL-ROM-FCC:1   [ waits here as it counts up 5, before continuing ]
Searching for Boot Record from Floppy..Not Found
Searching for Boot Record from CDROM..OK

NetBSD/i386 ustarfs Primary Bootstrap
Boot Failed (errno 5):  Can't open /boot.
then
RPL-ROM-ERR: DE48 ; RPL HALTED
direct to the blank line, fitting perfectly.   And Network is next in 
the boot order.

Hmm.  Disabling the network card, and now with floppy, produces:
Searching for Boot Record from Floppy..OK

NetBSD/i386 ustarfs Primary Bootstrap
Boot failed (errno 5): Can't open /boot.
Boot Failure from Previous Device..
Searching for Boot Record from IDE-0..OK

LILO 22.2 boot: dos

Seems like it just falls through...

> My thoughts have always been that there is a problem in the
> code that flips between real (16bit) and protected (32bit) modes.
> I'd guessed at invalid register values when returning to the BIOS
> but maybe the problem is the opposite - and it is junk in the
> top bits of the registers on entry that is causing grief.
>
> I wonder if just adding:
> 	andl	$0xffff,%esp
> at the start of real_to_prot (in stand/lib/realprot.S)
> is what is needed?
>
> 	David
>
> -- 
> David Laight: david@l8s.co.uk
>