トップ «前の日記(2014-03-06) 最新 次の日記(2014-03-08)» 編集

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|04|

2014-03-07 :-(

_ 午前

0530 起床

0710 食堂

0830 出勤 || デバッグしTARI

_ 午後

1300 デバッグしTARI

_

1700 退勤

1800 はうはう

2100 飯

2200 はうはう

_ [CPU][アーキテクチャ][NetBSD][MACHINE_ARCH]MACHINE_ARCH とは

MACHINE_ARCH の一覧はどこかで取得できるのか?

build.sh では MACHINE_ARCH が設定されてなければ uname を呼び出す。

CVS log for src/build.sh

	# Find information about the build platform.  This should be
	# kept in sync with _HOST_OSNAME, _HOST_OSREL, and _HOST_ARCH
	# variables in share/mk/bsd.sys.mk.
	#
	# Note that "uname -p" is not part of POSIX, but we want uname_p
	# to be set to the host MACHINE_ARCH, if possible.  On systems
	# where "uname -p" fails, prints "unknown", or prints a string
	# that does not look like an identifier, fall back to using the
	# output from "uname -m" instead.
	#
	uname_s=$(uname -s 2>/dev/null)
	uname_r=$(uname -r 2>/dev/null)
	uname_m=$(uname -m 2>/dev/null)
	uname_p=$(uname -p 2>/dev/null || echo "unknown")
	case "${uname_p}" in
	''|unknown|*[^-_A-Za-z0-9]*) uname_p="${uname_m}" ;;
	esac

uname(1) (/usr/bin/uname) は uname(3) (libc) を呼び出している。

CVS log for src/usr.bin/uname/uname.c

	if (uname(&u) != 0) {
		err(EXIT_FAILURE, "uname");
		/* NOTREACHED */
	}

uname(3) (libc) は sysctl を呼び出している

CVS log for src/lib/libc/gen/uname.c

int
uname(struct utsname *name)
{
	int mib[2];
	size_t len;
	char *p;

	_DIAGASSERT(name != NULL);

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSTYPE;
	len = sizeof(name->sysname);
	if (sysctl(mib, 2, &name->sysname, &len, NULL, 0) == -1)
		goto error;

	mib[0] = CTL_KERN;
	mib[1] = KERN_HOSTNAME;
	len = sizeof(name->nodename);
	if (sysctl(mib, 2, &name->nodename, &len, NULL, 0) == -1)
		goto error;

	mib[0] = CTL_KERN;
	mib[1] = KERN_OSRELEASE;
	len = sizeof(name->release);
	if (sysctl(mib, 2, &name->release, &len, NULL, 0) == -1)
		goto error;

	mib[0] = CTL_KERN;
	mib[1] = KERN_VERSION;
	len = sizeof(name->version);
	if (sysctl(mib, 2, &name->version, &len, NULL, 0) == -1)
		goto error;

	/* The version may have newlines in it, turn them into spaces. */
	for (p = name->version; len--; ++p) {
		if (*p == '\n' || *p == '\t') {
			if (len > 1)
				*p = ' ';
			else
				*p = '\0';
		}
	}

	mib[0] = CTL_HW;
	mib[1] = HW_MACHINE;
	len = sizeof(name->machine);
	if (sysctl(mib, 2, &name->machine, &len, NULL, 0) == -1)
		goto error;
	return (0);

error:
	return (-1);
}

ふうむ

アーキテクチャ一覧はここ

CVS log for src/sys/arch/README

port cpu の並び

ここにも同じものがあるんです

Platforms Supported by NetBSD

_ [CPU][アーキテクチャ][ruby][NetBSD][MACHINE_ARCH]アーキテクチャ一覧

#: coding utf-8

#
# for NetBSD
#
# buildall.rb /usr/src/sys/arch/README
#

def get_all_arch(arch_readme)
  :ST_DELIM1
  :ST_DELIM2

  st = :ST_DELIM1
  archs ||= []
  
  lines = File.open(arch_readme).readlines()
  lines.each {|line|
    case st
    when :ST_DELIM1
      if line =~ /\A\Z/
        st = :ST_DELIM2
      end
      
    when :ST_DELIM2
      if line =~ /\A\Z/
        break
      else
        sp = line.split()
        archs << sp[0]
      end
    end
  }
  return archs
end

def main(argv)
  arch_readme = argv[0]
  archs = get_all_arch(arch_readme)
  puts archs
end

main(ARGV)
% ruby buildall.rb /usr/src/sys/arch/README
acorn26
acorn32
algor
alpha
amd64
amiga
amigappc
arc
atari
bebox
cats
cesfic
cobalt
dreamcast
emips
evbarm
evbmips
evbppc
evbsh3
ews4800mips
hp300
hp700
hpcarm
hpcmips
hpcsh
i386
ia64
ibmnws
iyonix
landisk
luna68k
mac68k
macppc
mipsco
mmeye
mvme68k
mvmeppc
netwinder
news68k
newsmips
next68k
ofppc
pmax
prep
rs6000
sandpoint
sbmips
sgimips
shark
sparc
sparc64
sun2
sun3
vax
x68k
xen
zaurus