You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(715) |
Jun
(837) |
Jul
(583) |
Aug
(343) |
Sep
(205) |
Oct
(475) |
Nov
(188) |
Dec
(82) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(145) |
Feb
(85) |
Mar
(466) |
Apr
(761) |
May
(153) |
Jun
(151) |
Jul
(118) |
Aug
(84) |
Sep
(27) |
Oct
(44) |
Nov
(19) |
Dec
(70) |
| 2006 |
Jan
(18) |
Feb
(66) |
Mar
(113) |
Apr
(9) |
May
(31) |
Jun
(42) |
Jul
(14) |
Aug
(15) |
Sep
(16) |
Oct
(80) |
Nov
(40) |
Dec
(53) |
| 2007 |
Jan
(41) |
Feb
(44) |
Mar
(24) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
| 2008 |
Jan
(2) |
Feb
(7) |
Mar
(1) |
Apr
(3) |
May
|
Jun
(11) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Programmingkid <pro...@gm...> - 2016-02-15 20:31:36
|
On Feb 15, 2016, at 3:12 PM, Ben Franchuk wrote: > ProgrammingKid, Cassy was responding to Ty Armour, Not to you. He/she is right, also. Oh. I thought the message sounded odd. Thank you. |
|
From: Ben F. <mrs...@gm...> - 2016-02-15 20:12:18
|
ProgrammingKid, Cassy was responding to Ty Armour, Not to you. He/she is right, also. |
|
From: Programmingkid <pro...@gm...> - 2016-02-14 20:00:51
|
On Feb 14, 2016, at 2:23 PM, Cassy Foesch wrote: > I don't want to crush your dreams, but a lot of what you're talking about is Not Even Wrong (http://rationalwiki.org/wiki/Not_even_wrong) What? I don't think we are on the same page. > I do hope you luck in developing skills and knowledge in programming computers, but there is a reason why the thousands of computer programmers out here already haven't done some of this stuff. Either it's impossible, or it's not actually as useful as one would imagine. I mean, eye candy is cool and all, but in the end things need to be functional. Are you referring to QEMU as eye candy? I have successfully ran on QEMU Mac OS 10.4, 10.2, and 9.2. It is very functional as well. > Picasso mastered classical art before going rogue and doing his own thing. Later in life, he spent his time mastering how to paint like a child. You need to cover the basics and develop good skills BEFORE you go off and do revolutionary stuff. I'm not sure where this is coming from. > > Programmingkid <pro...@gm...> schrieb am Sa., 13. Feb. 2016 um 21:23 Uhr: > > On Feb 13, 2016, at 3:33 PM, ty armour wrote: > > > post a lot of the tutorials in assembly that way its super fast. you have to do everything in assembly because assembly will end up being faster than C and it will also produce smaller files. > > > > I am going to build all wireless computers...so only chips and no motherboard and write this operating system. > > > > I also had the idea for a few custom GUI and NEtworking frameworks which need a bit of help.l > > > > I want to make the actual GUI window 3dimensional(I am going to produce 3D monitors and need to write a framework that supports this) > > > > I want the actual GUI windows to be rotateable, scalable, and appear 3D. I also want it to be like OPENGL where the inside of the window can appear 3D too. > > > > so any tutorials on that would help, just do a bunch of research and give it away if you are interested. > > > > Im sure ill get around to it but it might be nice to have other people doing the same things. > > > All the Macintosh Emulator action is at QEMU. You are welcome to join us. This forum is where most of us talk: http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=702b4dbdb50568b78123543a58e1dcae&start=525 > > I am glad to see there is some activity with PearPC. > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Pearpc-devel mailing list > Pea...@li... > https://lists.sourceforge.net/lists/listinfo/pearpc-devel > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140_______________________________________________ > Pearpc-devel mailing list > Pea...@li... > https://lists.sourceforge.net/lists/listinfo/pearpc-devel |
|
From: Cassy F. <pue...@go...> - 2016-02-14 19:23:39
|
I don't want to crush your dreams, but a lot of what you're talking about is Not Even Wrong (http://rationalwiki.org/wiki/Not_even_wrong) I do hope you luck in developing skills and knowledge in programming computers, but there is a reason why the thousands of computer programmers out here already haven't done some of this stuff. Either it's impossible, or it's not actually as useful as one would imagine. I mean, eye candy is cool and all, but in the end things need to be functional. Picasso mastered classical art before going rogue and doing his own thing. Later in life, he spent his time mastering how to paint like a child. You need to cover the basics and develop good skills BEFORE you go off and do revolutionary stuff. Programmingkid <pro...@gm...> schrieb am Sa., 13. Feb. 2016 um 21:23 Uhr: > > On Feb 13, 2016, at 3:33 PM, ty armour wrote: > > > post a lot of the tutorials in assembly that way its super fast. you > have to do everything in assembly because assembly will end up being faster > than C and it will also produce smaller files. > > > > I am going to build all wireless computers...so only chips and no > motherboard and write this operating system. > > > > I also had the idea for a few custom GUI and NEtworking frameworks which > need a bit of help.l > > > > I want to make the actual GUI window 3dimensional(I am going to produce > 3D monitors and need to write a framework that supports this) > > > > I want the actual GUI windows to be rotateable, scalable, and appear 3D. > I also want it to be like OPENGL where the inside of the window can appear > 3D too. > > > > so any tutorials on that would help, just do a bunch of research and > give it away if you are interested. > > > > Im sure ill get around to it but it might be nice to have other people > doing the same things. > > > All the Macintosh Emulator action is at QEMU. You are welcome to join us. > This forum is where most of us talk: > http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=702b4dbdb50568b78123543a58e1dcae&start=525 > > I am glad to see there is some activity with PearPC. > > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Pearpc-devel mailing list > Pea...@li... > https://lists.sourceforge.net/lists/listinfo/pearpc-devel > |
|
From: Programmingkid <pro...@gm...> - 2016-02-13 21:22:51
|
On Feb 13, 2016, at 3:33 PM, ty armour wrote: > post a lot of the tutorials in assembly that way its super fast. you have to do everything in assembly because assembly will end up being faster than C and it will also produce smaller files. > > I am going to build all wireless computers...so only chips and no motherboard and write this operating system. > > I also had the idea for a few custom GUI and NEtworking frameworks which need a bit of help.l > > I want to make the actual GUI window 3dimensional(I am going to produce 3D monitors and need to write a framework that supports this) > > I want the actual GUI windows to be rotateable, scalable, and appear 3D. I also want it to be like OPENGL where the inside of the window can appear 3D too. > > so any tutorials on that would help, just do a bunch of research and give it away if you are interested. > > Im sure ill get around to it but it might be nice to have other people doing the same things. All the Macintosh Emulator action is at QEMU. You are welcome to join us. This forum is where most of us talk: http://www.emaculation.com/forum/viewtopic.php?f=34&t=7047&sid=702b4dbdb50568b78123543a58e1dcae&start=525 I am glad to see there is some activity with PearPC. |
|
From: ty a. <aa...@ci...> - 2016-02-13 20:34:00
|
post a lot of the tutorials in assembly that way its super fast. you have to do everything in assembly because assembly will end up being faster than C and it will also produce smaller files. I am going to build all wireless computers...so only chips and no motherboard and write this operating system. I also had the idea for a few custom GUI and NEtworking frameworks which need a bit of help.l I want to make the actual GUI window 3dimensional(I am going to produce 3D monitors and need to write a framework that supports this) I want the actual GUI windows to be rotateable, scalable, and appear 3D. I also want it to be like OPENGL where the inside of the window can appear 3D too. so any tutorials on that would help, just do a bunch of research and give it away if you are interested. Im sure ill get around to it but it might be nice to have other people doing the same things. |
|
From: ty a. <aa...@ci...> - 2016-02-13 20:27:45
|
I am looking for tutorials on every part of developing pearpc. I am also looking for tutorials on developing Operating systems based on PureDarwin, hackintosh and GNU-Darwin. If you are interested just start researching and posting all of the information and tutorials you can think of. It will help. But yeah someones gonna have to make an opensource freeware version of macintosh, and its probably gonna end up being me. I had the idea(which you can have) to write a version of BIOS where the user is capable of patching the computer to run different operating systems without shutting down the computer, but I need some help implementeing it at the moment. it would be based on writing a 64 bit version of freedos and puredarwin and maybe any old linux distro. but it needs to be fully documented and tutorials on it so that everyone can develop it an keep it alive so im giving it away for now thanks |
|
From: Cassy F. <pue...@go...> - 2015-06-28 02:03:13
|
Oh, it's absolutely a nice thing, and a wonderful feature that we were hoping to integrate... problem was it never got fully functional. So... *shrug* :( Programmingkid <pro...@gm...> schrieb am Sa., 27. Juni 2015 um 23:45 Uhr: > > On Jun 26, 2015, at 6:50 PM, Cassy Foesch wrote: > > The patch was never up to full quality, and still had a number of issues. > If I remember right, the author himself didn't even think it ready to apply > into to main branch... > > Programmingkid <pro...@gm...> schrieb am Mi., 24. Juni 2015 > um 15:48 Uhr: > >> >> http://sourceforge.net/p/pearpc/mailman/pearpc-devel/thread/414...@so.../ >> . >> Hi, I was wondering why this patch was never implemented into PearPC? >> >> ------------------------------------------------------------------------------ >> > > > Thank you very much for replying. I would think some sound support was > better than nothing. > > ------------------------------------------------------------------------------ > Monitor 25 network devices or servers for free with OpManager! > OpManager is web-based network management software that monitors > network devices and physical & virtual servers, alerts via email & sms > for fault. Monitor 25 devices for free with no restriction. Download now > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o > _______________________________________________ > Pearpc-devel mailing list > Pea...@li... > https://lists.sourceforge.net/lists/listinfo/pearpc-devel > |
|
From: Programmingkid <pro...@gm...> - 2015-06-27 23:45:12
|
On Jun 26, 2015, at 6:50 PM, Cassy Foesch wrote: > The patch was never up to full quality, and still had a number of issues. If I remember right, the author himself didn't even think it ready to apply into to main branch... > > Programmingkid <pro...@gm...> schrieb am Mi., 24. Juni 2015 um 15:48 Uhr: > http://sourceforge.net/p/pearpc/mailman/pearpc-devel/thread/414...@so.../. > Hi, I was wondering why this patch was never implemented into PearPC? > ------------------------------------------------------------------------------ Thank you very much for replying. I would think some sound support was better than nothing. |
|
From: Cassy F. <pue...@go...> - 2015-06-26 22:50:29
|
The patch was never up to full quality, and still had a number of issues. If I remember right, the author himself didn't even think it ready to apply into to main branch... Programmingkid <pro...@gm...> schrieb am Mi., 24. Juni 2015 um 15:48 Uhr: > > http://sourceforge.net/p/pearpc/mailman/pearpc-devel/thread/414...@so.../ > . > Hi, I was wondering why this patch was never implemented into PearPC? > > ------------------------------------------------------------------------------ > Monitor 25 network devices or servers for free with OpManager! > OpManager is web-based network management software that monitors > network devices and physical & virtual servers, alerts via email & sms > for fault. Monitor 25 devices for free with no restriction. Download now > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o > _______________________________________________ > Pearpc-devel mailing list > Pea...@li... > https://lists.sourceforge.net/lists/listinfo/pearpc-devel > |
|
From: Programmingkid <pro...@gm...> - 2015-06-24 15:48:19
|
http://sourceforge.net/p/pearpc/mailman/pearpc-devel/thread/414...@so.../. Hi, I was wondering why this patch was never implemented into PearPC? |
|
From: Sebastian B. <pe...@bi...> - 2015-03-03 21:34:39
|
Hi all! I moved the pearpc repository to Github: https://github.com/sebastianbiallas/pearpc Hopefully this makes merging patches easier. Additionally, I made the repository compile under clang and the assembler shipped with Mac OS X. - Sebastian |
|
From: Christian C. <cal...@gm...> - 2013-04-20 02:34:00
|
Hi, I am wondering if there is any programming I can contribute to this project. I know python pretty well, and I know a bit of C. What else would be helpful to learn so that I can make valuable contributions? |
|
From: Miles D <mw...@gm...> - 2011-12-10 16:05:15
|
I'd like to try my hand at designing - some logos, buttons etc for PearPC. If there's anything I could do, just email me back. |
|
From: Natanael <Nat...@gm...> - 2011-10-20 16:00:35
|
Jens von der Heydt <mailme <at> vdh-webservice.de> writes: > > > Am 07.04.2008 um 20:37 schrieb Cassy Foesch: > > 2008/2/16, Alex Smith <alex <at> alex-smith.me.uk>: > >> On Feb 7, 2008 8:50 PM, Sebastian Biallas <pearpc <at> biallas.net> wrote: > >> > >>> Hi! > >>> > >>> It's been some time since the last update, but today I merged the > >>> AMD64 > >>> branch... > >>> > >>> I guess I broke something so please test. > >>> > >>> Have fun, > >>> Sebastian > >> > >> Finally got round to having a look at it. I just tried compiling > >> for i386 > >> (I've not got a 64-bit distro installed right now), seems MAP_32BIT > >> isn't > >> defined on i386: > >> > >> g++ -DHAVE_CONFIG_H -I. -I../../../.. -I ../../.. -Wundef -Wall > >> -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno- > >> inline > >> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -I/usr/include/SDL > >> -D_GNU_SOURCE=1 -D_REENTRANT -MT sysfile.o -MD -MP -MF .deps/ > >> sysfile.Tpo -c > >> -o sysfile.o sysfile.cc > >> sysfile.cc: In function 'void* > >> sys_alloc_read_write_execute(int)': > >> sysfile.cc:275: error: 'MAP_32BIT' was not declared in this scope > >> gmake[5]: *** [sysfile.o] Error 1 > >> > > > > As this branch requires an x86-64 processor, it should be disabled > > from compiling on any other architecture. > > > > Is there anyone who know enough automake/autoconf to implement just > > such a test? > > > > > > -- > > Cassy > > Hi there, > > I think it actually is disabled by mistake :) I tried to compile it on > a Macbook Pro and it refused to compile for X86_64 just until I forced > it to take this branch by using many configure statements. But it > should be tested correctly, that's true. > > Jens > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Register now and save $200. Hurry, offer ends at 11:59 p.m., > Monday, April 7! Use priority code J8TLD2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > I get: $ make /usr/bin/make all-recursive Making all in doc make[2]: Nothing to be done for `all'. Making all in src Making all in cpu Making all in cpu_jitc_x86_64 g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_alu.o -MD -MP -MF .deps/ppc_alu.Tpo -c -o ppc_alu.o ppc_alu.cc mv -f .deps/ppc_alu.Tpo .deps/ppc_alu.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_cpu.o -MD -MP -MF .deps/ppc_cpu.Tpo -c -o ppc_cpu.o ppc_cpu.cc mv -f .deps/ppc_cpu.Tpo .deps/ppc_cpu.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_dec.o -MD -MP -MF .deps/ppc_dec.Tpo -c -o ppc_dec.o ppc_dec.cc ppc_dec.cc:1120: warning: ‘last_instr’ defined but not used ppc_dec.cc:1120: warning: ‘instr_report’ defined but not used ppc_dec.cc:1120: warning: ‘instr_count’ defined but not used mv -f .deps/ppc_dec.Tpo .deps/ppc_dec.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_esc.o -MD -MP -MF .deps/ppc_esc.Tpo -c -o ppc_esc.o ppc_esc.cc mv -f .deps/ppc_esc.Tpo .deps/ppc_esc.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_exc.o -MD -MP -MF .deps/ppc_exc.Tpo -c -o ppc_exc.o ppc_exc.cc mv -f .deps/ppc_exc.Tpo .deps/ppc_exc.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_fpu.o -MD -MP -MF .deps/ppc_fpu.Tpo -c -o ppc_fpu.o ppc_fpu.cc mv -f .deps/ppc_fpu.Tpo .deps/ppc_fpu.Po g++ -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -Wundef -Wall -Woverloaded-virtual -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_mmu.o -MD -MP -MF .deps/ppc_mmu.Tpo -c -o ppc_mmu.o ppc_mmu.cc ppc_mmu.cc: In function ‘bool ppc_init_physical_memory(uint)’: ppc_mmu.cc:828: error: ‘MAP_32BIT’ was not declared in this scope make[4]: *** [ppc_mmu.o] Error 1 make[3]: *** [all-recursive] Error 1 make[2]: *** [all-recursive] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 which seams to be the same problem. but I specified to use 64bit: ./configure --target=x86_64 --enable-ui=gtk I'm compiling on MacOSX 10.6.8 Thank You Natanael |
|
From: JD <jd...@gm...> - 2010-03-22 06:42:21
|
if g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -I ../.. -Wundef -Wall
-Woverloaded-virtual -fsigned-char -O2 -fomit-frame-pointer
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -MT ppc_alu.o -MD -MP
-MF ".deps/ppc_alu.Tpo" -c -o ppc_alu.o ppc_alu.cc; \
then mv -f ".deps/ppc_alu.Tpo" ".deps/ppc_alu.Po"; else rm -f
".deps/ppc_alu.Tpo"; exit 1; fi
In file included from jitc.h:25,
from ppc_alu.cc:29:
x86asm.h:387: error: redefinition of 'JitcFloatReg hint1'
x86asm.h:387: error: 'JitcFloatReg hint1' previously declared here
In file included from jitc.h:25,
from ppc_alu.cc:29:
x86asm.h:388: error: redefinition of 'JitcFloatReg hint1'
x86asm.h:388: error: 'JitcFloatReg hint1' previously declared here
So, I modified file src/cpu/cpu_jitc_x86/x86asm.h, please change these
2 lines, by changing the second occurrence of
hint1 to hint2
---------------------------------------------------
387: JitcFloatReg FASTCALL jitcGetClientFloatRegister(int creg,
JitcFloatReg hint1=JITC_FLOAT_REG_NONE, JitcFloatReg
hint2=JITC_FLOAT_REG_NONE);
388: JitcFloatReg FASTCALL jitcGetClientFloatRegisterUnmapped(int
creg, JitcFloatReg hint1=JITC_FLOAT_REG_NONE, JitcFloatReg
hint2=JITC_FLOAT_REG_NONE);
=====================
./src/system/file.cc
file.cc: In function 'int sys_basename(char*, const char*)':
file.cc:130: error: invalid conversion from 'const char*' to 'char*'
file.cc:131: error: invalid conversion from 'const char*' to 'char*'
file.cc: In function 'int sys_dirname(char*, const char*)':
file.cc:146: error: invalid conversion from 'const char*' to 'char*'
file.cc:147: error: invalid conversion from 'const char*' to 'char*'
file.cc: In function 'char* sys_filename_suffix(const char*)':
file.cc:274: error: invalid conversion from 'const char*' to 'char*'
So, I modified lines 130-131, 146-147 , 274 as follows:
130 char *slash1 = strrchr(*(char *)*filename, '/');
131 char *slash2 = strrchr(*(char *)*filename, '\\');
....
146 char *slash1 = strrchr(*(char *)*filename, '/');
147 char *slash2 = strrchr(*(char *)*filename, '\\');
....
274 char *p = s ? strrchr(*(char *)*s, '.') : NULL;
and that let me build the emulator to the finish.
|
|
From: Cassy F. <pue...@go...> - 2008-06-11 18:02:03
|
2008/6/10 James Molloy <jam...@tr...>:
> Cassy Foesch wrote:
> > Well, is this something "new" described my OpenBIOS, or is it actually
> > something that was originally defined in OpenFirmware?
> >
> > 2008/6/10 James Molloy <jam...@tr...
> > <mailto:jam...@tr...>>:
> >
> > Cassy Foesch wrote:
> > > This is an OpenBios feature? Or OpenFirmware? Or where are the
> > > specifications written?
> > >
> > > Basically, the OpenFirmware implementation on PearPC is pretty
> > buggy,
> > > and incomplete. If it does just run twice, then it doesn't look
> > like
> > > there would be any problems with even an inefficient version
> > running.
> > > It sounds like it works pretty good, and I'll have to examine the
> > > code a little more, but so far, it looks pretty good.
> > >
> > > 2008/6/9 James Molloy <jam...@tr...
> > <mailto:jam...@tr...>
> > > <mailto:jam...@tr... <mailto:jam...@tr...
> >>>:
> > >
> > > /Apologies for the possible repost - I checked the mailing list
> > > archives
> > > and my message didn't seem to appear, so I've now subscribed
> > to the
> > > mailing list to check if it does./
> > >
> > > Hi,
> > >
> > > I'm using PearPC to assist me in developing a hobby OS for
> > the PowerPC
> > > platform (in addition to real hardware) and noticed that PearPC
> > > doesn't
> > > expose the "translations" property of the MMU firmware
> > device node.
> > >
> > > The translations property is documented in the OpenBios PowerPC
> > > bindings
> > > document and is aimed at helping the client program
> > replicate the HTAB
> > > before taking full control of memory management. I took the
> > liberty of
> > > creating this property myself.
> > >
> > > As far as I can tell, PearPC doesn't maintain an explicit
> > list of
> > > mmu->map() calls, so my algorithm searches the HTAB for
> > every page in
> > > the effective address space and manually constructs a list of
> > > them. It's
> > > O(n), but since it's only intended to be called twice (once
> > from the
> > > getproplen call and once from the getprop call) I don't see
> that
> > > as much
> > > of a handicap. It executes seemingly instantaneously on my
> > Core2Duo
> > > running the x86_64 JITC cpu.
> > >
> > > Anyway, let me know if it's not up to coding standard or
> > there are too
> > > few comments and I'll change them.
> > >
> > > Cheers,
> > >
> > > James Molloy
> > >
> > > Index: src/io/prom/promdt.cc
> > > ==============================
> > > =====================================
> > > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> > > retrieving revision 1.29
> > > diff -u -r1.29 promdt.cc
> > > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> > > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> > > @@ -1032,6 +1032,95 @@
> > > }
> > > }
> > >
> > > +/*
> > > + * PromPropMMU: Implements the MMU's "translations" property,
> > > which allows
> > > + * client programs to replicate the HTAB contents before
> > taking over
> > > + * memory management.
> > > + */
> > > +PromPropMMU::PromPropMMU(const char *aName)
> > > + :PromProp(aName), nValidTranslations(0)
> > > +{
> > > +}
> > > +
> > > +PromPropMMU::~PromPropMMU()
> > > +{
> > > +}
> > > +
> > > +uint32 PromPropMMU::getValueLen()
> > > +{
> > > + calculateTranslations();
> > > + return nValidTranslations*sizeof(Translation);
> > > +}
> > > +
> > > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> > > +{
> > > + calculateTranslations();
> > > + if (nValidTranslations*sizeof(Translation) < buflen)
> > > + {
> > > + buflen = nValidTranslations*sizeof(Translation);
> > > + }
> > > +
> > > + // Convert all values to BE.
> > > + for (int i = 0; i < nValidTranslations; i++)
> > > + {
> > > + translations[i].virt =
> > ppc_word_to_BE(translations[i].virt);
> > > + translations[i].phys =
> > ppc_word_to_BE(translations[i].phys);
> > > + translations[i].size =
> > ppc_word_to_BE(translations[i].size);
> > > + translations[i].mode =
> > ppc_word_to_BE(translations[i].mode);
> > > + }
> > > +
> > > + uint32 phys;
> > > + ppc_prom_effective_to_physical(phys, buf);
> > > + ppc_dma_write(phys, (void*)translations, buflen);
> > > + return 0;
> > > +}
> > > +
> > > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> > > +{
> > > + return -1;
> > > +}
> > > +
> > > +void PromPropMMU::calculateTranslations()
> > > +{
> > > + nValidTranslations = 0;
> > > + uint32 phys;
> > > + // For every page in the address space, check for a mapping.
> > > + for (uint32 i = 0; i <= 0xFFFFF; i++)
> > > + {
> > > + uint32 ea = i << 12;
> > > + if (ppc_prom_effective_to_physical(phys, ea))
> > > + {
> > > + // A valid translation exists. Add to the
> > translations list.
> > > + addTranslation(ea, phys);
> > > + }
> > > + }
> > > +}
> > > +
> > > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> > > +{
> > > + // Can the given translation be appended to translation
> > > 'nValidTranslations-1'?
> > > + if ( (nValidTranslations > 0) &&
> > > + (translations[nValidTranslations-1].virt +
> > > translations[nValidTranslations-1].size == ea) &&
> > > + (translations[nValidTranslations-1].phys +
> > > translations[nValidTranslations-1].size == phys) )
> > > + {
> > > + // Modify 'nValidTranslations'.
> > > + translations[nValidTranslations-1].size += 0x1000;
> > > + }
> > > + else
> > > + {
> > > + // Else add a new translation.
> > > + translations[nValidTranslations].virt = ea;
> > > + translations[nValidTranslations].phys = phys;
> > > + translations[nValidTranslations].size = 0x1000;
> > > + translations[nValidTranslations].mode = 0x6a;
> > > + nValidTranslations++;
> > > + if (nValidTranslations == NUM_TRANSLATIONS)
> > > + {
> > > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too
> > many
> > > translations.");
> > > + }
> > > + }
> > > +}
> > > +
> > >
> >
> /*******************************************************************************
> > > *
> > > */
> > > @@ -1111,6 +1200,8 @@
> > > gPromRoot->addNode(cpus);
> > > gPromRoot->addNode(kbd);
> > >
> > > + mmu->addProp(new PromPropMMU("translations"));
> > > +
> > > PromNode *cpu = new PromNode("PowerPC,G4");
> > > cpus->addNode(cpu);
> > > cpus->addProp(new PromPropInt("#size-cells", 0));
> > > Index: src/io/prom/promdt.h
> > >
> > ===================================================================
> > > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> > > retrieving revision 1.3
> > > diff -u -r1.3 promdt.h
> > > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> > > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> > > @@ -272,6 +272,30 @@
> > > virtual uint32 setValue(uint32 buf, uint32
> > buflen);
> > > };
> > >
> > > +#define NUM_TRANSLATIONS 256
> > > +class PromPropMMU: public PromProp {
> > > +public:
> > > + PromPropMMU(const char *name);
> > > + virtual ~PromPropMMU();
> > > +
> > > + virtual uint32 getValueLen();
> > > + virtual uint32 getValue(uint32 buf,
> > uint32 buflen);
> > > + virtual uint32 setValue(uint32 buf, uint32
> > buflen);
> > > +
> > > +private:
> > > + void calculateTranslations();
> > > + void addTranslation(uint32 ea, uint32 phys);
> > > + struct Translation
> > > + {
> > > + uint32 virt;
> > > + uint32 size;
> > > + uint32 phys;
> > > + uint32 mode;
> > > + };
> > > + Translation translations[NUM_TRANSLATIONS];
> > > + uint32 nValidTranslations;
> > > +};
> > > +
> > > #define FIND_DEVICE_FIND 0
> > > #define FIND_DEVICE_OPEN 1
> > > PromNode *findDevice(const char *aPathName, int type,
> > > PromInstanceHandle *ret);
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > Check out the new SourceForge.net Marketplace.
> > > It's the best place to buy or sell services for
> > > just about anything Open Source.
> > > http://sourceforge.net/services/buy/index.php
> > > _______________________________________________
> > > Pearpc-devel mailing list
> > > Pea...@li...
> > <mailto:Pea...@li...>
> > > <mailto:Pea...@li...
> > <mailto:Pea...@li...>>
> > > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> > >
> > >
> > >
> > >
> > > --
> > > Cassy
> > >
> >
> ------------------------------------------------------------------------
> > >
> > >
> >
> -------------------------------------------------------------------------
> > > Check out the new SourceForge.net Marketplace.
> > > It's the best place to buy or sell services for
> > > just about anything Open Source.
> > > http://sourceforge.net/services/buy/index.php
> > >
> >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > Pearpc-devel mailing list
> > > Pea...@li...
> > <mailto:Pea...@li...>
> > > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> > >
> > Hi Cassy,
> >
> > Thanks for the reply. The property is described in the PPC binding
> for
> > OpenBIOS, available at http://openbios.org/Bindings. To quote from
> > section 5.1.7 - Memory management unit properties:
> >
> > To aid a client in "taking over" the translation mechanism and
> > still
> > interact with Open Firmware (via the client interface), the client
> > needs to know what translations have been established by Open
> > Firmware. The following standard translation shall exist within
> the
> > package to which the "mmu" property of the /chosen package refers.
> >
> > "Translations"
> > This property, consisting of sets of translations, defines the
> > currently active translations that have been established by Open
> > Firmware (e.g. using map). Each set has the following format:
> > (virt size phys mode)
> > Each value is encoded as with encode-int
> >
> >
> > As I said, it seems to run pretty quickly even though it's O(n),
> > however
> > I've only run it on a core 2 duo and a pentium 4, neither of which
> are
> > particularly slow (the P4 is pushing it though :) )
> >
> > Cheers,
> >
> > James
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > <mailto:Pea...@li...>
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> >
> >
> >
> > --
> > Cassy
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> Hi,
>
> That's a little difficult to answer, as I don't know the full history of
> OpenFirmware/OpenBIOS.
>
> What I /can/ tell you is:
>
> (a) It's defined as a "shall" in the OpenBIOS PPC binding (as I've
> already quoted).
> (b) It's implemented in OpenFirmware version 3 as used by the Apple
> iBook and iMacs.
>
> Further to that I have no real idea what you're asking - sorry.
>
> James
>
Awesome, that's pretty much what I was trying to get to. If it's implemented
in Apple's OpenFirmware, and it's a "shall" in OpenBIOS PPC, then it's
likely a "shall" in the original OpenFirmware requirements.
I'll review your code, and get it checked in unless you need to fix
anything... so far, it doesn't look like it at first glance.
--
Cassy
|
|
From: James M. <jam...@tr...> - 2008-06-10 08:46:33
|
Cassy Foesch wrote:
> Well, is this something "new" described my OpenBIOS, or is it actually
> something that was originally defined in OpenFirmware?
>
> 2008/6/10 James Molloy <jam...@tr...
> <mailto:jam...@tr...>>:
>
> Cassy Foesch wrote:
> > This is an OpenBios feature? Or OpenFirmware? Or where are the
> > specifications written?
> >
> > Basically, the OpenFirmware implementation on PearPC is pretty
> buggy,
> > and incomplete. If it does just run twice, then it doesn't look
> like
> > there would be any problems with even an inefficient version
> running.
> > It sounds like it works pretty good, and I'll have to examine the
> > code a little more, but so far, it looks pretty good.
> >
> > 2008/6/9 James Molloy <jam...@tr...
> <mailto:jam...@tr...>
> > <mailto:jam...@tr... <mailto:jam...@tr...>>>:
> >
> > /Apologies for the possible repost - I checked the mailing list
> > archives
> > and my message didn't seem to appear, so I've now subscribed
> to the
> > mailing list to check if it does./
> >
> > Hi,
> >
> > I'm using PearPC to assist me in developing a hobby OS for
> the PowerPC
> > platform (in addition to real hardware) and noticed that PearPC
> > doesn't
> > expose the "translations" property of the MMU firmware
> device node.
> >
> > The translations property is documented in the OpenBios PowerPC
> > bindings
> > document and is aimed at helping the client program
> replicate the HTAB
> > before taking full control of memory management. I took the
> liberty of
> > creating this property myself.
> >
> > As far as I can tell, PearPC doesn't maintain an explicit
> list of
> > mmu->map() calls, so my algorithm searches the HTAB for
> every page in
> > the effective address space and manually constructs a list of
> > them. It's
> > O(n), but since it's only intended to be called twice (once
> from the
> > getproplen call and once from the getprop call) I don't see that
> > as much
> > of a handicap. It executes seemingly instantaneously on my
> Core2Duo
> > running the x86_64 JITC cpu.
> >
> > Anyway, let me know if it's not up to coding standard or
> there are too
> > few comments and I'll change them.
> >
> > Cheers,
> >
> > James Molloy
> >
> > Index: src/io/prom/promdt.cc
> > ==============================
> > =====================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> > retrieving revision 1.29
> > diff -u -r1.29 promdt.cc
> > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> > @@ -1032,6 +1032,95 @@
> > }
> > }
> >
> > +/*
> > + * PromPropMMU: Implements the MMU's "translations" property,
> > which allows
> > + * client programs to replicate the HTAB contents before
> taking over
> > + * memory management.
> > + */
> > +PromPropMMU::PromPropMMU(const char *aName)
> > + :PromProp(aName), nValidTranslations(0)
> > +{
> > +}
> > +
> > +PromPropMMU::~PromPropMMU()
> > +{
> > +}
> > +
> > +uint32 PromPropMMU::getValueLen()
> > +{
> > + calculateTranslations();
> > + return nValidTranslations*sizeof(Translation);
> > +}
> > +
> > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> > +{
> > + calculateTranslations();
> > + if (nValidTranslations*sizeof(Translation) < buflen)
> > + {
> > + buflen = nValidTranslations*sizeof(Translation);
> > + }
> > +
> > + // Convert all values to BE.
> > + for (int i = 0; i < nValidTranslations; i++)
> > + {
> > + translations[i].virt =
> ppc_word_to_BE(translations[i].virt);
> > + translations[i].phys =
> ppc_word_to_BE(translations[i].phys);
> > + translations[i].size =
> ppc_word_to_BE(translations[i].size);
> > + translations[i].mode =
> ppc_word_to_BE(translations[i].mode);
> > + }
> > +
> > + uint32 phys;
> > + ppc_prom_effective_to_physical(phys, buf);
> > + ppc_dma_write(phys, (void*)translations, buflen);
> > + return 0;
> > +}
> > +
> > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> > +{
> > + return -1;
> > +}
> > +
> > +void PromPropMMU::calculateTranslations()
> > +{
> > + nValidTranslations = 0;
> > + uint32 phys;
> > + // For every page in the address space, check for a mapping.
> > + for (uint32 i = 0; i <= 0xFFFFF; i++)
> > + {
> > + uint32 ea = i << 12;
> > + if (ppc_prom_effective_to_physical(phys, ea))
> > + {
> > + // A valid translation exists. Add to the
> translations list.
> > + addTranslation(ea, phys);
> > + }
> > + }
> > +}
> > +
> > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> > +{
> > + // Can the given translation be appended to translation
> > 'nValidTranslations-1'?
> > + if ( (nValidTranslations > 0) &&
> > + (translations[nValidTranslations-1].virt +
> > translations[nValidTranslations-1].size == ea) &&
> > + (translations[nValidTranslations-1].phys +
> > translations[nValidTranslations-1].size == phys) )
> > + {
> > + // Modify 'nValidTranslations'.
> > + translations[nValidTranslations-1].size += 0x1000;
> > + }
> > + else
> > + {
> > + // Else add a new translation.
> > + translations[nValidTranslations].virt = ea;
> > + translations[nValidTranslations].phys = phys;
> > + translations[nValidTranslations].size = 0x1000;
> > + translations[nValidTranslations].mode = 0x6a;
> > + nValidTranslations++;
> > + if (nValidTranslations == NUM_TRANSLATIONS)
> > + {
> > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too
> many
> > translations.");
> > + }
> > + }
> > +}
> > +
> >
> /*******************************************************************************
> > *
> > */
> > @@ -1111,6 +1200,8 @@
> > gPromRoot->addNode(cpus);
> > gPromRoot->addNode(kbd);
> >
> > + mmu->addProp(new PromPropMMU("translations"));
> > +
> > PromNode *cpu = new PromNode("PowerPC,G4");
> > cpus->addNode(cpu);
> > cpus->addProp(new PromPropInt("#size-cells", 0));
> > Index: src/io/prom/promdt.h
> >
> ===================================================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> > retrieving revision 1.3
> > diff -u -r1.3 promdt.h
> > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> > @@ -272,6 +272,30 @@
> > virtual uint32 setValue(uint32 buf, uint32
> buflen);
> > };
> >
> > +#define NUM_TRANSLATIONS 256
> > +class PromPropMMU: public PromProp {
> > +public:
> > + PromPropMMU(const char *name);
> > + virtual ~PromPropMMU();
> > +
> > + virtual uint32 getValueLen();
> > + virtual uint32 getValue(uint32 buf,
> uint32 buflen);
> > + virtual uint32 setValue(uint32 buf, uint32
> buflen);
> > +
> > +private:
> > + void calculateTranslations();
> > + void addTranslation(uint32 ea, uint32 phys);
> > + struct Translation
> > + {
> > + uint32 virt;
> > + uint32 size;
> > + uint32 phys;
> > + uint32 mode;
> > + };
> > + Translation translations[NUM_TRANSLATIONS];
> > + uint32 nValidTranslations;
> > +};
> > +
> > #define FIND_DEVICE_FIND 0
> > #define FIND_DEVICE_OPEN 1
> > PromNode *findDevice(const char *aPathName, int type,
> > PromInstanceHandle *ret);
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> <mailto:Pea...@li...>
> > <mailto:Pea...@li...
> <mailto:Pea...@li...>>
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> >
> >
> >
> > --
> > Cassy
> >
> ------------------------------------------------------------------------
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> <mailto:Pea...@li...>
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> Hi Cassy,
>
> Thanks for the reply. The property is described in the PPC binding for
> OpenBIOS, available at http://openbios.org/Bindings. To quote from
> section 5.1.7 - Memory management unit properties:
>
> To aid a client in "taking over" the translation mechanism and
> still
> interact with Open Firmware (via the client interface), the client
> needs to know what translations have been established by Open
> Firmware. The following standard translation shall exist within the
> package to which the "mmu" property of the /chosen package refers.
>
> "Translations"
> This property, consisting of sets of translations, defines the
> currently active translations that have been established by Open
> Firmware (e.g. using map). Each set has the following format:
> (virt size phys mode)
> Each value is encoded as with encode-int
>
>
> As I said, it seems to run pretty quickly even though it's O(n),
> however
> I've only run it on a core 2 duo and a pentium 4, neither of which are
> particularly slow (the P4 is pushing it though :) )
>
> Cheers,
>
> James
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> <mailto:Pea...@li...>
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
>
>
>
> --
> Cassy
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
Hi,
That's a little difficult to answer, as I don't know the full history of
OpenFirmware/OpenBIOS.
What I /can/ tell you is:
(a) It's defined as a "shall" in the OpenBIOS PPC binding (as I've
already quoted).
(b) It's implemented in OpenFirmware version 3 as used by the Apple
iBook and iMacs.
Further to that I have no real idea what you're asking - sorry.
James
|
|
From: Aaron F. <fi...@gm...> - 2008-06-10 08:25:21
|
tried. doesn't work.
=(
On Jun 10, 2008, at 1:24 AM, Jens von der Heydt wrote:
> Aaron, just asking to get off the list won't help that much. Simply
> use the Newsletter-Tools provided by sourceforge on their homepage.
>
> Jens
>
> Am 10.06.2008 um 10:17 schrieb Aaron Fisher:
>
>> can someone please finally take me off this list!?!?!?!? i have
>> asked at least a dozen times.
>> thank you!
>>
>> On Jun 10, 2008, at 1:15 AM, Cassy Foesch wrote:
>>
>>> Well, is this something "new" described my OpenBIOS, or is it
>>> actually something that was originally defined in OpenFirmware?
>>>
>>> 2008/6/10 James Molloy <jam...@tr...>:
>>> Cassy Foesch wrote:
>>> > This is an OpenBios feature? Or OpenFirmware? Or where are the
>>> > specifications written?
>>> >
>>> > Basically, the OpenFirmware implementation on PearPC is pretty
>>> buggy,
>>> > and incomplete. If it does just run twice, then it doesn't look
>>> like
>>> > there would be any problems with even an inefficient version
>>> running.
>>> > It sounds like it works pretty good, and I'll have to examine the
>>> > code a little more, but so far, it looks pretty good.
>>> >
>>> > 2008/6/9 James Molloy <jam...@tr...
>>> > <mailto:jam...@tr...>>:
>>> >
>>> > /Apologies for the possible repost - I checked the mailing
>>> list
>>> > archives
>>> > and my message didn't seem to appear, so I've now subscribed
>>> to the
>>> > mailing list to check if it does./
>>> >
>>> > Hi,
>>> >
>>> > I'm using PearPC to assist me in developing a hobby OS for
>>> the PowerPC
>>> > platform (in addition to real hardware) and noticed that
>>> PearPC
>>> > doesn't
>>> > expose the "translations" property of the MMU firmware
>>> device node.
>>> >
>>> > The translations property is documented in the OpenBios
>>> PowerPC
>>> > bindings
>>> > document and is aimed at helping the client program
>>> replicate the HTAB
>>> > before taking full control of memory management. I took the
>>> liberty of
>>> > creating this property myself.
>>> >
>>> > As far as I can tell, PearPC doesn't maintain an explicit
>>> list of
>>> > mmu->map() calls, so my algorithm searches the HTAB for
>>> every page in
>>> > the effective address space and manually constructs a list of
>>> > them. It's
>>> > O(n), but since it's only intended to be called twice (once
>>> from the
>>> > getproplen call and once from the getprop call) I don't see
>>> that
>>> > as much
>>> > of a handicap. It executes seemingly instantaneously on my
>>> Core2Duo
>>> > running the x86_64 JITC cpu.
>>> >
>>> > Anyway, let me know if it's not up to coding standard or
>>> there are too
>>> > few comments and I'll change them.
>>> >
>>> > Cheers,
>>> >
>>> > James Molloy
>>> >
>>> > Index: src/io/prom/promdt.cc
>>> > ==============================
>>> > =====================================
>>> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
>>> > retrieving revision 1.29
>>> > diff -u -r1.29 promdt.cc
>>> > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000
>>> 1.29
>>> > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
>>> > @@ -1032,6 +1032,95 @@
>>> > }
>>> > }
>>> >
>>> > +/*
>>> > + * PromPropMMU: Implements the MMU's "translations" property,
>>> > which allows
>>> > + * client programs to replicate the HTAB contents before
>>> taking over
>>> > + * memory management.
>>> > + */
>>> > +PromPropMMU::PromPropMMU(const char *aName)
>>> > + :PromProp(aName), nValidTranslations(0)
>>> > +{
>>> > +}
>>> > +
>>> > +PromPropMMU::~PromPropMMU()
>>> > +{
>>> > +}
>>> > +
>>> > +uint32 PromPropMMU::getValueLen()
>>> > +{
>>> > + calculateTranslations();
>>> > + return nValidTranslations*sizeof(Translation);
>>> > +}
>>> > +
>>> > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
>>> > +{
>>> > + calculateTranslations();
>>> > + if (nValidTranslations*sizeof(Translation) < buflen)
>>> > + {
>>> > + buflen = nValidTranslations*sizeof(Translation);
>>> > + }
>>> > +
>>> > + // Convert all values to BE.
>>> > + for (int i = 0; i < nValidTranslations; i++)
>>> > + {
>>> > + translations[i].virt =
>>> ppc_word_to_BE(translations[i].virt);
>>> > + translations[i].phys =
>>> ppc_word_to_BE(translations[i].phys);
>>> > + translations[i].size =
>>> ppc_word_to_BE(translations[i].size);
>>> > + translations[i].mode =
>>> ppc_word_to_BE(translations[i].mode);
>>> > + }
>>> > +
>>> > + uint32 phys;
>>> > + ppc_prom_effective_to_physical(phys, buf);
>>> > + ppc_dma_write(phys, (void*)translations, buflen);
>>> > + return 0;
>>> > +}
>>> > +
>>> > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
>>> > +{
>>> > + return -1;
>>> > +}
>>> > +
>>> > +void PromPropMMU::calculateTranslations()
>>> > +{
>>> > + nValidTranslations = 0;
>>> > + uint32 phys;
>>> > + // For every page in the address space, check for a
>>> mapping.
>>> > + for (uint32 i = 0; i <= 0xFFFFF; i++)
>>> > + {
>>> > + uint32 ea = i << 12;
>>> > + if (ppc_prom_effective_to_physical(phys, ea))
>>> > + {
>>> > + // A valid translation exists. Add to the
>>> translations list.
>>> > + addTranslation(ea, phys);
>>> > + }
>>> > + }
>>> > +}
>>> > +
>>> > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
>>> > +{
>>> > + // Can the given translation be appended to translation
>>> > 'nValidTranslations-1'?
>>> > + if ( (nValidTranslations > 0) &&
>>> > + (translations[nValidTranslations-1].virt +
>>> > translations[nValidTranslations-1].size == ea) &&
>>> > + (translations[nValidTranslations-1].phys +
>>> > translations[nValidTranslations-1].size == phys) )
>>> > + {
>>> > + // Modify 'nValidTranslations'.
>>> > + translations[nValidTranslations-1].size += 0x1000;
>>> > + }
>>> > + else
>>> > + {
>>> > + // Else add a new translation.
>>> > + translations[nValidTranslations].virt = ea;
>>> > + translations[nValidTranslations].phys = phys;
>>> > + translations[nValidTranslations].size = 0x1000;
>>> > + translations[nValidTranslations].mode = 0x6a;
>>> > + nValidTranslations++;
>>> > + if (nValidTranslations == NUM_TRANSLATIONS)
>>> > + {
>>> > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too
>>> many
>>> > translations.");
>>> > + }
>>> > + }
>>> > +}
>>> > +
>>> > /
>>> *******************************************************************************
>>> > *
>>> > */
>>> > @@ -1111,6 +1200,8 @@
>>> > gPromRoot->addNode(cpus);
>>> > gPromRoot->addNode(kbd);
>>> >
>>> > + mmu->addProp(new PromPropMMU("translations"));
>>> > +
>>> > PromNode *cpu = new PromNode("PowerPC,G4");
>>> > cpus->addNode(cpu);
>>> > cpus->addProp(new PromPropInt("#size-cells", 0));
>>> > Index: src/io/prom/promdt.h
>>> >
>>> ===================================================================
>>> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
>>> > retrieving revision 1.3
>>> > diff -u -r1.3 promdt.h
>>> > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
>>> > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
>>> > @@ -272,6 +272,30 @@
>>> > virtual uint32 setValue(uint32 buf, uint32
>>> buflen);
>>> > };
>>> >
>>> > +#define NUM_TRANSLATIONS 256
>>> > +class PromPropMMU: public PromProp {
>>> > +public:
>>> > + PromPropMMU(const char *name);
>>> > + virtual ~PromPropMMU();
>>> > +
>>> > + virtual uint32 getValueLen();
>>> > + virtual uint32 getValue(uint32 buf,
>>> uint32 buflen);
>>> > + virtual uint32 setValue(uint32 buf, uint32
>>> buflen);
>>> > +
>>> > +private:
>>> > + void calculateTranslations();
>>> > + void addTranslation(uint32 ea, uint32 phys);
>>> > + struct Translation
>>> > + {
>>> > + uint32 virt;
>>> > + uint32 size;
>>> > + uint32 phys;
>>> > + uint32 mode;
>>> > + };
>>> > + Translation translations[NUM_TRANSLATIONS];
>>> > + uint32 nValidTranslations;
>>> > +};
>>> > +
>>> > #define FIND_DEVICE_FIND 0
>>> > #define FIND_DEVICE_OPEN 1
>>> > PromNode *findDevice(const char *aPathName, int type,
>>> > PromInstanceHandle *ret);
>>> >
>>> >
>>> -------------------------------------------------------------------------
>>> > Check out the new SourceForge.net Marketplace.
>>> > It's the best place to buy or sell services for
>>> > just about anything Open Source.
>>> > http://sourceforge.net/services/buy/index.php
>>> > _______________________________________________
>>> > Pearpc-devel mailing list
>>> > Pea...@li...
>>> > <mailto:Pea...@li...>
>>> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>>> >
>>> >
>>> >
>>> >
>>> > --
>>> > Cassy
>>> >
>>> ------------------------------------------------------------------------
>>> >
>>> >
>>> -------------------------------------------------------------------------
>>> > Check out the new SourceForge.net Marketplace.
>>> > It's the best place to buy or sell services for
>>> > just about anything Open Source.
>>> > http://sourceforge.net/services/buy/index.php
>>> >
>>> ------------------------------------------------------------------------
>>> >
>>> > _______________________________________________
>>> > Pearpc-devel mailing list
>>> > Pea...@li...
>>> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>>> >
>>> Hi Cassy,
>>>
>>> Thanks for the reply. The property is described in the PPC binding
>>> for
>>> OpenBIOS, available at http://openbios.org/Bindings. To quote from
>>> section 5.1.7 - Memory management unit properties:
>>>
>>> To aid a client in "taking over" the translation mechanism and
>>> still
>>> interact with Open Firmware (via the client interface), the
>>> client
>>> needs to know what translations have been established by Open
>>> Firmware. The following standard translation shall exist within
>>> the
>>> package to which the "mmu" property of the /chosen package
>>> refers.
>>>
>>> "Translations"
>>> This property, consisting of sets of translations, defines the
>>> currently active translations that have been established by Open
>>> Firmware (e.g. using map). Each set has the following format:
>>> (virt size phys mode)
>>> Each value is encoded as with encode-int
>>>
>>>
>>> As I said, it seems to run pretty quickly even though it's O(n),
>>> however
>>> I've only run it on a core 2 duo and a pentium 4, neither of which
>>> are
>>> particularly slow (the P4 is pushing it though :) )
>>>
>>> Cheers,
>>>
>>> James
>>>
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> _______________________________________________
>>> Pearpc-devel mailing list
>>> Pea...@li...
>>> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>>>
>>>
>>>
>>> --
>>> Cassy
>>> -------------------------------------------------------------------------
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php_______________________________________________
>>> Pearpc-devel mailing list
>>> Pea...@li...
>>> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php_______________________________________________
>> Pearpc-devel mailing list
>> Pea...@li...
>> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php_______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
|
|
From: Jens v. d. H. <ma...@vd...> - 2008-06-10 08:24:01
|
Aaron, just asking to get off the list won't help that much. Simply
use the Newsletter-Tools provided by sourceforge on their homepage.
Jens
Am 10.06.2008 um 10:17 schrieb Aaron Fisher:
> can someone please finally take me off this list!?!?!?!? i have
> asked at least a dozen times.
> thank you!
>
> On Jun 10, 2008, at 1:15 AM, Cassy Foesch wrote:
>
>> Well, is this something "new" described my OpenBIOS, or is it
>> actually something that was originally defined in OpenFirmware?
>>
>> 2008/6/10 James Molloy <jam...@tr...>:
>> Cassy Foesch wrote:
>> > This is an OpenBios feature? Or OpenFirmware? Or where are the
>> > specifications written?
>> >
>> > Basically, the OpenFirmware implementation on PearPC is pretty
>> buggy,
>> > and incomplete. If it does just run twice, then it doesn't look
>> like
>> > there would be any problems with even an inefficient version
>> running.
>> > It sounds like it works pretty good, and I'll have to examine the
>> > code a little more, but so far, it looks pretty good.
>> >
>> > 2008/6/9 James Molloy <jam...@tr...
>> > <mailto:jam...@tr...>>:
>> >
>> > /Apologies for the possible repost - I checked the mailing list
>> > archives
>> > and my message didn't seem to appear, so I've now subscribed
>> to the
>> > mailing list to check if it does./
>> >
>> > Hi,
>> >
>> > I'm using PearPC to assist me in developing a hobby OS for
>> the PowerPC
>> > platform (in addition to real hardware) and noticed that PearPC
>> > doesn't
>> > expose the "translations" property of the MMU firmware device
>> node.
>> >
>> > The translations property is documented in the OpenBios PowerPC
>> > bindings
>> > document and is aimed at helping the client program replicate
>> the HTAB
>> > before taking full control of memory management. I took the
>> liberty of
>> > creating this property myself.
>> >
>> > As far as I can tell, PearPC doesn't maintain an explicit
>> list of
>> > mmu->map() calls, so my algorithm searches the HTAB for every
>> page in
>> > the effective address space and manually constructs a list of
>> > them. It's
>> > O(n), but since it's only intended to be called twice (once
>> from the
>> > getproplen call and once from the getprop call) I don't see
>> that
>> > as much
>> > of a handicap. It executes seemingly instantaneously on my
>> Core2Duo
>> > running the x86_64 JITC cpu.
>> >
>> > Anyway, let me know if it's not up to coding standard or
>> there are too
>> > few comments and I'll change them.
>> >
>> > Cheers,
>> >
>> > James Molloy
>> >
>> > Index: src/io/prom/promdt.cc
>> > ==============================
>> > =====================================
>> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
>> > retrieving revision 1.29
>> > diff -u -r1.29 promdt.cc
>> > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
>> > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
>> > @@ -1032,6 +1032,95 @@
>> > }
>> > }
>> >
>> > +/*
>> > + * PromPropMMU: Implements the MMU's "translations" property,
>> > which allows
>> > + * client programs to replicate the HTAB contents before
>> taking over
>> > + * memory management.
>> > + */
>> > +PromPropMMU::PromPropMMU(const char *aName)
>> > + :PromProp(aName), nValidTranslations(0)
>> > +{
>> > +}
>> > +
>> > +PromPropMMU::~PromPropMMU()
>> > +{
>> > +}
>> > +
>> > +uint32 PromPropMMU::getValueLen()
>> > +{
>> > + calculateTranslations();
>> > + return nValidTranslations*sizeof(Translation);
>> > +}
>> > +
>> > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
>> > +{
>> > + calculateTranslations();
>> > + if (nValidTranslations*sizeof(Translation) < buflen)
>> > + {
>> > + buflen = nValidTranslations*sizeof(Translation);
>> > + }
>> > +
>> > + // Convert all values to BE.
>> > + for (int i = 0; i < nValidTranslations; i++)
>> > + {
>> > + translations[i].virt =
>> ppc_word_to_BE(translations[i].virt);
>> > + translations[i].phys =
>> ppc_word_to_BE(translations[i].phys);
>> > + translations[i].size =
>> ppc_word_to_BE(translations[i].size);
>> > + translations[i].mode =
>> ppc_word_to_BE(translations[i].mode);
>> > + }
>> > +
>> > + uint32 phys;
>> > + ppc_prom_effective_to_physical(phys, buf);
>> > + ppc_dma_write(phys, (void*)translations, buflen);
>> > + return 0;
>> > +}
>> > +
>> > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
>> > +{
>> > + return -1;
>> > +}
>> > +
>> > +void PromPropMMU::calculateTranslations()
>> > +{
>> > + nValidTranslations = 0;
>> > + uint32 phys;
>> > + // For every page in the address space, check for a mapping.
>> > + for (uint32 i = 0; i <= 0xFFFFF; i++)
>> > + {
>> > + uint32 ea = i << 12;
>> > + if (ppc_prom_effective_to_physical(phys, ea))
>> > + {
>> > + // A valid translation exists. Add to the translations
>> list.
>> > + addTranslation(ea, phys);
>> > + }
>> > + }
>> > +}
>> > +
>> > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
>> > +{
>> > + // Can the given translation be appended to translation
>> > 'nValidTranslations-1'?
>> > + if ( (nValidTranslations > 0) &&
>> > + (translations[nValidTranslations-1].virt +
>> > translations[nValidTranslations-1].size == ea) &&
>> > + (translations[nValidTranslations-1].phys +
>> > translations[nValidTranslations-1].size == phys) )
>> > + {
>> > + // Modify 'nValidTranslations'.
>> > + translations[nValidTranslations-1].size += 0x1000;
>> > + }
>> > + else
>> > + {
>> > + // Else add a new translation.
>> > + translations[nValidTranslations].virt = ea;
>> > + translations[nValidTranslations].phys = phys;
>> > + translations[nValidTranslations].size = 0x1000;
>> > + translations[nValidTranslations].mode = 0x6a;
>> > + nValidTranslations++;
>> > + if (nValidTranslations == NUM_TRANSLATIONS)
>> > + {
>> > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too
>> many
>> > translations.");
>> > + }
>> > + }
>> > +}
>> > +
>> > /
>> *******************************************************************************
>> > *
>> > */
>> > @@ -1111,6 +1200,8 @@
>> > gPromRoot->addNode(cpus);
>> > gPromRoot->addNode(kbd);
>> >
>> > + mmu->addProp(new PromPropMMU("translations"));
>> > +
>> > PromNode *cpu = new PromNode("PowerPC,G4");
>> > cpus->addNode(cpu);
>> > cpus->addProp(new PromPropInt("#size-cells", 0));
>> > Index: src/io/prom/promdt.h
>> >
>> ===================================================================
>> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
>> > retrieving revision 1.3
>> > diff -u -r1.3 promdt.h
>> > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
>> > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
>> > @@ -272,6 +272,30 @@
>> > virtual uint32 setValue(uint32 buf, uint32
>> buflen);
>> > };
>> >
>> > +#define NUM_TRANSLATIONS 256
>> > +class PromPropMMU: public PromProp {
>> > +public:
>> > + PromPropMMU(const char *name);
>> > + virtual ~PromPropMMU();
>> > +
>> > + virtual uint32 getValueLen();
>> > + virtual uint32 getValue(uint32 buf, uint32
>> buflen);
>> > + virtual uint32 setValue(uint32 buf, uint32
>> buflen);
>> > +
>> > +private:
>> > + void calculateTranslations();
>> > + void addTranslation(uint32 ea, uint32 phys);
>> > + struct Translation
>> > + {
>> > + uint32 virt;
>> > + uint32 size;
>> > + uint32 phys;
>> > + uint32 mode;
>> > + };
>> > + Translation translations[NUM_TRANSLATIONS];
>> > + uint32 nValidTranslations;
>> > +};
>> > +
>> > #define FIND_DEVICE_FIND 0
>> > #define FIND_DEVICE_OPEN 1
>> > PromNode *findDevice(const char *aPathName, int type,
>> > PromInstanceHandle *ret);
>> >
>> >
>> -------------------------------------------------------------------------
>> > Check out the new SourceForge.net Marketplace.
>> > It's the best place to buy or sell services for
>> > just about anything Open Source.
>> > http://sourceforge.net/services/buy/index.php
>> > _______________________________________________
>> > Pearpc-devel mailing list
>> > Pea...@li...
>> > <mailto:Pea...@li...>
>> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>> >
>> >
>> >
>> >
>> > --
>> > Cassy
>> >
>> ------------------------------------------------------------------------
>> >
>> >
>> -------------------------------------------------------------------------
>> > Check out the new SourceForge.net Marketplace.
>> > It's the best place to buy or sell services for
>> > just about anything Open Source.
>> > http://sourceforge.net/services/buy/index.php
>> >
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Pearpc-devel mailing list
>> > Pea...@li...
>> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>> >
>> Hi Cassy,
>>
>> Thanks for the reply. The property is described in the PPC binding
>> for
>> OpenBIOS, available at http://openbios.org/Bindings. To quote from
>> section 5.1.7 - Memory management unit properties:
>>
>> To aid a client in "taking over" the translation mechanism and
>> still
>> interact with Open Firmware (via the client interface), the client
>> needs to know what translations have been established by Open
>> Firmware. The following standard translation shall exist within
>> the
>> package to which the "mmu" property of the /chosen package refers.
>>
>> "Translations"
>> This property, consisting of sets of translations, defines the
>> currently active translations that have been established by Open
>> Firmware (e.g. using map). Each set has the following format:
>> (virt size phys mode)
>> Each value is encoded as with encode-int
>>
>>
>> As I said, it seems to run pretty quickly even though it's O(n),
>> however
>> I've only run it on a core 2 duo and a pentium 4, neither of which
>> are
>> particularly slow (the P4 is pushing it though :) )
>>
>> Cheers,
>>
>> James
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Pearpc-devel mailing list
>> Pea...@li...
>> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>>
>>
>>
>> --
>> Cassy
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php_______________________________________________
>> Pearpc-devel mailing list
>> Pea...@li...
>> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php_______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
|
|
From: Aaron F. <fi...@gm...> - 2008-06-10 08:17:18
|
can someone please finally take me off this list!?!?!?!? i have asked
at least a dozen times.
thank you!
On Jun 10, 2008, at 1:15 AM, Cassy Foesch wrote:
> Well, is this something "new" described my OpenBIOS, or is it
> actually something that was originally defined in OpenFirmware?
>
> 2008/6/10 James Molloy <jam...@tr...>:
> Cassy Foesch wrote:
> > This is an OpenBios feature? Or OpenFirmware? Or where are the
> > specifications written?
> >
> > Basically, the OpenFirmware implementation on PearPC is pretty
> buggy,
> > and incomplete. If it does just run twice, then it doesn't look
> like
> > there would be any problems with even an inefficient version
> running.
> > It sounds like it works pretty good, and I'll have to examine the
> > code a little more, but so far, it looks pretty good.
> >
> > 2008/6/9 James Molloy <jam...@tr...
> > <mailto:jam...@tr...>>:
> >
> > /Apologies for the possible repost - I checked the mailing list
> > archives
> > and my message didn't seem to appear, so I've now subscribed
> to the
> > mailing list to check if it does./
> >
> > Hi,
> >
> > I'm using PearPC to assist me in developing a hobby OS for the
> PowerPC
> > platform (in addition to real hardware) and noticed that PearPC
> > doesn't
> > expose the "translations" property of the MMU firmware device
> node.
> >
> > The translations property is documented in the OpenBios PowerPC
> > bindings
> > document and is aimed at helping the client program replicate
> the HTAB
> > before taking full control of memory management. I took the
> liberty of
> > creating this property myself.
> >
> > As far as I can tell, PearPC doesn't maintain an explicit list
> of
> > mmu->map() calls, so my algorithm searches the HTAB for every
> page in
> > the effective address space and manually constructs a list of
> > them. It's
> > O(n), but since it's only intended to be called twice (once
> from the
> > getproplen call and once from the getprop call) I don't see that
> > as much
> > of a handicap. It executes seemingly instantaneously on my
> Core2Duo
> > running the x86_64 JITC cpu.
> >
> > Anyway, let me know if it's not up to coding standard or there
> are too
> > few comments and I'll change them.
> >
> > Cheers,
> >
> > James Molloy
> >
> > Index: src/io/prom/promdt.cc
> > ==============================
> > =====================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> > retrieving revision 1.29
> > diff -u -r1.29 promdt.cc
> > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> > @@ -1032,6 +1032,95 @@
> > }
> > }
> >
> > +/*
> > + * PromPropMMU: Implements the MMU's "translations" property,
> > which allows
> > + * client programs to replicate the HTAB contents before
> taking over
> > + * memory management.
> > + */
> > +PromPropMMU::PromPropMMU(const char *aName)
> > + :PromProp(aName), nValidTranslations(0)
> > +{
> > +}
> > +
> > +PromPropMMU::~PromPropMMU()
> > +{
> > +}
> > +
> > +uint32 PromPropMMU::getValueLen()
> > +{
> > + calculateTranslations();
> > + return nValidTranslations*sizeof(Translation);
> > +}
> > +
> > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> > +{
> > + calculateTranslations();
> > + if (nValidTranslations*sizeof(Translation) < buflen)
> > + {
> > + buflen = nValidTranslations*sizeof(Translation);
> > + }
> > +
> > + // Convert all values to BE.
> > + for (int i = 0; i < nValidTranslations; i++)
> > + {
> > + translations[i].virt =
> ppc_word_to_BE(translations[i].virt);
> > + translations[i].phys =
> ppc_word_to_BE(translations[i].phys);
> > + translations[i].size =
> ppc_word_to_BE(translations[i].size);
> > + translations[i].mode =
> ppc_word_to_BE(translations[i].mode);
> > + }
> > +
> > + uint32 phys;
> > + ppc_prom_effective_to_physical(phys, buf);
> > + ppc_dma_write(phys, (void*)translations, buflen);
> > + return 0;
> > +}
> > +
> > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> > +{
> > + return -1;
> > +}
> > +
> > +void PromPropMMU::calculateTranslations()
> > +{
> > + nValidTranslations = 0;
> > + uint32 phys;
> > + // For every page in the address space, check for a mapping.
> > + for (uint32 i = 0; i <= 0xFFFFF; i++)
> > + {
> > + uint32 ea = i << 12;
> > + if (ppc_prom_effective_to_physical(phys, ea))
> > + {
> > + // A valid translation exists. Add to the translations
> list.
> > + addTranslation(ea, phys);
> > + }
> > + }
> > +}
> > +
> > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> > +{
> > + // Can the given translation be appended to translation
> > 'nValidTranslations-1'?
> > + if ( (nValidTranslations > 0) &&
> > + (translations[nValidTranslations-1].virt +
> > translations[nValidTranslations-1].size == ea) &&
> > + (translations[nValidTranslations-1].phys +
> > translations[nValidTranslations-1].size == phys) )
> > + {
> > + // Modify 'nValidTranslations'.
> > + translations[nValidTranslations-1].size += 0x1000;
> > + }
> > + else
> > + {
> > + // Else add a new translation.
> > + translations[nValidTranslations].virt = ea;
> > + translations[nValidTranslations].phys = phys;
> > + translations[nValidTranslations].size = 0x1000;
> > + translations[nValidTranslations].mode = 0x6a;
> > + nValidTranslations++;
> > + if (nValidTranslations == NUM_TRANSLATIONS)
> > + {
> > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too
> many
> > translations.");
> > + }
> > + }
> > +}
> > +
> > /
> *******************************************************************************
> > *
> > */
> > @@ -1111,6 +1200,8 @@
> > gPromRoot->addNode(cpus);
> > gPromRoot->addNode(kbd);
> >
> > + mmu->addProp(new PromPropMMU("translations"));
> > +
> > PromNode *cpu = new PromNode("PowerPC,G4");
> > cpus->addNode(cpu);
> > cpus->addProp(new PromPropInt("#size-cells", 0));
> > Index: src/io/prom/promdt.h
> >
> ===================================================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> > retrieving revision 1.3
> > diff -u -r1.3 promdt.h
> > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> > @@ -272,6 +272,30 @@
> > virtual uint32 setValue(uint32 buf, uint32
> buflen);
> > };
> >
> > +#define NUM_TRANSLATIONS 256
> > +class PromPropMMU: public PromProp {
> > +public:
> > + PromPropMMU(const char *name);
> > + virtual ~PromPropMMU();
> > +
> > + virtual uint32 getValueLen();
> > + virtual uint32 getValue(uint32 buf, uint32
> buflen);
> > + virtual uint32 setValue(uint32 buf, uint32
> buflen);
> > +
> > +private:
> > + void calculateTranslations();
> > + void addTranslation(uint32 ea, uint32 phys);
> > + struct Translation
> > + {
> > + uint32 virt;
> > + uint32 size;
> > + uint32 phys;
> > + uint32 mode;
> > + };
> > + Translation translations[NUM_TRANSLATIONS];
> > + uint32 nValidTranslations;
> > +};
> > +
> > #define FIND_DEVICE_FIND 0
> > #define FIND_DEVICE_OPEN 1
> > PromNode *findDevice(const char *aPathName, int type,
> > PromInstanceHandle *ret);
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > <mailto:Pea...@li...>
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> >
> >
> >
> > --
> > Cassy
> >
> ------------------------------------------------------------------------
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> >
> ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> Hi Cassy,
>
> Thanks for the reply. The property is described in the PPC binding for
> OpenBIOS, available at http://openbios.org/Bindings. To quote from
> section 5.1.7 - Memory management unit properties:
>
> To aid a client in "taking over" the translation mechanism and
> still
> interact with Open Firmware (via the client interface), the client
> needs to know what translations have been established by Open
> Firmware. The following standard translation shall exist within the
> package to which the "mmu" property of the /chosen package refers.
>
> "Translations"
> This property, consisting of sets of translations, defines the
> currently active translations that have been established by Open
> Firmware (e.g. using map). Each set has the following format:
> (virt size phys mode)
> Each value is encoded as with encode-int
>
>
> As I said, it seems to run pretty quickly even though it's O(n),
> however
> I've only run it on a core 2 duo and a pentium 4, neither of which are
> particularly slow (the P4 is pushing it though :) )
>
> Cheers,
>
> James
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
>
>
> --
> Cassy
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php_______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
|
|
From: Cassy F. <pue...@go...> - 2008-06-10 08:15:32
|
Well, is this something "new" described my OpenBIOS, or is it actually
something that was originally defined in OpenFirmware?
2008/6/10 James Molloy <jam...@tr...>:
> Cassy Foesch wrote:
> > This is an OpenBios feature? Or OpenFirmware? Or where are the
> > specifications written?
> >
> > Basically, the OpenFirmware implementation on PearPC is pretty buggy,
> > and incomplete. If it does just run twice, then it doesn't look like
> > there would be any problems with even an inefficient version running.
> > It sounds like it works pretty good, and I'll have to examine the
> > code a little more, but so far, it looks pretty good.
> >
> > 2008/6/9 James Molloy <jam...@tr...
> > <mailto:jam...@tr...>>:
> >
> > /Apologies for the possible repost - I checked the mailing list
> > archives
> > and my message didn't seem to appear, so I've now subscribed to the
> > mailing list to check if it does./
> >
> > Hi,
> >
> > I'm using PearPC to assist me in developing a hobby OS for the
> PowerPC
> > platform (in addition to real hardware) and noticed that PearPC
> > doesn't
> > expose the "translations" property of the MMU firmware device node.
> >
> > The translations property is documented in the OpenBios PowerPC
> > bindings
> > document and is aimed at helping the client program replicate the
> HTAB
> > before taking full control of memory management. I took the liberty
> of
> > creating this property myself.
> >
> > As far as I can tell, PearPC doesn't maintain an explicit list of
> > mmu->map() calls, so my algorithm searches the HTAB for every page in
> > the effective address space and manually constructs a list of
> > them. It's
> > O(n), but since it's only intended to be called twice (once from the
> > getproplen call and once from the getprop call) I don't see that
> > as much
> > of a handicap. It executes seemingly instantaneously on my Core2Duo
> > running the x86_64 JITC cpu.
> >
> > Anyway, let me know if it's not up to coding standard or there are
> too
> > few comments and I'll change them.
> >
> > Cheers,
> >
> > James Molloy
> >
> > Index: src/io/prom/promdt.cc
> > ==============================
> > =====================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> > retrieving revision 1.29
> > diff -u -r1.29 promdt.cc
> > --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> > +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> > @@ -1032,6 +1032,95 @@
> > }
> > }
> >
> > +/*
> > + * PromPropMMU: Implements the MMU's "translations" property,
> > which allows
> > + * client programs to replicate the HTAB contents before taking over
> > + * memory management.
> > + */
> > +PromPropMMU::PromPropMMU(const char *aName)
> > + :PromProp(aName), nValidTranslations(0)
> > +{
> > +}
> > +
> > +PromPropMMU::~PromPropMMU()
> > +{
> > +}
> > +
> > +uint32 PromPropMMU::getValueLen()
> > +{
> > + calculateTranslations();
> > + return nValidTranslations*sizeof(Translation);
> > +}
> > +
> > +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> > +{
> > + calculateTranslations();
> > + if (nValidTranslations*sizeof(Translation) < buflen)
> > + {
> > + buflen = nValidTranslations*sizeof(Translation);
> > + }
> > +
> > + // Convert all values to BE.
> > + for (int i = 0; i < nValidTranslations; i++)
> > + {
> > + translations[i].virt = ppc_word_to_BE(translations[i].virt);
> > + translations[i].phys = ppc_word_to_BE(translations[i].phys);
> > + translations[i].size = ppc_word_to_BE(translations[i].size);
> > + translations[i].mode = ppc_word_to_BE(translations[i].mode);
> > + }
> > +
> > + uint32 phys;
> > + ppc_prom_effective_to_physical(phys, buf);
> > + ppc_dma_write(phys, (void*)translations, buflen);
> > + return 0;
> > +}
> > +
> > +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> > +{
> > + return -1;
> > +}
> > +
> > +void PromPropMMU::calculateTranslations()
> > +{
> > + nValidTranslations = 0;
> > + uint32 phys;
> > + // For every page in the address space, check for a mapping.
> > + for (uint32 i = 0; i <= 0xFFFFF; i++)
> > + {
> > + uint32 ea = i << 12;
> > + if (ppc_prom_effective_to_physical(phys, ea))
> > + {
> > + // A valid translation exists. Add to the translations list.
> > + addTranslation(ea, phys);
> > + }
> > + }
> > +}
> > +
> > +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> > +{
> > + // Can the given translation be appended to translation
> > 'nValidTranslations-1'?
> > + if ( (nValidTranslations > 0) &&
> > + (translations[nValidTranslations-1].virt +
> > translations[nValidTranslations-1].size == ea) &&
> > + (translations[nValidTranslations-1].phys +
> > translations[nValidTranslations-1].size == phys) )
> > + {
> > + // Modify 'nValidTranslations'.
> > + translations[nValidTranslations-1].size += 0x1000;
> > + }
> > + else
> > + {
> > + // Else add a new translation.
> > + translations[nValidTranslations].virt = ea;
> > + translations[nValidTranslations].phys = phys;
> > + translations[nValidTranslations].size = 0x1000;
> > + translations[nValidTranslations].mode = 0x6a;
> > + nValidTranslations++;
> > + if (nValidTranslations == NUM_TRANSLATIONS)
> > + {
> > + IO_PROM_ERR("PromPropMMU::calculateTranslations - too many
> > translations.");
> > + }
> > + }
> > +}
> > +
> >
> /*******************************************************************************
> > *
> > */
> > @@ -1111,6 +1200,8 @@
> > gPromRoot->addNode(cpus);
> > gPromRoot->addNode(kbd);
> >
> > + mmu->addProp(new PromPropMMU("translations"));
> > +
> > PromNode *cpu = new PromNode("PowerPC,G4");
> > cpus->addNode(cpu);
> > cpus->addProp(new PromPropInt("#size-cells", 0));
> > Index: src/io/prom/promdt.h
> > ===================================================================
> > RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> > retrieving revision 1.3
> > diff -u -r1.3 promdt.h
> > --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> > +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> > @@ -272,6 +272,30 @@
> > virtual uint32 setValue(uint32 buf, uint32 buflen);
> > };
> >
> > +#define NUM_TRANSLATIONS 256
> > +class PromPropMMU: public PromProp {
> > +public:
> > + PromPropMMU(const char *name);
> > + virtual ~PromPropMMU();
> > +
> > + virtual uint32 getValueLen();
> > + virtual uint32 getValue(uint32 buf, uint32
> buflen);
> > + virtual uint32 setValue(uint32 buf, uint32 buflen);
> > +
> > +private:
> > + void calculateTranslations();
> > + void addTranslation(uint32 ea, uint32 phys);
> > + struct Translation
> > + {
> > + uint32 virt;
> > + uint32 size;
> > + uint32 phys;
> > + uint32 mode;
> > + };
> > + Translation translations[NUM_TRANSLATIONS];
> > + uint32 nValidTranslations;
> > +};
> > +
> > #define FIND_DEVICE_FIND 0
> > #define FIND_DEVICE_OPEN 1
> > PromNode *findDevice(const char *aPathName, int type,
> > PromInstanceHandle *ret);
> >
> >
> -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > <mailto:Pea...@li...>
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> >
> >
> >
> > --
> > Cassy
> > ------------------------------------------------------------------------
> >
> > -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Pearpc-devel mailing list
> > Pea...@li...
> > https://lists.sourceforge.net/lists/listinfo/pearpc-devel
> >
> Hi Cassy,
>
> Thanks for the reply. The property is described in the PPC binding for
> OpenBIOS, available at http://openbios.org/Bindings. To quote from
> section 5.1.7 - Memory management unit properties:
>
> To aid a client in "taking over" the translation mechanism and still
> interact with Open Firmware (via the client interface), the client
> needs to know what translations have been established by Open
> Firmware. The following standard translation shall exist within the
> package to which the "mmu" property of the /chosen package refers.
>
> "Translations"
> This property, consisting of sets of translations, defines the
> currently active translations that have been established by Open
> Firmware (e.g. using map). Each set has the following format:
> (virt size phys mode)
> Each value is encoded as with encode-int
>
>
> As I said, it seems to run pretty quickly even though it's O(n), however
> I've only run it on a core 2 duo and a pentium 4, neither of which are
> particularly slow (the P4 is pushing it though :) )
>
> Cheers,
>
> James
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
--
Cassy
|
|
From: James M. <jam...@tr...> - 2008-06-10 07:26:00
|
Cassy Foesch wrote:
> This is an OpenBios feature? Or OpenFirmware? Or where are the
> specifications written?
>
> Basically, the OpenFirmware implementation on PearPC is pretty buggy,
> and incomplete. If it does just run twice, then it doesn't look like
> there would be any problems with even an inefficient version running.
> It sounds like it works pretty good, and I'll have to examine the
> code a little more, but so far, it looks pretty good.
>
> 2008/6/9 James Molloy <jam...@tr...
> <mailto:jam...@tr...>>:
>
> /Apologies for the possible repost - I checked the mailing list
> archives
> and my message didn't seem to appear, so I've now subscribed to the
> mailing list to check if it does./
>
> Hi,
>
> I'm using PearPC to assist me in developing a hobby OS for the PowerPC
> platform (in addition to real hardware) and noticed that PearPC
> doesn't
> expose the "translations" property of the MMU firmware device node.
>
> The translations property is documented in the OpenBios PowerPC
> bindings
> document and is aimed at helping the client program replicate the HTAB
> before taking full control of memory management. I took the liberty of
> creating this property myself.
>
> As far as I can tell, PearPC doesn't maintain an explicit list of
> mmu->map() calls, so my algorithm searches the HTAB for every page in
> the effective address space and manually constructs a list of
> them. It's
> O(n), but since it's only intended to be called twice (once from the
> getproplen call and once from the getprop call) I don't see that
> as much
> of a handicap. It executes seemingly instantaneously on my Core2Duo
> running the x86_64 JITC cpu.
>
> Anyway, let me know if it's not up to coding standard or there are too
> few comments and I'll change them.
>
> Cheers,
>
> James Molloy
>
> Index: src/io/prom/promdt.cc
> ==============================
> =====================================
> RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> retrieving revision 1.29
> diff -u -r1.29 promdt.cc
> --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> @@ -1032,6 +1032,95 @@
> }
> }
>
> +/*
> + * PromPropMMU: Implements the MMU's "translations" property,
> which allows
> + * client programs to replicate the HTAB contents before taking over
> + * memory management.
> + */
> +PromPropMMU::PromPropMMU(const char *aName)
> + :PromProp(aName), nValidTranslations(0)
> +{
> +}
> +
> +PromPropMMU::~PromPropMMU()
> +{
> +}
> +
> +uint32 PromPropMMU::getValueLen()
> +{
> + calculateTranslations();
> + return nValidTranslations*sizeof(Translation);
> +}
> +
> +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> +{
> + calculateTranslations();
> + if (nValidTranslations*sizeof(Translation) < buflen)
> + {
> + buflen = nValidTranslations*sizeof(Translation);
> + }
> +
> + // Convert all values to BE.
> + for (int i = 0; i < nValidTranslations; i++)
> + {
> + translations[i].virt = ppc_word_to_BE(translations[i].virt);
> + translations[i].phys = ppc_word_to_BE(translations[i].phys);
> + translations[i].size = ppc_word_to_BE(translations[i].size);
> + translations[i].mode = ppc_word_to_BE(translations[i].mode);
> + }
> +
> + uint32 phys;
> + ppc_prom_effective_to_physical(phys, buf);
> + ppc_dma_write(phys, (void*)translations, buflen);
> + return 0;
> +}
> +
> +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> +{
> + return -1;
> +}
> +
> +void PromPropMMU::calculateTranslations()
> +{
> + nValidTranslations = 0;
> + uint32 phys;
> + // For every page in the address space, check for a mapping.
> + for (uint32 i = 0; i <= 0xFFFFF; i++)
> + {
> + uint32 ea = i << 12;
> + if (ppc_prom_effective_to_physical(phys, ea))
> + {
> + // A valid translation exists. Add to the translations list.
> + addTranslation(ea, phys);
> + }
> + }
> +}
> +
> +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> +{
> + // Can the given translation be appended to translation
> 'nValidTranslations-1'?
> + if ( (nValidTranslations > 0) &&
> + (translations[nValidTranslations-1].virt +
> translations[nValidTranslations-1].size == ea) &&
> + (translations[nValidTranslations-1].phys +
> translations[nValidTranslations-1].size == phys) )
> + {
> + // Modify 'nValidTranslations'.
> + translations[nValidTranslations-1].size += 0x1000;
> + }
> + else
> + {
> + // Else add a new translation.
> + translations[nValidTranslations].virt = ea;
> + translations[nValidTranslations].phys = phys;
> + translations[nValidTranslations].size = 0x1000;
> + translations[nValidTranslations].mode = 0x6a;
> + nValidTranslations++;
> + if (nValidTranslations == NUM_TRANSLATIONS)
> + {
> + IO_PROM_ERR("PromPropMMU::calculateTranslations - too many
> translations.");
> + }
> + }
> +}
> +
> /*******************************************************************************
> *
> */
> @@ -1111,6 +1200,8 @@
> gPromRoot->addNode(cpus);
> gPromRoot->addNode(kbd);
>
> + mmu->addProp(new PromPropMMU("translations"));
> +
> PromNode *cpu = new PromNode("PowerPC,G4");
> cpus->addNode(cpu);
> cpus->addProp(new PromPropInt("#size-cells", 0));
> Index: src/io/prom/promdt.h
> ===================================================================
> RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> retrieving revision 1.3
> diff -u -r1.3 promdt.h
> --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> @@ -272,6 +272,30 @@
> virtual uint32 setValue(uint32 buf, uint32 buflen);
> };
>
> +#define NUM_TRANSLATIONS 256
> +class PromPropMMU: public PromProp {
> +public:
> + PromPropMMU(const char *name);
> + virtual ~PromPropMMU();
> +
> + virtual uint32 getValueLen();
> + virtual uint32 getValue(uint32 buf, uint32 buflen);
> + virtual uint32 setValue(uint32 buf, uint32 buflen);
> +
> +private:
> + void calculateTranslations();
> + void addTranslation(uint32 ea, uint32 phys);
> + struct Translation
> + {
> + uint32 virt;
> + uint32 size;
> + uint32 phys;
> + uint32 mode;
> + };
> + Translation translations[NUM_TRANSLATIONS];
> + uint32 nValidTranslations;
> +};
> +
> #define FIND_DEVICE_FIND 0
> #define FIND_DEVICE_OPEN 1
> PromNode *findDevice(const char *aPathName, int type,
> PromInstanceHandle *ret);
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> <mailto:Pea...@li...>
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
>
>
>
> --
> Cassy
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
Hi Cassy,
Thanks for the reply. The property is described in the PPC binding for
OpenBIOS, available at http://openbios.org/Bindings. To quote from
section 5.1.7 - Memory management unit properties:
To aid a client in "taking over" the translation mechanism and still
interact with Open Firmware (via the client interface), the client
needs to know what translations have been established by Open
Firmware. The following standard translation shall exist within the
package to which the "mmu" property of the /chosen package refers.
"Translations"
This property, consisting of sets of translations, defines the
currently active translations that have been established by Open
Firmware (e.g. using map). Each set has the following format:
(virt size phys mode)
Each value is encoded as with encode-int
As I said, it seems to run pretty quickly even though it's O(n), however
I've only run it on a core 2 duo and a pentium 4, neither of which are
particularly slow (the P4 is pushing it though :) )
Cheers,
James
|
|
From: Cassy F. <pue...@go...> - 2008-06-09 23:22:38
|
This is an OpenBios feature? Or OpenFirmware? Or where are the
specifications written?
Basically, the OpenFirmware implementation on PearPC is pretty buggy, and
incomplete. If it does just run twice, then it doesn't look like there
would be any problems with even an inefficient version running. It sounds
like it works pretty good, and I'll have to examine the code a little more,
but so far, it looks pretty good.
2008/6/9 James Molloy <jam...@tr...>:
> /Apologies for the possible repost - I checked the mailing list archives
> and my message didn't seem to appear, so I've now subscribed to the
> mailing list to check if it does./
>
> Hi,
>
> I'm using PearPC to assist me in developing a hobby OS for the PowerPC
> platform (in addition to real hardware) and noticed that PearPC doesn't
> expose the "translations" property of the MMU firmware device node.
>
> The translations property is documented in the OpenBios PowerPC bindings
> document and is aimed at helping the client program replicate the HTAB
> before taking full control of memory management. I took the liberty of
> creating this property myself.
>
> As far as I can tell, PearPC doesn't maintain an explicit list of
> mmu->map() calls, so my algorithm searches the HTAB for every page in
> the effective address space and manually constructs a list of them. It's
> O(n), but since it's only intended to be called twice (once from the
> getproplen call and once from the getprop call) I don't see that as much
> of a handicap. It executes seemingly instantaneously on my Core2Duo
> running the x86_64 JITC cpu.
>
> Anyway, let me know if it's not up to coding standard or there are too
> few comments and I'll change them.
>
> Cheers,
>
> James Molloy
>
> Index: src/io/prom/promdt.cc
> ==============================
> =====================================
> RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.cc,v
> retrieving revision 1.29
> diff -u -r1.29 promdt.cc
> --- src/io/prom/promdt.cc 16 Aug 2005 12:26:43 -0000 1.29
> +++ src/io/prom/promdt.cc 8 Jun 2008 09:48:24 -0000
> @@ -1032,6 +1032,95 @@
> }
> }
>
> +/*
> + * PromPropMMU: Implements the MMU's "translations" property, which allows
> + * client programs to replicate the HTAB contents before taking over
> + * memory management.
> + */
> +PromPropMMU::PromPropMMU(const char *aName)
> + :PromProp(aName), nValidTranslations(0)
> +{
> +}
> +
> +PromPropMMU::~PromPropMMU()
> +{
> +}
> +
> +uint32 PromPropMMU::getValueLen()
> +{
> + calculateTranslations();
> + return nValidTranslations*sizeof(Translation);
> +}
> +
> +uint32 PromPropMMU::getValue(uint32 buf, uint32 buflen)
> +{
> + calculateTranslations();
> + if (nValidTranslations*sizeof(Translation) < buflen)
> + {
> + buflen = nValidTranslations*sizeof(Translation);
> + }
> +
> + // Convert all values to BE.
> + for (int i = 0; i < nValidTranslations; i++)
> + {
> + translations[i].virt = ppc_word_to_BE(translations[i].virt);
> + translations[i].phys = ppc_word_to_BE(translations[i].phys);
> + translations[i].size = ppc_word_to_BE(translations[i].size);
> + translations[i].mode = ppc_word_to_BE(translations[i].mode);
> + }
> +
> + uint32 phys;
> + ppc_prom_effective_to_physical(phys, buf);
> + ppc_dma_write(phys, (void*)translations, buflen);
> + return 0;
> +}
> +
> +uint32 PromPropMMU::setValue(uint32 buf, uint32 buflen)
> +{
> + return -1;
> +}
> +
> +void PromPropMMU::calculateTranslations()
> +{
> + nValidTranslations = 0;
> + uint32 phys;
> + // For every page in the address space, check for a mapping.
> + for (uint32 i = 0; i <= 0xFFFFF; i++)
> + {
> + uint32 ea = i << 12;
> + if (ppc_prom_effective_to_physical(phys, ea))
> + {
> + // A valid translation exists. Add to the translations list.
> + addTranslation(ea, phys);
> + }
> + }
> +}
> +
> +void PromPropMMU::addTranslation(uint32 ea, uint32 phys)
> +{
> + // Can the given translation be appended to translation
> 'nValidTranslations-1'?
> + if ( (nValidTranslations > 0) &&
> + (translations[nValidTranslations-1].virt +
> translations[nValidTranslations-1].size == ea) &&
> + (translations[nValidTranslations-1].phys +
> translations[nValidTranslations-1].size == phys) )
> + {
> + // Modify 'nValidTranslations'.
> + translations[nValidTranslations-1].size += 0x1000;
> + }
> + else
> + {
> + // Else add a new translation.
> + translations[nValidTranslations].virt = ea;
> + translations[nValidTranslations].phys = phys;
> + translations[nValidTranslations].size = 0x1000;
> + translations[nValidTranslations].mode = 0x6a;
> + nValidTranslations++;
> + if (nValidTranslations == NUM_TRANSLATIONS)
> + {
> + IO_PROM_ERR("PromPropMMU::calculateTranslations - too many
> translations.");
> + }
> + }
> +}
> +
>
> /*******************************************************************************
> *
> */
> @@ -1111,6 +1200,8 @@
> gPromRoot->addNode(cpus);
> gPromRoot->addNode(kbd);
>
> + mmu->addProp(new PromPropMMU("translations"));
> +
> PromNode *cpu = new PromNode("PowerPC,G4");
> cpus->addNode(cpu);
> cpus->addProp(new PromPropInt("#size-cells", 0));
> Index: src/io/prom/promdt.h
> ===================================================================
> RCS file: /cvsroot/pearpc/pearpc/src/io/prom/promdt.h,v
> retrieving revision 1.3
> diff -u -r1.3 promdt.h
> --- src/io/prom/promdt.h 21 May 2004 22:29:43 -0000 1.3
> +++ src/io/prom/promdt.h 8 Jun 2008 09:48:24 -0000
> @@ -272,6 +272,30 @@
> virtual uint32 setValue(uint32 buf, uint32 buflen);
> };
>
> +#define NUM_TRANSLATIONS 256
> +class PromPropMMU: public PromProp {
> +public:
> + PromPropMMU(const char *name);
> + virtual ~PromPropMMU();
> +
> + virtual uint32 getValueLen();
> + virtual uint32 getValue(uint32 buf, uint32 buflen);
> + virtual uint32 setValue(uint32 buf, uint32 buflen);
> +
> +private:
> + void calculateTranslations();
> + void addTranslation(uint32 ea, uint32 phys);
> + struct Translation
> + {
> + uint32 virt;
> + uint32 size;
> + uint32 phys;
> + uint32 mode;
> + };
> + Translation translations[NUM_TRANSLATIONS];
> + uint32 nValidTranslations;
> +};
> +
> #define FIND_DEVICE_FIND 0
> #define FIND_DEVICE_OPEN 1
> PromNode *findDevice(const char *aPathName, int type,
> PromInstanceHandle *ret);
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Pearpc-devel mailing list
> Pea...@li...
> https://lists.sourceforge.net/lists/listinfo/pearpc-devel
>
--
Cassy
|
|
From: Alex S. <al...@al...> - 2008-06-09 17:47:29
|
Just a test message, someone I know is unable to send to the list. If this gets through, ignore it. |