Blog @ Blog - Linux Life

移動

move firstmove previous|move to page 0move to page 1move to page 2move to page 3move to page 4currentmove to page 6move to page 7move to page 8move to page 9move to page 10move to page 11move to page 12move to page 13move to page 14move to page 15move to page 16move to page 17move to page 18move to page 19move to page 20move to page 21move to page 22move to page 23move to page 24move to page 25move to page 26move to page 27move to page 28move to page 29move to page 30move to page 31move to page 32move to page 33move to page 34move to page 35move to page 36move to page 37move nextmove last

30日でできる! OS自作入門 5日目:メモリ管理、ウィンドウの表示

2008/04/15 ( n ) < HariboteOS >

週末は飲んでました。
昨日は仕事。

今日はメモリ管理からスタート。
32MB のメモリを管理して、一部の確保、開放なんかを実装。
シンプルだけど、よく考えられている。

次に画面のレイヤー管理。
SHEET 構造体を作成して位置、順序を管理して、描画処理を行う。
vx0, vy0, vx, vy, vx1, vy1 とか変数が増えてめんどくさい。
Point とか Rect とか作って。。。みるか。今度。
苦労の甲斐があって、マウスの動きで背景が上書きされる問題が解決。

で、最後にウィンドウの表示。
地道にウィンドウを描画して。。。 Haribote OS - 5th day
明日はタイマーの作成と描画の最適化。地道にがんばりましょう。

30日でできる! OS自作入門 4日目:マウスを動かす、メモリ容量

2008/04/11 ( n ) < HariboteOS >

今週は仕事を普通にしながら、夕食後から夜中にかけてOS作りをしていたので、 さすがに相当疲労が溜まってしまいまして、今日はあまり進まなかった。

初めにマウスを動かす処理。
昨日マウスからのデータの読み込みまで終了していたので、今日はこのデータを解析して、マウスカーソルを実際に動かしてみた。ついでにボタンに応じてカーソルの色を変えてみたり。

それからブートローダー関連で後回しになっていたアセンブラソースの解説を読む。
GDT,IDT の簡単な初期化、OSのメモリ領域へのコピー等など。
なんか若干理解できた気分。

次に、メモリ容量の取得。
すごくシンプルだけど、こんなもんでいいんだろうか。

それからメモリ管理部分に頭を突っ込んだけど、今日はギブアップ。

今日のところの成果。
Haribote OS - 4th day
本の9日目までを4日で進んだのでいいペース。ただ、ちゃんと理解できていない部分もある。 でも、とりあえず楽しんで作って、細かいことは後でちゃんと勉強するって方針でいいと思います。

30日でできる! OS自作入門 3日目:文字の描画、割り込みの設定

2008/04/10 ( n ) < HariboteOS >

まず最初に文字の描画。32bit になってしまったのでもはやBIOSはつかえない。
ビットマップみたいなフォントデータを作成して1ドットづつ地道に描画。。。
なかなか切ない。
本に付属のフォントデータを使用してASCII文字列の描画ができるようになった。
デバッグメッセージを表示できる様になったのは喜ぶべきことのはず。

次に、マウスカーソルの表示。
とりあえず表示だけ。

で、ここからが本日のメインイベント。
GDT と IDT
IDTの方はやりたいこともやってることも(やり方は別として)なんとなく理解できる。
一方GDTの方はさっぱり。要復習。

息抜き程度にソースを分割。
複数のソースファイル(*.c,*.nas)に対してヘッダファイルが一つっていう状況に違和感を感じるのは普通なんだろうか。

で、割り込みの設定をしてキーボードとマウスの反応を得る。
ハードの制御となると途端に難しく感じる。こちらも要復習。

途中で FIFO を実装。
オブジェクトにしてメソッド呼び出したいよーと思いながらも C++ でやることのハードルの高さに(全然見当もつかないけど)しぶしぶ我慢。
やっぱり C言語はあまり好きではない。

今日の結果。
Haribote OS - 3rd day
見た目はそんなに変わらないけど、マウスとキーボードを例にハードウェア回りの最初の一歩を踏み出した感じ。
今日はここまで。いいペース。

30日でできる! OS自作入門 2日目:アセンブラ初体験〜C言語でプログラム

2008/04/09 ( n ) < HariboteOS >

昨日手書きしたイメージファイル を作るためのアセンブラを、とりあえず本を見ながら打ってみる。
イメージファイルをバイナリエディタで作ってからアセンブラで作り始めるのは順番が逆では?と思いつつもこっちの順番の方が意外と理解しやすいのが不思議だ。

  • DB は 「data byte」。1バイトを書く命令。文字列も書ける。
  • RESB は 「reserve byte」。指定した分を予約(0で埋めてくれる) らしい。
  • ; はコメント
  • DW は「data word」。2バイト。
  • DD は 「data double-word」。4バイト。
  • などなど。後で説明しますよと書いてあってまだ出てきていない命令も多数。

Linux版開発セットを HariboteOS/Index から持ってきてアセンブルして実行。当然結果は昨日と同じ。

Linux/wako_memo をブックマークに追加。

......................

レジスタがたくさんあって、8ビットだ16ビットだ32ビットだと全然覚えられない。 そのうちアセンブラの教科書的なものを買ってこよう。

で、なんか調子がよくて、なんと本の四日目まで終わってしまった。
要所要所で説明が省かれて(後で説明しますとかなんとか)、 肝心なところが理解できていないような感じを残しつつ、 画面にお絵描きをするに至る。 Haribote OS - 2nd day
今日はここまで。GW前に終わらないかなぁ。

30日でできる! OS自作入門 1日目:バイナリエディタでファイルイメージを作成

2008/04/08 ( n ) < HariboteOS >

いきなりバイナリエディタで直接イメージファイルを作り始めましたか。。。
バイナリエディタなんて使ったこと無いですが、名前は確か khexedit, khexedit...
KDE 4.0.2 には無いのか!? まぁ、それは置いておいて、 kde3.5 の khexedit で helloos.img の内容を作成してみる。ノートPCのキーボードだと数字を打つのが辛い。

イメージを作成し終わったけど、何をしているのかはまったく不明のままとりあえず実行へ。

本に書いてあるのは Windows でフロッピーから起動する方法ですが、 フロッピーなしのノートPCで Linux なので、、、QEMU ね。

HOWTO: Qemu - Gentoo Linux Wiki を参考に QEMU のインストールをした。
gcc は 4系では文句を言われるので一瞬 gcc-config で 3.3.6 に切り替えて

    # emerge -avt qemu

kqemu というものも必要らしい。

    # emerge -avt kqemu

kqemu をカーネルにロードして、ユーザーを qemu グループに追加して、

    $ qemu -fda helloos.img

HariboteOS - 1

おぉ、素晴らしい。よくわかんないけど、何かが動いて文字が表示されている。

今日はここまで。

30日でできる! OS自作入門 0日目

2008/04/07 ( n ) < HariboteOS >

今から約2年前、本当に30日でOSが出来上がるのかを試してみるBlog という Blog を見て買って以来、かれこれ2年ほど放置していた 30日でできる! OS自作入門 をとうとう読むことにしました。

C言語もアセンブラもOSもほとんど知識がないので、なんとうってつけの本かと。なにより、そういう知識がなくてもいいよーと書いてあるところが素晴らしい。

一応社会人なので30日×2くらいを目標になんとなく進めていこうと思っています。

気分転換

2008/04/02 ( n ) < お仕事 >

なんとなく家で仕事をする気分ではなかったので、昼過ぎから近くのマックで仕事をしてきた。
コンセントが借りれたので、そのまま夕方まで居座る。
居心地自体は自宅の仕事部屋の方がいいけど、気分転換にはなかなか便利だなぁ。
ちょくちょく利用させてもらうことにしよう。

Yahoo UI と konqueror

2008/04/01 ( n ) < JavaScript Qt >

Qt-4.4 から WebKit がサポートされるため、色々物色していて、The Yahoo! User Interface Library (YUI) かなんかでおもしろいものが作れないかを検討してみたりしています。

色々ちゃんと動くのであればQt リファレンス ドキュメント (オープンソース版) を YUI で全部書き直したいところなんだけど、惜しいかな Context Menu の Example が Konqueror 4.0.2 ではうまく動かない。
KDE 4.1 が出て WebKit ベースのブラウザに置き換わるまで保留かな。
Drag and Drop や Resize なんかは動くので、Context Menu 以外だけでも YUI 化するってのもなしではないなぁ。

QtDbus のテストアプリ

2008/03/21 ( n ) < KDE Qt >

QtDbus で kget のドロップターゲットの表示、非表示を切り替えるサンプルアプリケーションを作ってみた。

$ svn export http://svn.linux-life.net/qt/4/projects/qdbus-kget/
$ cd qdbus-kget
$ qmake
$ make
$ ./qdbus-kget

Gentoo KDE4

2008/03/02 ( n ) < Gentoo KDE >

Gentoo KDE 4.0 Guide を参考に KDE 4.0.1 をインストールしてみた。

Example package.unmask
Example package.keywords の内容をそれぞれ追加。

app-text/libspectre
kde-base/kdeartwork-icewm-themes:kde-4
のエントリが足りなかったので追加。

# emerge -avD kde-base/kdebase-meta:kde-4

[ebuild     U ] x11-apps/xinit-1.0.5-r2 [1.0.5-r1] USE="hal pam -debug -minimal" 0 kB
[ebuild     U ] x11-libs/qt-4.3.3 [4.3.2-r1] USE="accessibility cups dbus doc examples gif jpeg mysql opengl png postgres qt3support sqlite ssl tiff zlib -debug -firebird -glib -mng -nas -nis -odbc -pch -sqlite3 -xinerama" INPUT_DEVICES="-wacom" 41,350 kB
[ebuild  N    ] kde-base/qimageblitz-0.0.4  USE="mmx sse sse2 -3dnow (-altivec) -debug" 55 kB
[ebuild     U ] x11-libs/libxklavier-3.3 [3.1] USE="doc" 465 kB
[ebuild  N    ] dev-libs/soprano-2.0.0  USE="clucene doc -debug" 1,579 kB
[ebuild     U ] app-crypt/gpgme-1.1.6 [1.1.5] USE="-pth%" 939 kB
[ebuild  N    ] app-misc/strigi-0.5.7  USE="clucene dbus exiv2 java qt4 -debug -hyperestraier -inotify -test" 786 kB
[ebuild  NS   ] kde-base/kdelibs-4.0.1-r1  USE="acl alsa bzip2 doc fam kerberos mmx nls opengl semantic-desktop spell sse sse2 ssl -3dnow (-altivec) -bindist -debug -htmlhandbook -jpeg2k -openexr -test -zeroconf" 8,849 kB
[ebuild  N    ] kde-base/kdepimlibs-4.0.1  USE="ldap -debug -htmlhandbook -sasl -test" 1,731 kB
[ebuild  NS   ] kde-base/libkonq-4.0.1  USE="-debug -test" 3,948 kB
[ebuild  N    ] kde-base/libkworkspace-4.0.1  USE="-debug" 29,174 kB
[ebuild  NS   ] kde-base/kdebase-data-4.0.1  47,137 kB
[ebuild  NS   ] kde-base/kdesu-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/libtaskmanager-4.0.1  USE="xcomposite -debug" 0 kB
[ebuild  N    ] kde-base/solid-4.0.1  USE="-bluetooth -networkmanager -test" 0 kB
[ebuild  N    ] kde-base/systemsettings-4.0.1  USE="opengl ssl usb -debug -htmlhandbook -ieee1394 -xinerama" 0 kB
[ebuild  N    ] kde-base/ksplash-4.0.1  USE="mmx sse sse2 -3dnow (-altivec) -debug -xinerama" 0 kB
[ebuild  NS   ] kde-base/ktip-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/ksystraycmd-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kurifilter-plugins-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kscreensaver-4.0.1  USE="opengl pam -debug" 0 kB
[ebuild  N    ] kde-base/kpasswdserver-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/knewstuff-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kwrite-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/kquitapp-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kuiserver-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kde-menu-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kfile-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/khelpcenter-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/kappfinder-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/nepomuk-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kcmshell-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/ktraderclient-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kmenuedit-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/ktimezoned-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/knetattach-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/kdebugdialog-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/kdialog-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kde-wallpapers-4.0.1  0 kB
[ebuild  NS   ] kde-base/kreadconfig-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kde-menu-icons-4.0.1  0 kB
[ebuild  NS   ] kde-base/kdeartwork-iconthemes-4.0.1  41,293 kB
[ebuild  N    ] kde-base/kstyles-4.0.1  0 kB
[ebuild  N    ] kde-base/kstartupconfig-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/phonon-4.0.1  USE="-debug -xcb" 0 kB
[ebuild  NS   ] kde-base/kwin-4.0.1  USE="opengl xcomposite -captury -xinerama" 0 kB
[ebuild  NS   ] kde-base/drkonqi-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/konsole-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/kcheckpass-4.0.1  USE="pam" 0 kB
[ebuild  N    ] kde-base/kioclient-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/kmimetypefinder-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kstart-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/libplasma-4.0.1  USE="opengl -debug -test -xinerama" 0 kB
[ebuild  NS   ] kde-base/kcminit-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kdebase-kioslaves-4.0.1  USE="bzip2 samba -debug -htmlhandbook -openexr" 0 kB
[ebuild  N    ] kde-base/soliduiserver-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/khotkeys-4.0.1  USE="-debug" 0 kB
[ebuild  N    ] kde-base/dolphin-4.0.1  USE="semantic-desktop -debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/keditbookmarks-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kfind-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/knotify-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kdepasswd-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/klipper-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  N    ] kde-base/plasma-4.0.1  USE="xcomposite -debug -htmlhandbook -xinerama" 0 kB
[ebuild  NS   ] kde-base/ksmserver-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/kcontrol-4.0.1  USE="opengl ssl -debug -htmlhandbook -ieee1394 -logitech-mouse" 0 kB
[ebuild  NS   ] kde-base/konqueror-4.0.1  USE="-debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/kdm-4.0.1  USE="kerberos pam -debug -htmlhandbook" 0 kB
[ebuild  NS   ] kde-base/nsplugins-4.0.1  USE="-debug" 0 kB
[ebuild  NS   ] kde-base/ksysguard-4.0.1  USE="-debug -htmlhandbook -lm_sensors -test" 0 kB
[ebuild  N    ] kde-base/krunner-4.0.1-r1  USE="opengl xcomposite -debug -xscreensaver" 0 kB
[ebuild  NS   ] kde-base/kdebase-startkde-4.0.1  0 kB
[ebuild  NS   ] kde-base/kdebase-meta-4.0.1  0 kB

スクリーンショット

移動

move firstmove previous|move 0move 1move 2move 3move 4currentmove 6move 7move 8move 9move 10move 11move 12move 13move 14move 15move 16move 17move 18move 19move 20move 21move 22move 23move 24move 25move 26move 27move 28move 29move 30move 31move 32move 33move 34move 35move 36move 37|move nextmove last

スポンサードリンク

Copyright - ©2003- tasuku All Rights Reserved