Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Oct 2000 23:01:16 +1030
From:      "Martin Minkus" <diskiller@diskiller.net>
To:        "Gerald Heinig" <Gerald.Heinig@post.rwth-aachen.de>, <freebsd-sparc@freebsd.org>
Subject:   Re: Anyone out there ?
Message-ID:  <009801c04336$7e45ea20$0200000a@lan.diskiller.net>
References:  <016a01c03d9d$eb2c6950$0200000a@lan.diskiller.net> <39F5BD2D.2F978990@post.rwth-aachen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
> > I've got an old SparcServer 10 sitting around, and after trying OpenBSD
and Linux on it, i'm very interested in the
> > possibility of porting my favourite OS to it.
> >
> > Whilist i'm a competent C coder, and have done ASM (MIPS/SGI), i have
effectively no experience as a kernel coder.
> >
> > It also seems the FreeBSD/Sparc port is quite dead ? :(
>
> Well, I wouldn't call it 'dead': I'd say 'suspended animation'.
> There was a flurry of activity about 8 months ago, maybe a bit longer, by
two guys who wanted to get the ball rolling. I
> believe they're students and by the looks of things they've found they
have substantially less free time than they
> anticipated.

Well, i don't know anything about it, and i don't know where their work is,
so it looks like i'm starting the FreeBSD/sparc port from scratch.

> The consensus seemed to be:
>
> a) We start from a FreeBSD 2.2.7-ish base and work with the NetBSD sources
for guidance, since these two seem to be
> rather similar (or so I'm told).

I'm using OpenBSD 2.7.

> b) A few weeks ago someone posted the OpenBoot specification, which we'll
need to write a boot loader and to understand
> what the NetBSDers are doing. This is very useful, as the original
document from http://www.ieee.org costs about US$ 160
> - one reason I didn't start on the project when I did have the time
(unlike now).

Where can i find this? I've found only general documentation on OpenBoot,
and in layman terms what happens in the boot sequence. The OpenBSD
sparc_boot (?) man page also describes the boot procedure.
Essentially, the OpenBoot bios loads the 1st stage bootloader from a certain
location within the beggining of the ufs filesystem. It has harcoded in, the
location and block numbers for the 2nd stage boot loader, that is larger in
size. The 2nd stage bootloader has support for ufs, and can therefore locate
and load the kernel (and preload kernel modules, in the case of FreeBSD?).

I've modified the bootloader on OpenBSD already, changing the text to read
FreeBSD/sparc boot, etc, and installed the new bootblocks just fine. It
works and boots OpenBSD as normal.

> c) You (or whoever) start with locore.s and port that over.

I've been studying this file on OpenBSD/sparc.

> My own thoughts on the matter are: (I'm not a FreeBSD kernel hacker,
though I do have Solaris kernel experience)
>
> a) Sit down with a copy of the FreeBSD i386 and Alpha versions of locore.s
and try to find out what it exactly *does*.
> You'll need to pester several people either on this list or on
freebsd-hackers (another reason, incidentally, which
> stopped me: freebsd-hackers has a phenomenal mail volume - more or less
150 mails a day, IIRC).

Haven't gotten this far yet :).

I've been studying the OpenBSD/sparc locore.s, and alot of the stuff in the
file makes sense, but i'm no kernel hacker, so i have a long way to go. I'm
picking up sparc asm as i go (its not hard) as i've had experience with MIPS
asm, which is just a fairly simliar RISC load/store architecture.

> b) Compare with the NetBSD SPARC version and spot the diffs/similarities.

I've been studying the OpenBSD SPARC locore.s like i stated, but haven't
compared with FreeBSD's i386 or Alpha locore.s yet. Infact, i don't know x86
or alpha asm ...
My main goal atm. is to get familiar with the OpenBSD kernel code, make
useful changes, *then* comparing it to the existing code in the FBSD kernel,
and working on implementing its locore.s

> c) Write some small programs that can be loaded and executed by the
OpenBoot firmware.

That is the idea. Make the OpenBoot firmware use the bootloaders to be able
to run some basic binaries on the filesystem and execute them (rather then
the /kernel). These basic binaries are, of course, ones written to run from
OpenBoot, not unix utilities obviously :). So i can't make systemcalls, or
use library functions.

> d) Trace the execution thread from locore.s onwards, translating code as
you go and seeing whether the file executes OK.
>
> OK. Those are my thoughts/observations. If you've got free time and really
want to try on this, it's a cool project to
> do. There are a number of smart people subscribed to the list, so fire
away any amount of technical questions you want.
> My guess is that if you start asking lots of questions, people will see
things are moving and start contributing
> themselves. Herd instinct, basically :-)

We'll see how it goes :)

> That's all from me. Good luck and have fun

Some of you at this point might be wondering ... WHY????

Well, simple. A sparc10 is all i have (as well as an IPX), so i have to make
do. So i'm doing a 32bit sparc port. That, and Net and Open already have
working Sparc32 ports i can study and learn from.

This may end up being more of a learning excercise then anything, and if so,
it will at least give me the experience i need to be able to do the Sparc64
port. And hopefully at that time i can score a U1 from David O'Brien :).

Seriously, i don't envision this becoming an official FreeBSD port; but its
at least a stepping stone and something for me to do before i can work on
bigger and better (and more useful) things. (ie. FreeBSD/sparc64.)

martin.

--
diskiller@diskiller.net | www.diskiller.net | irc.diskiller.net | my world



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?009801c04336$7e45ea20$0200000a>