than assembler.
In order to allow OpenSolaris to boot under OpenBIOS, it is necessary to be able to invoke Forth words from within the MMU
I/D-TLB miss handlers, since Solaris 10 kernels hook into the virtual to physical address translation process via va>tte-data at
boot time. Hence this patch implements two macros: SAVE_CPU_STATE and RESTORE_CPU_STATE which enable a context switch to occur
from within these trap handlers.
Things are more complicated from within the MMU miss handlers because we can't use flushw to flush the processor registers to
stack. This is because the memory pointed to by the stack pointer may not be in the TLB either, and so we'd end up in a
recursive MMU trap. Hence we solve this by creating a static stack within OpenBIOS which is guaranteed to be locked in the TLB
and storing all of our state there.
Once the ability to switch context has been implemented, it is possible to invoke C functions as per normal from within the MMU
miss handlers. Hence as a proof of concept I've migrated the MMU miss handling code from ASM to C with a view of making the
relevant changes to invoke the relevant Forth functions at a later date.
I'd also like to say thank you to Blue Swirl who took the time to answer all my questions and generally point out the
shortcomings in my first attempts at SPARC assembler.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@874 f158a5a8-5612-0410-a976-696ce0be7e32
The existing 8K stack used when switching context to run the executable payload was not enough. Increasing the stack to 16K
solves the issue, preventing the payload from clobbering memory within OpenBIOS as it runs.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@873 f158a5a8-5612-0410-a976-696ce0be7e32
Each console write caused temporary buffer allocation.
Avoid allocations by changing console_draw_str() to use Forth
string parameters, which are usually readily available.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@872 f158a5a8-5612-0410-a976-696ce0be7e32
Add checks to fill_rect() and video_scroll().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@871 f158a5a8-5612-0410-a976-696ce0be7e32
The maximum allowed value for x axis is one less than cons.w.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@870 f158a5a8-5612-0410-a976-696ce0be7e32
is emitted by dump_service(). After successful execution the return value
and a linebreak are emitted by dump_return(). If however the method fails,
nothing is emitted, so that subsequent method calls end up in place of the
return value. Observed for getproplen with AIX.
Emit an error indication and a linebreak when DEBUG_CIF is defined.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@868 f158a5a8-5612-0410-a976-696ce0be7e32
Free the string returned by my_args_copy() also in error cases.
Adjust string parsing to avoid strdup() calls.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@866 f158a5a8-5612-0410-a976-696ce0be7e32
Make seek_name() compare the path component in a case-insensitive way.
Should fix an issue reported by Mark.
Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Cc: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@865 f158a5a8-5612-0410-a976-696ce0be7e32
There's a mixup of 0 and -1. Don't return failure if iso9660_open() succeeded. Don't return success in case
iso9660_open() or iso9660_mount() failed.
This resolves both a hang when trying to boot cd:,\\:tbxi and failure to boot either cd:,\ppc\bootinfo.txt
or cd:,\ppc\chrp\bootfile.exe despite present on the AIX 6.1 disk.
Cc: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@864 f158a5a8-5612-0410-a976-696ce0be7e32
DMA should be enabled before using it.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@862 f158a5a8-5612-0410-a976-696ce0be7e32
Move nested extern declarations into header files, or use the
already existing declarations.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@861 f158a5a8-5612-0410-a976-696ce0be7e32
OFmem is not available on x86.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@860 f158a5a8-5612-0410-a976-696ce0be7e32
Solaris 9 boot; i.e. remove the /CPU/mmu device, relocate its methods to /virtual-memory, and alter the /chosen mmu property so
that it now points to /virtual-memory. This helps both Solaris 9 and OpenSolaris boot further along the way.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@859 f158a5a8-5612-0410-a976-696ce0be7e32
Can't enable Sparc32 yet, there is no ofmem_claim().
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@858 f158a5a8-5612-0410-a976-696ce0be7e32
it existed when opening a disk device. Emulate this behaviour in order to fix Solaris 9 boot. With thanks to Tarl for pointing
me in the right direction.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@857 f158a5a8-5612-0410-a976-696ce0be7e32
and physical memory and setting up an MMU mapping.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@856 f158a5a8-5612-0410-a976-696ce0be7e32
Found with this Coccinelle script:
@@
type T;
identifier i;
expression E;
@@
(
extern T i;
|
- T i;
<+... when != i
- i = E;
...+>
)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@855 f158a5a8-5612-0410-a976-696ce0be7e32
to ensure that execution of any platform-specific boot code can occur before the main "load & go" boot, even if they invoke
Forth commands that alter the parse buffer.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@854 f158a5a8-5612-0410-a976-696ce0be7e32
The ePAPR spec requires us to have a /hypervisor node that tells the guest OS
which hypervisor it's running on and which hypercall to use to call into it.
So let's fetch all that information from Qemu's fw_cfg interface and put it
into place, making everyone happy.
Signed-off-by: Alexander Graf <agraf@suse.de>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@853 f158a5a8-5612-0410-a976-696ce0be7e32
callback as suggested by Google, and simply return nothing for the v2 callback as indicated by the romvec structure. This allows us to remove the
extra POP() which was causing a stack underflow error which was affecting Solaris 8 installation kernel boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@850 f158a5a8-5612-0410-a976-696ce0be7e32
If a loader succeeds, don't try the others.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@847 f158a5a8-5612-0410-a976-696ce0be7e32
If the size of the partition currently being probed is zero,
fail the probe. This lets Forth code try the next candidate from
boot-device list.
Add explicit ':d' (Sparc32, 'f' for Sparc64) partition to
CDROM probe list, so we can remove the ugly forced partition logic.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@846 f158a5a8-5612-0410-a976-696ce0be7e32
Move initial banner printing, CPU setup and graphic_depth
setup to openbios.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@845 f158a5a8-5612-0410-a976-696ce0be7e32
open_io() returns -1 on error and 0 is a valid return value.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@841 f158a5a8-5612-0410-a976-696ce0be7e32
Also use __bexx_to_cpu() to access the fields.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@840 f158a5a8-5612-0410-a976-696ce0be7e32
open_ih() returns -1 on error and 0 is a valid return value.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@839 f158a5a8-5612-0410-a976-696ce0be7e32
Fixes a warning with GCC 4.0.2:
CC target/drivers/vga_load_regs.o
cc1: warnings being treated as errors
../drivers/vga_load_regs.c: In function 'vga_load_regs':
../drivers/vga_load_regs.c:491: warning: 'par.misc' may be used uninitialized in this function
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@835 f158a5a8-5612-0410-a976-696ce0be7e32
CC target/arch/x86/boot.o
../arch/x86/boot.c: In function 'go':
../arch/x86/boot.c:35: error: 'boot_notes' undeclared (first use in this function)
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@834 f158a5a8-5612-0410-a976-696ce0be7e32
hd:,%BOOT or cd:,\ofwboot.xcf. This latter form allows booting NetBSD PPC in a similar manner as described in the
NetBSD documentation.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@833 f158a5a8-5612-0410-a976-696ce0be7e32
Fix more breakage from r828:
For some reason, QEMU/Sparc32 does not set FW_CFG_CMDLINE_SIZE, so
we have to use FW_CFG_KERNEL_CMDLINE instead.
Setup romvec obp_arg.argv[1] and "boot-file" property.
Remove obsolete command line setup code from obio.c.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@832 f158a5a8-5612-0410-a976-696ce0be7e32
Fix NetBSD crash when printing bootpath. Also fix generation of
compatibility paths when the bootpath includes partition
letter (e.g. 'disk:d'). Consider also 'cd' alias of 'cdrom'.
See also r244.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@831 f158a5a8-5612-0410-a976-696ce0be7e32
Replace uchar, uint, ulong, u_char, u_int, u_long, u_int* with
their standard equivalents.
Fixes warnings like these on OpenBSD:
CC target/arch/unix/unix.o
In file included from ../arch/unix/unix.c:29:
../include/config.h:26: warning: redefinition of `ulong'
/usr/include/sys/types.h:56: warning: `ulong' previously declared here
../include/config.h:26: warning: redundant redeclaration of `ulong' in same scope
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@830 f158a5a8-5612-0410-a976-696ce0be7e32
Fix build failure:
LINK openbios-unix
libopenbios.a(load.o)(.text+0xe0): In function `load':
../libopenbios/load.c:58: undefined reference to `elf_boot_notes'
libopenbios.a(load.o)(.text+0xe8):../libopenbios/load.c:58: undefined reference to `elf_boot_notes'
Move elf_boot_notes variable to load.c to make it also available on
Unix build. Also fix a spurious sys_info variable definition.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@829 f158a5a8-5612-0410-a976-696ce0be7e32
IEEE-1275 spec compliance.
This patch implements the following:
1) Fix bootpath/bootargs handling so that default values are read from NVRAM, and allow multiple space-separated values to be
specified.
2) With correct bootargs handling in place, move the ELF loader over to the new libopenbios unified loaders.
3) Remove all the loader code from all architecture directories sine we don't need it anymore.
4) Simplify the boot word so it invokes platform-specific code where required, then calls load and go as per the specification.
Tested on all my available images for SPARC32, SPARC64 and PPC, and compile-tested on x86.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@828 f158a5a8-5612-0410-a976-696ce0be7e32
Remove old hack to jump to loaded code and use switch_to().
Use FLUSH_ALL_KERNEL_WINDOWS macro from Linux.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@827 f158a5a8-5612-0410-a976-696ce0be7e32
Move sys_info to load.c to make it also available on Unix build.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@826 f158a5a8-5612-0410-a976-696ce0be7e32