トップ «前の日記(2010-07-27) 最新 次の日記(2010-07-29)» 編集

ヨタの日々

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|

2010-07-28 :-(

_ 朝ッ

0520 起床

_ 仕事

0830 出勤

リハーサル

_ ,

まさかコミケ 3 日目に全力を出す日が来るとは思ってもいなかった。

_ [NetBSD][PAE][翻訳]NetBSD Blog - PAE support for native i386 翻訳

i386 での PAE サポート

July 26, 2010 posted by Jean-Yves Migeon

With kernel revision 5.99.37, the options(4) PAE was added to native i386. It is currently disabled by default.

カーネルリビジョン 5.99.37 で options(4) の i386 に PAE が追加された。現在デフォルトでは無効になっている。

PAE, or Physical Address Extension, is a mode that started to appear with Intel's Pentium Pro processor. When enabled, the i386 memory management physical addresses, including page directory and page table entries, are promoted to 64 bits entities, instead of 32 bits. This allows, in the present state, to address physical accesses with 36 bits -- thus turning the whole physical address space to 64GB (although the userland virtual address space remains with 32 bits addresses, or 4GB).

PAE( Physical Address Extension ) とは、インテル Pentium Pro プロセッサの起動時のモードのことである。これを有効にすると、i386 の物理アドレスメモリ管理は page directory と page table entries を含むようになり、32 ビットエントリーの代わりに 64 ビットエントリーに拡張される。この状態になると、36 ビットでの物理アドレスアクセスができるようになるり、物理アドレス全体を 64GB として扱えるようになる( とはいえ、userland の仮想アドレス空間は依然として 32 ビット( つまり 4GB ) のままなんだけど )。

As NetBSD supported amd64 very early, there was no real urge to add PAE support within the kernel; in early 2002, hosts with more than 4GB were rare, and those that had more than 4GB of memory were already moving to amd64.

NetBSD では amd64 が早くからサポートしており、無茶しない範囲で kernel に PAE サポートを追加できていた。2002 年の初頭では計算機が 4GB 以上( のメモリ )を持っていることは珍しかったし、そういう計算機は既に amd64 へ移行していた。

Historically, the first appearance of PAE was thanks to Manuel Bouyer (bouyer@), for the Xen port. It remains, even today, the only solution to run 32 bits domUs with a 64 bits Xen hypervisor. The situation became even more strict starting with Xen 3.3, where non-PAE support was removed from Xen, effectively forcing the domains (dom0 as well as domUs) to move to full PAE support.

歴史的には、最初に PAE を使うようになったのは Manuel Bouyer (bouyer@) による Xen への移植によるものだ。これはいまだに今日でも 64 ビット Xen hypervisor で 32 ビット domU を動作させるための唯一の手段になっている。非 PAE サポートが除外された Xen3.3 の場合はもっとしっかりしており、domain ( domU と同じく dom0 とか )を完全に PAE サポートさせるように移行している。

Later, Jeremy Morse took interest in having PAE supported within native i386, and proposed a patch on port-i386@ for it. I took the responsibility for merging it within -current, and make it less intrusive with regards to the present code of port-xen.

その後、Jeremy Morse が i386 の範囲内で PAE をサポートさせることに関心を持ち、port-i386 へパッチを投げた。私はその後のやりとりも含めて -current にマージし、port-xen に投げたコードに関してはそれほど問題なく make できるはず。

In essence, adding PAE within NetBSD was not a difficult task; however, it took quite a lot of time for testing and debugging, as the merge with the current required modifications in low level code (boot and initialization, pmap(9) handling), as well as fixes in place where physical address change could mask the upper 32 bits (addresses could not be considered as 32 bits "unsigned long" anymore). Fortunately, the API in NetBSD being very clear, finding out and isolating the problematic parts was easy. Besides, having PAE inside GENERIC forced the implementation to be multi-processor safe, so the Xen port can later take advantage from it and move more easily to the multi processor world.

実際のところ、NetBSD に PAE を追加することは難しいことではない。しかし、テストとデバッグにものすごく時間がかかる。current へマージするために必要な低レベルなコード( boot や 初期化や pmap(9)ハンドリング )を変更したり、物理アドレスの上位 32 ビット( アドレスには符号なし 32 ビット整数を含めることができない )を変更するといった手間がある。幸いにも NetBSD の API は非常に分かりやすく見つけやすいので、問題を簡単に切り分けることができる。さらに、GENERIC の PAE はマルチプロセッサーセーフに実装されており、Xen port はそれを利用できるから、より簡単にマルチプロセッサー環境へ移行できる。

For those interested in small security improvements, enabling PAE on i386 has the benefit of unmasking the 63rd bit in the physical address, called the NX/XD (No-eXecute/eXecute Disable) bit. By marking a physical page with this bit, you can prevent code execution on the page. All CPUs do not support this feature; you can easily spot it through cpuctl(8) -- look for NOX or XD in the features output.

セキュリティに関してちょっと面白いものがある。i386 上で PAE を有効にすると、物理アドレスの 63 ビット目( NX/XD (No-eXecute/eXecute Disable) bit と呼ばれる )のマスクを解除できて嬉しい。このビットによってマークされた物理ページはコードの実行を防ぐことができる。すべての CPU がこの機能を使えるわけじゃないけど、cpuctl(8) を見れば NOX や XD についてわかる。( 訳: cpuctl(8) 読んでもさっぱり分らないんだけど... )

Importing PAE was an interesting challenge, as it raised concerns regarding the stability of the kernel ABI when manipulating physical addresses. Physical addresses are constantly used for device drivers, as they are needed for communication with them over different types of buses. Stabilizing the ABI offers the possibility to develop drivers, or modules, without fear of breaking binary interfaces. Here, it will help modularizing the kernel even further, by providing modules, and hopefully, a kernel, that could fit native, PAE and Xen memory models without needing separate compile and build time options.

PAE を取り込むことはとても挑戦的なことで、物理アドレスを操作する kernel ABI の安定性向上につなげられるとみなすことができる。物理アドレスとは、デバイスドライバが異なるバス間で通信するときによく使われるものだ。ABI を安定させることは、バイナリインターフェースをぶち壊すことを恐れずにドライバやモジュールを開発することができるようになる。これにより、モジュールによる kernel モジュール化をさらに進め、うまくすればそれが標準( 訳: native )となり、PAE や Xen のメモリーモデルはコンパイルとビルドを間髪おかずに実行できるようになる。( 訳: ???? )

_ FMトランスミッターとやらを購入した

FM周波数をオートスキャンしてくれるんだが( オートしかできない ) iPod touch の場合 この液晶に周波数が表示されないのでむしろ手動で設定できるほうがうれしいかもしれない。( iPod は表示されるらしい )

とりあえず設置してみた図

IMG_4902

B002UM5THU