Commit Graph

45 Commits

Author SHA1 Message Date
Blue Swirl
75a471e6c5 Fix power-management location
git-svn-id: svn://coreboot.org/openbios/openbios-devel@144 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-07 17:21:15 +00:00
Blue Swirl
e774472da7 Fix out of bounds accesses
git-svn-id: svn://coreboot.org/openbios/openbios-devel@143 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-06 17:29:58 +00:00
Blue Swirl
674ab21bdc Increase virtual memory supply to meet NetBSD and OpenBSD demand
git-svn-id: svn://coreboot.org/openbios/openbios-devel@142 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-05 18:35:34 +00:00
Blue Swirl
c4f3fbc099 Fix boot-device use
git-svn-id: svn://coreboot.org/openbios/openbios-devel@138 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-04 20:55:05 +00:00
Blue Swirl
2b99ad760f Use nvram boot-args and boot-device variables
git-svn-id: svn://coreboot.org/openbios/openbios-devel@137 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-01 14:14:17 +00:00
Blue Swirl
c4633488e8 Set variable defaults before nvram_init
git-svn-id: svn://coreboot.org/openbios/openbios-devel@136 f158a5a8-5612-0410-a976-696ce0be7e32
2007-05-01 14:12:34 +00:00
Blue Swirl
9bcf7edf3d Clear preloaded kernel parameters to avoid crash at reset
git-svn-id: svn://coreboot.org/openbios/openbios-devel@132 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-29 19:50:57 +00:00
Blue Swirl
0e4a65dbb9 Fix broken compilation when debugging enabled
git-svn-id: svn://coreboot.org/openbios/openbios-devel@129 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-24 20:00:02 +00:00
Stefan Reinauer
247c616971 Fix for interpose problem.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@127 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-24 19:19:58 +00:00
Blue Swirl
a389f6e924 TCX 24 bit model support
git-svn-id: svn://coreboot.org/openbios/openbios-devel@126 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-21 19:47:16 +00:00
Stefan Reinauer
d06b24d10f SS10 support by blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@120 f158a5a8-5612-0410-a976-696ce0be7e32
2007-04-09 12:35:41 +00:00
Stefan Reinauer
aac2f06b44 Patch for SunOS compatibility from pjcreath+openbios@gmail.com:
I've been trying to get old versions of SunOS to load under qemu.  In
doing so, I've encountered a number of bugs in OBP.  I'm not always
certain of the best fix, but I can at least provide a quick hack that
will get people farther along.


1) Error message: "kmem_alloc failed, nbytes 680"

Bug: obp_dumb_memalloc is a bit too dumb.  It needs to pick an address
if passed a null address.  (According to the comment in the allocator
in OpenSolaris prom_alloc.c (see
<http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/psm/promif/ieee1275/sun4/prom_alloc.c>),
"If virthint is zero, a suitable virt is chosen.")

Quick fix: If passed a null address, start doling out addresses at
10MB and increment by size.

Shortcomings: The quick fix ignores the issue of free() and doesn't
remove memory from the virtual-memory/available node.

After the quick fix, the boot gets farther, leading us to:


2) Error message: "Unhandled Exception 0x00000080"

Bug: Trap 0 (entry 0x80 in the table, i.e. syscall_trap_4x) is
undefined.  This is because the SunOS bootloader installs the trap by
writing code in the trap table, but the trap table is in the .text
section of OpenBIOS.  Thus the trap 0 handler simply jumps to "bug".

Quick fix: Move the trap table  to the .data section.  Insert a "b
entry; nop; nop; nop;" before "bug:".

Shortcomings: Requires the extra "b entry" code.  Allows the only VM
copy of the trap table to be permanently changed.  OpenBIOS should
copy the read-only trap table to read-write memory (and update %tbr)
upon reset/entry.


3) #2 above actually exposes another bug.  The write to the read-only
trap table does not cause an access violation -- instead, it silently
fails.  The "std" instruction at 0x403e6c in the bootloader has no
effect.

Bug: Uncertain.  It could be a systemic bug in qemu, but it appears
that the VM's MMU believes that the page is writable.  That means that
the VM's MMU is not having the access protection flags set for pages
mapped to ROM.  It thinks everything is rwx.

Fix?: The VM's MMU should have the access protection flags properly
set for each ROM section.  This should probably be done within
OpenBIOS.  E.g., .text should be r-x, .data should probably be rwx,
etc.

This is the one fix I'm really not sure how to implement.  Any
suggestions?  This may be a problem that only affects this bootloader,
so fixing #2 above may be all that's strictly necessary.  But I'm not
positive that this bug doesn't have other ill effects I haven't found
yet.

At any rate, fixing #2 gets us still further, to:


4) Error messages:
"obp_devopen(sd(0,0,0):d) = 0xffd8e270
obp_inst2pkg(fd 0xffd8e270) = 0xffd57f44
obp_getprop(0xffd57f44, device_type) (not found)"

Bug: The OpenBIOS "interpose" implementation is not transparent to
non-interposition-aware code (in violation of the interposition spec).
 The inst2pkg call in this sequence returns the phandle for
/packages/misc-files, instead of the proper phandle.

Quick fix: Comment out the "interpose disk-label" lines in ob_sd_open.

Shortcomings: It disables disk-label.  The correct fix is to fix the
underlying problem with interposition, but I'm not sure exactly what
it is.  Could someone help?


Fixing #4 gets us quite a bit further, until:


5) Error message:
"Unhandled Exception 0x00000009
PC = 0xf0138b20 NPC = 0xf0138b24
Stopping execution"

Bug: The instruction is trying to read from 0xfd020000+4, which is an
invalid address.  This address isn't mapped by OBP by default on Sun
hardware, so the bootloader must be trying to (a) map this address and
failing silently or (b) skipping the mapping for some reason.  The
instruction is hard-coded to look at this absolute address.

Fix: Unknown.  This may be another instance of writes silently
failing, hence my interest in #3 above.  It could also be a
side-effect of the quick fix for #4.

6) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008f0c addr=feff8008 mmu_fsr=3a6 rw=2
MMU sfsr=3a6: Invalid Address on supv data store at level 3
regs at fd008f0c:
psr=4400fc7 pc=f00053f4 npc=f00053f8
..."

Bug: Real sun4m hardware registers 4 CPU-specific interrupts followed
by a system-wide interrupt, regardless of the number of CPUs
installed.  The same is true of counters.  SunOS looks at the 5th
interrupt for the system-wide interrupt.  OBP, since there's only one
CPU, just sets up one CPU-specific interrupt followed by the
system-wide interrupt, so there is no 5th interrupt.  See the comment
on "NCPU" at
<http://stuff.mit.edu/afs/athena/astaff/project/opssrc/sys.sunos/sun4m/devaddr.h>.

Fix: in obp_interrupt_init() and obp_counter_init() register 4
CPU-specific interrupts before allocating the system-wide interrupt.
The kernel will then map the 5th interrupt to the system-wide
interrupt.

7) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008d8c addr=7ff000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008d8c:
psr=4000cc4 pc=f01339a4 npc=f01339a8
..."

Bug: The command-line arguments passed to the kernel are fixed at
address 0x7FF000 (CMDLINE_ADDR, passed from qemu via nv_info.cmdline),
which is no longer mapped by the time the kernel looks at the boot
arguments.  A regular Sun boot ROM will copy this into mapped memory.

Fix: Copy the string in nv_info.cmdline to a OpenBIOS global (since
OpenBIOS continues to be mapped) in ob_nvram_init().


8) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008dec addr=1019000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008dec:
psr=4400cc5 pc=f0131680 npc=f0131684
..."

Bug: The dumb memory allocator from bug #1 was allocating a range that
the SunOS 4 kernel doesn't like.

Fix: Mimic the Sun boot ROM allocator:  the top of the heap should be
a 0xFFEDA000 and allocations should return descending addresses.  So,
for example, if asking for 0x1000 bytes, the first returned pointer
should be 0xFFED9000.

9) Error message:
"BAD TRAP: cpu=0 type=9 rp=fd008d2c addr=b1b91000 mmu_fsr=126 rw=1
MMU sfsr=126: Invalid Address on supv data fetch at level 1
regs at fd008d2c:
psr=4900cc3 pc=f0142c04 npc=f0142c08
..."

Bug: The precise underlying cause isn't clear.  The bug appears due to
a variation between OBP's behavior and stock Sun behavior.

Fix: Add the "cache-physical?" property to the CPU node in
ob_nvram_init() and bump the "mmu-nctx" property up to 4096 (from
256).





git-svn-id: svn://coreboot.org/openbios/openbios-devel@114 f158a5a8-5612-0410-a976-696ce0be7e32
2007-03-09 00:59:05 +00:00
Stefan Reinauer
d98f56098d power management patch from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@86 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-20 20:12:04 +00:00
Stefan Reinauer
8dafee5941 Blueswirl's serial patch
git-svn-id: svn://coreboot.org/openbios/openbios-devel@84 f158a5a8-5612-0410-a976-696ce0be7e32
2006-09-14 15:08:45 +00:00
Stefan Reinauer
0726cb7dd7 blueswirl's latest console-nographic.diff.bz2
git-svn-id: svn://coreboot.org/openbios/openbios-devel@71 f158a5a8-5612-0410-a976-696ce0be7e32
2006-07-23 14:29:29 +00:00
Stefan Reinauer
c200933ccd get sparc64 build some further
move libgcc to top level


git-svn-id: svn://coreboot.org/openbios/openbios-devel@61 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-10 02:22:45 +00:00
Stefan Reinauer
6aa2681386 get sparc64 almost building (fails due to my binutils at the moment)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@60 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-10 02:04:54 +00:00
Stefan Reinauer
9448a7cffb more moderate memory consumption of BSD - Why do they break the a.out
headers?


git-svn-id: svn://coreboot.org/openbios/openbios-devel@59 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-10 01:41:02 +00:00
Stefan Reinauer
f1ab57e8a0 non-sparc64 part of -25
git-svn-id: svn://coreboot.org/openbios/openbios-devel@57 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-10 01:31:30 +00:00
Stefan Reinauer
b8a7ec8a6b fix prototype
git-svn-id: svn://coreboot.org/openbios/openbios-devel@54 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-07 10:18:24 +00:00
Stefan Reinauer
5e2b868389 "fix" some solaris boot errors
git-svn-id: svn://coreboot.org/openbios/openbios-devel@53 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-07 09:19:11 +00:00
Stefan Reinauer
d369c47203 get solaris boot to show error messages again :-))
This also gets us further with netbsd


git-svn-id: svn://coreboot.org/openbios/openbios-devel@50 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-07 07:44:40 +00:00
Stefan Reinauer
ebc74de556 openbios.patch-22.bz2 from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@49 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-06 22:23:04 +00:00
Stefan Reinauer
9f386f64bd add reset-all and reset for sparc32
git-svn-id: svn://coreboot.org/openbios/openbios-devel@48 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 20:34:53 +00:00
Stefan Reinauer
0f8870dd45 we're on the way: solaris fails a lot later now:
git-svn-id: svn://coreboot.org/openbios/openbios-devel@46 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 19:49:53 +00:00
Stefan Reinauer
7170cac0da add dummy rmap@
git-svn-id: svn://coreboot.org/openbios/openbios-devel@45 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 19:41:28 +00:00
Stefan Reinauer
65bae45b24 safe filedescriptors
git-svn-id: svn://coreboot.org/openbios/openbios-devel@44 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 19:40:05 +00:00
Stefan Reinauer
f9340b4ea9 remove <null> output
git-svn-id: svn://coreboot.org/openbios/openbios-devel@42 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 17:02:59 +00:00
Stefan Reinauer
e43a4c0025 sparc32 -20 merge remainder
git-svn-id: svn://coreboot.org/openbios/openbios-devel@41 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 12:37:25 +00:00
Stefan Reinauer
af50cf569a fix loading silo - is this number correct?
git-svn-id: svn://coreboot.org/openbios/openbios-devel@39 f158a5a8-5612-0410-a976-696ce0be7e32
2006-06-05 10:57:48 +00:00
Stefan Reinauer
eb024f020d have the name match a real sparcstation (solaris wants that)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@36 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-31 18:09:18 +00:00
Stefan Reinauer
f7784c1d5d blueswirl's sparc32 patches - boots linux.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@35 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-28 18:48:47 +00:00
Stefan Reinauer
85a73f1f84 make sparc32 boot linux. This should be stripped down again
git-svn-id: svn://coreboot.org/openbios/openbios-devel@33 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-26 10:37:37 +00:00
Stefan Reinauer
40d0162516 blueswirl sparc32 -17 (without romvec.c changes)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@32 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-25 21:02:53 +00:00
Stefan Reinauer
2eaec36c50 drop io from bootstrap and exception stuff from non-bootstrap compiles.
git-svn-id: svn://coreboot.org/openbios/openbios-devel@28 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-22 22:36:01 +00:00
Stefan Reinauer
9283d9ebc8 openbios.patch-15-svn25.bz2 part II merge
git-svn-id: svn://coreboot.org/openbios/openbios-devel@27 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-22 22:16:20 +00:00
Stefan Reinauer
ad82fa58a6 blueswirl -14 sparc32 related
git-svn-id: svn://coreboot.org/openbios/openbios-devel@24 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-22 10:33:31 +00:00
Stefan Reinauer
e67c4c8142 this makes linux on sparc32 boot :-)
git-svn-id: svn://coreboot.org/openbios/openbios-devel@23 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-18 21:57:08 +00:00
Stefan Reinauer
3b61f3011b new sparc merge
git-svn-id: svn://coreboot.org/openbios/openbios-devel@19 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-16 17:36:09 +00:00
Stefan Reinauer
1d33aa0ec0 sparc32 merge
git-svn-id: svn://coreboot.org/openbios/openbios-devel@18 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-15 08:17:51 +00:00
Blue Swirl
db8e7fe92a merge more sparc32 code from: Blue Swirl <blueswir1@hotmail.com>
git-svn-id: svn://coreboot.org/openbios/openbios-devel@16 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-10 23:00:34 +00:00
Stefan Reinauer
1ab6b463ad latest sparc32 patch from Blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@13 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-07 16:40:13 +00:00
Stefan Reinauer
d80454d07a new sparc patch from blueswirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@12 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-06 21:33:36 +00:00
Stefan Reinauer
8e89ccf89e more of the sparc32 port by Blue Swirl <blueswir1@hotmail.com>
git-svn-id: svn://coreboot.org/openbios/openbios-devel@4 f158a5a8-5612-0410-a976-696ce0be7e32
2006-05-04 22:07:30 +00:00
Stefan Reinauer
9a04f5a6c1 add initial sparc32 (qemu) support by Blue Swirl
git-svn-id: svn://coreboot.org/openbios/openbios-devel@3 f158a5a8-5612-0410-a976-696ce0be7e32
2006-04-26 16:39:16 +00:00