News for hackers. Stuff that matters.
Re:FreeBSD on the POWER8: it's alive by yellowapple on Monday February 23, 2015 @05:12PM (#9097395)
Being highly-portable also helps to make sure that your code has a maximum of cleanliness and correctness; this is one of the primary reasons why OpenBSD, for example, emphasizes the importance of being portable to everything from x86 and POWER systems to Zaurus PDAs and VAXen, even though portability isn't an explicit objective of OpenBSD like it is for NetBSD.
Re:FreeBSD on the POWER8: it's alive by tiffanyh on Monday February 23, 2015 @05:17PM (#9097424)
I love NetBSD, don't get me wrong, but inevitably you will end up with a messing subsystem if managing multiple architectures because you won't be able to avoid situation like this:

if (x86)

  // do ...
else (Power)

  // do ...
else (PPC)

  // do ...
Re:FreeBSD on the POWER8: it's alive by bch on Monday February 23, 2015 @06:35PM (#9097777)
From http://www.netbsd.org/about/portability.html:

> Every effort is made to keep everything cleanly split into 'Machine Dependent' (MD) and 'Machine Independent' (MI) areas. For example, an Ethernet chipset would have a single MI core hardware driver, which would be matched with appropriate MD bus attachment code for a given platform. Not all drivers are as clean as we would like for historical reasons, but any new driver will be, and old drivers are in the process of being converted across.

Machine dependent parts are built to a hardware abstraction layer (HAL)[1] interface, so that spec gives a single abstraction that the hardware-dependant code is built against, and can operate w/ the rest of the OS. As I understand it, this is facilitated by the _build system_ (not a mess of if/then in code) like this[2]:

  .if ${ARCHSUBDIR} == "mips64"
  ARCHSUBDIR= mips
  .endif
  .if ${ARCHSUBDIR} == "powerpc64"
  ARCHSUBDIR= powerpc
  .endif

These are also the sorts of problems that are addressed by considering "lots and lots" of targets -- it'd be unmaintainable otherwise.

[1]: http://en.wikipedia.org/wiki/NetBSD#Portability

[2]: /usr/src/sys/arch/Makefile

EDIT: ws

s/it's be/it'd be/

s/that spec give/that spec gives/