| ***Jammy***'s profile张孟的个人空间PhotosBlogLists | Help |
|
November 21 最近特别喜欢电子书阅读器计算机相关的纸版书籍太贵了... ...很偶然的我发现了它们, SONY的PRS-500 Amazon新推出的Kindle(不知道其命运如何) 还有近乎完美的iLiad 看看的参数 硬件规格: 接口 1.USB A 型接口,适用于USB 盘(memory stick) 心动不?再看看价格(商城价格:6,500.00 元) :( October 14 Conception Cars奥迪首次为好莱坞主流电影开发特殊车辆,奥迪的工程师为一部名为“I, ROBOT”的影片,创造了一部2035年的车。因此而产生了这款名为奥迪RSQ的运动跑车,这是一部用奥迪的经典设计语言诠释科技与幻想。其中最为重要的是,虽然这部车上使用许多极端的元素,但是仍然可以成为一部真正的奥迪车。影迷们可以在影片中的这款新车上,发现奥迪标志性的一体化网状格栅。 RSQ上包括了一部分由导演Alex Proyas指定的特殊功能。这款中置引擎的跑车隶属于影片中的警察局,在芝加哥的未来的道路上,RSQ使用半球体行进装置运行,而非使用传统的车轮。车上的两扇门则是通过C柱上的铰链进行开合,所采用的结构类似于蝴蝶翅膀的原理。主人公Will Smith轻巧的跨入车厢,整个车门就会轻盈的合上。 RSQ的车身非常光滑,为了符合半球状行进装置,将车身两侧的轮拱设计成了明显的边缘状,配合车身的略微前倾,在道路上行驶就仿佛一头公牛一般。一次冲压成型的玻璃纤维车身,采用的是月光银色的油漆,从而产生了一种眩目的效果,根据导演的要求,当这款银色的跑车以迅雷不及掩耳之势出现在强光之下,整个银色就会泛出一种金色色调。这种效果如此神奇而独到。 车厢内部为了突出未来的氛围,减去了不少驾驶所必需的元素,Will Smith坐在车厢内,就仿佛在战斗机座舱内一样,中控台将驾车者包围在坐椅上。包括方向盘也类似于飞机操纵设备一样。车厢内还装备了奥迪的MMI系统,用于控制驾驶过程中显示的各项信息。车厢的颜色则是以营造空间感为原则的,色彩很暗,但为了突出技术感在局部采用了更多的银色,而红色的RSQ字样则出现在门槛上。 RSQ是为电影而创造的新车,但同时也表现出奥迪对未来的一种解释。 September 08 一段漂亮的代码static void avl_rebalance (struct vm_area_struct *** nodeplaces_ptr, int count) { for ( ; count > 0 ; count--) { struct vm_area_struct ** nodeplace = *--nodeplaces_ptr; struct vm_area_struct * node = *nodeplace; struct vm_area_struct * nodeleft = node->vm_avl_left; struct vm_area_struct * noderight = node->vm_avl_right; int heightleft = heightof(nodeleft); int heightright = heightof(noderight); if (heightright + 1 < heightleft) { /* */ /* * */ /* / \ */ /* n+2 n */ /* */ struct vm_area_struct * nodeleftleft = nodeleft->vm_avl_left; struct vm_area_struct * nodeleftright = nodeleft->vm_avl_right; int heightleftright = heightof(nodeleftright); if (heightof(nodeleftleft) >= heightleftright) { /* */ /* * n+2|n+3 */ /* / \ / \ */ /* n+2 n --> / n+1|n+2 */ /* / \ | / \ */ /* n+1 n|n+1 n+1 n|n+1 n */ /* */ node->vm_avl_left = nodeleftright; nodeleft->vm_avl_right = node; nodeleft->vm_avl_height = 1 + (node->vm_avl_height = 1 + heightleftright); *nodeplace = nodeleft; } else { /* */ /* * n+2 */ /* / \ / \ */ /* n+2 n --> n+1 n+1 */ /* / \ / \ / \ */ /* n n+1 n L R n */ /* / \ */ /* L R */ /* */ nodeleft->vm_avl_right = nodeleftright->vm_avl_left; node->vm_avl_left = nodeleftright->vm_avl_right; nodeleftright->vm_avl_left = nodeleft; nodeleftright->vm_avl_right = node; nodeleft->vm_avl_height = node->vm_avl_height = heightleftright; nodeleftright->vm_avl_height = heightleft; *nodeplace = nodeleftright; } } else if (heightleft + 1 < heightright) { /* similar to the above, just interchange 'left' <--> 'right' */ struct vm_area_struct * noderightright = noderight->vm_avl_right; struct vm_area_struct * noderightleft = noderight->vm_avl_left; int heightrightleft = heightof(noderightleft); if (heightof(noderightright) >= heightrightleft) { node->vm_avl_right = noderightleft; noderight->vm_avl_left = node; noderight->vm_avl_height = 1 + (node->vm_avl_height = 1 + heightrightleft); *nodeplace = noderight; } else { noderight->vm_avl_left = noderightleft->vm_avl_right; node->vm_avl_right = noderightleft->vm_avl_left; noderightleft->vm_avl_right = noderight; noderightleft->vm_avl_left = node; noderight->vm_avl_height = node->vm_avl_height = heightrightleft; noderightleft->vm_avl_height = heightright; *nodeplace = noderightleft; } } else { int height = (heightleft<heightright ? heightright : heightleft) + 1; if (height == node->vm_avl_height) break; node->vm_avl_height = height; } } } August 19 [转]NCE[A Puma at large]
Pumas are large, cat-like animals which are found in America. When reports came into London Zoo that a wild puma had been spotted forty-five miles south of London, they were not taken seriously. However, as the evidence began to accumulate, experts from the Zoo felt obliged to investigate, for the descriptions given by people who claimed to have seen the puma were extraordinarily similar.
The hunt for the puma began in a small village where a woman picking blackberries saw 'a large cat' only five yards away from her. It immediately ran away when she saw it, and experts confirmed that a puma will not attack a human being unless it is cornered. The search proved difficult, for the puma was often observed at one place in the morning and at another place twenty miles away in the evening. Wherever it went, it left behind it a trail of dead deer and small animals like rabbits. Paw prints were seen in a number of places and puma fur was found clinging to bushes. Several people complained of "cat-like noises' at night and a businessman on a fishing trip saw the puma up a tree. The experts were now fully convinced that the animal was a puma, but where had it come from? As no pumas had been reported missing from any zoo in the country, this one must have been in the possession of a private collector and somehow managed to escape. The hunt went on for several weeks, but the puma was not caught. It is disturbing to think that a dangerous wild animal is still at large in the quiet countryside. [Translation]
美洲狮是一种体形似猫的大动物,产于美洲。当伦敦动物园接到报告说,在伦敦以南45英里处发现一只美洲狮时,这些报告并没有受到重视。可是,随着证据越来越多,动物园的专家们感到有必要进行一番调查,因为凡是声称见到过美洲狮的人们所描述的情况竟是出奇地相似。
搜寻美洲狮的工作是从一座小村庄开始的。那里的一位妇女在采摘黑莓时的看见“一只大猫”,离她仅5码远,她刚看见它,它就立刻逃走了。专家证实,美洲狮非被逼得走投无路,是决不会伤人的。事实上搜寻工作很困难,因为常常是早晨在甲地发现那只美洲狮,晚上却在20英里外的乙地发现它的踪迹。无论它走哪儿,一路上总会留下一串死鹿及死兔子之类的小动物,在许多地方看见爪印,灌木丛中发现了粘在上面的美洲狮毛。有人抱怨说夜里听见“像猫一样的叫声”;一位商人去钓鱼,看见那只美洲狮在树上。专家们如今已经完全肯定那只动物就是美洲狮,但它是从哪儿来的呢?由于全国动物园没有一家报告丢了美洲狮,因此那只美洲狮一定是某位私人收藏豢养的,不知怎么设法逃出来了。搜寻工作进行了好几个星期,但始终未能逮住那只美洲狮。想到在宁静的乡村里有一头危险的野兽继续逍遥流窜,真令人担心 [Thirteen equals one]
Our vicar is always raising money for one cause or another, but he has never managed to get enough money to have the church clock repaired. The big clock which used to strike the hours day and night was damaged many years ago and has been silent ever since. [Translation] 我们教区的牧师总是为各种各样的事筹集资金。但始终未能筹足资金把教堂的钟修好。教堂的钟很大,以前不分昼夜打点报时,但很多年前遭到毁坏,从此便无声无息了。 August 18 涂鸦今天看书的时候特别有感觉,让我不禁想到了在学校考研的那个冬天,几个伙伴围桌一坐,在大厅里冻的唏嘘唏嘘的,但还是坚持过来了,
尽管有些得到了想得到的,也有些像我一样失败而返,那段日子永远值得怀念,
我想你了, July 15 linux0.00 可运行的内核... ...! boot.s
! ! It then loads the system at 0x10000, using BIOS interrupts. Thereafter ! it disables all interrupts, changes to protected mode, and calls the BOOTSEG = 0x07c0
SYSSEG = 0x1000 ! system loaded at 0x10000 (65536). SYSLEN = 17 ! sectors occupied. entry start
start: jmpi go,#BOOTSEG go: mov ax,cs mov ds,ax mov ss,ax mov sp,#0x400 ! arbitrary value >>512 !取得光标所在位置,并在光标处打印字符串 Loading linux0.11...
mov es,ax mov ah,#0x03 xor bh,bh int 0x10 mov cx,#26 mov bx,#0x0007 mov bp,#msg1 mov ax,#0x1301 int 0x10 !中断0x13功能2加载
load_system: mov dx,#0x0000 mov cx,#0x0002 mov ax,#SYSSEG mov es,ax xor bx,bx mov ax,#0x200+SYSLEN int 0x13 jnc ok_load die: jmp die !加载失败,死循环 ! now we want to move to protected mode ...
ok_load: cli ! no interrupts allowed ! mov ax, #SYSSEG mov ds, ax xor ax, ax mov es, ax mov cx, #0x2000 sub si,si sub di,di rep movw mov ax, #BOOTSEG mov ds, ax lidt idt_48 ! load idt with 0,0 lgdt gdt_48 ! load gdt with whatever appropriate ! absolute address 0x00000, in 32-bit protected mode.
mov ax,#0x0001 ! protected mode (PE) bit lmsw ax ! This is it! jmpi 0,8 ! jmp offset 0 of segment 8 (cs) gdt: .word 0,0,0,0 ! dummy
.word 0x07FF ! 8Mb - limit=2047 (2048*4096=8Mb)
.word 0x0000 ! base address=0x00000 .word 0x9A00 ! code read/exec .word 0x00C0 ! granularity=4096, 386 .word 0x07FF ! 8Mb - limit=2047 (2048*4096=8Mb)
.word 0x0000 ! base address=0x00000 .word 0x9200 ! data read/write .word 0x00C0 ! granularity=4096, 386 idt_48: .word 0 ! idt limit=0
.word 0,0 ! idt base=0L gdt_48: .word 0x7ff ! gdt limit=2048, 256 GDT entries .word 0x7c00+gdt,0 ! gdt base = 07xxx msg1: .byte 13,10 .ascii "Loading linux0.11..." .byte 13,10,13,10 .org 510 .word 0xAA55 # head.s contains the 32-bit startup code.
# Two L3 task multitasking. The code of tasks are in kernel area, # just like the Linux. The kernel code is located at 0x10000. SCRN_SEL = 0x18 TSS0_SEL = 0x20 LDT0_SEL = 0x28 TSS1_SEL = 0X30 LDT1_SEL = 0x38 .text
startup_32: movl $0x10,%eax mov %ax,%ds # mov %ax,%es lss init_stack,%esp # setup base fields of descriptors.
call setup_idt call setup_gdt movl $0x10,%eax # reload all the segment registers mov %ax,%ds # after changing gdt. mov %ax,%es mov %ax,%fs mov %ax,%gs lss init_stack,%esp # setup up timer 8253 chip.
movb $0x36, %al movl $0x43, %edx outb %al, %dx movl $11930, %eax # timer frequency 100 HZ movl $0x40, %edx outb %al, %dx movb %ah, %al outb %al, %dx # setup timer & system call interrupt descriptors.
movl $0x00080000, %eax movw $timer_interrupt, %ax movw $0x8E00, %dx movl $0x08, %ecx # The PC default timer int. lea idt(,%ecx,8), %esi movl %eax,(%esi) movl %edx,4(%esi) movw $system_interrupt, %ax movw $0xef00, %dx movl $0x80, %ecx lea idt(,%ecx,8), %esi movl %eax,(%esi) movl %edx,4(%esi) # unmask the timer interrupt.
# movl $0x21, %edx # inb %dx, %al # andb $0xfe, %al # outb %al, %dx # Move to user mode (task 0)
pushfl andl $0xffffbfff, (%esp) !关键之处,复位NT popfl movl $TSS0_SEL, %eax ltr %ax movl $LDT0_SEL, %eax lldt %ax movl $0, current sti pushl $0x17 pushl $init_stack pushfl pushl $0x0f pushl $task0 iret /****************************************/
setup_gdt: lgdt lgdt_opcode ret setup_idt:
lea ignore_int,%edx movl $0x00080000,%eax movw %dx,%ax /* selector = 0x0008 = cs */ movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ lea idt,%edi mov $256,%ecx rp_sidt: movl %eax,(%edi) movl %edx,4(%edi) addl $8,%edi dec %ecx jne rp_sidt lidt lidt_opcode ret # -----------------------------------
write_char: push %gs pushl %ebx # pushl %eax mov $SCRN_SEL, %ebx mov %bx, %gs movl scr_loc, %bx shl $1, %ebx movb %al, %gs:(%ebx) shr $1, %ebx incl %ebx cmpl $2000, %ebx jb 1f movl $0, %ebx 1: movl %ebx, scr_loc # popl %eax popl %ebx pop %gs ret /***********************************************/
/* This is the default interrupt "handler" :-) */ .align 2 ignore_int: push %ds pushl %eax movl $0x10, %eax mov %ax, %ds movl $67, %eax /* print 'C' */ call write_char popl %eax pop %ds iret /* Timer interrupt handler */
.align 2 timer_interrupt: push %ds pushl %eax movl $0x10, %eax mov %ax, %ds movb $0x20, %al outb %al, $0x20 movl $1, %eax cmpl %eax, current je 1f movl %eax, current ljmp $TSS1_SEL, $0 jmp 2f 1: movl $0, current ljmp $TSS0_SEL, $0 2: popl %eax pop %ds iret /* system call handler */
.align 2 system_interrupt: push %ds pushl %edx pushl %ecx pushl %ebx pushl %eax movl $0x10, %edx mov %dx, %ds call write_char popl %eax popl %ebx popl %ecx popl %edx pop %ds iret /*********************************************/
current:.long 0 scr_loc:.long 0 .align 2
lidt_opcode: .word 256*8-1 # idt contains 256 entries .long idt # This will be rewrite by code. lgdt_opcode: .word (end_gdt-gdt)-1 # so does gdt .long gdt # This will be rewrite by code. .align 3
idt: .fill 256,8,0 # idt is uninitialized gdt: .quad 0x0000000000000000 /* NULL descriptor */
.quad 0x00c09a00000007ff /* 8Mb 0x08, base = 0x00000 */ .quad 0x00c09200000007ff /* 8Mb 0x10 */ .quad 0x00c0920b80000002 /* screen 0x18 - for display */ .word 0x0068, tss0, 0xe900, 0x0 # TSS0 descr 0x20
.word 0x0040, ldt0, 0xe200, 0x0 # LDT0 descr 0x28 .word 0x0068, tss1, 0xe900, 0x0 # TSS1 descr 0x30 .word 0x0040, ldt1, 0xe200, 0x0 # LDT1 descr 0x38 end_gdt: .fill 128,4,0 init_stack: # Will be used as user stack for task0. .long init_stack .word 0x10 /*************************************/
.align 3 ldt0: .quad 0x0000000000000000 .quad 0x00c0fa00000003ff # 0x0f, base = 0x00000 .quad 0x00c0f200000003ff # 0x17 tss0: .long 0 /* back link */
.long krn_stk0, 0x10 /* esp0, ss0 */ .long 0, 0, 0, 0, 0 /* esp1, ss1, esp2, ss2, cr3 */ .long 0, 0, 0, 0, 0 /* eip, eflags, eax, ecx, edx */ .long 0, 0, 0, 0, 0 /* ebx esp, ebp, esi, edi */ .long 0, 0, 0, 0, 0, 0 /* es, cs, ss, ds, fs, gs */ .long LDT0_SEL, 0x8000000 /* ldt, trace bitmap */ .fill 128,4,0
krn_stk0: # .long 0 /************************************/
.align 3 ldt1: .quad 0x0000000000000000 .quad 0x00c0fa00000003ff # 0x0f, base = 0x00000 .quad 0x00c0f200000003ff # 0x17 tss1: .long 0 /* back link */
.long krn_stk1, 0x10 /* esp0, ss0 */ .long 0, 0, 0, 0, 0 /* esp1, ss1, esp2, ss2, cr3 */ .long task1, 0x200 /* eip, eflags */ .long 0, 0, 0, 0 /* eax, ecx, edx, ebx */ .long usr_stk1, 0, 0, 0 /* esp, ebp, esi, edi */ .long 0x17,0x0f,0x17,0x17,0x17,0x17 /* es, cs, ss, ds, fs, gs */ .long LDT1_SEL, 0x8000000 /* ldt, trace bitmap */ .fill 128,4,0
krn_stk1: /************************************/
task0: movl $0x17, %eax movw %ax, %ds movl $65, %al /* print 'A' */ int $0x80 movl $0xfff, %ecx 1: loop 1b jmp task0 task1:
movl $0x17, %eax movw %ax, %ds movl $66, %al /* print 'B' */ int $0x80 movl $0xfff, %ecx 1: loop 1b jmp task1 .fill 128,4,0
usr_stk1: # Makefile for the simple example kernel.
AS86 =as86 -0 -a #-0 生成8086目标程序 LD86 =ld86 -0 AS =gas LD =gld LDFLAGS =-s -x -M #-s省略所有的符号信息 -M 打印链接映像 all: Image
Image: boot system
dd bs=32 if=boot of=Image skip=1 dd bs=512 if=system of=Image skip=2 seek=1 sync disk: Image
dd bs=8192 if=Image of=/dev/fd0 sync;sync;sync head.o: head.s
system: head.o
$(LD) $(LDFLAGS) head.o -o system > System.map boot: boot.s
$(AS86) -o boot.o boot.s $(LD86) -s -o boot boot.o clean:
rm -f Image System.map core boot *.o system 在Bochs下运行效果
June 28 好久没有更新了日子过得真快,转眼毕业一年了,就象朱自清先生写的,
在过去的日子里,失去了不想失去的,收获了应该获得的,自己的以后依然没有打算好,也许这就是优柔寡断的我吧。
自己的明天还没想好,
只好把握好现在的每一天,吃好,喝好,睡好... ...嘻嘻
离开了大学的校园,不知道同学们现在都好不好?
September 17 工作、加班、学习工作了一段时间了,才发现生活并不像想象中的那么美好。
其实,想一想,人挺有意思的。
在学校的时候,那么好的条件不知道珍惜。动不动就学不下去了。
现在可好,连个学习的地儿都没有,可还拼命的积时间找地方学。
昨天,去清华学了半天,感觉挺好,但收获不大。
1月20号,又该上战场了,刀还没磨呢,郁闷ing.
我的blog好久没有更新了。今天本来是找房子的。看网速还不错,写下这些文字吧。
June 19 散伙饭昨天我们系吃散伙饭,我又喝多了,也不知怎么回来的,现在刚睡醒,想留点纪念,:-) 说实话,自己大学里的造化,大多归功于自己的喜好,不过考研没考上,失败呵:-( 依稀记得,昨晚我给自己的几个师傅敬过酒,硬件方面的丛燕平老师,学电工学的时候,从他那学到了好些东西,我还记得自己得了92分呢,没拿到满分遗憾:- (软件方面我非常感谢秦勃老师,十分感谢他让我做了些东西,要不然,学四年可能只会写些十多行的小玩具toy:-),还记的他还给我上了一课,告诉我有些东西是不能随便给别人的,即使出于好心:-)(学弟学妹们要好好跟着他们学肯定没错),对了,还有我们敬爱的唐瑞春老师,虽然我们跟她作毕业设计只有短短的一个多月的时间,她是一个热心的好老师,言语之中就给人很亲切的感觉,我都不知道她怎么知道我的考研经历的,我想大多老师可能不会问的:-)剩下的就是跟兄弟姐妹们喝的。够义气我心里明白:-) 头疼,不写了,再睡会... ... 对了,我还得感谢我的女友,我们两个在一起,我感到我很幸福(虽然从来不说)我脾气坏,她性子也急,吵架难免,不过每次都是她迁就我,说来真怕别人笑话,其实我还是蛮疼她的,只是我从来不说而已,女生都喜欢被哄吧,应该改改了(此历程挺艰辛),嘿嘿。今天她毕业答辩,我先写下我的祝福,呵呵 还有几天,就告别这个是非之地了,也不知将来自己会是什么样子 只好祝自己更祝朋友们一路走好。 PS:I am working under linux.:-) May 28 [转载]◆ 大四了要毕业了。必须要做二十个事情1.不管你曾经多么内向,你一定要在全班同学面前,认认真真地讲一次话,或者唱一支歌, 即使你和开学时一样,再介绍一回你自己. 2.拜访一回你最尊敬的老师,在毕业时 ,认真地记住一条关于人生的经验. 3.一定要对你喜欢的女生(男生),很认真地告诉她(他),我爱过你! 4.一定要和一个女生(男生),很认真地走一回“情人路“ 或者爬一次“情人坡“. 5即使从不喝酒,你也一定要认真地醉一次. 6在夏夜的雨水里,大声地喊一次那个你想过多次人的名字. 不要怕你的声音过大, 惊醒n 多梦中人. 7.认真地在你不喜欢的食堂里,然后品尝一次食堂的免费汤, 它的气味你会在很多年后还 能记得. 8.在一个太阳还没有升起来的早晨,去x场跑一次步, 和那些生猛的大一新生们比较一下 懒觉睡多了后体力上的差距. 9.在宿舍里不要有类似于写“某某到此一游“的行为. 10.下定决心,班集体的活动这次一定不会借故溜走___如果还有的话. 11.很认真地穿一次西装(套装),看看自己和4年前,变化的地方在哪里? 12.花一个下午的时候,认真地整理一次自己的书箱, 哪些是可以留的,哪些是不要了的 在某本书里,是不是看见了一张陌生已久的纸条,或者是某人的名字.? 13.男生整理衣柜的时候,记得把你的球衣送给你的学弟, cd送给学妹,游戏碟记得自己带走. 14.在校园里,假如有山,请记得再爬一次, 假如有水,请记得再游一次. 15.记得留下每一个你觉得应该是朋友的联系方法,然后把你的新单位的电话给他们. 16.终于要走了,再剪一次发,让自己崭崭新新地离开, 然后,崭崭新新地开始. 17.记得归还你的证件,陪伴了你4年的桌子, 椅子和凳子____我们不提倡你宁愿罚钱也要 留下你的图书证学生证,医疗证,食堂饭卡..... 但我们对此表示理解. 18.论文答辩可能是你人生当中最后一次的课堂作业了, 请你认真地书写每一个字. 19.和你一起睡了4年的床,一定要记得和它合一张影. 20.尽可能地送每一个你能送的同学,你要明白, 他们是你4年的同学,他们中的某人, 也许是你最后一次能见到了! 一天天临近离校的日子,总觉得心里怪怪的,复习了半天研究生没考上,落了个一而再的郁闷。
些许天了,总是无聊的过着?
----------------------------------------------------------------------------------
Everything has the beginning,has the end.All ,determined by your choice.
I think it is time to do something.
昨天晚上焦培金请客,喝多了,回来床上一躺就睡着了,凌晨三点不知道怎么醒了,发现自己衣服都没脱,渴得厉害喝了半瓶不知什么时候的凉水,又睡了。等上午十点起床,头疼得厉害,啥也不想吃,啥也不想干。混混沌沌得过了一天,总算这会儿好点了。明天接着作毕设... ...
|
|
|