OpenBIOS
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1969 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1968 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1967 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1966 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1965 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1964 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1963 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1962 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1961 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1960 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1959 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1958 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1957 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1956 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1955 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1954 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1953 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1952 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1951 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1950 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1949 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1948 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1947 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1946 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1945 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1944 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1943 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1942 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1941 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1940 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1939 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1938 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1937 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1936 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1935 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1934 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1933 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1932 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1931 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1930 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1929 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1928 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1927 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1926 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1925 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1924 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1923 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1922 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1921 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1920 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1919 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1918 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1917 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1916 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1915 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1914 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1913 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1912 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1911 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1910 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1909 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1908 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1907 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1906 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1905 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1904 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
November 2012
- 6 participants
- 31 discussions
Hi all,
One of the reasons the previous posted patch for setting the keyboard
devalias has to work with string concatenation is because of this oddity
in get-package-path (the underlying word used by CIF's package-to-path):
0 > keyboard-phandle @ get-package-path ok
2 > type /pci@80000000/mac-io@4/via-cuda@16000/adb/keyboard@8 ok
0 > s" /pci@80000000/mac-io@4/via-cuda@16000/adb/keyboard@8" open-dev u.
0 ok
Hmmmm. So the path we're returning is not valid. Some experimentation
shows that the problem is due to the trailing @8 on the keyboard node:
0 > s" /pci@80000000/mac-io@4/via-cuda@16000/adb/keyboard" open-dev u.
7c5b33c ok
0 > keyboard-phandle @ push-package ok
0 > .properties
name "keyboard"
device_type "keyboard"
reg 00000008
ok
Now AFAICT one of two things is wrong here:
1) get-package-path should be fixed so that if a phandle belongs to a
leaf node, the unit address is not included as part of the node name
2) open-dev should happily accept the trailing @8 on the keyboard node
Does anyone know which one of these is the correct solution?
Many thanks,
Mark.
2
2
Nov. 26, 2012
Author: mcayland
Date: Sat Nov 24 15:43:11 2012
New Revision: 1073
URL: http://tracker.coreboot.org/trac/openbios/changeset/1073
Log:
PPC: Add keyboard device alias as a duplicate of stdin.
This is required when attempting to boot Mac OS X.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/arch/ppc/qemu/qemu.fs
Modified: trunk/openbios-devel/arch/ppc/qemu/qemu.fs
==============================================================================
--- trunk/openbios-devel/arch/ppc/qemu/qemu.fs Sat Nov 24 15:43:09 2012 (r1072)
+++ trunk/openbios-devel/arch/ppc/qemu/qemu.fs Sat Nov 24 15:43:11 2012 (r1073)
@@ -46,6 +46,14 @@
then
;
+\ set the keyboard alias to stdin
+:noname
+ active-package
+ " /aliases" find-device
+ input-device encode-string " keyboard" property
+ active-package!
+; SYSTEM-initializer
+
\ -------------------------------------------------------------------------
\ pre-booting
\ -------------------------------------------------------------------------
3
7
Author: mcayland
Date: Sat Nov 24 15:43:09 2012
New Revision: 1072
URL: http://tracker.coreboot.org/trac/openbios/changeset/1072
Log:
Fix dir cd:,\ (no partition specified) when reading from Mac partitions.
The existing checks in mac-parts,c were wrong; regardless of whether or not we
have an argument string specified, if a partition is not specified then we
must still search for the first valid partition.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.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 Sat Nov 24 15:43:06 2012 (r1071)
+++ trunk/openbios-devel/packages/mac-parts.c Sat Nov 24 15:43:09 2012 (r1072)
@@ -140,7 +140,7 @@
* Implement partition selection as per the PowerPC Microprocessor CHRP bindings
*/
- if (str == NULL || parnum == 0) {
+ if (parnum == 0) {
/* According to the spec, partition 0 as well as no arguments means the whole disk */
offs = (long long)0;
size = (long long)__be32_to_cpu(dmap.sbBlkCount) * bs;
@@ -156,12 +156,11 @@
ret = -1;
goto out;
- } else if (parnum == -1 && strlen(argstr)) {
+ } else if (parnum == -1) {
DPRINTF("mac-parts: counted %d partitions\n", __be32_to_cpu(par.pmMapBlkCnt));
- /* No partition was explicitly requested, but an argstr was passed in.
- So let's find a suitable partition... */
+ /* No partition was explicitly requested so let's find a suitable partition... */
for (parnum = 1; parnum <= __be32_to_cpu(par.pmMapBlkCnt); parnum++) {
SEEK( bs * parnum );
READ( &par, sizeof(par) );
1
0
Nov. 24, 2012
Author: mcayland
Date: Sat Nov 24 15:43:06 2012
New Revision: 1071
URL: http://tracker.coreboot.org/trac/openbios/changeset/1071
Log:
Improve dir word by reducing complexity and adding some more diagnostics.
Since the OF path resolution algorithm automatically passes anything following
a ':' as an argument to the specified device, we don't need to bother with
handling this ourselves. As a side effect, the auxiliary word split-path-device
is no longer needed as we can isolate the path by doing a simple split on ','.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/forth/debugging/client.fs
trunk/openbios-devel/forth/lib/split.fs
Modified: trunk/openbios-devel/forth/debugging/client.fs
==============================================================================
--- trunk/openbios-devel/forth/debugging/client.fs Fri Nov 23 16:50:43 2012 (r1070)
+++ trunk/openbios-devel/forth/debugging/client.fs Sat Nov 24 15:43:06 2012 (r1071)
@@ -126,12 +126,14 @@
: dir ( "{paths}<cr>" -- )
linefeed parse
- split-path-device
- open-dev dup 0= if
+ ascii , left-split
+ 2dup open-dev dup 0= if
drop
+ cr ." Unable to locate device " type
+ 2drop
exit
then
- -rot 2 pick
+ -rot 2drop -rot 2 pick
" dir" rot ['] $call-method catch
if
3drop
Modified: trunk/openbios-devel/forth/lib/split.fs
==============================================================================
--- trunk/openbios-devel/forth/lib/split.fs Fri Nov 23 16:50:43 2012 (r1070)
+++ trunk/openbios-devel/forth/lib/split.fs Sat Nov 24 15:43:06 2012 (r1071)
@@ -47,24 +47,3 @@
c@ r@ = if 1- then then
r> drop
;
-
-\ split <param-text> into separate path and device strings
-: split-path-device ( str len -- pathstr len devstr len )
- ascii , left-split 2 pick 0= if
- \ No comma - so either <dev>:<id> or <dev>:<id><path>
- 2dup ascii \ strchr 0= if
- \ No backslash so just <dev> or <dev>:<id>
- s" " 2swap \ ( pathstr len devstr len )
- else
- \ Contains backslash, must be a <dev>:<id><path>
- ascii : left-split \ ( pathstr len devstr len )
- then
-
- \ Remove RHS split (unused)
- 4 roll drop
- 4 roll drop
- else
- \ Contains comma so split is already correct
- then
-;
-
1
0
Author: mcayland
Date: Fri Nov 23 16:50:43 2012
New Revision: 1070
URL: http://tracker.coreboot.org/trac/openbios/changeset/1070
Log:
The spin word is set by BootX when Mac OS X is booting.
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Acked-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/arch/ppc/ppc.fs
Modified: trunk/openbios-devel/arch/ppc/ppc.fs
==============================================================================
--- trunk/openbios-devel/arch/ppc/ppc.fs Fri Nov 23 15:44:26 2012 (r1069)
+++ trunk/openbios-devel/arch/ppc/ppc.fs Fri Nov 23 16:50:43 2012 (r1070)
@@ -1,3 +1,6 @@
+\ -------------------------------------------------------------------------
+\ registers
+\ -------------------------------------------------------------------------
0 value %cr
0 value %ctr
@@ -45,3 +48,10 @@
0 value %sprg1
0 value %sprg2
0 value %sprg3
+
+\ -------------------------------------------------------------------------
+\ other
+\ -------------------------------------------------------------------------
+
+\ Set by BootX when booting Mac OS X
+defer spin
1
0
Nov. 23, 2012
Author: mcayland
Date: Fri Nov 23 15:44:26 2012
New Revision: 1069
URL: http://tracker.coreboot.org/trac/openbios/changeset/1069
Log:
PPC32: Enable local variables for the PPC32 build.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Modified:
trunk/openbios-devel/config/examples/ppc_config.xml
Modified: trunk/openbios-devel/config/examples/ppc_config.xml
==============================================================================
--- trunk/openbios-devel/config/examples/ppc_config.xml Fri Nov 23 15:44:23 2012 (r1068)
+++ trunk/openbios-devel/config/examples/ppc_config.xml Fri Nov 23 15:44:26 2012 (r1069)
@@ -60,6 +60,7 @@
<option name="CONFIG_PPC_64BITSUPPORT" type="boolean" value="true"/>
<option name="CONFIG_LINUXBIOS" type="boolean" value="false"/>
<option name="CONFIG_RTAS" type="boolean" value="false"/>
+ <option name="CONFIG_LOCALS" type="boolean" value="true"/>
<!-- Drivers -->
<option name="CONFIG_DRIVER_PCI" type="boolean" value="true"/>
1
0
Nov. 23, 2012
Author: mcayland
Date: Fri Nov 23 15:44:23 2012
New Revision: 1068
URL: http://tracker.coreboot.org/trac/openbios/changeset/1068
Log:
Implementation of Forth local variables for OpenBIOS.
Some bootloaders, particularly OS X, execute Forth strings that make use
of Forth local variables. This patch provides an implementation that allows
OpenBIOS to execute such code.
A couple of examples are included below:
: diff.squares { A B -- A*A-B*B }
A A *
B B * -
;
: myword { ; cat dog }
4 -> cat
5 -> dog
cat \ cat's value pushed onto stack ( - cat)
dog \ dog's value pushed onto stack (cat - cat dog )
+
cr
." Total animals = " .
cr
;
Since the Forth locals stack and temporary dictionary take up extra space,
the locals implementation is protected by a new CONFIG_LOCALS build
variable.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland(a)ilande.co.uk>
Added:
trunk/openbios-devel/forth/lib/locals.fs
Modified:
trunk/openbios-devel/forth/bootstrap/bootstrap.fs
trunk/openbios-devel/forth/lib/build.xml
Modified: trunk/openbios-devel/forth/bootstrap/bootstrap.fs
==============================================================================
--- trunk/openbios-devel/forth/bootstrap/bootstrap.fs Sun Oct 21 20:14:06 2012 (r1067)
+++ trunk/openbios-devel/forth/bootstrap/bootstrap.fs Fri Nov 23 15:44:23 2012 (r1068)
@@ -49,6 +49,10 @@
defer context
0 value vocabularies?
+defer locals-end
+0 value locals-dict
+variable locals-dict-buf
+
\
\ 7.3.7 Flag constants
\
@@ -925,6 +929,11 @@
;
: $find ( name-str name-len -- xt true | name-str name-len false )
+ locals-dict 0<> if
+ locals-dict-buf @ find-wordlist ?dup if
+ exit
+ then
+ then
vocabularies? if
#order @ 0 ?do
i cells context + @
@@ -1426,6 +1435,10 @@
;
: ;
+ locals-dict 0<> if
+ 0 ['] locals-dict /n + !
+ ['] locals-end ,
+ then
['] (semis) , reveal ['] [ execute
; immediate
Modified: trunk/openbios-devel/forth/lib/build.xml
==============================================================================
--- trunk/openbios-devel/forth/lib/build.xml Sun Oct 21 20:14:06 2012 (r1067)
+++ trunk/openbios-devel/forth/lib/build.xml Fri Nov 23 15:44:23 2012 (r1068)
@@ -16,6 +16,7 @@
<object source="split.fs"/>
<object source="lists.fs"/>
<object source="64bit.fs"/>
+ <object source="locals.fs"/>
</dictionary>
</build>
Added: trunk/openbios-devel/forth/lib/locals.fs
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/openbios-devel/forth/lib/locals.fs Fri Nov 23 15:44:23 2012 (r1068)
@@ -0,0 +1,197 @@
+\ tag: local variables
+\
+\ Copyright (C) 2012 Mark Cave-Ayland
+\
+\ See the file "COPYING" for further information about
+\ the copyright and warranty status of this work.
+\
+
+[IFDEF] CONFIG_LOCALS
+
+\ Init local variable stack
+variable locals-var-stack
+here 200 cells allot locals-var-stack !
+
+\ Set initial stack pointer
+\
+\ Stack looks like this:
+\ ... (sp n-2) local1 ... localm-1 localm (sp n-1) <-- sp
+
+locals-var-stack @ value locals-var-sp
+locals-var-sp locals-var-stack @ !
+
+0 value locals-var-count
+0 value locals-flags
+
+here 200 cells allot locals-dict-buf !
+
+8 constant #locals
+
+: (local1) locals-var-sp @ /n + ;
+: (local2) locals-var-sp @ 2 cells + ;
+: (local3) locals-var-sp @ 3 cells + ;
+: (local4) locals-var-sp @ 4 cells + ;
+: (local5) locals-var-sp @ 5 cells + ;
+: (local6) locals-var-sp @ 6 cells + ;
+: (local7) locals-var-sp @ 7 cells + ;
+: (local8) locals-var-sp @ 8 cells + ;
+
+: local1@ (local1) @ ;
+: local2@ (local2) @ ;
+: local3@ (local3) @ ;
+: local4@ (local4) @ ;
+: local5@ (local5) @ ;
+: local6@ (local6) @ ;
+: local7@ (local7) @ ;
+: local8@ (local8) @ ;
+
+: local1! (local1) ! ;
+: local2! (local2) ! ;
+: local3! (local3) ! ;
+: local4! (local4) ! ;
+: local5! (local5) ! ;
+: local6! (local6) ! ;
+: local7! (local7) ! ;
+: local8! (local8) ! ;
+
+create locals-read-table
+['] local1@ ,
+['] local2@ ,
+['] local3@ ,
+['] local4@ ,
+['] local5@ ,
+['] local6@ ,
+['] local7@ ,
+['] local8@ ,
+
+create locals-write-table
+['] local1! ,
+['] local2! ,
+['] local3! ,
+['] local4! ,
+['] local5! ,
+['] local6! ,
+['] local7! ,
+['] local8! ,
+
+
+: locals-push ( n -- )
+ locals-var-sp /n + to locals-var-sp
+ locals-var-sp !
+;
+
+: locals-0-push ( -- )
+ 0 locals-push
+;
+
+: (apply-local-flags) ( lfa -- )
+ 1 - dup c@ locals-flags or swap c!
+;
+
+: locals-no-pop? ( lfa -- ? )
+ 1 - c@ 8 and 0<>
+;
+
+: locals-drop \ Destroy current stack frame
+ locals-var-sp @ to locals-var-sp
+;
+
+['] locals-drop to locals-end
+
+: (local-init) ( str len -- )
+ header 1 , \ DOCOL
+ ['] (lit) , ['] noop , \ read-xt
+ ['] (lit) , ['] noop , \ write-xt
+ ['] 2drop , \ do nothing
+ ['] (lit) ,
+ here 5 cells - ,
+ ['] @ , ['] , , \ store read-xt
+ ['] (semis) ,
+ reveal
+ immediate
+ last @ (apply-local-flags)
+;
+
+: (local-noop) ( str len -- )
+ 2drop
+;
+
+\ Word called when consuming a local variable
+defer (local)
+
+: } ( C: current latest here -- )
+ here! latest ! current ! \ Switch back to normal dict
+ locals-dict-buf @ to locals-dict \ Make locals-dict visible to $find
+ 0 to locals-var-count
+ ['] locals-var-sp , \ save previous sp on rstack
+ ['] >r ,
+ locals-dict @ \ ( last -- )
+ begin
+ ?dup 0<>
+ while
+ >r
+ locals-var-count /n *
+ locals-read-table + @ r@ 3 cells + ! \ set read-xt
+ locals-var-count /n *
+ locals-write-table + @ r@ 5 cells + ! \ set write-xt
+ locals-var-count 1+ to locals-var-count
+ r@ locals-no-pop? if
+ ['] locals-0-push , \ initialise with 0
+ else
+ ['] locals-push , \ initialise from stack
+ then
+ r> @ \ next lfa
+ repeat
+ ['] r> ,
+ ['] locals-push , \ write previous sp
+; immediate
+
+: { ( C: -- current latest here )
+ current @ latest @ here
+ ['] (local-init) to (local)
+ 0 to locals-flags
+ 0 to locals-var-count
+ locals-dict-buf @ 200 cells 0 fill \ Zero out temporary dictionary
+ locals-dict-buf @ current ! \ Switch to locals dictionary
+ locals-dict-buf @ /n + here!
+
+ begin
+ parse-word
+ 2dup s" }" strcmp 0= if
+ 2drop
+ ['] } execute -1
+ else
+ 2dup s" ;" strcmp 0= if
+ 2drop
+ 8 to locals-flags 0 \ Don't init from stack
+ else
+ 2dup s" |" strcmp 0= if
+ 2drop
+ 8 to locals-flags 0 \ Don't init from stack
+ else
+ 2dup s" --" strcmp 0= if
+ 2drop
+ ['] (local-noop) to (local) 0
+ else
+ locals-var-count #locals < if
+ (local) 0 \ accept local
+ else
+ s" maximum locals used ignoring " type type cr 0
+ then
+ locals-var-count 1+ to locals-var-count
+ then
+ then
+ then
+ then
+ until
+; immediate
+
+: -> ( n -- )
+ parse-word $find if
+ 4 cells + @ ,
+ else
+ s" unable to find word " type type
+ then
+; immediate
+
+[THEN]
1
0
Here is the CIF output I captured after adding FILLL.
>> =============================================================
>> OpenBIOS 1.0 [Nov 19 2012 20:51]
>> Configuration device id QEMU version 1 machine id 2
>> CPUs: 1
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,750
Welcome to OpenBIOS v1.0 built on Nov 19 2012 20:51
Trying hd:,\\:tbxi...
Trying hd:,\ppc\bootinfo.txt...
No valid state has been set by load or init-program
0 > boot cd:,\\:tbxi >> finddevice("/openprom") = 0xfff69f4c
>> getprop(0xfff69f4c, "model", 0x0565f68c, 255) = 15
>> 0x0565f68c 4f 70 65 6e 46 69 72 6d 77 61 72 65 20 33 00 __ OpenFirmware 3.
>> peer(0x00000000) = 0xfff69d8c
>> getprop(0xfff69d8c, "#address-cells", 0x056579d0, 4) = 4
>> 0x056579d0 00 00 00 01 __ __ __ __ __ __ __ __ __ __ __ __ ....
>> peer(0x00000000) = 0xfff69d8c
>> getprop(0xfff69d8c, "#size-cells", 0x056579d4, 4) = 4
>> 0x056579d4 00 00 00 01 __ __ __ __ __ __ __ __ __ __ __ __ ....
>> of_client_interface: interpret 05616674
>> interpret hex unselect-dev " /packages" find-device new-device " sl_words" device-name : open true ; : close ; 0 value outputLevel : slw_set_output_level dup 0= if 0 stdout ! then to outputLevel ; : slw_emit 2 outputLevel <= if emit else drop then ; : slw_cr 2 outputLevel <= if cr then ; 0 value keyboardIH 20 buffer: keyMap : slw_init_keymap to keyboardIH keyMap dup 20 0 fill ; : slw_update_keymap { ; dpth } depth -> dpth keyboardIH if " get-key-map" keyboardIH $call-method depth dpth - 1 = if 20 then 4 / 0 do dup i 4 * + l@ keyMap i 4 * + tuck l@ or swap l! loop drop then ; 0 value screenIH 0 value cursorAddr 0 value cursorX 0 value cursorY 0 value cursorW 0 value cursorH 0 value cursorFrames 0 value cursorPixelSize 0 value cursorStage 0 value cursorTime 0 value cursorDelay : slw_spin screenIH 0<> cursorAddr 0<> and if get-msecs dup cursorTime - cursorDelay >= if to cursorTime slw_update_keymap cursorStage 1+ cursorFrames mod dup to cursorStage handle_calls return: 00000000 07c5b8e0
>> finddevice("/options") = 0xfff6a0f4
>> finddevice("/chosen") = 0xfff6a16c
>> of_client_interface: interpret 056133e4
>> interpret dev /chosen new-device " memory-map" device-name active-package device-end ([1] -- [2])
>> handle_calls return: 00000000 fff77c8c
>> getprop(0xfff6a16c, "mmu", 0x056579ec, 4) = 4
>> 0x056579ec 07 c5 a8 2c __ __ __ __ __ __ __ __ __ __ __ __ .Ũ,
>> getprop(0xfff6a16c, "memory", 0x056579f0, 4) = 4
>> 0x056579f0 07 c5 ae 58 __ __ __ __ __ __ __ __ __ __ __ __ .ŮX
>> peer(0x00000000) = 0xfff69d8c
>> of_client_interface: interpret 05616db8 fff69d8c 0000000a 056131d4
>> interpret get-package-property if 0 0 then ([4] -- [3])
>> handle_calls return: 00000000 00000019 fff76f6c
>> getprop(0xfff6a16c, "stdout", 0x056579f4, 4) = 4
>> 0x056579f4 07 c5 af 5c __ __ __ __ __ __ __ __ __ __ __ __ .ů\
>> instance-to-package(0x07c5af5c) = 0xfff76640
>> getprop(0xfff6a16c, "stdin", 0x056579f8, 4) = 4
>> 0x056579f8 07 c5 b0 64 __ __ __ __ __ __ __ __ __ __ __ __ .Űd
>> instance-to-package(0x07c5b064) = 0xfff76640
>> getprop(0xfff76640, "name", 0x0565f81c, 31) = 5
>> 0x0565f81c 63 68 2d 62 00 __ __ __ __ __ __ __ __ __ __ __ ch-b.
>> open("keyboard") = 0x07c5bc88
>> of_client_interface: call-method 05616d78 07c5b8e0 07c5bc88
>> call-method slw_init_keymap ([3] -- [2])
>> handle_calls return: 00000000 fff77754
>> of_client_interface: call-method 05616d88 07c5b8e0
>> call-method slw_update_keymap ([2] -- [1])
>> handle_calls return: 00000000
>> getprop(0xfff6a0f4, "security-mode", 0x0565f83c, 32) = -1
>> of_client_interface: call-method 05616d60 07c5b8e0 00000000
>> call-method slw_set_output_level ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 07c5b8e0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 07c5b8e0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 0000004d
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000061
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000063
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 0000004f
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000053
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000058
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 0000004c
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 0000006f
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000061
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000064
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000065
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 07c5b8e0 00000072
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 07c5b8e0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> claim(0x05000000, 4194304, 0) = 0x05000000
>> claim(0x05400000, 2097152, 0) = 0x05400000
>> claim(0x04000000, 16777216, 0) = 0x04000000
>> claim(0x00004000, 67092480, 0) = 0x00004000
>> peer(0x00000000) = 0xfff69d8c
>> child(0xfff69d8c) = 0xfff69ea8
>> getprop(0xfff69ea8, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff69ea8) = 0x00000000
>> peer(0xfff69ea8) = 0xfff69f4c
>> getprop(0xfff69f4c, "device_type", 0x056569c8, 4095) = 8
>> 0x056569c8 42 6f 6f 74 52 4f 4d 00 __ __ __ __ __ __ __ __ BootROM.
>> child(0xfff69f4c) = 0xfff6fd0c
>> getprop(0xfff6fd0c, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6fd0c) = 0x00000000
>> peer(0xfff6fd0c) = 0x00000000
>> peer(0xfff69f4c) = 0xfff6a0f4
>> getprop(0xfff6a0f4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6a0f4) = 0x00000000
>> peer(0xfff6a0f4) = 0xfff6a16c
>> getprop(0xfff6a16c, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6a16c) = 0xfff77c8c
>> getprop(0xfff77c8c, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff77c8c) = 0x00000000
>> peer(0xfff77c8c) = 0x00000000
>> peer(0xfff6a16c) = 0xfff6a250
>> getprop(0xfff6a250, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6a250) = 0xfff6a2f4
>> getprop(0xfff6a2f4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6a2f4) = 0x00000000
>> peer(0xfff6a2f4) = 0x00000000
>> peer(0xfff6a250) = 0xfff6fa00
>> getprop(0xfff6fa00, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff6fa00) = 0xfff70b14
>> getprop(0xfff70b14, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff70b14) = 0x00000000
>> peer(0xfff70b14) = 0xfff70c54
>> getprop(0xfff70c54, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff70c54) = 0x00000000
>> peer(0xfff70c54) = 0xfff718c4
>> getprop(0xfff718c4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff718c4) = 0x00000000
>> peer(0xfff718c4) = 0xfff724b4
>> getprop(0xfff724b4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff724b4) = 0x00000000
>> peer(0xfff724b4) = 0xfff72808
>> getprop(0xfff72808, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff72808) = 0x00000000
>> peer(0xfff72808) = 0xfff72aa8
>> getprop(0xfff72aa8, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff72aa8) = 0x00000000
>> peer(0xfff72aa8) = 0xfff72d44
>> getprop(0xfff72d44, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff72d44) = 0x00000000
>> peer(0xfff72d44) = 0xfff72f7c
>> getprop(0xfff72f7c, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff72f7c) = 0x00000000
>> peer(0xfff72f7c) = 0xfff731b4
>> getprop(0xfff731b4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff731b4) = 0x00000000
>> peer(0xfff731b4) = 0xfff733ec
>> getprop(0xfff733ec, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff733ec) = 0x00000000
>> peer(0xfff733ec) = 0xfff73624
>> getprop(0xfff73624, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff73624) = 0x00000000
>> peer(0xfff73624) = 0xfff73858
>> getprop(0xfff73858, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff73858) = 0x00000000
>> peer(0xfff73858) = 0xfff73924
>> getprop(0xfff73924, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff73924) = 0x00000000
>> peer(0xfff73924) = 0xfff739ec
>> getprop(0xfff739ec, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff739ec) = 0x00000000
>> peer(0xfff739ec) = 0xfff775b4
>> getprop(0xfff775b4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff775b4) = 0x00000000
>> peer(0xfff775b4) = 0x00000000
>> peer(0xfff6fa00) = 0xfff716c4
>> getprop(0xfff716c4, "device_type", 0x056569c8, 4095) = -1
>> child(0xfff716c4) = 0xfff77040
>> getprop(0xfff77040, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 63 70 75 00 __ __ __ __ __ __ __ __ __ __ __ __ cpu.
>> child(0xfff77040) = 0x00000000
>> peer(0xfff77040) = 0x00000000
>> peer(0xfff716c4) = 0xfff717c4
>> getprop(0xfff717c4, "device_type", 0x056569c8, 4095) = 7
>> 0x056569c8 6d 65 6d 6f 72 79 00 __ __ __ __ __ __ __ __ __ memory.
>> child(0xfff717c4) = 0x00000000
>> peer(0xfff717c4) = 0xfff73ab8
>> getprop(0xfff73ab8, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 70 63 69 00 __ __ __ __ __ __ __ __ __ __ __ __ pci.
>> child(0xfff73ab8) = 0xfff73ed0
>> getprop(0xfff73ed0, "device_type", 0x056569c8, 4095) = 8
>> 0x056569c8 64 69 73 70 6c 61 79 00 __ __ __ __ __ __ __ __ display.
>> child(0xfff73ed0) = 0x00000000
>> peer(0xfff73ed0) = 0xfff743a4
>> getprop(0xfff743a4, "device_type", 0x056569c8, 4095) = 8
>> 0x056569c8 6e 65 74 77 6f 72 6b 00 __ __ __ __ __ __ __ __ network.
>> child(0xfff743a4) = 0x00000000
>> peer(0xfff743a4) = 0xfff74780
>> getprop(0xfff74780, "device_type", 0x056569c8, 4095) = 8
>> 0x056569c8 70 63 69 2d 69 64 65 00 __ __ __ __ __ __ __ __ pci-ide.
>> child(0xfff74780) = 0xfff74bbc
>> getprop(0xfff74bbc, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 61 74 61 00 __ __ __ __ __ __ __ __ __ __ __ __ ata.
>> child(0xfff74bbc) = 0xfff74d3c
>> getprop(0xfff74d3c, "device_type", 0x056569c8, 4095) = 6
>> 0x056569c8 62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __ block.
>> child(0xfff74d3c) = 0x00000000
>> peer(0xfff74d3c) = 0x00000000
>> peer(0xfff74bbc) = 0xfff75108
>> getprop(0xfff75108, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 61 74 61 00 __ __ __ __ __ __ __ __ __ __ __ __ ata.
>> child(0xfff75108) = 0x00000000
>> peer(0xfff75108) = 0x00000000
>> peer(0xfff74780) = 0xfff75288
>> getprop(0xfff75288, "device_type", 0x056569c8, 4095) = 7
>> 0x056569c8 6d 61 63 2d 69 6f 00 __ __ __ __ __ __ __ __ __ mac-io.
>> child(0xfff75288) = 0xfff75768
>> getprop(0xfff75768, "device_type", 0x056569c8, 4095) = 9
>> 0x056569c8 76 69 61 2d 63 75 64 61 00 __ __ __ __ __ __ __ via-cuda.
>> child(0xfff75768) = 0xfff75984
>> getprop(0xfff75984, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 61 64 62 00 __ __ __ __ __ __ __ __ __ __ __ __ adb.
>> child(0xfff75984) = 0xfff75aec
>> getprop(0xfff75aec, "device_type", 0x056569c8, 4095) = 9
>> 0x056569c8 6b 65 79 62 6f 61 72 64 00 __ __ __ __ __ __ __ keyboard.
>> child(0xfff75aec) = 0x00000000
>> peer(0xfff75aec) = 0xfff75d14
>> getprop(0xfff75d14, "device_type", 0x056569c8, 4095) = 6
>> 0x056569c8 6d 6f 75 73 65 00 __ __ __ __ __ __ __ __ __ __ mouse.
>> child(0xfff75d14) = 0x00000000
>> peer(0xfff75d14) = 0x00000000
>> peer(0xfff75984) = 0xfff75ea0
>> getprop(0xfff75ea0, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 72 74 63 00 __ __ __ __ __ __ __ __ __ __ __ __ rtc.
>> child(0xfff75ea0) = 0x00000000
>> peer(0xfff75ea0) = 0x00000000
>> peer(0xfff75768) = 0xfff76080
>> getprop(0xfff76080, "device_type", 0x056569c8, 4095) = 6
>> 0x056569c8 6e 76 72 61 6d 00 __ __ __ __ __ __ __ __ __ __ nvram.
>> child(0xfff76080) = 0x00000000
>> peer(0xfff76080) = 0xfff762a0
>> getprop(0xfff762a0, "device_type", 0x056569c8, 4095) = 5
>> 0x056569c8 65 73 63 63 00 __ __ __ __ __ __ __ __ __ __ __ escc.
>> child(0xfff762a0) = 0xfff763a8
>> getprop(0xfff763a8, "device_type", 0x056569c8, 4095) = 7
>> 0x056569c8 73 65 72 69 61 6c 00 __ __ __ __ __ __ __ __ __ serial.
>> child(0xfff763a8) = 0x00000000
>> peer(0xfff763a8) = 0xfff76640
>> getprop(0xfff76640, "device_type", 0x056569c8, 4095) = 7
>> 0x056569c8 73 65 72 69 61 6c 00 __ __ __ __ __ __ __ __ __ serial.
>> child(0xfff76640) = 0x00000000
>> peer(0xfff76640) = 0x00000000
>> peer(0xfff762a0) = 0xfff768ac
>> getprop(0xfff768ac, "device_type", 0x056569c8, 4095) = 4
>> 0x056569c8 61 74 61 00 __ __ __ __ __ __ __ __ __ __ __ __ ata.
>> child(0xfff768ac) = 0xfff76b54
>> getprop(0xfff76b54, "device_type", 0x056569c8, 4095) = 6
>> 0x056569c8 62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __ block.
>> child(0xfff76b54) = 0x00000000
>> peer(0xfff76b54) = 0x00000000
>> peer(0xfff768ac) = 0x00000000
>> peer(0xfff75288) = 0x00000000
>> parent(0xfff73ed0) = 0xfff73ab8
>> peer(0xfff73ab8) = 0x00000000
>> parent(0xfff73ab8) = 0xfff69d8c
>> peer(0xfff69d8c) = 0x00000000
>> parent(0xfff69d8c) = 0x00000000
>> finddevice("/chaos/control") = 0xffffffff
>> finddevice("screen") = 0xfff76640
>> of_client_interface: interpret 0561366c
>> interpret " _screen-ihandle" $find if execute else 0 then ([1] -- [2])
>> interpret '" _screen-ihandle" $find if execute else 0 then': possible argument error (-1--2) got 2
>> handle_calls return: 00000000 00000000
>> package-to-path(0xfff73ed0, 0x0565f5ac, 255) = 24
>> 0x0565f5ac 2f 70 63 69 40 38 30 30 30 30 30 30 30 2f 51 45 /pci@80000000/QE
>> 0x0565f5bc 4d 55 2c 56 47 41 40 31 __ __ __ __ __ __ __ __ MU,VGA@1
>> open("/pci@80000000/QEMU,VGA@1:0") = 0x07c5bcf4
>> getprop(0xfff73ed0, "display-type", 0x0565f6bc, 31) = -1
>> getprop(0xfff73ed0, "address", 0x0562aba4, 4) = 4
>> 0x0562aba4 80 00 00 00 __ __ __ __ __ __ __ __ __ __ __ __ ....
>> getprop(0xfff73ed0, "width", 0x0562aba8, 4) = 4
>> 0x0562aba8 00 00 03 20 __ __ __ __ __ __ __ __ __ __ __ __ ...
>> getprop(0xfff73ed0, "height", 0x0562abac, 4) = 4
>> 0x0562abac 00 00 02 58 __ __ __ __ __ __ __ __ __ __ __ __ ...X
>> getprop(0xfff73ed0, "depth", 0x0562abb0, 4) = 4
>> 0x0562abb0 00 00 00 0f __ __ __ __ __ __ __ __ __ __ __ __ ....
>> getprop(0xfff73ed0, "linebytes", 0x0562abb4, 4) = 4
>> 0x0562abb4 00 00 06 40 __ __ __ __ __ __ __ __ __ __ __ __ ...@
>> of_client_interface: interpret 056136e4 00000001 00000640 fff73ed0
>> interpret value depthbytes value rowbytes to active-package frame-buffer-adr value this-frame-buffer-adr : rect-setup >r >r rowbytes * swap depthbytes * + this-frame-buffer-adr + r> depthbytes * -rot r> ; : DRAW-RECTANGLE rect-setup 0 ?do 2dup 4 pick move 2 pick rowbytes d+ loop 3drop ; : FILL-RECTANGLE rect-setup rot depthbytes case 1 of dup 8 << or dup 10 << or endof 2 of dup 10 << or endof endcase -rot 0 ?do dup 3 pick 3 pick filll rowbytes + loop 3drop ; : READ-RECTANGLE rect-setup >r swap r> 0 ?do 2dup 4 pick move rowbytes 3 pick d+ loop 3drop ; this-frame-buffer-adr 0 to active-package ([4] -- [2])
>> handle_calls return: 00000000 80000000
>> of_client_interface: call-method 05613620 07c5bcf4 00000258 00000320 00000000 00000000 00000001
>> call-method fill-rectangle ([7] -- [1])
>> handle_calls return: 00000000
>> getprop(0xfff6a16c, "bootpath", 0x056567c8, 255) = 12
>> 0x056567c8 63 64 3a 2c 5c 5c 3a 74 62 78 69 00 __ __ __ __ cd:,\\:tbxi.
>> finddevice("cd:,\\:tbxi") = 0xfff74d3c
>> getprop(0xfff74d3c, "device_type", 0x0565f7bc, 31) = 6
>> 0x0565f7bc 62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __ block.
>> getprop(0xfff6a16c, "bootargs", 0x056568c8, 256) = 1
>> 0x056568c8 00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __ .
>> setprop(0xfff6a16c, "rootpath", 0x056568c8, 19)
>> 0x056568c8 63 64 3a 30 2c 5c 5c 6d 61 63 68 5f 6b 65 72 6e cd:0,\\mach_kern
>> 0x056568d8 65 6c 00 __ __ __ __ __ __ __ __ __ __ __ __ __ el.
>> = 19
>> setprop(0xfff73ed0, "AAPL,boot-display", 0x00000000, 0)
>> = 0
>> of_client_interface: call-method 05613610 07c5bcf4 00000080 00000080 000000ec 00000150 05617280
>> call-method draw-rectangle ([7] -- [1])
1
0
Seeing as there are people who want work on Max OS X (ppc) support and
to speed up their work, so they won't redundantly search for stuff which needs
to get implemented and so they can spend time on implementing it further.
There was some work done already during GSOC 2011,
which didn't get applied (due to not being finished? / missing signed-offs).
Anyway some time ago I tried to apply those patches and got Mac OS X
to start booting, you can see description and some screenshots at this address:
http://www.emaculation.com/forum/viewtopic.php?f=1&t=7047
Links to those patches with my comments here:
I tried them with latest tree, mixing some current stuff from mailing
list (mainly trying some filesystem things).
http://lists.openbios.org/pipermail/openbios/2011-August/006653.html
dummy get-key-map
http://lists.openbios.org/pipermail/openbios/2011-August/006615.html
http://lists.openbios.org/pipermail/openbios/2011-August/006616.html
http://lists.openbios.org/pipermail/openbios/2011-August/006618.html
file-system / partitioning stuff - may need some changes due to recent
patches
http://lists.openbios.org/pipermail/openbios/2011-August/006617.html
after "Call kernel!" it stops drawing to screen
http://lists.openbios.org/pipermail/openbios/2011-August/006619.html
local forth variables, I tested new implementation (from few days ago) and it also works
http://lists.openbios.org/pipermail/openbios/2011-August/006620.html
I think I stumbled upon it not booting without this one, but currently
can't reproduce
http://lists.openbios.org/pipermail/openbios/2011-August/006651.html
0 > boot cd:\\:tbxi >> openbios panic: Unexpected exception fff26500
http://lists.openbios.org/pipermail/openbios/2011-August/006623.html
for drawing apple logo (from my tests it seems badly positioned but it
may just want some other -g option to qemu)
https://lists.nongnu.org/archive/html/qemu-devel/2011-08/msg01418.html
I can confirm that it stops after "COLOR video console at 0x80000000 (800x600x32) without this
I will certainly test any new patches that appear ;)
Amadeusz
3
6
On Nov 14, 2012, at 4:35 AM, Mark Cave-Ayland wrote:
> On 14/11/12 02:39, Programmingkid wrote:
>
>> It is probably a lot of stuff. The get-key-map word is one of them. I'm going to have to put bootx under the microscope to see what else is the problem.
>
> Well may I make a suggestion? At the moment, our ability to help is limited because you are the only person with a copy of OS X.
>
> It would make more sense rather than simply stating "I need to do X, Y and Z" on the mailing list, that you post sections of log file to the mailing list so that people who know more about Open Firmware can make a better judgment as to what is the best way forward.
>
> In particular, I'd expect you to be posting sections of log file with CIF debugging enabled so you can see exactly what Forth is being executed and whether or not it is failing.
>
> The other alternative is for someone to send me a copy of OS X bought from Ebay or similar...
This will help you:
http://www.ebay.com/itm/Apple-Mac-OS-X-Jaguar-Version-10-2-Install-Discs-Ma…
Here is the debug output from enabling DEBUG_CIF:
0 > boot cd:,\\:tbxi >> finddevice("/openprom") = 0xfff48f3c
>> getprop(0xfff48f3c, "model", 0x0565f68c, 255) = 15
>> 0x0565f68c 4f 70 65 6e 46 69 72 6d 77 61 72 65 20 33 00 __ OpenFirmware 3.
>> peer(0x00000000) = 0xfff48d7c
>> getprop(0xfff48d7c, "#address-cells", 0x056579d0, 4) = 4
>> 0x056579d0 00 00 00 01 __ __ __ __ __ __ __ __ __ __ __ __ ....
>> peer(0x00000000) = 0xfff48d7c
>> getprop(0xfff48d7c, "#size-cells", 0x056579d4, 4) = 4
>> 0x056579d4 00 00 00 01 __ __ __ __ __ __ __ __ __ __ __ __ ....
>> of_client_interface: interpret 05616674
>> interpret hex unselect-dev " /packages" find-device new-device " sl_words" device-name : open true ; : close ; 0 value outputLevel : slw_set_output_level dup 0= if 0 stdout ! then to outputLevel ; : slw_emit 2 outputLevel <= if emit else drop then ; : slw_cr 2 outputLevel <= if cr then ; 0 value keyboardIH 20 buffer: keyMap : slw_init_keymap to keyboardIH keyMap dup 20 0 fill ; : slw_update_keymap { ; dpth } depth -> dpth keyboardIH if " get-key-map" keyboardIH $call-method depth dpth - 1 = if 20 then 4 / 0 do dup i 4 * + l@ keyMap i 4 * + tuck l@ or swap l! loop drop then ; 0 value screenIH 0 value cursorAddr 0 value cursorX 0 value cursorY 0 value cursorW 0 value cursorH 0 value cursorFrames 0 value cursorPixelSize 0 value cursorStage 0 value cursorTime 0 value cursorDelay : slw_spin screenIH 0<> cursorAddr 0<> and if get-msecs dup cursorTime - cursorDelay >= if to cursorTime slw_update_keymap cursorStage 1+ cursorFrames mod dup to cursorStage handle_calls return: 00000000 1fc5b2f0
>> finddevice("/options") = 0xfff490e4
>> finddevice("/chosen") = 0xfff4915c
>> of_client_interface: interpret 056133e4
>> interpret dev /chosen new-device " memory-map" device-name active-package device-end ([1] -- [2])
>> handle_calls return: 00000000 fff56864
>> getprop(0xfff4915c, "mmu", 0x056579ec, 4) = 4
>> 0x056579ec 1f c5 a8 2c __ __ __ __ __ __ __ __ __ __ __ __ .Ũ,
>> getprop(0xfff4915c, "memory", 0x056579f0, 4) = 4
>> 0x056579f0 1f c5 ae 58 __ __ __ __ __ __ __ __ __ __ __ __ .ŮX
>> peer(0x00000000) = 0xfff48d7c
>> of_client_interface: interpret 05616db8 fff48d7c 0000000a 056131d4
>> interpret get-package-property if 0 0 then ([4] -- [3])
>> handle_calls return: 00000000 00000019 fff55b44
>> getprop(0xfff4915c, "stdout", 0x056579f4, 4) = 4
>> 0x056579f4 1f c5 af 5c __ __ __ __ __ __ __ __ __ __ __ __ .ů\
>> instance-to-package(0x1fc5af5c) = 0xfff555e4
>> getprop(0xfff4915c, "stdin", 0x056579f8, 4) = 4
>> 0x056579f8 1f c5 b0 64 __ __ __ __ __ __ __ __ __ __ __ __ .Űd
>> instance-to-package(0x1fc5b064) = 0xfff555e4
>> getprop(0xfff555e4, "name", 0x0565f81c, 31) = 5
>> 0x0565f81c 63 68 2d 62 00 __ __ __ __ __ __ __ __ __ __ __ ch-b.
>> open("keyboard") = 0x00000000
>> open("kbd") = 0x00000000
>> of_client_interface: call-method 05616d78 1fc5b2f0 00000000
>> call-method slw_init_keymap ([3] -- [2])
>> handle_calls return: 00000000 fff5632c
>> of_client_interface: call-method 05616d88 1fc5b2f0
>> call-method slw_update_keymap ([2] -- [1])
>> handle_calls return: 00000000
>> getprop(0xfff490e4, "security-mode", 0x0565f83c, 32) = -1
>> of_client_interface: call-method 05616d60 1fc5b2f0 00000000
>> call-method slw_set_output_level ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 1fc5b2f0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 1fc5b2f0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 0000004d
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000061
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000063
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 0000004f
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000053
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000058
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000020
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 0000004c
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 0000006f
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000061
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000064
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000065
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c78 1fc5b2f0 00000072
>> call-method slw_emit ([3] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: call-method 05613c70 1fc5b2f0
>> call-method slw_cr ([2] -- [1])
>> handle_calls return: 00000000
>> claim(0x05000000, 4194304, 0) = 0x05000000
>> claim(0x05400000, 2097152, 0) = 0x05400000
>> claim(0x04000000, 16777216, 0) = 0x04000000
>> claim(0x00004000, 67092480, 0) = 0x00004000
The first thing that bothers me is this:
>> open("keyboard") = 0x00000000
>> open("kbd") = 0x00000000
Bootx can't open the keyboard node and call any of its methods. This is something to fix. I would fix it myself, but I couldn't find any documentation on how the DECLARE_NODE() method works.
On a side note, the partition selection patch I sent you appears to be ready to commit. It is the patch that has made the most difference. Because of it, the Mac OS actually beings to start booting when I use the boot word.
3
3