NeXT Computers Forum Index NeXT Computers
www.NeXTComputers.org
 
Log in to check your private messagesLog in to check your private messages

Log inLog in  RegisterRegister


Profile  Search  Memberlist  FAQ  Usergroups
f2c & dungeon
Goto page 1, 2  Next
 
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software
View previous topic :: View next topic  
Author Message
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Sun Sep 27, 2009 10:51 am    Post subject: f2c & dungeon Reply with quote

I was playing with f2c (the fortran to c translator) and I managed to whip up a quad cpu build of f2c, and dungeon (ie zork!).

You can find it here:
http://vpsland.superglobalmegacorp.com/install/f2c/dungeon-2.5.6-i386-m68k-sparc-hppa-nextstep.tar.gz

This combines all the source, and the built exe's and lib all in quad cpu format. I had to tweak makefiles and whatnot, but it builds quickly on my 2.6Ghz p4. I can confirm the i386 & m68k work, but I don't have any sparc/hppa to test with, but they are built.

I didn't make a package as you kind of have to know your way around the source to get anything out of it. But speaking of all the fotran, was there ever any fortran compilers for the next?

Anyways, here is a 'screen cap' of dungeon in action!
Code:
nextcube> file dungeon
dungeon:        fat file with 4 architecture(s)
dungeon (for architecture i386):        Mach-O executable
dungeon (for architecture m68k):        Mach-O executable
dungeon (for architecture hppa):        Mach-O executable
dungeon (for architecture sparc):       Mach-O executable
nextcube> ls -l dungeon
-rwxr-xr-x  1 neozeed   1368064 Sep 27 13:41 dungeon*
nextcube> size dungeon
__TEXT  __DATA  __OBJC  others  dec     hex
245760  65536   0       8192    319488  4e000
nextcube> ./dungeon
 Welcome to Dungeon.                    This version created 30-AUG-90.
 You are in an open field west of a big white house with a boarded
 front door.
 There is a small mailbox here.
 >

_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
helf



Joined: 29 Dec 2005
Posts: 1097
Location: Alabama, USA

PostPosted: Sun Sep 27, 2009 11:31 pm    Post subject: Reply with quote

nice! can you whip up one with the other zork games? Very Happy
_________________
*INACTIVE*
Back to top
View user's profile Send private message AIM Address
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Mon Sep 28, 2009 6:34 am    Post subject: Reply with quote

helf wrote:
nice! can you whip up one with the other zork games? Very Happy


frotz is a great interpreter, it should be trivial to slap one together...

What I should be asking for is if someone with OSX on an i386 could download, configure & build SDL-1.2.13 and then send me the tar of all the source objects etc etc....

I think there is enough NeXT in there for a rudamentary port of SDL to nextstep i386 but I'm not all that sure......

I got SDL to build & run on NT 3.5 after stripping out all the win32 stuff that NT 3.5 doesn't have, and now I've got quake running....

Needless to say SDL would give us LOTS of new & exciting stuff (quake!).
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
iDork



Joined: 18 Jan 2006
Posts: 62
Location: Kirkland, WA

PostPosted: Tue Sep 29, 2009 9:23 pm    Post subject: SDL Build Folder Reply with quote

Here are the build folders for SDL-1.2.13:

Command line Xcode 2.5: http://files.me.com/alexjfp/lh375z;
Xcode 2.5 IDE, i386 framework & static library targets without X11: http://files.me.com/alexjfp/hvtye3;

I'd be happy to produce some more specific builds if you post instructions. I still have no idea how you could use the object files for a NeXTSTEP build, though.

Alex
_________________
NS TurboColor, SparcStation 5, Ultra 10, Octane SSI, HP 9000 C110, AlphaStation 200, Apple IIgs|IIe|IIc, Amiga 500+|600|1200, Commodore 64|128
Back to top
View user's profile Send private message
helf



Joined: 29 Dec 2005
Posts: 1097
Location: Alabama, USA

PostPosted: Tue Sep 29, 2009 9:26 pm    Post subject: Reply with quote

oh man, playing Quake 1 on my NeXT would be absolutely amazing.
_________________
*INACTIVE*
Back to top
View user's profile Send private message AIM Address
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Wed Sep 30, 2009 4:16 am    Post subject: Re: SDL Build Folder Reply with quote

iDork wrote:
Here are the build folders for SDL-1.2.13:

Command line Xcode 2.5: http://files.me.com/alexjfp/lh375z;
Xcode 2.5 IDE, i386 framework & static library targets without X11: http://files.me.com/alexjfp/hvtye3;

I'd be happy to produce some more specific builds if you post instructions. I still have no idea how you could use the object files for a NeXTSTEP build, though.

Alex

What I also need is the source as it stood configured, along with everything built....

I know this sounds odd... but bear with me.

FWIW this 'helps' in that with the source configured I can just run the next tools on the same thing as well and start to canabalize the parts out that are too osx specific...

I can't promise much, but using the same thing from vista I was able to get SDL to build with visual c++ 2.0 and thus my port of quake to the MIPS for NT 4.0 & i386 for NT 3.5...
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Wed Sep 30, 2009 4:17 am    Post subject: Reply with quote

helf wrote:
oh man, playing Quake 1 on my NeXT would be absolutely amazing.


I don't think the 68040 would have the power.....

however a 'modern' white box, or under some good emulation should prove fast enough....
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
iDork



Joined: 18 Jan 2006
Posts: 62
Location: Kirkland, WA

PostPosted: Wed Sep 30, 2009 7:08 am    Post subject: Re: SDL Build Folder Reply with quote

neozeed wrote:
iDork wrote:
Here are the build folders for SDL-1.2.13:

Command line Xcode 2.5: http://files.me.com/alexjfp/lh375z;
Xcode 2.5 IDE, i386 framework & static library targets without X11: http://files.me.com/alexjfp/hvtye3;

I'd be happy to produce some more specific builds if you post instructions. I still have no idea how you could use the object files for a NeXTSTEP build, though.

Alex

What I also need is the source as it stood configured, along with everything built....

I know this sounds odd... but bear with me.

FWIW this 'helps' in that with the source configured I can just run the next tools on the same thing as well and start to canabalize the parts out that are too osx specific...

I can't promise much, but using the same thing from vista I was able to get SDL to build with visual c++ 2.0 and thus my port of quake to the MIPS for NT 4.0 & i386 for NT 3.5...


OK, here's a ZIP file of the entire SDL-1.2.13 folder after running "./configure" & "make":

http://files.me.com/alexjfp/d2labh

If this procedure works, it can be used to compile a more recent version of gcc for OPENSTEP & Mac OS X Server 1.x, I guess. I have unsuccessfully tried to build newer versions before. On the other hand, the version of gcc that ships with OPENSTEP 4.2/Mac OS X Server 1.2 can't even build itself from the sources it ships with.
_________________
NS TurboColor, SparcStation 5, Ultra 10, Octane SSI, HP 9000 C110, AlphaStation 200, Apple IIgs|IIe|IIc, Amiga 500+|600|1200, Commodore 64|128
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Wed Sep 30, 2009 7:42 am    Post subject: Re: SDL Build Folder Reply with quote

iDork wrote:
neozeed wrote:
iDork wrote:
Here are the build folders for SDL-1.2.13:

Command line Xcode 2.5: http://files.me.com/alexjfp/lh375z;
Xcode 2.5 IDE, i386 framework & static library targets without X11: http://files.me.com/alexjfp/hvtye3;

I'd be happy to produce some more specific builds if you post instructions. I still have no idea how you could use the object files for a NeXTSTEP build, though.

Alex

What I also need is the source as it stood configured, along with everything built....

I know this sounds odd... but bear with me.

FWIW this 'helps' in that with the source configured I can just run the next tools on the same thing as well and start to canabalize the parts out that are too osx specific...

I can't promise much, but using the same thing from vista I was able to get SDL to build with visual c++ 2.0 and thus my port of quake to the MIPS for NT 4.0 & i386 for NT 3.5...


OK, here's a ZIP file of the entire SDL-1.2.13 folder after running "./configure" & "make":

http://files.me.com/alexjfp/d2labh

If this procedure works, it can be used to compile a more recent version of gcc for OPENSTEP & Mac OS X Server 1.x, I guess. I have unsuccessfully tried to build newer versions before. On the other hand, the version of gcc that ships with OPENSTEP 4.2/Mac OS X Server 1.2 can't even build itself from the sources it ships with.


*MAYBE*.....

I've been wondering what is involved with doing a cross compiler... I know for other things it's somewhat straight forward... I even had a linux i386 -> AIX rs/6000 cross compiler that I used for all my class work but OSX & NeXTSTEP/OPENSTEP are a creature somewhat off the GNU track...

At one point I had hacked pcc enough to start to biuld stuff on nextstep... I havent looked at it in a long while, but I'd probably look at pcc 1st.
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Wed Sep 30, 2009 7:47 am    Post subject: cross gcc Reply with quote

I should add I have some notes on doing a cross gcc in my less then exciting blog:

http://virtuallyfun.blogspot.com/2007/05/psim-powerpc-simulator.html

------
Quote:
Psim is one of those great peices of software that has been long sice forgotten. In every copy of GDB since 4.14 it has been sitting there dormant. What is it? Well it'll emulate various PowerPC systems to some degree (GXemul & Qemu are better now) but what is cool is the 'run' program. Simply put, any system that can run GDB can *run* powerpc NetBSD statically linked EXE's! Now isn't that exciting!



Now I know you'll want to build your own copy of the 'run' program, and then setup a cross compile enviroment so that you, to can produce NetBSD PowerPC executables. I'm assuming that you are *not* on a PowerPC running NetBSD, since this whole excersize would be... redundant.


For this example I'm using OpenBSD 4.0 on the i386. You will *need* a real unixy envioment for this. MinGW isn't good enough, cygwin however is. *BSD/*Linux will work too.



Ok first let's start with building the run program. I'm going to download my GDB from ftp://ftp.gnu.org/ .



Gdb 5.3



Unpack it somewhere, and then run the following commadn to configure GDB.
./configure –enable-sim-powerpc –target=powerpc-unknown-eabi –prefix=/usr/local/psim




You will need to replace or update the sim/ppc/emul_netbsd.c program to include system calls up to 300, and make sure that 279 is setup to do_fstat. Otherwise you will be unable to run any programs. This is also a good excersize to see how libraries interact with the simulator so you can add your own native interfaces, for things like OpenGL, SDL....




Now we are ready to build it.. You could use -O0 in your CFLAGS to build it quicker, but it will result in a slower run times.. If you have issues with this you will want to use those flags so it doesnt take *forever* to be building this thing. Otherwise a simple 'make;make install' will suffice.



Next up is binutils. I'm using version 2.17


Binutils 2.17



Again download and unpack this somewhere (/usr/src?) Then run the following to configure your binutils


./configure –target=powerpc-unknown-netbsd –prefix=/usr/local/psim


Since execution time here isn't as critical as the emulator, and I want to hurry it along I'm going to use the following command to build & install:


make CFLAGS=’-O0 –pipe’ ;make install

On OpenBSD 4.1 the install fails, and I had to manually copy the binutils applications into /usr/local/psim/powerpc-unknown-netbsd-bin

Before you build gcc you will want to populate your directory with headers & libraries from NetBSD 1.4 get the compiler package and copy the usr/lib files to /usr/local/psim/powerpc-unknown-netbsd/lib and the usr/include files to /usr/local/psim/include . I get my includes & lib files from here ( ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-archive/NetBSD-1.4/macppc/binary/sets/comp.tgz )

Gcc 3.3

You may need to do some special tweaking to this source to get it to run correctly
Optionally running make with CFLAGS=-O0 may speed your compliation.


You know the drill by now. Download, unpack and configure as follows:


./configure –target=powerpc-unknown-netbsd –prefix=/usr/local/psim --disable-shared --enable-languages="c" --disable-threads --disable-intl


Now make the compiler as follows. Note that I'm only interested in the C compiler. I haven't even looked at C++/ObjectiveC...

You will need to add /usr/local/psim/bin into your path, as Gcc 3.3 will expext to be able to call powerpc-unknown-netbsd-ld/ar/ranlib etc while building itself.


export PATH=$PATH:/usr/local/psim/bin

Next I would comment out the following line from gcc/builtins.c

builtins.c:2864:// error ("__builtin_saveregs not supported by this target");



Now we can build the compiler


make CFLAGS=’-O0 –pipe’

Now before we get all giddy, lets test this thing out!

cd into the gcc directory, and lets make a simple c program... hello world is a good starting place.

use xgcc to compile it, and this will test your c compiler.


#include

void main(void)

{

printf("hello from PowerPC\n");

}


bash-2.05a$ xgcc hello.c -o hello

hello.c: In function `main':hello.c:2: warning: return type of `main' is not `int'

bash-2.05a$ file hello

hello: ELF 32-bit MSB executable Version 1

bash-2.05a$ ./hello

bash: ./hello: cannot execute binary file

Ok the executable that we have just created is *NOT* for our native platform, but for the PowerPC.. So lets kick in the emulator! If you didn't patch your emul_netbsd.c you'll get this:

% /usr/local/psim/bin/powerpc-unknown-eabi-psim hello

do_call() os_emul call 279 out-of-range


However if you did, this is what you'll get!


% /usr/local/psim/bin/powerpc-unknown-eabi-psim hello
hello from PowerPC

On my computer the installation of gcc gets retarded so I manually copy the files to the right places.

cp xgcc to /usr/local/psim/bin/powerpc-unknown-netbsd-gcc

mkdir -p /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/

cp cc1 /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/

cp crtsaveres.o /usr/local/psim/lib/gcc-lib/powerpc-unknown-netbsd/3.3/


Building cross compilers is always involved, but hopefully this will help someone.

_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Sat Oct 03, 2009 7:33 am    Post subject: Reply with quote

I thought I'd share I'm making *SOME* progress here...

I'm building this like this:

Code:
gmake EXTRA_CFLAGS="-I./include -D_GNU_SOURCE=1 -DTARGET_API_MAC_OSX
" CFLAGS="-O0 -pipe -posix"


And here is my progress so far..... It's building more than I had thought which is good, I've got to remove all the OpenGL & x11 components from the build.... But the system stuff looks built.
Code:


.libs                SDL_audiodev.o       SDL_mixer.lo
SDL.lo               SDL_cdrom.lo         SDL_mixer.o
SDL.o                SDL_cdrom.o          SDL_mixer_MMX.lo
SDL_active.lo        SDL_cpuinfo.lo       SDL_mixer_MMX.o
SDL_active.o         SDL_cpuinfo.o        SDL_mixer_MMX_VC.lo
SDL_audio.lo         SDL_error.lo         SDL_mixer_MMX_VC.o
SDL_audio.o          SDL_error.o          SDL_mixer_m68k.lo
SDL_audiocvt.lo      SDL_events.loT       SDL_mixer_m68k.o
SDL_audiocvt.o       SDL_fatal.lo         SDL_wave.lo
SDL_audiodev.lo      SDL_fatal.o          SDL_wave.o



So far the source tar is here:
http://dl.getdropbox.com/u/1694005/SDL-1.2.13-next1.tar.bz2

I'll keep on plugging away over the weekend.... I'll probably try to inject a 'null' configuration to get it to 'build' assuming it does.

Oh and I'm using gcc 2.7.2.3 ... so this is i386 only...
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
iDork



Joined: 18 Jan 2006
Posts: 62
Location: Kirkland, WA

PostPosted: Sat Oct 03, 2009 9:09 am    Post subject: Reply with quote

I thought there was an option to build it without X11 dependencies. The Xcode project, at least, had it.
_________________
NS TurboColor, SparcStation 5, Ultra 10, Octane SSI, HP 9000 C110, AlphaStation 200, Apple IIgs|IIe|IIc, Amiga 500+|600|1200, Commodore 64|128
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Sat Oct 03, 2009 9:32 am    Post subject: Reply with quote

iDork wrote:
I thought there was an option to build it without X11 dependencies. The Xcode project, at least, had it.


It's probably a 'configure' option..

I recall something vaguely about that a while ago...

There is a PowerMAC g5 1.6Ghz for $299 on ebay..... I'm almost tempted to buy it to get back into the OSX swing of things, since my ibook died a long while ago.....

But it'd only get me weird configs that are not so x86 friendly....
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
iDork



Joined: 18 Jan 2006
Posts: 62
Location: Kirkland, WA

PostPosted: Sat Oct 03, 2009 12:15 pm    Post subject: Reply with quote

For $300 you can build a pretty decent hackintosh. My current MacBook Pro can't run Tiger and I use a P4 Compaq tower to test stuff on x86 (I have 2 G4 towers for PPC 10.4 and earlier Mac OSs).
_________________
NS TurboColor, SparcStation 5, Ultra 10, Octane SSI, HP 9000 C110, AlphaStation 200, Apple IIgs|IIe|IIc, Amiga 500+|600|1200, Commodore 64|128
Back to top
View user's profile Send private message
neozeed



Joined: 15 Apr 2006
Posts: 686
Location: Hong Kong

PostPosted: Sat Oct 03, 2009 12:20 pm    Post subject: Reply with quote

iDork wrote:
For $300 you can build a pretty decent hackintosh. My current MacBook Pro can't run Tiger and I use a P4 Compaq tower to test stuff on x86 (I have 2 G4 towers for PPC 10.4 and earlier Mac OSs).


When all the dusts settles on that USB EFI hack thing... I'll probably get one of those... The register (.co.uk) was pushing it at one point, but it was nearly $300 USD..

However it's come to light as it's some freeware thing, rebranded... I'll need a new machine as my nextstep box is only a P4, I doubt it has the instructions needed, it's one of those socket 478 things which I doubt has SSE2 letalone SSE3.... but then who knows....
_________________
# include <wittycomment.h>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    NeXT Computers Forum Index -> Porting New Software All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2017 phpBB Group