Author: mcayland
Date: Sat Aug 7 14:05:02 2010
New Revision: 837
URL: http://tracker.coreboot.org/trac/openbios/changeset/837
Log:
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(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/arch/x86/openbios.c
Modified: trunk/openbios-devel/arch/x86/openbios.c
==============================================================================
--- trunk/openbios-devel/arch/x86/openbios.c Sat Aug 7 14:02:42 2010 (r836)
+++ trunk/openbios-devel/arch/x86/openbios.c Sat Aug 7 14:05:02 2010 (r837)
@@ -18,8 +18,8 @@
#include "libopenbios/sys_info.h"
#include "openbios.h"
#include "relocate.h"
+#include "boot.h"
-void boot(void);
void collect_sys_info(struct sys_info *info);
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
@@ -71,6 +71,7 @@
#endif
device_end();
bind_func("platform-boot", boot );
+ bind_func("(go)", go );
}
int openbios(void)
Author: blueswirl
Date: Fri Aug 6 18:49:32 2010
New Revision: 835
URL: http://tracker.coreboot.org/trac/openbios/changeset/835
Log:
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(a)gmail.com>
Modified:
trunk/openbios-devel/drivers/vga_load_regs.c
Modified: trunk/openbios-devel/drivers/vga_load_regs.c
==============================================================================
--- trunk/openbios-devel/drivers/vga_load_regs.c Fri Aug 6 18:35:44 2010 (r834)
+++ trunk/openbios-devel/drivers/vga_load_regs.c Fri Aug 6 18:49:32 2010 (r835)
@@ -490,6 +490,7 @@
{
struct vga_par par;
- vga_decode_var(&vga_settings, &par);
- vga_set_regs(&par);
+ if (vga_decode_var(&vga_settings, &par) == 0) {
+ vga_set_regs(&par);
+ }
}
Author: mcayland
Date: Wed Aug 4 22:53:22 2010
New Revision: 833
URL: http://tracker.coreboot.org/trac/openbios/changeset/833
Log:
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(a)siriusit.co.uk>
Modified:
trunk/openbios-devel/packages/mac-parts.c
Modified: trunk/openbios-devel/packages/mac-parts.c
==============================================================================
--- trunk/openbios-devel/packages/mac-parts.c Tue Aug 3 22:48:23 2010 (r832)
+++ trunk/openbios-devel/packages/mac-parts.c Wed Aug 4 22:53:22 2010 (r833)
@@ -102,10 +102,8 @@
parnum = atol(parstr);
/* Detect if we are looking for the bootcode */
- if (strcmp(argstr, "%BOOT") == 0) {
+ if (strcmp(argstr, "%BOOT") == 0)
want_bootcode = 1;
- argstr = strdup("");
- }
}
}
@@ -158,11 +156,12 @@
ret = -1;
goto out;
- } else if (parnum == -1) {
+ } else if (parnum == -1 && strlen(argstr)) {
DPRINTF("mac-parts: counted %d partitions\n", __be32_to_cpu(par.pmMapBlkCnt));
- /* No partition was explicitly requested, so find one */
+ /* No partition was explicitly requested, but an argstr was passed in.
+ So let's find a suitable partition... */
for (parnum = 1; parnum <= __be32_to_cpu(par.pmMapBlkCnt); parnum++) {
SEEK( bs * parnum );
READ( &par, sizeof(par) );
@@ -172,15 +171,29 @@
DPRINTF("found partition type: %s with status %x\n", par.pmPartType, __be32_to_cpu(par.pmPartStatus));
- /* Ignore any partition maps when searching */
- if (strcmp(par.pmPartType, "Apple_partition_map")) {
- if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) &&
- (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
- (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) {
- offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
- size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
-
+ /* If we have a valid, allocated and readable partition... */
+ if( (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsValid) &&
+ (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsAllocated) &&
+ (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsReadable) ) {
+ offs = (long long)__be32_to_cpu(par.pmPyPartStart) * bs;
+ size = (long long)__be32_to_cpu(par.pmPartBlkCnt) * bs;
+
+ /* If the filename was set to %BOOT, we actually want the bootcode */
+ if (want_bootcode && (__be32_to_cpu(par.pmPartStatus) & kPartitionAUXIsBootValid)) {
+ offs += (long long)__be32_to_cpu(par.pmLgBootStart) * bs;
+ size = (long long)__be32_to_cpu(par.pmBootSize);
+
goto found;
+ } else {
+ /* Otherwise we were passed a filename and path. So let's
+ choose the first partition with a valid filesystem */
+ DPUSH( offs );
+ PUSH_ih( my_parent() );
+ parword("find-filesystem");
+
+ ph = POP_ph();
+ if (ph)
+ goto found;
}
}
}
@@ -207,12 +220,6 @@
found:
- /* If the filename was set to %BOOT, we actually want the bootcode instead */
- if (want_bootcode) {
- offs += (long long)__be32_to_cpu(par.pmLgBootStart) * bs;
- size = (long long)__be32_to_cpu(par.pmBootSize);
- }
-
ret = -1;
di->blocksize = (unsigned int)bs;
@@ -234,6 +241,11 @@
DPRINTF("mac-parts: filesystem found with ph " FMT_ucellx " and args %s\n", ph, argstr);
di->filesystem_ph = ph;
+ /* If the filename was %BOOT then it's not a real filename, so clear argstr before
+ attempting interpose */
+ if (want_bootcode)
+ argstr = strdup("");
+
/* If we have been asked to open a particular file, interpose the filesystem package with
the passed filename as an argument */
if (strlen(argstr)) {