Port to OS9?

François Revol revol at free.fr
Sat Apr 25 20:12:37 BST 2009

> > I'm a long time Macintosh developer and am involved in the Classic
> > Mac online scene. I just found about about Netsurf and was 
> > wondering
> > if it would be possible to port it to the old Macintosh OS9
> > environment and bring a modern, web standards compliant browser to
> > people using classic macs.

Wow, it would be funny :)

I happen to have a mac clone around, and a PCI based mac with OS9 
Mostly for testing the Haiku ppc port, but I could probably help 
testing it.

Btw, do you intend to look at a possible 68k port too ?
I have a Mac LC III here and it would be really funky to see NetSurf on 
(I started a 68k port of Haiku too, so...)

> > I need to know if it would be possible to compile Netsurf under the
> > older dev tools available for OS9 and where to start.  I have
> > CodeWarrior 7 and the old Macintosh Developers Workshop.

Isn't there any cross-compiler available ?
I suppose one could build a cross gcc for powerpc-apple-os9 and use the 
libraries and headers from the sdk...
Seems gcc4 and binutils don't have this target...
grep apple gcc/conf*
gcc/config.guess:       echo m68k-apple-machten${UNAME_RELEASE}
gcc/config.guess:       echo powerpc-apple-machten${UNAME_RELEASE}
gcc/config.guess:       echo m68k-apple-aux${UNAME_RELEASE}
gcc/config.guess:       echo powerpc-apple-beos
gcc/config.guess:       echo powerpc-apple-rhapsody${UNAME_RELEASE}
gcc/config.guess:       echo ${UNAME_MACHINE}-apple-
gcc/config.guess:       echo ${UNAME_PROCESSOR}-apple-

... oh wait:

grep macos gcc/conf*
gcc/config.sub:       | -macos* | -mpw* | -magic* | -mmixware* | -
mon960* | -lnews*)
gcc/config.sub:         os=`echo $os | sed -e 's|mac|macos|'`
gcc/config.sub:         os=-macos
gcc/config.sub:                 -mpw* | -macos*)

Are those macos ...9 or X ?

seems OS9.

Try to google something like "powerpc-apple-macos cross gcc"

> NetSurf is very portable and I think this is very likely possible. 
> The code is 
> mostly ANSI C with use of some common POSIX functions such as regex 
> and iconv. 

Also, since the BeOS port requires using gcc2, I had to fix many C99 
stuff to be C89 compliant, and as I suppose the OS9 dev kits likely 
don't know about C99 it should probably be useful for you too.
(I still have a pending fix for libtinysvg though.)

> The essential dependencies are libcurl, libxml, and hubbub (part of 
> the 
> project). You'll also need libjpeg, libpng or libmng, and libnsgif, 
> but those 
> can be disabled to start with.

You will also need some build tools like re2c and lemon.
lemon built fine in BeOS, so should be portable.
re2c requires gcc4 (and C++), but yasm has its own version rewritten as 
plain C, which built without a hitch in BeOS, so you can probably use 
I also heard dependancy on those 2 might disapear some day.

> Creating a new user interface involves implementing about 50 
> functions - see 
> desktop/gui.h. You'll need to look at the existing ports code to see 
> what
>  they 
> should do.

Since we also have a framebuffer version now you can probably try 
cloning it first to fix porting the core part and use a single window 
(or maybe SDL, is there SDL for OS9 ?)


More information about the netsurf-dev mailing list