Commit Graph

883 Commits

Author SHA1 Message Date
Blue Swirl
84518defd6 linux_load: fix open_io return value checks
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
2010-08-08 18:28:48 +00:00
Blue Swirl
f7717af419 sun-parts: fix id and flag sizes
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
2010-08-07 12:49:53 +00:00
Blue Swirl
988f780aa5 loaders: fix open_ih return value checks
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
2010-08-07 12:49:52 +00:00
Blue Swirl
76715fe930 diskio: add debugging
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@838 f158a5a8-5612-0410-a976-696ce0be7e32
2010-08-07 12:49:50 +00:00
Mark Cave-Ayland
3fad9a0185 Bind the (go) function into the C equivalent go function arch/x86/boot.c (this should re-enable load/boot with the new unified
loader).

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@837 f158a5a8-5612-0410-a976-696ce0be7e32
2010-08-07 12:05:02 +00:00
Mark Cave-Ayland
c62d099b4b Stop openbios-unix from crashing when auto-boot? is enabled.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@836 f158a5a8-5612-0410-a976-696ce0be7e32
2010-08-07 12:02:42 +00:00
Blue Swirl
3f121048da vga_load_regs: check return value for errors
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
2010-08-06 16:49:32 +00:00
Blue Swirl
0bad076169 Fix x86 build
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
2010-08-06 16:35:44 +00:00
Mark Cave-Ayland
9d04d7ebad Improve packages/mac-parts partition detection for the cases where no partition is specified but a filename argument is, e.g
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
2010-08-04 20:53:22 +00:00
Blue Swirl
b11569eb24 sparc32: fix pre-loaded kernel command line
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
2010-08-03 20:48:23 +00:00
Blue Swirl
6e79d1d9c3 sparc32: fix NetBSD crash
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
2010-08-03 18:39:27 +00:00
Blue Swirl
482249e794 Use standard types
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
2010-08-01 21:25:08 +00:00
Blue Swirl
626c95da21 Fix Unix target build
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
2010-08-01 21:15:14 +00:00
Mark Cave-Ayland
f9bdcf050c Rework the OpenBIOS internals so that boot, load and init-program now all use the unified libopenbios loader code with improved
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
2010-08-01 15:13:48 +00:00
Blue Swirl
f4564e0dc0 sparc32: fix context switching
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
2010-08-01 14:37:04 +00:00
Blue Swirl
9daf539c27 Fix Unix target build
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
2010-08-01 11:03:45 +00:00
Mark Cave-Ayland
d35fbe15aa Fix the SCSI block driver so that it doesn't leave an extra item on the stack when its open method is called.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@825 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-31 22:48:10 +00:00
Mark Cave-Ayland
4d0add8337 For some reason, the floppy alias is never registered in /aliases - let's make it happen.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@824 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-31 22:46:48 +00:00
Mark Cave-Ayland
da46f5ab8d Fix the bootinfo loader so that it will correctly accept device strings with no partition id, e.g. load cdrom:,\path\to\file.
Also add a little bootscript debugging for those people that may need it.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@823 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-31 22:46:00 +00:00
Mark Cave-Ayland
fc58e30c96 Create a C wrapper around the Forth key word to be used in the debugger instead of calling availchar()/getchar(). Using this
wrapper means that the debugger now works correctly under PPC.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@822 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-25 17:34:13 +00:00
Mark Cave-Ayland
3330f2e126 Fix a thinko in packages/mac-parts and then rework the open method so it more accurately reflects the CHRP boot specification. Also add seek limits
to each partition type, since some existing code uses this to detect bootloader code. This fixes the quik bootloader problem for PPC as reported by 
Aurelian Jarno.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@821 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-13 16:41:06 +00:00
Mark Cave-Ayland
48af2808ba Fix incorrect CONFIG constant in init.c.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@820 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-11 22:41:34 +00:00
Mark Cave-Ayland
fcf762c309 Remove /packages/misc-files since it is no longer required now that each filesystem has its own package.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@819 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-11 21:32:38 +00:00
Mark Cave-Ayland
1b964d9441 Fix bug in dir path parsing on HFS filesystems.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@818 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-11 19:40:18 +00:00
Mark Cave-Ayland
f1e745579c Switch dir over to use the new static filesystem dir methods.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@817 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-11 18:57:19 +00:00
Mark Cave-Ayland
a5511ad95c Currently the dir word works by using /packages/misc-files to open a directory in a similar way to a file and then
special-casing directory actions. This is wrong in that in order to list the contents of a directory, open-dev must return true 
for any device which contains a valid filesystem, regardless of whether or not the supplied arguments reference a valid path.

This causes us a problem because in order to implement multiple references in boot-device correctly, we have to fail if we open 
a specific device with invalid arguments (such as a non-existent file reference). This patch therefore makes the following changes:

1) Create a static method in each of the filesystem packages to implement dir
2) Enhance the partition/disk handlers to record the phandle of any detected filesystem during open
3) Create a new dir method in the partition/disk handlers which invokes the static dir method for the currently detected 
filesystem

Hence we can now open a raw device/partition and invoke dir on its filesystem without having to open a specific file-reference 
first. Following shortly is a patch to switch the main dir word over to use this new system.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@816 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-10 13:11:22 +00:00
Mark Cave-Ayland
930ce00f5f Move the grubfs filesystem handler into its own new package /packages/grubfs-files. This is the last of the filesystems to be
migrated to a standard package. Note that with this in place /packages/misc-files is obsolete (it is currently disabled) and 
very likely to be removed.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@815 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-04 13:37:00 +00:00
Mark Cave-Ayland
ec930b7f72 Fix incorrect interpretation of HFS seek function result code which was causing FC12 to fail during second-stage boot.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@814 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-04 10:56:05 +00:00
Mark Cave-Ayland
40ed0faad9 Move the ext2 filesystem handler into its own new package /packages/ext2-files.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@813 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-04 10:18:03 +00:00
Mark Cave-Ayland
8a5ccc08b3 Move the HFS filesystem handler into its own new package /packages/hfs-files.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@812 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 23:29:37 +00:00
Mark Cave-Ayland
df3132e620 Fix a couple of incorrect error codes in hfsp_files_open(), and also revert the filesystem type return value to a cstr to
maintain the existing API.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@811 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 23:22:21 +00:00
Mark Cave-Ayland
d698673c6d Move the HFS+ filesystem handler into its own new package /packages/hfsplus-files.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@810 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 19:02:43 +00:00
Mark Cave-Ayland
5ed6ff34fc Move the separate ISO9660 handler into a new /packages/iso9660-files package in preparation for some future work. Based heavily
on Laurent's original patch posted to the list.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@809 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 14:39:49 +00:00
Blue Swirl
6e3c34c7b5 Fix cross compiler detection with dash shell
Based on patch by Andreas Färber.

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

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@808 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 08:07:59 +00:00
Blue Swirl
f361b7cf09 Remove unused asm.m4
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@807 f158a5a8-5612-0410-a976-696ce0be7e32
2010-07-03 08:07:57 +00:00
Mark Cave-Ayland
c0c7231b2d Fix up SPARC32 boot from CDROM.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@806 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-28 17:43:48 +00:00
Mark Cave-Ayland
004dc4cf85 Fix up NVRAM settings for boot-device and boot-args.
This patch originally started as a fix for PPC, in that the NVRAM initialiser wasn't been run on startup (this is why printenv 
on PPC always showed much much less than on SPARC). However, it also showed up some inconsistent logic for boot device 
selection, which must also happen *before* boot is called in order for load to work correctly. With this patch applied, bootpath 
and bootargs are set from boot-device and boot-args respectively on startup for SPARC32, SPARC64 and PPC.

Note: there is a small chance SPARC32 may break on some images - please let me know if it does.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@805 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-28 11:58:28 +00:00
Mark Cave-Ayland
6afdc00000 Commit a couple of minor fixes to packages/nvram.c which allow it to be compiled with debugging enabled on platforms where
sizeof(int) != sizeof(void *).

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@804 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-28 05:18:47 +00:00
Mark Cave-Ayland
50e344721c Fix up parse word so that it can correctly handle empty arguments and (encode-bootpath) word so that it can handle optional
arguments. With these fixes in place we can now switch the boot word to use (encode-bootpath) which means that the bootpath and 
bootarg properties are now set exactly the same when executing boot and/or load.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@803 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-28 05:16:15 +00:00
Blue Swirl
cab993ac04 Fix Sparc32 boot breakage: define load-base
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>

git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@802 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-27 20:08:21 +00:00
Mark Cave-Ayland
43fe2ac4e8 Move a.out loader into the new C load implementation (also fix up the header includes in load.c).
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@801 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-27 14:00:37 +00:00
Mark Cave-Ayland
db474e634c Move Forth loader into the new C load implementation.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@800 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-27 13:14:03 +00:00
Mark Cave-Ayland
78863dfcc9 Switch Forth loader over to using an ihandle rather than a direct path reference.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@799 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-27 13:06:38 +00:00
Mark Cave-Ayland
3d7832bba9 Implement a basic C loader function in load.c that tries to load each supported executable file format. Now that the ihandle
hierarchy is correct, we can simply pass an ihandle into the loader and it will work correctly regardless of whether it is being 
invoked on an entire disk, partition or individual file.

In order to test the new code, start by switching the Fcode loader over to the new infrastructure for testing on SPARC64. Note 
this patch also contains a correction to load-base on SPARC which was being set to a value other than 0x4000 which is the 
documented default.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@798 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-25 20:42:00 +00:00
Mark Cave-Ayland
add30adb7d ext2 magic is stored in little-endian format, not big-endian format.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@797 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-23 21:02:12 +00:00
Mark Cave-Ayland
0dddb61de8 Fix up non-grub iso9660 filesystem, plus correct a thinko where the sense of the existing hfs/ext2 probe functions was inverted
by default.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@796 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-23 20:41:34 +00:00
Mark Cave-Ayland
c6a9039103 Fix partition string parsing code so that it correctly handles boot strings beginning with a comma of the form
<device>,\path\to\file. This fixes all outstanding issues with PPC.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@795 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-15 19:59:47 +00:00
Mark Cave-Ayland
fd32324336 Fix the HFSP probe function, plus also resolve an off-by-one error in the mac-parts partition code. This should fix PPC boot once again.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@794 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-15 16:31:54 +00:00
Blue Swirl
4cac87e606 Fix PPC target build
Fix errors like this:
../fs/hfs/volume.c:612:2: 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@793 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-10 18:35:25 +00:00
Mark Cave-Ayland
372ad163dc Fix up the majority of the non-grubfs filesystems from my last commit, since they require a "probe with offset" function to
allow the partition handler to identify a valid FS before interposition to /packages/misc-files.

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


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@792 f158a5a8-5612-0410-a976-696ce0be7e32
2010-06-09 22:30:32 +00:00