If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):
From: Bela Lubkin <belal@caldera.com> Subject: Re: INT13 function FAh during boot? Date: Sat, 27 Apr 2002 02:16:18 GMT References: <c12f3009.0204221242.29c063c4@posting.google.com> <c12f3009.0204251312.3993b1bc@posting.google.com> <20020426031846.B10046@mammoth.ca.caldera.com> <c12f3009.0204261117.62e44dda@posting.google.com> Carl Sopchak wrote: > Well, I tried coding the SEEK, and I know my code's being executed > (via use of debug statements), but OSR5 still comes up with "no root > disk"... > > Now, I can't pretend that I have much clue as to if I coded the > function right, but the code was lifted from the seek portion of the > read command implementation for the hard drive, so I'm guessing it's > at least close. (I also found and briefly looked at the ATA-2 spec, > which is what is supposed to be implemented by bochs, and the spec and > code actually seem understandable [!] and consistent.)
I was trying to say that all your implementation needs to do is report
success if it should have been successful. i.e., in pseudocode:
IDE_SEEK(drive, cyl):
if (drive is not valid)
return failure
if (cyl is outside drive's range)
return failure
return success
An IDE SEEK positions the head. But an IDE READ or WRITE tells the
drive where to read or write -- there is no need to SEEK first. One
would only SEEK in a situation where you knew you were going to need
some data from "over there" in a short while, but not yet. You could
save a little time by moving the head before requesting the action.
Probably makes the most sense for writes -- you could easily have a
situation where you're going to write soon, but the data hasn't quite
finished being generated.
What I'm trying to say is, IDE SEEK has no real effect other than its
error checking (which is what "wd" is using it for) and performance.
But an emulated drive has no physical head to move, so the performance
effect is irrelevant. So your implementation should do nothing but the
error checks.
> Bela, what does OSR5 check for on return from the SEEK? What does it
> do next to see if the drive exists? (Can you tell me the next several
> steps without giving away company secrets?)
It's not the company secrets, it's the difficulty of understanding
exactly what the code does, with all its layers of function calls,
interrupts to be handled, etc.
> The bochs log file has (does this help?):
> 00290159500d[HD ] IO write to 01f3 = 01
> 00290159509d[HD ] IO write to 01f4 = 00
> 00290159518d[HD ] IO write to 01f5 = 00
> 00290159530d[HD ] IO write to 01f6 = a0
> 00290159833d[HD ] IO write to 01f7 = 70
> 00290159833d[HD ] write cmd 0x70 executed <== my debug stmt
> 00290159833d[HD ] concat_image_t.lseek(0)
> 00290159833d[HD ] SEEK completed <== my debug stmt
> 00292142586d[HD ] IO write to 03f6 = 04
> 00292142586d[HD ] hard drive: RESET
> 00292143282d[HD ] IO write to 03f6 = 00
> 00292143282d[HD ] Reset complete {DISK}
> 00293833375d[HD ] 8-bit read from 03f6 = 50 {DISK}
> 00293833390d[HD ] 8-bit read from 01f1 = 01 {DISK}
> 00378278000p[XGUI ] >>PANIC<< POWER button turned off.
> (the last line is where I hit the virtual "Big Red Switch")
Help me with the log format -- what are the digits and 'd' or 'p' before
each entry -- time in microseconds? What's the letter? And what does
the panic / "I hit the switch" stuff mean? Do you mean: nothing seemed
to be happening, so you gave up and hit reset?
It might help if the log included the program counter address (EIP) from
which each I/O was done.
... OK, if I assume that the numbers are 1uS timestamps, that gives us
just under 2 sec between the SEEK and the RESET. The driver sets a
watchdog timer, then issues the SEEK and expects a completion interrupt.
The timer is supposed to be 1 second, but I'm sure a bunch of factors
could cause it to be off by a factor of 2 in an emulated environment.
So it looks like it's hitting its timeout code because it never got the
completion interrupt. That causes it to see no disk.
You need to go back to the IDE READ implementation from which you
derived the SEEK; remove the parts that have anything to do with
actually "seeking" since they're irrelevant; add in whatever causes it
to generate a virtual completion interrupt.
>Bela<
/Bofcusm/1566.html copyright 1997-2004 (various authors) All Rights Reserved
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar