The bootinfo.txt parsing code assumed that the filename to the boot loader
always contained a backslash. However, this is maybe not the case if the
boot loader has been put into the root directory of the filesystem. For example
SLES 8 used "boot &device;:1,yaboot.chrp" in its boot-script. Now we look for
the &device; string instead which should always work.
SLOF also failed if there were parameters after the path to the boot loader.
Now we take care of the parameters, too.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
According to the ISO9660/Ecma-119 standard, directory entries must not cross
the boundary of a sector. That means that there might be some padding after
the last directory entry that still fitted into a sector. SLOF did not take
this into account yet so it failed to find files in directories which used
more than one sector for its directory entries. Now we are taking the padding
into account so the "file not found" problems should be gone.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
No need to redefine rtas-start-cpu in the board-qemu folder again, we can use
the function from the common code folder instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Some parts of envvar.fs were quite hard to read due to bad indentation, and
the handling of env-byte variables was quite shaky. Fixed and cleaned up the
code now so that it should be more maintainable now.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Flashing on JS2x is done via the "update-flash" Forth code nowadays (see the
file slof/fs/update_flash.fs for details), so there is no need to maintain the
obsolete netflash code anymore.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
To analyze the behavior and requirements of boot loaders and OS clients, it's
crucial to know which properties they try to read from our device tree. Thus
we need the possibility to debug the "getprop" client interface call.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
This moves _FASTREMOVE to the cache.h header, 970 uses the
existing code, p7 now uses the new memop hcall.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
The file pci-setup.fs provided the basic PCI environment in the past when we
did not do a full PCI scan yet. Now that we include the whole PCI scan functions
via pci-scan.fs in tree.fs, the pci-setup.fs file is not needed anymore.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
The parse-partition function was not able to deal with arguments that only
contained a partition number (without comma), e.g. "boot disk:1" failed.
Also limited the size that we load from a PReP partition in case the hard disk
is smaller than max-prep-partition-blocks.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Functions that use the TO keyword with an instance variable need some special
treatment, just like we did it with the TO for normal variables already (see
the usage of <doto> in debugger.fs).
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
There was a bug that occured when yaboot tried to load its configuration file
via network. The net-snk tries to probe the device tree node for write and read
methods (see ci_device.c), which triggers $call-method in the end. But when
$call-method failed, it did not restore my-self and the return stack, which
caused some bad crashes.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
We know that QEMU always starts with bus ID 0, so to speed up the boot process
quite a bit, we do not have to scan all 255 bus IDs here. In full emulation
mode, SLOF now boots ~20 seconds faster when there are no PCI devices attached.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
One of the old FCODE tokenizers uses the opcodes in the range of 0x407 to 0x41f
for supporting Forth local values. To get these FCODE programs working, we have
to support these opcodes, too.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Now the documentation reflect that we support KVM/QEMU, too. Also added a
short section about the source code structure.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
The USB stack did instance specific allocations for the
various buffers, but would then assign them to package
specific lists, and would generally get badly confused
as soon as multiple instances of the driver got opened.
This typically occurs when using a USB keyboard and booting
from a USB disk.
This makes everything node variables instead, with tracking
of how many instances are open, with one allocation pass
on the first open and one free pass on the last close.
The result is a lot more reliable, I can boot with USB keyboard
and a USB disk fine without hanging qemu.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
When erasing characters or when inserting characters in the middle of a line,
the framebuffer code did not correctly calculate the line width, since it was
not taking the bit depth into account yet.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
We now support populating the device-nodes ourselves when using
a newer qemu which doesn't do it anymore.
Note: I have removed the support for working with the existing
device nodes, so qemu needs to be updated in sync with slof
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
It was clobbering r4 and not marking it as such, causing
problems among others in virtio-blk
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
We do that by replacing the word "boot-command" to return
"(boot-ram)" (but we don't change the nvram env).
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
According to IEEE 1275, the "my-unit" command shall return the unit address
of the current _instance_, i.e. this unit address can be set differently for
each instance, it is not bound to the physical unit address like "my-space"
and "my-address". This behaviour is expected by the Citrine FCODE for example,
which does not set a physical unit address for the "sd" (disk) nodes, but
needs the unit address to be specified when opening the device tree node
instead.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
These two compiler flags for additional warnings help to improve the quality
of the source code: Removed some unused code and fixed some obvious bugs.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Some functions in node.fs were formatted in a very bad way, using wrong
indentation or mixing spaces and tabs for indentation. Cleaned this up now,
without doing any functional changes.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
When the ' (tick) or postpone commands hit an unknown function, they simply
printed out "undefined word" without telling which word was not defined. These
problems were quite cumbersome to debug since it was quite hard to find the
right spot in the source code where such problems happened. Now the tick and
postpone command store the name of the undefined word, too, so that the code
which catches the ABORT also prints this information.
I also fixed the $FIND command to be standard compliant right from the start
(so that it leaves the string parameters on the stack in case the word has
not been found).
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
When the "open" method of the target node failed, the open-node function did
not correctly restore the previous value of "my-self" (it was using my-parent
of the new node to restore the previous value, but that did not work when the
new node could not be opened). Now the old value of "my-self" is saved on the
return stack instead and then always correctly restored.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Now that our framebuffer code basically supports 16 and 32 bit color depths,
we can also enable support for these resolutions in the QEMU VGA device driver.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
The "Warning: Did not replace phandle in XYZ" messages could confuse the
normal users, so they are now only printed when running in diagnostic-mode.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
The biosemu on bimini had some problems with newer versions of GCC ... I saw
on a couple of websites that for lwbrx and lhbrx, the assembler constraint
"Z" should be used instead of "r". This seems to fix the hang.
For some reasons, interrupt transfers do not work right on QEMU, so we use
control transfers there instead. Also digest one key scancode at a time only
to avoid the problem with phantom keypresses.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
QEMU already provides a string for the "model" property of the root node.
We should not change this to avoid incompatibilities with the kernel.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>