2012-02-01から1ヶ月間の記事一覧

エクリプス プラグイン指南

アマテラスをさがしてたら、いいところみっけたのでメモhttp://www.kkaneko.com/rinkou/index.html 九州大学の先生のようですね。さすが http://itpro.nikkeibp.co.jp/article/COLUMN/20070329/266888/ Java開発を便利にする基本プラグイン ■プロパティエデ…

kernel2.6-day1 カーネルソース再び(debian6.0編)

kernel 2.6 debian6.0を仮想環境にてインストールしてみて仕切り直し 1) apt-get install linux-source2.6.xxx 2) cd /usr/src してkenrnelソースのtar ballを解凍 (パッチがあればそれも) 3)ソースのディレクトリを linuxって名前でシンボリックリンクを…

day4-gcc-core-build

gcc-coreのソース先を求めて gcc と core の二つのstringでぐぐってみたら 結構目移りwたとえばここかは、SHクロスコンパイル環境の構築howto かな? http://www.interface.co.jp/cpu/sh_howto/sh_howto10.aspCQ出版のインタフェース、古めだけどつかえそう…

ジャクソンのお勉強  memo

#!/usr/bin/perl while ($line = <STDIN>) { if(not $line) { exit; } ($col1,$col2) = split(/\s/, $line); $count1 = 0; $count2 = 1; $old_col1 = $col1; $old_col2 = $col2; while($line = <STDIN>) { ($col1,$col2) = split(/\s/, $line); if ($col1 ne $old_col1 || </stdin></stdin>…

Ubunt10.04のmake error

root@ubunt1004-32-2:/usr/src/linux# ./myMake oldconfig oldconfig now making dir oldconfig HOSTCC scripts/basic/fixdep In file included from /usr/include/sys/socket.h:40, from /usr/include/netinet/in.h:25, from /usr/include/arpa/inet.h:23, …

Kernel2.6-day1

make helpの結果の下のほうにコピペしておきます。 clean は .configファイルはそのままで、中間ファイルなどを削除。 mrproper は clean + .configも削除。やり直しをしたいときに吉。vmlinux bzImage 圧縮カーネルイメージをビルド arch/i386/boot/bzimage…

ajax googlemap javascipt api サンプル

うちの近くw root@aspire-white:/var/www# cat map.html CTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> </meta></head></html>

ntp

こちらは昔のメモ ntp memo ..http://d.hatena.ne.jp/toshi_hirasawa/20110508/1304809367hwclock ..http://d.hatena.ne.jp/toshi_hirasawa/20090702/1246502623ここから本文ーーーーーーこのPC うぶんちゅの設定はこうなってる。 このPCはふつーのクライア…

day4- リンカースクリプト a.out再び

a.out形式実行ファイルは歴史的にOMAGIC,NMAGIC,ZMAGIC,QMAGICの順番に進化。ファイルヘッダーは32バイトからなる(各バージョンにおいてもみんな共通らしい)/usr/include/a.out.hから struct exec { unsigned long a_info; /* Use macros N_MAGIC, etc for…

commonって何だ? nm 謎解き編

[hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ cat comm1.c #include <stdio.h> int ver_major, ver_minor; int main(void) { printf("Version is %d %d\n", ver_major , ver_minor); return 0; } [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ cat comm2.c i</stdio.h>…

day4- ldによるセクション配置の確認(nm編)

[hirasawa@aspire-white gcc-Programming-Kobo]$ nm address.o 00000004 C a1 00000000 D a2 00000004 C a3 00000004 D a4 00000000 b a5 00000008 d a6 0000000c D a7 00000004 b c3.1697 00000010 d c4.1698 00000000 T func 000000ef T main U printf U p…

day4- ldによるセクション配置の確認(readelf -S編)

[hirasawa@aspire-white gcc-Programming-Kobo]$ cat address.c #include <stdio.h> int a1; int a2 = 0x11111111; int a3; int a4 = 0x22222222; static int a5; static int a6 = 0x33333333; const char * a7 = "const_char_string"; void func( int b1 , int b2 ) </stdio.h>…

Queueの考察 ほんとにただのメモ

自分用のメモです。 isEmpty() { p_in ==p_out } isFull() { (p_in + 1) % arysize == p_out } myPush(String) { if (isFull) { print("Full!"); return; } else { Ary[p_in] = String; p_in ++; p_in = p_in % arysize; } } myPop() { if (isEmpty) { print…

スタック領域(スタックが使うアドレス)の再確認

x86版gccの場合、 関数からのリターンの際、 リターン時のEAXレジスタが関数の戻り値になるので、 次のようにスタックが使うアドレスを直接とりだすことができる [hirasawa@aspire-white gcc-Programming-Kobo]$ cat ./stack.c #include <stdio.h> asm("stack: "); as</stdio.h>…

ubuntu kernel 2.6 kernel-module make

ubuntu linux-source packageComments からのつづき2.6のモジュールmake数年ぶりに やってみた。 見事に忘れてたようhttp://d.hatena.ne.jp/toshi_hirasawa/20120206/1328530240http://d.hatena.ne.jp/toshi_hirasawa/comment?date=20090301&section=1235900…

ubuntu linux-source package

[hirasawa@ubunt1004-32-2 src]$ apt-cache search linux-source linux-source - Linux kernel source with Ubuntu patches linux-source-2.6.32 - Linux kernel source for version 2.6.32 with Ubuntu patches [hirasawa@ubunt1004-32-2 src]$ [hirasawa@u…

day3-バイナリ形式a.out実行形式の復活

ld --verboase -m i386linux [hirasawa@ubunt1004-32-2 ldscripts]$ ld -m i386linux --verbose GNU ld (GNU Binutils for Ubuntu) 2.20.1-system.20100303 Supported emulations: elf_i386 i386linux elf_x86_64 elf_l1om opened script file /usr/bin/../l…

objdump -i

http://d.hatena.ne.jp/toshi_hirasawa/20120202/1328189742 [hirasawa@ubunt1004-32-2 ~]$ objdump -i BFD header file version (GNU Binutils for Ubuntu) 2.20.1-system.20100303 elf32-i386 (header little endian, data little endian) i386 a.out-i386…

組込み技術者向け「初めてのC言語」

ぐぐってたらみつけた いい感じ 初めてのC言語って部分は C言語が初めて、って意味ではないよ http://www.ertl.jp/~takayuki/readings/c/このページはC言語初心者向けではなく、組込み開発初心者を対象としています。理解には、C言語に関する十分な知識 およ…

day3-ld

ldの役割 ー シンボルへのアドレス割付作業 ー ファイルヘッダーやセクションヘッダーの作成 ファイルヘッダーってのは elfヘッダーとはちがうのか? バイナリを作成する際には elfとは限らないってことかリンカースクリプト ディフォルトのエミュレーション…

day3-union.c

ここでの学習ポイントは unionをつかった場合のアドレスprintfの表示format %08x\nで表示する際に(int*)でキャストしているのは unionを構成している、char,short int, intの3つのなかで intの大きさが一番大きいから [hirasawa@ubunt1004-32-2 gcc-Program…

gas hello.S

GAS(Gnu Assembler)だ、ATTだ。 Intel方式になれている御方のために 1)オペランドは左から右に、インテルとは逆 2)レジスタ名の前に%をおく 例 %eax 3) イミディエーとの前には$をおく 例 $0x80 4) 各命令(ニーモニック)のは、オペランドサイズに応…

gas myvoid.c

[hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ cat myvoid.c #include <stdio.h> int secret = 80486; int function( int key) { printf("your secret key is %d\n",key); return 123; } int main(void) { void * ptr; int i; ptr = (void*) &secret; i = *((int*</stdio.h>…

dd とか bvi elfデータ構造解析

hexdump elfデータ構造解析からのつづきセクションヘッダと.shstrtabセクションをけずっちまえwで最終的にできたのがhello5 [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ hexdump -C hello5 00000000 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 …

hexdump elfデータ構造解析

stripからのつづきhello4はいまのところ440byte readelf,stripにできるところまでシェイプアップしました。 つぎはhexdumpでバイナリ的に解析して、さらにシェイプアップしてみます。 [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ hexdump -C hello4 00…

[binutils] strip

gnu

stripは gnu binutilsの中の一つだよぉ http://d.hatena.ne.jp/toshi_hirasawa/20120202/1328189742 システムコールexitにてつくったhello4(1038byte)の調理つづき readelfで解析してみると [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ readelf -h hel…

システムコールexit

まずは man 2 exitの調査からいってみます NAME _exit, _Exit - terminate the calling process SYNOPSIS #include <unistd.h> void _exit(int status); #include <stdlib.h> void _Exit(int status); Feature Test Macro Requirements for glibc (see feature_test_macros(7)): </stdlib.h></unistd.h>…

拡張アッセンブラ

gccからのつづきです。 拡張アッセンブラにてhello3.cを書いてみる [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ [hirasawa@ubunt1004-32-2 gcc-Programming-Kobo]$ cat hello3.c #include <unistd.h> #define MSG "hello\n" int mywrite( const char * buf , int</unistd.h>…

int命令ってマシン語になるとどうなんの?

アッセンブラのint命令ってマシン語になるだとどうなるの? とか、疑問におもってしまったのですよint命令により、割り込み手続きをおこなうのだけど、 Linuxの場合は、汎用レジスタA、B、C、D(など)にパラメータをセットして、 int 0x80を発行するわけだが…

gcc

主要なパートのバージョンの確認方法はbinutils ld -v http://d.hatena.ne.jp/toshi_hirasawa/20120202/1328189742 GCC gcc --version glibc GNU C ライブラリ(libc6) /sbin/ldconfig -V 標準ライブラリ・ヘッダーファイル(libc6-dev) file /usr/include/std…