hagio.org - 日記

Powered by PENS


Index

2009: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2010: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2011: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2012: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2013: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2014: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2015: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2016: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2017: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2018: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2019: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2020: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2021: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2022: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2023: 1月(1)(2) 2月(1)(2) 3月(1)(2) 4月(1)(2) 5月(1)(2) 6月(1)(2) 7月(1)(2) 8月(1)(2) 9月(1)(2) 10月(1)(2) 11月(1)(2) 12月(1)(2)
2024: 1月(1)(2) 2月(1)(2) 3月(1)(2)

今月のアルバム U.S. Beers! [ 投稿 | 編集 ]


編集

September 2009

Sep 15 (Tue)

00:34

前に Snow Leopard のカーネルが 32 ビット動作だと、プロセスが 64 ビットでも、使えるメモリ量は変わらないんじゃないかと考えていたが、 やはりそんなショボい OS ではなかったようだ。以下にわかりやすい解説があった。

カーネルは 32 ビット互換モードで動かし、メモリ管理だけ 64 ビットってどんなやねん…。 そもそもそんなに高速に CPU の動作モードが切り替わるんだろうか。 ここに書いてあるように 64 ビットレジスタが互換モードで使えなくなるとしたら、動作モードの切り替わりの度に レジスタごっそりお引っ越しってことにはならんのかね??謎は深まるばかり…。

Sep 9 (Wed)

00:44

hagio の、「感覚をつかめ!」シリーズ!!!記念すべき第 1 回のお題は、「ページサイズをつかめ!」
Linux のページサイズが 4 KB であることは皆さんご存知のこととは思いますが、それが実際にどの程度のサイズなのか、 感覚をつかんでおくと後々ためになるかもしれません。ということで、早速まいりましょう。

まず用意するのは、適当な Linux マシンと bash, seq, echo コマンドでございます。

[hagio@lab ~]$ for i in $(seq 1 4096); do echo -n 0; done 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

うーむ、無機質なデータ列ながら、なかなかいい感じでつかめちゃいますね。 思っていたより、小さいです。メモリ数 GB も当たり前の昨今、こんな細かい単位で管理してていいのでしょうか。

さて次は、文書で見てみましょう。適当な文書が見つからないので、カーネル付属文書でつかんでみます。

[hagio@lab ~]$ head -c 4096 /usr/share/doc/kernel-doc-2.6.18/Documentation/kernel-docs.txt Index of Documentation for People Interested in Writing and/or Understanding the Linux Kernel. Juan-Mariano de Goyeneche <jmseyas@dit.upm.es> /* * The latest version of this document may be found at: * http://www.dit.upm.es/~jmseyas/linux/kernel/hackers-docs.html */ The need for a document like this one became apparent in the linux-kernel mailing list as the same questions, asking for pointers to information, appeared again and again. Fortunately, as more and more people get to GNU/Linux, more and more get interested in the Kernel. But reading the sources is not always enough. It is easy to understand the code, but miss the concepts, the philosophy and design decisions behind this code. Unfortunately, not many documents are available for beginners to start. And, even if they exist, there was no "well-known" place which kept track of them. These lines try to cover this lack. All documents available on line known by the author are listed, while some reference books are also mentioned. PLEASE, if you know any paper not listed here or write a new document, send me an e-mail, and I'll include a reference to it here. Any corrections, ideas or comments are also welcomed. The papers that follow are listed in no particular order. All are cataloged with the following fields: the document's "Title", the "Author"/s, the "URL" where they can be found, some "Keywords" helpful when searching for specific topics, and a brief "Description" of the Document. Enjoy! ON-LINE DOCS: * Title: "Linux Device Drivers, Third Edition" Author: Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman URL: http://lwn.net/Kernel/LDD3/ Description: A 600-page book covering the (2.6.10) driver programming API and kernel hacking in general. Available under the Creative Commons Attribution-ShareAlike 2.0 license. * Title: "The Linux Kernel" Author: David A. Rusling. URL: http://www.tldp.org/LDP/tlk/tlk.html Keywords: everything!, book. Description: On line, 200 pages book describing most aspects of the Linux Kernel. Probably, the first reference for beginners. Lots of illustrations explaining data structures use and relationships in the purest Richard W. Stevens' style. Contents: "1.-Hardware Basics, 2.-Software Basics, 3.-Memory Management, 4.-Processes, 5.-Interprocess Communication Mechanisms, 6.-PCI, 7.-Interrupts and Interrupt Handling, 8.-Device Drivers, 9.-The File system, 10.-Networks, 11.-Kernel Mechanisms, 12.-Modules, 13.-The Linux Kernel Sources, A.-Linux Data Structures, B.-The Alpha AXP Processor, C.-Useful Web and FTP Sites, D.-The GNU General Public License, Glossary". In short: a must have. * Title: "The Linux Kernel Hackers' Guide" Author: Michael K.Johnson and others. URL: http://www.tldp.org/LDP/khg/HyperNews/get/khg.html Keywords: everything! Description: No more Postscript book-like version. Only HTML now. Many people have contributed. The interface is similar to web available mailing lists archives. You can find some articles and then some mails asking questions about them and/or complementing previous contributions. A little bit anarchic in this aspect, but with some valuable information in some cases. * Title: "Conceptual Architecture of the Linux Kernel" Author: Ivan T. Bowman. URL: http://plg.uwaterloo.ca/~itbowman/papers/CS746G-a1.html Keywords: conceptual software arquitecture, extracted design, reverse engineering, system structure. Description: Conceptual software arquitecture of the Linux kernel, automatically extracted from the source code. Very detailed. Good figures. Gives good overal

無機質なデータで見たときは意外と小さいように思いましたが、文書だと結構いけちゃうんですね。

お次は・・・ネタが浮かばないので、比較と言えば「東京ドーム」ということで、強引に計算してみましょう。

4 KB のメモリは、hagio のサーバに搭載されている 4 GB のメモリの 100 万分の 1 です。 4 GB のメモリを東京ドーム 1 杯分 (Wikipedia より、1,240,000 m3) とすると、 4 KB は 1.24 m3・・・結構でかい・・・。

えー、では気を取り直して、面積で計算してみましょう。

東京ドームのグラウンドの面積が 13,000 m2 ですから、 これを 4 GB のメモリとすると、4 KB のメモリは 0.013 m2 = 130 cm2 です。 すなわち、おおよそ 11 cm 四方ということになります。これは小さいですね。 東京ドームのグラウンドを 11 cm 四方で管理するバディーさんやスラブさんは大変です。 そりゃ、大量にメモリを使うやつをたまには殺したくもなりますね・・・(違

Sep 7 (Mon)

01:02

久しぶりに『ショーシャンクの空に』を見た。 いい映画というのは、何度見ても、その時々に応じた新しい何かを、自分の中に置いていったり、 自分の中から掘り出したりしてくれるものだと思う。

Sep 6 (Sun)

22:59

今日は、ふとしたきっかけで西新井を訪れたところ、気の利いたショッピングモールを発見して、 (当初は 1 〜 2 時間で帰るつもりだったのだけど) 一日中楽しめた。 福岡で言えば、ちょうど旧ダイヤモンドシティと香椎浜ジャスコの中間くらいのサイズで、 店舗もポイントを押さえた感じのラインナップで良かった。 やはり、知らないところに行くのは、こういう意外な発見があっておもしろい。

税金についての勉強を始めた。 働き始めてから、消費税や自動車税以外の税金を納めるようになったものの、 まったく詳しいことがわかっていないから、いちおう社会人の常識として。 普通のサラリーマンは特に申告なんかは必要ないと思っているんだけど (会社がやってるよね?)、 本当かどうかもわからないのは情けなさすぎる。

あまりお金に執着心がないのが問題なのだが…。

Sep 4 (Fri)

00:18

遅ればせながら 1Q84 を読み終えた。

うむ… これは続編出ると思っていいよね? このままじゃ、主人公と一緒に読者もあっちの世界においてきぼりである。

Sep 3 (Thu)

19:17

Snow Leopard をインストールしたが、本当に何ら変わりないように見える。 外見上で変わったと気づいたのは、Exposé でウィンドウが整列するようになったのと、 アプリケーション名が付くようになったこと、Dock でメニューの色が変わったのと、 展開したフォルダの中のフォルダも展開できるようになったことくらい。 これまでメジャーバージョンが変わるたびに、ウィンドウのデザインなどが変わっていたが、 今回は全く変化がない。インターフェースについては十分に成熟したとの判断だろう。 確かに、最近では特に不満もないしね。

一番の問題は、Logicool M555b のドライバ関連ソフトウェア Logicool Control Center が Snow Leopard に対応しておらず、 機能割り当てなどの設定ができなくなったことだ。普通のマウスとして標準の機能では使えるが、キー割り当てなどができない。

少し調べてみたところ、以下のサイトの方法で LCC を再インストールすると、設定できるようになることがわかった。

いちおう正常に動作しているけど、もちろんインストールは自己責任ってことになる。

8 月(2) へ


↑戻る