Commit Graph

151 Commits

Author SHA1 Message Date
Mark Cave-Ayland
f21a9ceb00 Partially fix up the OpenBIOS PPC build. While the code technically works, even with this fix in place the PPC console output
disappears when booting a FC12 test ISO directly. Interestingly enough, if the equivalent "load" and "go" commands are entered 
manually then the console output works fine and the ISO can boot?! So there is still an issue with the console not being 
initialised correctly somewhere.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@734 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-05 18:41:11 +00:00
Mark Cave-Ayland
1b273803c2 The new loader APIs in libopenbios already have routines to detect the type of executable at a given address and react
accordingly. Hence since the loaders are currently written in C, it makes more sense to drop down into C and re-use the same 
code rather than have a second implementation in Forth.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@726 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-02 13:01:10 +00:00
Mark Cave-Ayland
9661f91432 Create an initialisation function called openbios_init(), similar to modules_init(), for use by libopenbios and make sure all
architectures are updated to use it. This is required to allow binding of C functions into Forth by libopenbios (i.e. cross 
architecture) rather than having to update everything in every arch/*/ initialisation file.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@725 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-02 11:41:35 +00:00
Mark Cave-Ayland
de891e0244 Move the bootinfo loader into libopenbios, refactoring and adding the new CONFIG_LOADER_BOOTINFO as appropriate.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@723 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-02 09:18:51 +00:00
Mark Cave-Ayland
7fdf25e044 Switch the bootinfo-loader over to using strncasecmp rather than strcasecmp which should be much safer on binary buffersi of
unknown content/length.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@722 f158a5a8-5612-0410-a976-696ce0be7e32
2010-04-02 08:33:07 +00:00
Mark Cave-Ayland
d4451ae216 Move the *_init_program() functions into the main loader source files so that everything is in one place. Part of this
involves taking the existing parts of the XCOFF loader and putting them into a new loader file xcoff_load.c. Also fix a 
dependency order change these changes introduce when building openbios-unix.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@720 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-28 23:47:36 +00:00
Mark Cave-Ayland
c60fad9646 Add is_fcode(), is_forth() and is_aout() functions which take a pointer to an area of memory which may contain a valid loader
image.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@719 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-28 20:55:10 +00:00
Blue Swirl
dc5c530885 Add missing newline
Fixes build:
  CC    target/arch/sparc64/boot.o
In file included from ../arch/sparc64/boot.c:14:
../include/libopenbios/forth_load.h:22:28: error: no newline at end of file

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@718 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-28 20:48:53 +00:00
Blue Swirl
5fb589b003 Add missing newlines
Fixes build:
In file included from ../arch/sparc64/boot.c:12:
../include/libopenbios/aout_load.h:24:27: error: no newline at end of file
In file included from ../arch/sparc64/boot.c:13:
../include/libopenbios/fcode_load.h:22:28: error: no newline at end of file

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@715 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 13:20:52 +00:00
Mark Cave-Ayland
0933f8c540 Move the Fcode loader from arch/*/fcodeload.c to libopenbios/fcode_load.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@714 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 12:09:16 +00:00
Mark Cave-Ayland
126f9ee43e Move the Forth loader forthload.c from arch/*/forthload.c to libopenbios/forth_load.c. While the Forth loader source was
included and built as part of the SPARC64 and SPARC32 builds, it was never actually invoked in the boot sequence. Hence this 
patch maintains the existing behaviour in that only X86 builds included the Forth loader.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@712 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 11:53:59 +00:00
Mark Cave-Ayland
f02d2bde53 Move the a.out loader from arch/*/aoutload.c into libopenbios as aout_load.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@711 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 11:30:14 +00:00
Mark Cave-Ayland
1264ad95d2 Create a brand new ELF loader based upon arch/*/elfload.c and libopenbios/elfload.c combined together in libopenbios. This means
that each arch no longer needs its own ELF loader implementation.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@710 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-27 10:57:03 +00:00
Mark Cave-Ayland
6dd0574272 Switch the loaders for x86, sparc64 and sparc32 over to use the new saved-program-state in boot() rather than try to execute the
device payload directly. This is the first stage in isolating the OF "load" and "go" words, and in preparation for moving the 
majority of the loaders into libopenbios.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@709 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-26 22:33:50 +00:00
Mark Cave-Ayland
34d5a76f7e Revert the parts of the last commit which changed the exception function to use an exception pointer as it isn't really
required. Update forthstrap to add a new -c option that when specified will direct the Forth kernel console output to a file 
and integrate this into the build system. By default, when a dictionary is built using a base dictionary then a new log file 
called <dict>-console.log will be generated to help debugging if the build fails.

Also update the exception handler in kernel/bootstrap.c so that it matches the entire range of error codes in 
forth/bootstrap/interpreter.fs.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@706 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-25 21:14:00 +00:00
Mark Cave-Ayland
a288b3044b Change the sysdebug exception() callback so that it is now a function pointer, rather than a function. This enables us to setup an appropriate exception handler
for the task in hand; in particular it allows us to distinguish between an error that occurs when attempting to execute a base dictionary, and an error that 
occurs when interpreting source.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@705 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-24 11:49:41 +00:00
Mark Cave-Ayland
10a518a7aa Only one file remains - asm.m4. I have absolutely no idea what this file is supposed to do (since it doesn't seem to be called)
so I'll move in into include/libopenbios for the time being. Anyone know what this file is used for?

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@699 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 21:02:58 +00:00
Mark Cave-Ayland
92f8310ff7 Split nvram.h into its proper two components - one for the arch-specific functions and another for the package functions.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@698 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:34:01 +00:00
Mark Cave-Ayland
d60e3b62a4 Commit extra files I forgot to "svn add" from the previous commit :(
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@697 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:19:46 +00:00
Mark Cave-Ayland
bf897f1619 Split video_subr.h into its separate components so that they can live in the right places, rather than placing the definitions
from lots of different C files into a single header.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@696 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 20:10:01 +00:00
Mark Cave-Ayland
1dbe55b8e4 Move the basic OpenBIOS configuration header files from include/openbios to include/.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@695 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 17:19:58 +00:00
Mark Cave-Ayland
02896c11fd Move the a.out, ELF and XCOFF header files down into include/arch/common.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@694 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 17:06:20 +00:00
Mark Cave-Ayland
f84dd73af4 Fix the sys_info.h header file so it doesn't reference functions both inside and outside of libopenbios, and move the firmware
configuration header file to include/arch/common. Following through the code showed that elfnote.c and linuxbios.c were being 
used by sys_info and so these are also renamed to elf_info.c and linuxbios_info.c for clarity.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@693 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 16:09:44 +00:00
Mark Cave-Ayland
da4cc1d0bd Move the driver header files into include/drivers to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@692 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:19:41 +00:00
Mark Cave-Ayland
4a2c065e4f Move the libopenbios header files into include/libopenbios to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@691 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 15:05:53 +00:00
Mark Cave-Ayland
9a1c40734c Move the fs header file into include/fs to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@690 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:33:32 +00:00
Mark Cave-Ayland
c112720b01 Move the kernel header files into include/kernel to synchronise with the code directory structure.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@689 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 14:21:02 +00:00
Mark Cave-Ayland
259edb2d3b Finish move of architecture-specific header files, with modifications to the header paths as required.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@688 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 13:54:45 +00:00
Mark Cave-Ayland
04a412a7f5 Begin tidying up of header locations as described on the mailing list. Firstly we move all of the architecture-specific header
files from include/$ARCH to include/arch/$ARCH.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@687 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-14 13:47:44 +00:00
Mark Cave-Ayland
dbf16392cc Refactoring of the OpenBIOS source code, as discussed on the mailing list. The primary aim of this process is to try and arrange
the source files into a structure whereby it is easier to find the relationship between a forth package word and its C 
implementation, while also creating a libopenbios library into which more common code from the arch/ tree can eventually be 
moved.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> 


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@685 f158a5a8-5612-0410-a976-696ce0be7e32
2010-03-13 10:58:19 +00:00
Alexander Graf
88679e07e4 PPC: Add U3 based Mac machine
Linux on PPC64 knows only so many chipsets. One of the is the U3. So
we can use that when we're emulating a PPC64 machine, making Linux happy.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@681 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:30 +00:00
Alexander Graf
81605d775a PPC: Create interrupt map for PCI
There is a draft spec that defines how interrupts are supposed to be mapped
from one bus to another, down to the PIC and CPU interrupt line.

So far we don't implement that spec. But PPC64 Linux requires us to for PCI
devices. So let's create a map here.

Draft: http://playground.sun.com/1275/practice/imap/imap0_9d.pdf

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@679 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:26 +00:00
Alexander Graf
50d1f0e78e PPC: Get timebase and clock speed from fw_cfg
When running on Qemu (TCG) time goes by at a constant frequency which
accidently happens to match with Linux's fallback value.

As soon as we go to KVM, the time base suddenly starts going as fast as
the host CPU's time base. So we need to make sure Linux knows about
it, so it can do its timekeeping properly.

Signed-off-by: Alexander Graf <agraf@suse.de>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@678 f158a5a8-5612-0410-a976-696ce0be7e32
2010-02-22 18:52:25 +00:00
Blue Swirl
bdf1f6ce72 QEMU changed PCI/IO port byte swapping, adapt OpenBIOS to new way
This requires an updated QEMU.

Also use little endian access ASIs.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@671 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-29 18:46:38 +00:00
Blue Swirl
b135ff9ead Sparc64: use correct PCI probe mechanism
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@667 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-22 18:50:54 +00:00
Blue Swirl
a40a92653f Sparc64: use firmware configuration device for command line storage
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@663 f158a5a8-5612-0410-a976-696ce0be7e32
2010-01-09 21:28:28 +00:00
Laurent Vivier
576f234a27 Implement command "dir <path>".
This is the generic command, it needs support from the filesystem 
packages.

Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@630 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-22 09:58:01 +00:00
Laurent Vivier
144d172001 Add a function forth_printf() which prints to openbios stdout.
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@628 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-22 09:50:54 +00:00
Laurent Vivier
26c129730b Add cleaner ext2 filesystem implementation
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@627 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-22 09:47:08 +00:00
Laurent Vivier
d2cc5db789 Add a cleaner implementation of ISO9660.
Enable it for powerpc and cross-powerpc

Signed-off-by: Laurent Vivier <Laurent@vivier.Eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@626 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-22 09:26:50 +00:00
Blue Swirl
d6aac5ffe2 Reworked version of Forth Source debugger (Mark Cave-Ayland)
This patch implements the following Forth words:

   debug <xt> - Mark word for debugging
   debug-off  - Unmark all words for debugging
   resume     - Return from subordinate Forth interpreter

The source debugger also implements the following commands when it has
been activated:

   Up - Unmark current word for debugging, mark parent and continue
   Down - Mark next word for debugging
   Trace - Continue execution until end of word displaying
           debug information
   Rstack - Display contents of the Rstack
   Forth - Launch subordinate Forth interpreter

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@611 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-15 21:03:51 +00:00
Laurent Vivier
d6365bca24 Fully decode PCI unit name attribute.
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@603 f158a5a8-5612-0410-a976-696ce0be7e32
2009-11-10 21:39:42 +00:00
Laurent Vivier
9164a49dc8 Implements XCOFF loader (to be able to boot Apple BootX bootloader)
Signed-off-by: Laurent Vivier <Laurent@vivier.eu>



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@581 f158a5a8-5612-0410-a976-696ce0be7e32
2009-09-19 21:44:05 +00:00
Blue Swirl
f85f67517b Sparc64: partially revert r515: long long is safer than int64_t
Host headers may define int64_t as different type than long long, especially
on a 64 bit host. This matters with printf formatting.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@555 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-17 16:58:39 +00:00
Blue Swirl
c803a121b7 Sparc64: configure screen size from QEMU command line options
Configure the screen size from QEMU command line options using FW_CFG
interface, like r538 for PPC.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@539 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-08 10:52:59 +00:00
Laurent Vivier
a3970b12b7 Allows to configure screen size from Qemu command line options using FW_CFG
interface.
Only enabled for PPC/QEMU and VGA/VBE.



git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@538 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-04 21:08:37 +00:00
Blue Swirl
d4b64752eb Improve version number handling
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@533 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 18:20:53 +00:00
Blue Swirl
defe01ae5c extract ofmem module implementation (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@525 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:05:16 +00:00
Blue Swirl
d53a95d1f9 add more cell type formatting macros for ppc and sparc64 (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@520 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 11:01:23 +00:00
Blue Swirl
0f141c94d3 move ppc internal prototypes to arch-specific implementation (Igor Kovalenko)
git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@519 f158a5a8-5612-0410-a976-696ce0be7e32
2009-08-02 10:59:49 +00:00