Miguel Simon <simon@ou.edu> wrote:
Hi Dave…
Regarding the flash device, it seems to be linearly mapped. I can get it
to boot in DOS. I can get the devf-generic to see the flash and mount
it as /dev/fs0 and /dev/fs0p0. But I cannot erase the flash (the action
fails), nor can I write to it (it blocks).
Some boards have the flash wired with additional control lines to ensure
against accidental erasure. There may be a GPIO line or something similar,
tied to a write protect or write enable pin on the flash, and in addition
to running the flash driver, the GPIO line needs to be asserted in the
correct state to enable writes to the flash. You’ll probably need board
schematics to determine this, or perhaps the source to the DOS utilities
used to write to the flash will indicate what needs to be done.
When I boot in DOS, it does behave as a disk, but I cannot transfer the
.boot image to there because none of the DOS utilities recognize the
file, or complain about something else.
It sounds like the DOS utilities for working with the flash are
restricted to certain operations. It also sounds like you’re close
to having the QNX flash driver working, so if you don’t get anywhere
with the DOS utilities, I’d focus on getting the QNX flash driver
able to erase and write.
Any help is most appreciated.
Here is what I have done (aside to what is above):
- got the sc400 BSP source code, adapted the best I knew how,
- did the following:
mkrec -s32k -ffull -r ipl-sc400 > ipl-bin.pad
mkrec -ffull -s128k ipl-bin.pad > sc400.rom
cat sc400.rom sc400.rom > sc400_256.rom
- changed the build file to have:
[virtual=x86,nobios +compress].bootstrap={
startup-bios -D0x3f.115200 -vvv
PATH=/proc/boot procnto -vv
}
…
-
mkifs -vv sc400.build sc400.ifs
-
cat sc400_256.rom sc400.ifs > new.rom
-
uploaded the new rom to the board using the proper utilities…
-
…and nothing worked (as expected)
The IPL needs to be located in flash at the correct offset, such
that it will be executed at the reset vector. You’ve placed it
at the bottom of the image, where it won’t be seen or executed.
When you say that you uploaded the image to the board using the
proper utilities, I’m assuming you mean the DOS utilities. Did
you overwrite the BIOS with your image? That’s the only way
this is going to work (once you get the IPL placed correctly
within the image).
As for the stuff below, using ipl-sc400_ext is not correct
for this situation. This is a BIOS extension IPL, which is
intended to be placed into a free area of the BIOS. Some
BIOSes will scan within themselves for BIOS extensions,
such as video BIOSes, etc. The Phoenix BIOS on the SC400
had this capability, so we’d patch the BIOS with an extension
which would be executed after the BIOS had done the other
hardware initialization. Unless you intend to use the BIOS
as the primary boot code (which I suspect you don’t), then
ipl-sc400_ext is not applicable here.
I’d suggest the following:
-forget about the OS image and the EFS image for the time
being. Focus on only generating the IPL code, and padding
it out such that the reset vector appears at the proper
offset within the image.
-put something in the IPL code, as early as possible, to
let you know if it’s executing. Ideally you could put
something out the serial port, but it will be necessary
to initialize the serial port first (note how the sc400
IPL initializes the serial port in _start.S, and then
displays a string out the serial port right away).
Perhaps your hardware has an LED which can be accessed
directly. You could turn on the LED right away in your
IPL, which would let you know if your code is executing
or not.
-study the ‘buildrom’ script in the SC400 IPL, to see
how the reset vector is being generated. Once the
binary IPL is generated, the first call to ‘mkrec’
simply pads that binary out to 32k. The second
call to mkrec is the one that actually generates the
reset vector, which is basically an instruction that
gets placed at the very top of the image, and is a
‘jmp’ instruction to the beginning of the IPL code.
If you look at the sc400.lnk file, you’ll see:
rom : ORIGIN = 0x000f7fe0, LENGTH = 0x2000
If you then look at the x86/o/ipl-sc400.map file,
after you’ve generated the IPL, you’ll see:
Name Origin Length
stack 0x00000000 0x00001000
ram1 0x00001000 0x00001000
rom 0x000f7fe0 0x00002000
So, 0xf7fe0 is where the beginning of the IPL code
will be, in an address space of 1M (which is all that
the x86 CPU can see when it initially boots, in real
mode). Now, once you’ve run the second mkrec command,
it will generate a reset vector to jump to address
0xf7fe0 once the board boots. If you make an IPL
image which is only 128k, it must be placed at the
TOP of the flash. Once you get the flash driver working,
determine where in the 2M flash that the system BIOS
resides (i.e. at the top of the first MEG, at the
top of the second MEG, etc). This will indicate where
in flash your 128k IPL image should sit…
Then… another way…
8. this time I used the ipl-sc400_ext which is the one that we use with
the bios and:
- did the following:
mkrec -s32k -ffull -r ipl-sc400_ext > ipl-bin.pad
mkrec -ffull -s128k ipl-bin.pad > sc400.rom
- changed the build file to have:
[virtual=x86,bios +compress].bootstrap={
startup-sc400 -D0x3f.115200 -vvv
PATH=/proc/boot procnto -vv
}
-
cat bios.rom sc400.rom sc400.ifs > new.rom
-
uploaded the new.rom to the flash… but it did not work either.
I wonder if you have some suggestions? I appreciate it.
Best regards…
–
David Green (dgreen@qnx.com)
QNX Software Systems Ltd.
http://www.qnx.com