Skip to content

Instantly share code, notes, and snippets.

@oraccha
oraccha / linux-0.01-rm-3.5-rt20110112.patch
Created January 12, 2011 06:40
Linux 0.01: fix compile errors with gcc 4.4.5
diff -rc linux-0.01-rm-3.5.orig/fs/Makefile linux-0.01-rm-3.5/fs/Makefile
*** linux-0.01-rm-3.5.orig/fs/Makefile 2008-01-14 05:58:48.000000000 +0900
--- linux-0.01-rm-3.5/fs/Makefile 2011-01-12 15:19:16.412242974 +0900
***************
*** 3,9 ****
CC =gcc
LD =ld
CFLAGS =-Wall -O -fstrength-reduce -fomit-frame-pointer \
! -fno-stack-protector -nostdinc -I../include
CPP =gcc -E -nostdinc -I../include
@oraccha
oraccha / PDP-11 bootstrap loader
Created December 26, 2010 08:22
xx7762番地のmovb命令で、紙テープから読み込んだ内容でxx7752番地(xx7400+オフセット)以降を上書きしているように見えるが、その理解は間違っている?
address contents
======================
xx7744 016701 ; mov 026(r7), r1 -> mov #177550, r1
xx7746 000026
; (r1にデバイスアドレスをロード)
xx7750 012702 ; mov #0352, r2
xx7752 000352 ; オフセット(xx7770番地のinc命令でこの値がincrementされる)
xx7754 005211 ; inc (r1)
; (readerをenableにする)
xx7756 105711 ; tstb (r1)
Linux version 2.6.18-164.15.1.el5 (mockbuild@builder10.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Wed Mar 17 11:30:06 EDT 2010
Command line: ro root=/dev/VolGroup00/LogVol00 rhgb quiet console=tty0 console=ttyS0,115200n8
BIOS-provided physical RAM map:
BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 00000000f0000000 (usable)
BIOS-e820: 00000000fc000000 - 0000000100000000 (reserved)
BIOS-e820: 0000000100000000 - 00000005ad800000 (usable)
DMI 2.4 present.
@oraccha
oraccha / gist:713353
Created November 24, 2010 08:57
This is an OFED-1.5.2 mlx4_en_conf script. removed bash-ism notations for Debian.
We couldn’t find that file to show.
@oraccha
oraccha / gist:673601
Created November 12, 2010 01:51
nanosleep(2) accuracy
/*
* source code from http://d.hatena.ne.jp/naoya/20080122
*
* result on Debian/sid kernel 2.6.32-5-amd64
* (gettimeofday(2) overhead: 41us)
*
* interval 1ms
* 1289525521:664885
* 1289525521:665938
* 1289525521:666991
/*
* jQuery ping
* Original code: http://ha.ckers.org/weird/xhr-ping-sweep.html
*/
<script type="text/javascript" src="./jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="./timer.js"></script>
<script type="text/javascript">
url = "http://twitter.com/";
term% diff -c etherigbe.c.orig etherigbe.c
etherigbe.c.orig:1680,1686 - etherigbe.c:1680,1686
}
break;
}
- snprint(rop, sizeof(rop), "S :%dDCc;", bits+3);
+ snprint(rop, sizeof(rop), "CcS :%dDCc;", bits+3);
for(addr = 0; addr < 0x40; addr++){
/*
static void
igbepci(void)
{
int cls;
Pcidev *p;
Ctlr *ctlr;
void *mem;
p = nil;
while(p = pcimatch(p, 0, 0)){
Guest -> Host case:
** experimental setting **
- 192.168.1.1: host OS
- 192.168.1.10: guest OS (VCPU 2: -smp sockets=2,cores=1)
192.168.1.10$ netperf -H 192.168.1.1 -c -C -l 70
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.1 (192.168.1.1) port 0 AF_INET : demo
Recv Send Send Utilization Service Demand
Socket Socket Message Elapsed Send Recv Send Recv
** experimental setting **
- 192.168.1.1: host OS
- 192.168.1.10: guest OS
- 192.168.1.2: remote machine's OS
** sender side **
192.168.1.10$ netperf -H 192.168.1.2 -c -C -l 70
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.1.2 (192.168.1.2) port 0 AF_INET : demo
Recv Send Send Utilization Service Demand
Socket Socket Message Elapsed Send Recv Send Recv