blog counter

View My Blog Hit Stats

Wednesday Jul 09, 2008

Years ago, 8259 was extensively adopted by single CPU PC and the IRQ and vector number was clear to OS.  Now, we have APICs in Intel multiple processor systems.  It is quite confusing how the IRQ numbers are assigned to OS.  Here is the output of "::interrupts" output in mdb.


 ::interrupts

IRQ  Vect IPL Bus    Trg Type   CPU Share APIC/INT# ISR(s)

4    0xb0 12  ISA    Edg Fixed  3   1     0x0/0x4   asyintr

9    0x81 9   PCI    Lvl Fixed  1   1     0x0/0x9   acpi_wrapper_isr

14   0x41 5   ISA    Edg Fixed  7   1     0x0/0xe   ata_intr

20   0x20 1   PCI    Lvl Fixed  4   1     0x0/0x14  ehci_intr

21   0x21 1   PCI    Lvl Fixed  5   1     0x0/0x15  ohci_intr

48   0x60 6   PCI    Lvl Fixed  6   1     0x1/0x0   e1000g_intr  <--- first pin of second IOAPIC

49   0x61 6   PCI    Lvl Fixed  6   1     0x1/0x1   e1000g_intr

50   0x62 6   PCI    Lvl Fixed  6   1     0x1/0x2   e1000g_intr

51   0x63 6   PCI    Lvl Fixed  6   1     0x1/0x3   e1000g_intr

63   0x40 5   PCI    Edg MSI    2   1     -         mpt_intr


....


We have IRQ numbers from 4 to 63 here.  But how they are assigned?  Before we understand it, we should firstly look into IOAPIC.  Usually, Intel IOAPIC have 24 interrupt pins.  The interrupt pins of PCI devices will be routed to these pins hierarchically.  And the routing paths are almost harden into the motherboard, though PCI devices may have two selectable pins for some flexibility.  The first interrupt input pin of first IOAPIC will be assigned IRQ 0, while  the forth pin will be assigned IRQ4 in this example, and so on.  If the system have two more IOAPICs, the first IRQ number will start from the multiples of 24, 48 in the example above.  Now, we know the IRQ numbers are from the input pins of IOAPICs.  IRQ numbers are not necessary bundled with the vector numbers in APICs, because the vector numbers can be re-programmable. To some degrees, IRQ numbers are the hardware level layout of interrupt lines and vector numbers are in software level and more meaningful to OS.
  As to the MSI interrupt, IOAPIC is no longer required to deliver the interrupt.  For, MSI message can target the host bridge address as other IO transactions. So such format will be printed for MSI devices:


24   0x61 6   PCIe   Edg MSI    0   1     -    e1000g`e1000g_intr_pciexpress
^
|-------- no ioapic listed



Tuesday Jul 08, 2008

经常经过八达岭沿线, 每次看到一些路牌上面写着Badaling Expwy(expressway), 总觉得有点不妥.  按照美国<<manual on uniform traffic control devices>>标准, Expressway和Freeway解释如下.


Expressway—a divided highway with partial control of access.  部分控制分道公路
Freeway—a divided highway with full control of access.  全控制分道公路


我就在美国亲眼见到一条Expressway(加州Menlo Park的Bayfront Expressway)是有十字路口的. 而freeway才是全封闭的, 最高等级公路.  所以我觉得八达岭高速, 翻译成Badaling Freeway比较确切一些. 

Sunday Jun 15, 2008

中国国家足球队又一次窝囊的倒下了,输得连最后一件底库都给脱光啦. 这次我并不想评论球员,因为全国球迷都很无奈的预测到这个结果啦,可谓是众望所归。输一次也许是球员的责任, 可是连续两次预选赛小组都没出线,那就不能怪他们拉。我们的队员到底是怎么选拔上来拉,为什么球员选择面越来越窄,球员的战术素养越来越差。为什么联赛越踢越难看,球迷越来越少。所有的足球强队都有一个强大而健康的联赛做支撑。我们的中超呢,赛程没有保证,裁判缺乏公正,球迷缺乏尊重。组织者只关心自己的政绩,为了备战随便中断联赛。球员的水平不是圈养出来的,而是在长期的比赛中提高的。这种国家队组织方式,只能是固步自封,闭门造车。还有基层球员的选拔,那些足球最高统治者关心过吗?我们在一些偏项,小项当中通过重点扶持,国家投入,取得了不错的成绩。但是事实证明足球是一个需要广大群众基础的体育项目,不是能突击几个月或几年就可以的。我们需要一个有效健康的多级联赛,提高球员的比赛水平面,战术素养。中国足协这么多年没有做到,或者是他们根本就没有能力做到。那么就请你们尊重联赛,让更有能力的人来领导。足球不是赌博,现在国家队输啦,联赛支离破碎,我们还剩下什么?

Monday May 12, 2008

  Indiana release was hit by a P1 bug recently. Further details are recorded in: http://defect.opensolaris.org/bz/show_bug.cgi?id=1069.
  It was reported on laptops with Intel graphics card.  Colleagues in US had reproduced it on their laptops, however we could not reproduce it on our latop with the same model.  Finally, we figured out that all the laptops in China are equipped with less than 4G physical memory, while the laptop in US are equipped with 4G.
  Before further detail, I will give some background about Intel graphics card.  Intel graphics card is a integrated device in Intel's chipset and it target at the low end market.  Actually, it does not have any video memory connected to the graphics chip, but a reserved aperture to remap system memory.  The system can dynamically pin and remap the system memory to fulfill the aperture.  Usually, it can consume tens or hundreds of megabytes of system memory.  And that is what agpgart driver is for.  When the agpgart driver was developed, Intel only was shipping 32-bit hardware.  Consequently, solaris can only have 4G virtual memory on such systems.  Even more, user applications will consume part of the 4G space, that make the kernel virtual space more precious.  The standard DDI DMA interfaces must allocate the kernel virtual space first and then get the physical pages.  So a set of pmem interfaces were developed to allocate the physical memory directly without occupying any kernel virtual space. agpgart driver depend on pmem interfaces to allocate and free the memory.  One defect of pmem interfaces was that a certain physical range could not be guaranteed when requesting the physical pages. As a result, agpgart driver may get a physical page above 4G under 64-bit kernel mode. That cause agpgart driver have wrong GART/GTT table entries pointing to pages owned by ZFS.  ZFS pages will easily be corrupted.
  The quick solution is to use the standard DDI DMA interfaces to allocate physical pages under 64-bit kernel mode, for the kernel virtual memory is not so expensive for 64-bit kernel.  The physical pages can be qualified to a certain range by a parameter named DDI DMA attribute.

Sunday Mar 23, 2008

  Someone's wish is customers can assemble their own vehicles like computers.  Tough it is crazy,  you can find the similarities between vehicles and computers.



   1) cpu vs engine Both of them are the key component to drive the whole systems.
   2) motherboard vs vehicle chassis Both of them are the host for other devices. 
   3) northbridge vs transmission Both of them are the nexus between the key component and the other devices.
   4) Computer chassis vs vehicle iron shell. Both of them are the outside parts.
   5) cpu fan vs engine fan Both of them cool the key component.



  I think the biggest gap for the end users to DIY their vehicle is, the devices in vehicle are analogous and the system will not be guaranteed to function well after all the necessities are plugged. It depends on the experience of the end user to make the vehicle as better as it can be. That is, you can DIY a vehicle with all the necessities and it can run in the road, but the gasoline consumption may make you mad.

Tuesday Mar 18, 2008

1. The worst thing is not you haven't done anything,  but it is your boss doesn't know you.


2. Try to make your boss look better to her/his boss will make you look better to your boss.


3. If you plan to earn more, try to be unique in your group.


4. Too much meeting are bad to your company, however it is much beneficial to you if you miss none.

Wednesday Mar 05, 2008

今天天去美国大使馆签证处按指纹,刚刚要进签证大厅,出来一摩登女郎,看着非常眼熟。由于前两天老妈天天看<<女人花>>,一下子就认出来是刘涛了,可不是吗? 旁边那个男的不就是她新婚的老公嘛,前几天媒体恶炒的豪华婚礼的男主角。两口子有说有笑的,旁若无人,可甜蜜了。感觉现实中的刘涛比较矮小,不超过162,上身一白风衣,腿上绑着丝袜。刚走出了几步,刘涛就把她的深黑大墨镜给带上了。可惜我的手机已经在过门卫之前已经寄存了,否则还能拍几张背影照。下次得仔细看看带大墨镜的人,没准就是哪个大明星呢。

Wednesday Feb 27, 2008

最近工行给我发通知说, 由于去年表现优异,  给我把人民币的透支额度提高2500元. 于是这几天想蹭热打铁, 把我可怜的美圆透支上限给调一调.   好不容易拨通了服务电话, 被告知我最近的消费不够, 不给办.  为什么?  提高美圆透支额度,  无非是想在国外多消费点, 这应该是银行所求之不得的。难道银行连这笔帐也算不清楚吗? 我的信用难道就值1500美圆?  联想到国内银行的种种不方便,  银行总是以高傲的姿态俯视着我们这些小市民, 这种举动也不足为奇了.  可是别忘了大客户给他们带来的利润, 未必会超过人数众多的小市民.  现在和银行打交道真是头疼, 常常为了办理2分钟的事情排上两小时.   我们的银行难道真的就没有一点点服务意识吗?  造成这种局面的根源又是什么呢?  银行就是个被国家宠坏的孩子.

Saturday Feb 02, 2008

   From the birth of computer hardware, OS software had experienced three big steps. Firstly, OS was a supplement to computer for customers to drive the hardware.  They were copied from person to person  without any limitations. Then, many proprietary OSs were developed by special companys. These software are released under certain copyrights and are closed source usually. Now, more and more software were open sourced to customers. The software owner release their source to end user.  GNU has Linux, while SUN has open Solaris.  Does the end user really need these code which are composed by millions of lines? The answer is obvious not. They will not care what is the code under the OS if they are only interested in using them. Then who the most possible embracer of the OSs with source code.  Let's look at the current situation of the industry. As we have known, M$ acquire more and more IT market by their closed source windows. Their OSs are so dominate that the hardware vendors must pay M$ to verify their hardware because no one will by the hardware not compatable with windows. As a result, hardware vendors are losing their power and profit silently because they must obey the same monarch. It is a complete subversion to the time when customer paid much money for the hardware and got their OSs freely, at least it was what they thought. In order to change this unbalance, hardware vendors need an OS which conforms to an open standard.  Also, they would like to give their voices on how the OS will evolve in the future. There is no difficulty to guess the hardware vendors are applauding hard behind the open OSs.
   Then, does "open" mean everything that the hardware vendors want?  However,  the fact is far from what we expect.  The top hardware vendors like IBM seems show more interests on Linux than Open Solaris.  From their perspectives,  Open Solaris was controlled by an potential hardware opponents.  To them,  it is like a party, very attractive but they don't know when the host will ask them to pay for attending the party. 

Tuesday Jan 29, 2008

   Most area of South China were hit a heavy blizzard these days.  Public
transportations are encountering a unprecedented challenge.  Hundreds of
Thousand people were stalled in Airports,  Railway Stations.
Vegetable trucks were blocked in the freeway.  Power transmission were
interrupted in some districts.  Imagine that, no power, no vegetable means
what to people in winter.
   What happens to where we are living?  This is not the first time the nature
teach us.  Last year, some provinces in South China got a unbearable draught.
As you may know, South China was known as humid land. It is ridiculous!
   No mater what the nature are complaining, we are burning the gasoline,
blocking the river by dam, pulling down the green forrest and disposing trash
everywhere. Then, we got punishment because its voice was ignored.  It is
the right time we listen carefully from the nature and pay more respect to it.
It is never too late.
 


1) High voltage tower collapsed in Dabie mountain, Anhui province


High volatge tower collapsed in Dabie Mountain, Anhui province


2) Traffic jam in Jingzhu freeway


Tuesday Jan 01, 2008

To Chinese people, speaking in English is not a easy life for most one. However, you must speak it if you work in a US' company.  It was very frustrating if the native speaker looks lost after you finished a sentence to him, tough each word was sure to be pronounced correctly.  And It is funny that my Chinese colleague can understand me, while ehe native speaker didn't understand my sentence as a whole.  Some time ago, I worked with an Indian engineers who
spoke English with a heavy accent.  Although I can not even hear any English word from him, he can communicate with US' people very well.  The pronunciation doesn't make a big point here.  Why does this happen?   Possible reason is here:
1) wrong language context. US' people have a different logic consecution from Chinese. Sometime, it is natural for  Chinese to put two specific sentences one by one, however it may be confusing to US' people. 
2) wrong stress and rhythm. Every sentence has its point on one or two word, these word must be paid  more respect. The stress and rhythm in Chinese way make native speaker confused. 

Wednesday Dec 19, 2007

王石,马云等一行人组成的临终关怀团,在看望了艾滋病患者,癌症晚期患者和敬老院之后,顺便看望了正在集训备战世界杯预选赛并且被分在死亡之组的的中国国家足球队。

Wednesday Nov 07, 2007

晚上回家车上打开收音机,  正好是一个台的有奖问答. 规则是问题提出来之后,  然后听众竞播,  第一个进来的听众如果答对的话, 奖励100元,  答错的话机会留给下一个人,  奖金变为200元,  依此类推, 奖金逐渐增高.  主持人的第一道题是" 人身上最小的肌肉在哪".  过了一会,  有听众拨进来了,  答曰, 手上.  主持人一听,  觉得这个答案太不靠边了, 就开始提示了,  "这块肌肉是藏在某个地方, 你听我说话的时候就要用到, 是五官的一部分, 并且长在两侧".  这个提示已经很明显了. 接着第二观众来电, 答曰, "脸上". 当场喷饭.  主持人已经着急了说, "我说是长在两测, 千万别给我说眼睛, 眼睛长在两侧的是螃蟹,  脸上是能看见的,我告诉你这块肌肉的名字叫'镫骨肌',  声音过大的时候就会自动升缩,具有保护作用, 我不能再提示了".   第三个听众打进来了, 答曰,   "鼻子".  这回我已经是欲哭无泪了. 心里暗骂, 这些人太弱智了. 仔细一想, 这些人不该是故意答错,然后奖金就逐渐垒高, 最后才照单全收, 实在是高啊. 这个世界,到底是谁愚弄了谁?

Friday Oct 26, 2007

时常用Solaris办公,因为安装的是中文化的solaris, 里面经常会出来一些信息是中文的。比如一个管道操作失败, 系统就告诉你"打破的管道"。 初一看, "打破"这个词很吓人,就好像有人潜伏在solaris专干破坏工作一样。 仔细一琢磨,这不就是"broken pipe"的直译吗,让人苦笑不得。有没有更好的词来翻译它呢?"残破的管道", "毁坏的管道"...,想到的就是这么些了。

Sunday Aug 05, 2007

中国足球 智商[Read More]

This blog copyright 2009 by Ming Shu